/// <summary>
    /// 获取地图连接
    /// </summary>
    /// <returns></returns>
    public static IMap GetIMap()
    {
        string address = ConfigurationSettings.AppSettings["MapServer_Address"].ToString();
        int port = int.Parse(ConfigurationSettings.AppSettings["MapServer_Port"].ToString());
        string mapname = ConfigurationSettings.AppSettings["MapName"].ToString();
        //这里的Application["m_map"]不要随便改名字,它跟TcpMapHandler.ashx有关联
        IMap m_map = null;
        if (System.Web.HttpContext.Current.Application["m_map"] == null)
        {
            m_map = TcpMap.Create(address, port, new Hashtable());
            System.Web.HttpContext.Current.Application["m_map"] = m_map;
        }
        else
        {
            m_map = (IMap)System.Web.HttpContext.Current.Application["m_map"];
        }
        MapParam mp = new MapParam();
        mp.MapName = mapname;
        MapImage mimg = m_map.GetMapImage(mp);
        return m_map;
    }

相关文章:

  • 2021-08-17
  • 2022-12-23
  • 2021-12-02
  • 2022-01-10
  • 2022-12-23
  • 2021-12-09
  • 2021-05-30
  • 2022-01-21
猜你喜欢
  • 2021-04-27
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
相关资源
相似解决方案