Ios – Manually show current location blue dot MKMapView ios

iosiphonelocationmapkitmkmapview

I'm building an iPhone app. There is a screen with a map (MKMapView) always showing. But to preserve battery, I don't want user location to be updated all the time, only automatically (every 15 minutes) and manually (onclick).

But, I also want to show this user location on the map.
The problem is, if I showsUserLocation for my MapView, it automatically starts updating location, hence drains battery.

I tried activating the showsUserLocation option, saving the MKUserLocation, then deactivating the showsUserLocation then adding the saved MKUserLocation as an annotation by hand, but it actually shows a WARNING and reactivate the showsUserLocation option !

So I guess the last way is by hand:

I built a blue dot annotation myself but it doesn't have the glowing effect and the accuracy circle around. Do you have any idea how to do this? Or if there is any other way, please share.

Thanks !

Best Answer

well you will have to go with your 'last way' -- MKAnnotationViews can easily be animated -- just treat it like any UIView :) there

see MKMapView current location showing as custom pins for how to mae custom Pins

Related Topic