如何在 Mapbox 中禁用用户位置注释的标注?
How to disable callout for user location annotation in Mapbox?
如何在 Swift 的 Mapbox 中禁用附加到用户位置注释的 "You are here" 标注?
您需要实现以下方法来检查用户位置注释。
func mapView(_ mapView: MGLMapView, annotationCanShowCallout annotation: MGLAnnotation) -> Bool {
if annotation is MGLUserLocation {
return false
} else {
return true
}
}
如何在 Swift 的 Mapbox 中禁用附加到用户位置注释的 "You are here" 标注?
您需要实现以下方法来检查用户位置注释。
func mapView(_ mapView: MGLMapView, annotationCanShowCallout annotation: MGLAnnotation) -> Bool {
if annotation is MGLUserLocation {
return false
} else {
return true
}
}