Round selection of location on the MKMapView - ios

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?

Related

MKAnnotation with error margin

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.

MKCircle overlay inverted

I've found this post how to draw circle overlay around location
Draw a circle of 1000m radius around users location in MKMapView
I'm able to set some color, or transparency or whatever for overlay.
but I'd like to do the same for rest of the map area.
F.e outside circle overlay sort of "terra incognita"
One possible solution in my mind is:
get circle coordinates, radius
create UIView overlay above mapView with shadow and blur radius respectively to mapView circle
simply saying I'd like to have something like this:
Any ideas how to achieve this?
I think you're thinking right. Howbeit, for make a blur background u need make screenshot and calculate blur with library GPUImage for example.

Change User Location Blue Pulsing Circle Radius

Is it possible to change the radius of the blue pulsing circle around current user's location in MapKit? I have an application which looks around current location for points of interest within a certain radius. I'd like to show this circle to the user without having to completely provide a new annotation for current user location. Any ideas?
This radius signifies the GPS's inaccuracy. I don't think you can override its behaviour.
Take a look at the Mapbox iOS SDK, which is open source and allows you full access to this component. In MapKit, you can only change the tinted user dot, but not the circle.

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.

Adjust MkMapView Annotation

I'm adding annotations to an MkMapView and am using a custom image to do so. My custom image is box shaped with a little triangular arrow that's supposed to be right on the place that's being annotated. It seems like MapView by default annotates using the geometric center of the image. What's the best way to design around this problem? Manually moving the icon? Creating the icon in a specific way?
Here's the Apple docs for MKAnnotationView's centerOffset property:
By default, the center point of an annotation view is placed at the coordinate point of the associated annotation. You can use this property to reposition the annotation view as needed. This x and y offset values are measured in pixels. Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.

Resources