作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是一个 ambibdata 函数
for (i in p0.children) {
var user: ModelSharing? =
i.getValue(ModelSharing::class.java)
var datalongitude = user!!.longitude
var datalatitude = user.latidude
var nama = user.name
var foto = user.image
lokasi = LatLng(datalatitude, datalongitude)
if (markerViewManager != null) {
customview = LayoutInflater.from(context!!.applicationContext)
.inflate(R.layout.marker, null)
customview.layoutParams =
FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
val titleTextView: TextView =
customview.findViewById(R.id.marker_window_title)
val gambarView: ImageView =
customview.findViewById(R.id.gambarview)
Picasso.get().load(foto).resize(50,50)
.into(gambarView)
marker = MarkerView(lokasi, customview)
titleTextView.text = nama
markerViewManager?.addMarker(marker)
markerMap.put(counter, marker)
counter++
//break
}
}
这是一个 onMapReady
override fun onMapReady(mapboxMap: MapboxMap) {
this.mapboxMap = mapboxMap
mapboxMap.setStyle(Style.MAPBOX_STREETS) {
enableLocationComponent(it)
markerViewManager = MarkerViewManager(mapboxfamily, mapboxMap)
mapboxMap.addOnMapClickListener(this)
if (setMarker == true)
{
try {
ambildata()
} catch (e: IOException) {
e.printStackTrace()
}
}
}
}
最佳答案
我遇到了同样的问题,为了防止它,请尝试覆盖 onDestroy
而不是 onDestroyView
。
override fun onDestroy() {
super.onDestroy()
mapBox.locationComponent.isLocationComponentEnabled = false
mapView.onDestroy()
}
关于java - 您在 `removeAnnotationIcon` 被销毁后调用 `MapView` ,您是在 `onDestroy()` 之后调用它吗? map 框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61299301/
You're calling removeAnnotationIcon after the MapView was destroyed, were you invoking it after onDe
我是一名优秀的程序员,十分优秀!