Is it possible to update the lods for the map at runtime?
The basemap gallery has different maps with different levels of detail. For example it is possible to zoom in as close on Dark and Light Gray canvas maps down to 1:9028 but on the topo maps you can zoom to 1:1128. It would be nice to change the possible zoom levels on the map in the "selection-change" event of the basemap gallery. Something like this:
basemapGallery.on("selection-change", function (msg) {
//change the levels of detail for the map here.
});
Any suggestions?
Rich
Solved! Go to Solution.
Why don't you set it up for when it zooms in past the a base map that does not display on that scale (such as Dark Grey Canvas) the basemap switch to another one so that their is never a blank screen? Then it could switch back when you zoom back out.
I think when it comes to how far in you can zoom, you rely on the basemap. What exactly would you like to do with the zoom levels?
Rich,
I don't know if adding LODs at runtime is possible but in your use case you just need to add the extra lods at configuration time that your default basemap does not include.
Tim,
I would like to limit the zoom levels to those that are actually available when a user toggles between different basemaps.
Robert,
I am setting the LODs at runtime to contain all of the possible lods for all of the basemaps. What I would like to do is limit the LODs when a user selects a basemap that doesn't support all of the lods. I don't want the user to be able to zoom in further than a particular basemap will allow but I don't want to limit users if the basemap does have additional levels of detail.
Thanks for your replies.
Rich
I thought each basemap dictates how far you can zoom in. So there shouldn't be an issue with users zooming in too far?
Unfortunately that doesn't seem to be the way it works. The possible zoom levels for the map are set based on the initial base map. So if you switch to a basemap with fewer zoom levels you are able to zoom in beyond what is available.
I just checked the sample code for the widget (to make sure I didn't have something going on specific to my code) and it works the same way.
ArcGIS API for JavaScript Sandbox
Rich
Why don't you set it up for when it zooms in past the a base map that does not display on that scale (such as Dark Grey Canvas) the basemap switch to another one so that their is never a blank screen? Then it could switch back when you zoom back out.
While not ideal. This is what I eventually went with.
Thanks for all of the responses!
Rich