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
2 Answers
Reset to default 6I 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
评论列表(0条)