Question

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?

Was it helpful?

Solution 2

I figured it out!

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top