How to get iPhone Maps blue blue iPhone app for current location?

I think the name is quite explanatory. Currently, when I add the default annotation for the current location:

let currentAnnot = MKPointAnnotation() currentAnnot.coordinate = loc.coordinate mainMap.addAnnotation(currentAnnot) 

It gives me a red pin. I want the same blue dot with a light blue field that the Apple iPhone Maps app uses by default. Is there a special name for this and how to add it?

+5
source share
1 answer

This is because you are adding an annotation (pin) rather than the user's location.

Turn it on using the following

 mapView.showsUserLocation = true 

Also check out a tutorial that might help

+7
source

Source: https://habr.com/ru/post/1234056/


All Articles