【问题标题】:ESRI.ArcGIS Map Load dynamic KMLsESRI.ArcGIS 地图加载动态 KML
【发布时间】:2012-09-30 20:59:18
【问题描述】:

我正在加载 ESRI 地图和 KML 图层,一切正常!

问题: KML 数据更改(经常更改)后,我无法在地图中显示新更改。我需要用力 每次都清除浏览器缓存。我尝试刷新图层没有成功。

我的代码

// Create a new KmlLayer object. 
  ESRI.ArcGIS.Client.Toolkit.DataSources.KmlLayer theKmlLayer = new ESRI.ArcGIS.Client.Toolkit.DataSources.KmlLayer();

  // Set the KmlLayer's ID.
  theKmlLayer.ID = "SampleData";

  // Set the Url of the KmlLayer. Note the Url takes a Uri object!
  theKmlLayer.Url = new Uri("localhost/KML/east.kml");//Here is the New KML Data

  // Need to use a ProxyUrl on the KmlLayer since the service is not hosted locally or on a local network.
  theKmlLayer.ProxyUrl = "http://serverapps.esri.com/SilverlightDemos/ProxyPage/proxy.ashx";

  // Add the KmlLayer to the Map. An automaic refresh of the Map and Legend Controls will occur.
  Map1.Layers.Add(theKmlLayer);

我试过 theKmlLayer.Refresh();

我需要通过代码清除浏览器缓存还是可以加载新数据?

【问题讨论】:

    标签: .net c#-2.0 kml esri esri-arc-engine


    【解决方案1】:

    KML 缓存的常用解决方案(Google 在服务器上缓存数据几个小时)是在 URL 中使用随机或基于时间的缓存破坏参数(因此它永远不会相同)。

    缓存清除参数的一个示例:

    '?dummy=' + (new Date()).getTime()); 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-28
      • 2012-05-30
      • 1970-01-01
      相关资源
      最近更新 更多