limit zoom levels in dashboard

463
6
09-02-2021 12:28 PM
forestknutsen1
MVP Regular Contributor

I want to set a maximum zoom level for a dashboard map, i.e. do not allow the user to zoom in more then the city level. 

I have reviewed a number of posts on this subject. It looked like it might be possible if I created a tile cache and set it as the basemap. So, I did this but it will let me zoom in past the base map resolution at witch point everything disappears.

To be clear I do not need a custom basemap. The esri ones are fine for display. I created the cache with the sole goal of controlling the zoom.

0 Kudos
6 Replies
David_Brooks
MVP Regular Contributor

@forestknutsen1 , according to this post, it's not possible https://support.esri.com/en/technical-article/000018002

However, I think it's possible if you hack a TPK and remove the levels below where you want them to stop. I'll have a quick look.


David
..Maps with no limits..
0 Kudos
David_Brooks
MVP Regular Contributor

@forestknutsen1 , it seems you cannot restrict the zoom levels of a web map, but you can restrict them in a web app

Brooks_SummitGeo_0-1630617247789.png

So when I restricted a test app to level 16, I then used AGOL Assistant https://ago-assistant.esri.com/ to inpsect the JSON, and the section of the code where the number of levels stopped at level 16 was defined just after here:

    "map": {
        "3D": false,
        "2D": true,
        "position": {
            "left": 0,
            "top": 0,
            "right": 0,
            "bottom": 0
        },
        "itemId": "7e3d3079bace439f9390c7eefb7b4130",
        "mapOptions": {
            "lods": [

 So possibly adding this to the JSON of the map in a dashboard might work?


David
..Maps with no limits..
0 Kudos
forestknutsen1
MVP Regular Contributor

Thanks David -- I will make an app and give it a try

0 Kudos
David_Brooks
MVP Regular Contributor

@forestknutsen1 , the mad thing is, I have hosted tile layers on my site that have been created from TPKs authored in both arcmap and pro. The ones in arcmap stop at level 19 in the web map, but the ones authored in pro continue past 19 and stop at 23 (the new default agol cache schema limit) even though I only have levels cached to 19.

I'm going to compare the TPKs tomorrow and get to the bottom of it.


David
..Maps with no limits..
0 Kudos
David_Brooks
MVP Regular Contributor

@forestknutsen1 so a bit more testing, and all ive managed to find out, is that if i open a new map and drop in a tile package limited to level 19, i can zoom beyond L19 up to L23. However, if i save the web map and then open it fresh from the contents, the zoom is limited to L19 and i can't zoom in any more. 

I've inspected the JSON, and can't find any difference between web maps. But the default map seems to be enabled up to L23 until you save it, and then the levels for the web map are derived from the basemap at the point of saving, even though this isn't evident in the JSON.

I haven't looked at dashboards though....


David
..Maps with no limits..
0 Kudos
forestknutsen1
MVP Regular Contributor

Thanks for all you efforts on this.

I cannot reproduce the behavior. Are you using a tpk published as an image service?

0 Kudos