I have a GPS coordinate (latitude, longitude) and I quickly want to place a single pin on a MKMapView showing that position. Everything works just fine, but as I only need a
Since you want to animate the drop, you will need to implement viewForAnnotation
as you've done because that property is NO
by default.
If you don't need to animate the drop, you could eliminate the viewForAnnotation
method implementation completely and to disable the callout, set the annotation's title
to nil or blank when adding the annotation instead.
If you do need the pin drop animation and you're also showing the user's location (blue dot), you'll also need to check for MKUserLocation
in viewForAnnotation
and return nil
.
Otherwise, you could remove the whole viewForAnnotation
method and the default red pin will appear without animation, the callout will show if title
is not blank, and the user location will show as a blue dot.