Как повернуть пользовательский заголовок маркера (направление) на карте Mapbox
Как я могу изменить направление (направление) пользовательского маркера на карте Mapbox на Swift. Вот мой код
func mapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? {
var annotationImage = mapView.dequeueReusableAnnotationImage(withIdentifier: "annotation")
if annotationImage == nil {
var image = UIImage(named: "mapdirection")!
image = image.withAlignmentRectInsets(UIEdgeInsets(top: 0, left: 0, bottom: image.size.height/2, right: 0))
annotationImage = MGLAnnotationImage(image: image, reuseIdentifier: "annotation")
}
return annotationImage
}