Пример #1
0
 public static UpdateCacheConfig GetUpdateCacheConfig()
 {
     if (pUpdateCacheConfig == null)
     {
         string      ConfigPath = CommonConstString.STR_DataPath + "\\SysConfig.xml";
         XmlDocument pConfigDoc = XmlUtil.LoadXmlDocument(ConfigPath);
         pUpdateCacheConfig = UpdateCacheConfig.Create(pConfigDoc["SysComfig"]["CacheConfig"]);
     }
     return(pUpdateCacheConfig);
 }
Пример #2
0
        public void UpdateMapServerCache(double XMin, double YMin, double XMax, double YMax)
        {
            UpdateCacheConfig pUpdateCacheConfig = UpdateCacheConfig.GetUpdateCacheConfig();
            string            UpdateCacheUrl     = pUpdateCacheConfig.Url;
            string            UpdateExtent       = string.Format("{0},{1},{2},{3}", XMin, YMin, XMax, YMax);

            UpdateExtent = "{" + UpdateExtent + "}";
            Encoding myEncoding = Encoding.GetEncoding("gb2312");
            string   data       = "service_url=" + HttpUtility.UrlEncode(service_url, myEncoding);

            data += string.Format("&levels={0}&thread_count={1}&update_mode=RECREATE_ALL_TILES&constraining_extent=", pUpdateCacheConfig.Levels, pUpdateCacheConfig.Thread);
            data += UpdateExtent;
            PostData(UpdateCacheUrl, data);
        }
Пример #3
0
        private static UpdateCacheConfig Create(System.Xml.XmlNode section)
        {
            UpdateCacheConfig pConfig = new UpdateCacheConfig();

            if (section["Url"] != null)
            {
                pConfig.pUrl = section["Url"].InnerText;
            }
            if (section["levels"] != null)
            {
                pConfig.pLevels = section["levels"].InnerText;
            }
            if (section["thread"] != null)
            {
                pConfig.pThread = section["thread"].InnerText;
            }

            return(pConfig);
        }