lurning too koad
lurning too koad

Reputation: 2974

How to disable callout for user location annotation in Mapbox?

How do I disable the "You are here" callout attached to the user location annotation in Mapbox in Swift?

Upvotes: 0

Views: 418

Answers (1)

Magnas
Magnas

Reputation: 4064

You need to implement the following method which checks for the user location annotation.

func mapView(_ mapView: MGLMapView, annotationCanShowCallout annotation: MGLAnnotation) -> Bool {
    if annotation is MGLUserLocation {
        return false
    } else {
        return true
    }
}

Upvotes: 4

Related Questions