【发布时间】:2022-12-22 21:38:16
【问题描述】:
我才开始学习 mapbox 地图,每次创建另一个注释时我都试图删除 mapbox 注释。
我的代码:
bitmapFromDrawableRes(
this@PagePlanRouteMap,
R.drawable.red_marker
)?.let {
val annotationApi = mapView?.annotations
val pointAnnotationManager = annotationApi?.createPointAnnotationManager(mapView!!)
val pointAnnotationOptions: PointAnnotationOptions = PointAnnotationOptions()
.withPoint(Point.fromLngLat(lng, lat))
.withIconImage(it)
pointAnnotationManager?.create(pointAnnotationOptions)
}
你能帮我实现注释的删除吗——
pointAnnotationManager?.deleteAll()
或者还有另一种更好的方法吗?谢谢。
【问题讨论】:
标签: kotlin mapbox mapbox-android mapbox-marker