Implementing zoom level for MKMapView - ios

I'm trying to find an easier way to set and get a "zoom level" for an MKMapView than being changing its region's span, something more intuitive such as an integer zoom level... I need to programmatically change zoom and to frequently check the zoom level to determine if I should show or hide certain map overlays.
Thanks in advance.

You could use this category, it can get and set a zoomlevel : https://github.com/johndpope/MKMapViewZoom

Related

How to get zoom level of map?

I have multiple Annotations in my map I need to see annotation dependent on map zoom level. like if zoom level is max then show all annotations and if zoom level is min show half annotations. but I am unable to do this.
You can just change the map zoom level using the following line:
mkMkMapview.camera.altitude *= 1.4
You can put your priority depending on Annotations.

iOS: Maximum Zoom while Setting a Region in MapKit?

I'm trying to get my mapView to zoom in fairly close by using the setRegion function.
My problem is that, while testing, it seems that setRegion doesn't want to zoom in more than to a span of about 0.01 or so, even though I can manually pinch to zoom in closer than that.
What's stopping this? Will setRegion not allow me to zoom in closer?

MapBox Marker Size on Zoom (ios sdk)

I'm trying to change the size of the marker image during a zoom event, so the image scales nicely while pinching/zooming.
I can't find anywhere how to do this, the closest I have come is to resize the marker image after the zoom event is completed (when the zoom level changes)
It would look a lot nicer if it would resize during the zoom event instead of after.
Any ideas?
Look into using RMMapLayer directly (RMMarker's superclass) which should scale when zoomed. RMShape and RMCircle are also a good, albeit not directly related, models for this since they represent shapes that "stick" to the map instead of points that don't scale. But the short answer is there is not built-in functionality for this.

Graph should not be move if not zoomed

I am using core plot to draw graph. Graph moves always whether it is zoomed or not. But I want like it should not move until it is zoomed. In zooming state we should allow panning(moving left/right) to see the whole graph.Any help would be appreciated.
I can think of several ways to do this:
Disable user interaction when zoomed out. Enable it when the user zooms in.
Set the globalXRange and globalYRange on the plot space. The plot won't scroll outside these ranges no matter how far out you zoom.
Use a plot space delegate. Implement the -plotSpace:willChangePlotRangeTo:forCoordinate: delegate method. If the proposed range is outside the desired scrolling range, modify the range to your preferred range before returning it.

Is there any way to programatically zoom MKMapView without it snapping to one of its predefined zoom levels?

I am using setRegion to have MKMapView zoom in to the region I have supplied. The problem is that there is very little granularity to this and it simply chooses the most proximate zoom-level and zooms to that.
Is there any way of having it zoom to exactly the region I have supplied or do I need to accept this limitation and move on?
No, currently it zooms so that the map tiles aren't blurry, which means fixed zoom levels. The upcoming update seems to render on the fly, so you may be able to do it in the future, but for now you'll have to accept the region you get.

Resources