How to determine whether the map is at the maximum zoom level

652
3
07-03-2012 05:56 PM
StephenLead
Regular Contributor III
Is there a property on the map to show whether it is already at the maximum zoom level (that is, it's not possible to zoom in any further)?

The map can return its current zoom level using map.getLevel(), but how can I determine whether this is the maximum level? (I'm looking for generic functionality so I can't guarantee that the map has LODs specified, and I can't guarantee that the Zoom slider is present - two workarounds I already considered)

Thanks,
Steve
0 Kudos
3 Replies
RahulMetangale1
Occasional Contributor II
Hi Steve,

You can use following to get the min and max level of map
map._slider.maximum
map._slider.minimum


You can compare the current level of map with the max or min level.

Hope this helps.
0 Kudos
StephenLead
Regular Contributor III
Thanks for the tip - looks like a reasonable workaround.

Is it valid to depend on properties with an underscore (as with map._slider)?

I always thought they were not fully supported and shouldn't be used?




Cheers,
Steve
0 Kudos
RahulMetangale1
Occasional Contributor II
Till now i have not come across any issue in using this property.
0 Kudos