OpenLayers 2 used to have a getZoomForResolution
method that would give you the zoom level (or closest zoom level) of a given resolution.
I don't see any such method in ol3, for the ol.View
object that is. Is there a way to achieve this with what ol.view
currently have ?
This will give the next closest integer zoom for a give resolution:
My brother suggested:
refining the logarithmic solution for browsers with Math.log2()
and for IE which does not have log2()