Zoom in by level of detail

1474
2
Jump to solution
07-31-2018 02:56 AM
matuskajba
New Contributor II

I have a map with tiled basemap. I would like to have zoom in button that with every click increases zoom by one level of detail. I just could't find property or method to get current level of detail of map. Only solution that came to my mind is that with every zoom click get current map scale, enumerate basemap layer levels of detail, find one with closest scale and take LOD from it as current LOD.

Am I missing something and there is simpler/smarter way to get current LOD?

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

The LOD scale is an artifact of the specific tiled layer and not really a MapView thing. The MapView can zoom to any scale and isn't locked to a particular set of scales. In addition you could have multiple tiled layers with different set of LODs, and they would all render together just fine.

Typically though, the scale of LODs double/half for each level, so you could just zoom to twice the current scale. (There's no guarantee that exactly matches an LOD though).

I'm curious why you would want to limit your zoom to a specific set of scales?

View solution in original post

0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

The LOD scale is an artifact of the specific tiled layer and not really a MapView thing. The MapView can zoom to any scale and isn't locked to a particular set of scales. In addition you could have multiple tiled layers with different set of LODs, and they would all render together just fine.

Typically though, the scale of LODs double/half for each level, so you could just zoom to twice the current scale. (There's no guarantee that exactly matches an LOD though).

I'm curious why you would want to limit your zoom to a specific set of scales?

0 Kudos
matuskajba
New Contributor II

Thanks for clarification, I thought that it would be that way.

I don't know the real reason, I just have that point in the analysis. My guess is that our customer is using web application, where zoom levels are set by LODS and they probably want create something close to it. The other thing may be, that scale label 1:10000 is more "interpretable" than 1:128627, but that is another story and could be done other way.

Thank you.

0 Kudos