I figured out how to calculate the current zoom level of the map from
http://troybrant.net/blog/2010/01/set-the-zoom-level-of-an-mkmapview/ (the first comment on that blog), but it gives me a value between 0 and 20, whereas region.span
has values like 0.1f, 0.01f
etc.
I want to calculate the current zoom level and then if a user does a "long tap", then an annotation has to be dropped. I have done everything except that I have hardcoded following:
region.span.longitudeDelta = 0.2f;
region.span.latitudeDelta = 0.2f;
So instead of 0.2f
, I would like to put a number which I get from Zoom Level (between 0-20). So is there any way to do this conversion?
Is it done like this?
(Current Zoom Level Output/Maximum Zoom Level);