Select to view content in your preferred language

Update lods at runtime

4427
7
Jump to solution
05-14-2015 08:01 AM
RichardWinkelbauer
Deactivated User

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

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RickeyFight
MVP Regular Contributor

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.

View solution in original post

7 Replies
TimWitt2
MVP Alum

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?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

0 Kudos
RichardWinkelbauer
Deactivated User

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

0 Kudos
TimWitt2
MVP Alum

I thought each basemap dictates how far you can zoom in. So there shouldn't be an issue with users zooming in too far?

0 Kudos
RichardWinkelbauer
Deactivated User

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

0 Kudos
RickeyFight
MVP Regular Contributor

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.

RichardWinkelbauer
Deactivated User

While not ideal.  This is what I eventually went with. 

Thanks for all of the responses!

Rich

0 Kudos