Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get iPhone Maps app blue dot with light blue field for current location?

I think the title is quite self explanatory. Currently when I add a default annotation for current location:

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

It is giving me a red pin. I want the same blue dot with light blue field which the Apple iPhone Maps app is using by default. Is there a special name for that and how can I add it?

like image 862
Kashif Avatar asked Oct 19 '15 21:10

Kashif


1 Answers

It's because you're adding an annotation (pin) rather than the user location.

Enable it by using the following

mapView.showsUserLocation = true

Also check out a tutorial which may help

like image 99
Russell Avatar answered Nov 15 '22 05:11

Russell