Does anyone know what triggers the blue marble animation. I know that it happens when the location gets updated but how do i trigger that event with whatever is in that property. I have an app that i would like to show the user’s location when the map appears, but then clear the map of all annotations (including the user location)when the map disappears. This works fine. The problem comes in that when i try to go back into the map after removing the user location, the blue marble does not pop back in. Does anyone know how to set this animation going again?
thanks in advance.
If you set your
MKMapViewto show the user’s location by setting its propertyshowsUserLocationto YES, then the map will automatically show the user’s location unless his/her coordinates are outside the map. You can check this by inspecting theuserLocationVisibleproperty.Now, if you remove the user’s location (the property
userLocationwhich is an annotation), then the map can not show the user’ location even if you haveshowsUserLocationset to yes.Simply restore the userLocation again by updating it using the
CoreLocationframework and it will appear automatically on the map again.EDIT: To trigger the animation, update the user’s location, setup again the region to be shown (may be the center and/or span have changed) and then call
If the region didn’t change simply reuse it.