How to get zoom level of map? - ios

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.

Related

How to add and remove pins in mapview when zoom in and zoom out

I want to update pins on map view when we zoom in and zoom out.For Example I have multiple location on map view now now when I zoom in any one of them So the radius is updated and now those place which are still in radius will remain visible others are remove which are out of the radius.
Any kind of help would be appreciate able.....

Implementing zoom level for MKMapView

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

Can a map overlay be moved?

I'm displaying several user's locations on a map simultaneously as circles of different colors.
I can do this using an annotation and then when the user's location updates use UIView:animateWithDuration: to move to their new location.
However there is a requirement that the size of the circles reflects the accuracy of the location i.e. very accurate equals a circle of size 10 meters, rough accuracy is represented as a circle of size 500 meters etc.
However there are two problems using annotations for this - the first is how to transform meters into a CGRect on the correct size to draw on the map. And the second is the annotations need to be resized if the user zooms the map.
So I was looking at using an overlay instead as that already has a radius and automatic resizing during zooming built in so it handles those two problems.
However it looks like overlays are meant to be static and their coordinate property is read only.
Is there some way I can make the overlays move as the user's location moves? (other than completely remove it and re-add it?)
[THis is for iOS 7 only]

MKMapView - Is there a way to use MKUserTrackingModeFollow with a modified center/focus?

I have a MapView that takes up the full screen and a few elements toward the top of the screen that overlay the map. These top elements potentially cover the blue location marker.
The map is currently tracking fine with MKUserTrackingModeFollow, but I'd like to move the tracking focus down about an inch (obviously the metric will vary by zoom level) to ensure the marker isn't covered. Is there a way to do this with MKUserTrackingModeFollow?
I've considered moving the map with the top elements, but due to design constraints this isn't an option.
Instead of using the userTrackingMode of the MKMapView object to follow the user's location, you could set up a delegate of CLLocationManager to receive location tracking events, and with each location update event you receive, set the center coordinate of the map view, with your vertical offset added to the coordinate value.
You can use the various Map Kit functions and MKMapView methods to convert your offset from some fraction of the map view's bounds.height to a MKMapPoint or CLLocationDistance value.

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