MKAnnotation with error margin - ios

I'm using a MKMapView and use annotations with custom MKAnnotationViews in order to display other person's locations. Although, as the location of other people have error margins, I would like to represent the error margin just like the blue circle around your current location. I looked in the documentation of MKAnnotation and MKMapViewDelegate but couldn't find anything related. Is it possible to achieve this? If yes, how?

I found out that it wasn't actually possible. Although, I could draw the accuracy circle myself, by using an MKCircle with the accuracy radius and implementing mapView:rendererForOverlay: on the MKMapView's delegate.

Related

MKMapView - annotations block each other when coordinates are close

I have a map with big pictures for annotations and when coordinates close to each other - one annotation is over another. Is there any methods to see them both entirely?
You can do some annotation clustering and display one annotation for both coordinates. If you really want to see them both and do not need to be exact shift them a bit like done in here
Handling MKMapView Annotation Pins on the Same Coordinate
But if you do care about precision detect the distance between two annotations. You want the distance on the screen not on the map. If the distance is over some treshold, you can present with two rotated annotations one reaching to the left and one to the right side. More can be studied from stuff written on topic of annotation clustering. Search on stack there is a ton of it.
I found better solution !
Change
#property (assign, nonatomic) CGSize clusterAnnotationViewSize to set a size of your own annotation and it will do everything. Also this pod implements same thing, as mentioned earlier.

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

Round selection of location on the MKMapView

I want to implement a circular selection (with center and radius) on the MKMapView like it looks on the screenshot below.
Should be possible to move the selection pulling the green pointer and change circle radius pulling the dark gray pointer.
What the best way to implement it? Maybe there's already some solution?
I would be grateful for any help.
I have not found ready-made solution for select circular map region from MKMapView. So I created own component to do that. https://github.com/d0ping/DBMapSelectorViewController
You can add a UISlider to your map and update MKCircle radius on the Value Changed action.
Please take a look how to use MKCircle here - How to create MKCircle in Swift?

IOS MKMapView sidewalk

Im working with Mapkit and I trying to draw a line in the "sidewalks" (border of the street),right now I'm looking for ideas on how I could start this task, thanks for your help.
notes: I know how to works with mkpolyline and coordinates
http://s30.postimg.org/7rnmdjzu9/mapa.png
You do not have access to the information that qualifies as a road inside the MKMapView. so, in order to be able to draw into the border of the street you will need to access the information that qualifies as a street (the coordinates of the road) or analyzing the view and changing the specific color represented by the border of the street (this is not public API, you will need to dig around the view hierarchy).

Show circle around selected location

As we have seen there is a circle around current location in iOS mkmapview. Is there any way to draw a similar circle in mkmapview for location other then current location?
If you look at the documentations for MKCircle: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKCircle_class/Reference/Reference.html and MKCircleView: http://developer.apple.com/library/iOS/documentation/MapKit/Reference/MKCircleView_class/Reference/Reference.html both of which are part of the MapKit API,
you'll find tools for drawing circles!
As mentioned at this link Circle around a point on an MKMapView
there are no easy way to create animations for these circles, however the advantage is that they will provide you with a degree of accuracy for your coordinates on your map!
The steps to creating the circles, one way, is here: Drawing a circle on mapkit
Basically, create an MKCircle object using circleWithCenterCoordinate:radius: method and add it to your mapView (using addOverlay: method)
Next, in the mapView delegate, implement mapView:viewForOverlay: method, create and setup MKCircleView instance there and return it.

Resources