Pergunta

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?

Foi útil?

Solução 2

I figured it out!

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top