Limit zoom levels on embedded web map

263
7
3 weeks ago
Labels (3)
KaraG
by
New Contributor III

Hi, I have a web map embedded in a web page using a basemap based off of the light gray canvas style that I edited in Esri's vector tile editor. I now want to limit the zoom levels on the embedded map to 0-14 or 15 or so. I thought for sure I'd be able to just use a URL parameter to do this, but I can't find a way to do so. I was able to edit the JSON of the basemap to only draw to level 14, but then realized that this was silly because the map continues zooming in on nothing beyond that, plus now I can't use that basemap for anything that needs to be zoomed in further. Is there a straightforward way to do this? Should I have just created a web app instead? 

0 Kudos
7 Replies
BernSzukalski
Esri Frequent Contributor

I'm not positive I understand what you are trying to do, but you can use URL parameters to open a map at a specific scale (LOD). Example and discussion here:

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/use-url-parameters-in-map-viewer/

Examples:

https://www.arcgis.com/apps/mapviewer/index.html?webmap=8152694dd9594393a1db4d62d2020fe3&level=15

https://www.arcgis.com/apps/mapviewer/index.html?webmap=8152694dd9594393a1db4d62d2020fe3&level=5

 

In addition, even if the basemap supports all LODs, you can adjust the basemap layer properties to only display within a sprecific scale range, the same way you can adjust layers to only display within a specific scale range.

So your basemaps can go the full range LOD-wise, but you can restrict visibility in any map. Viewers can change that, but that can be controlled using apps.

0 Kudos
KaraG
by
New Contributor III

Hi, thanks for the reply. Basically I just want to set a max zoom for just this web map so that users can not zoom in past level 14 or 15. I can change the visibility of all of the layers, but you can keep scrolling in further. I thought maybe I could set a max zoom so that there was no way to go beyond that. 

0 Kudos
BernSzukalski
Esri Frequent Contributor

There isn't a built-in setting in Map Viewer to do that, however using Instant Apps you can set both a boundary and a scale.

BernSzukalski_0-1712626692817.png

BernSzukalski_1-1712626713065.png

 

0 Kudos
KaraG
by
New Contributor III

Ok thank you. I was hoping to avoid creating an app, but I will if that is the only option. Do you know if specifying/restricting LODs is possible by modifying the web map JSON? 

0 Kudos
BernSzukalski
Esri Frequent Contributor

Actually, I am not sure. I've never considered editing the JSON to do that, and only rarely edit the JSON anyway. But I am curious myself and will take a look later, if you do find out one way or another, please post here.

0 Kudos
BernSzukalski
Esri Frequent Contributor

I did take a quick look at the JSON for a map, even a basemap I'd saved in my organization, but couldn't see anything about display LODs. You could edit the zoom levels in the Vector Tile Style Editor, but you would have to do consider that for each layer which would not be trivial. I would try the apps first to see if that provides the desired result before considering other alternatives.

0 Kudos
KaraG
by
New Contributor III

Thank you so much for looking into that. I also just remembered another reason I don't want to have to change from the web map -- I have it embedded at different extents in about 100 different pages and would definitely prefer not to change all of those links! (unless there is a more streamlined way to do that...) 

 

editing to add: I did find this link that mentions min and max LOD parameters, but I'm not sure where/how to add that in...

0 Kudos