标签: mglmapview

如何旋转 Mapbox 地图视图的自定义标记标题(方向)

如何更改 Swift 上 Mapbox 地图上自定义标记的方向(标题)。这是我的代码

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
}
Run Code Online (Sandbox Code Playgroud)

ios swift mapbox-gl mglmapview

5
推荐指数
0
解决办法
512
查看次数

标签 统计

ios ×1

mapbox-gl ×1

mglmapview ×1

swift ×1