ArcGIS Javascript - How do I refresh static map? - Stack Overflow

I have a page that uses ArcGIS Javascript when page loads first time, map on the page loads just fine.

I have a page that uses ArcGIS Javascript when page loads first time, map on the page loads just fine. I have a drop down box that controllers what to show on the map and ajax event handler attached to that drop down box when some other option is being selected in that drop down box function

function ajaxOnComplete() {  } 

gets called. How in that function do I ask ArcGIS Javascript to reload its static map?

I have a page that uses ArcGIS Javascript when page loads first time, map on the page loads just fine. I have a drop down box that controllers what to show on the map and ajax event handler attached to that drop down box when some other option is being selected in that drop down box function

function ajaxOnComplete() {  } 

gets called. How in that function do I ask ArcGIS Javascript to reload its static map?

Share Improve this question edited Jul 17, 2015 at 22:17 Vikash Pandey 5,4436 gold badges42 silver badges42 bronze badges asked Apr 29, 2014 at 21:10 Alexander C.Alexander C. 1,1914 gold badges16 silver badges29 bronze badges 1
  • You don't - you want to update what's displayed based on (presumably) what was selected from the dropdown, but if that's your actual question we're going to need more detail on what you're doing. You should (almost) never recreate the actual map from scratch unless you're reloading the page itself. – Juffy Commented Apr 30, 2014 at 7:56
Add a ment  | 

2 Answers 2

Reset to default 6

I know there's an accepted answer here, but there is a much easier way to refresh the layer of the map. When you refresh the extent of the map, all Layers will be newly loaded.

map.setExtent(map.extent);

This just loads the existing extent again and refresh the layers. I used this to reload the map after hiding the basemaplayers.

I figured it out!

function ajaxOnComplete() 
{
   map.destroy();
   dojo.addOnLoad(init);
} 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744120358a4559370.html

相关推荐

  • ArcGIS Javascript - How do I refresh static map? - Stack Overflow

    I have a page that uses ArcGIS Javascript when page loads first time, map on the page loads just fine.

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信