expo-gaode-map 2.2.9-next.1 → 2.2.10-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -524,10 +524,14 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
524
524
|
|
|
525
525
|
/**
|
|
526
526
|
* 移除子视图
|
|
527
|
+
* 延迟移除 Marker,让它们跟随地图一起延迟销毁
|
|
527
528
|
*/
|
|
528
529
|
override fun removeView(child: View?) {
|
|
529
530
|
if (child is MarkerView) {
|
|
530
|
-
|
|
531
|
+
// 延迟移除 Marker,与地图的延迟销毁时间一致(500ms)
|
|
532
|
+
mainHandler.postDelayed({
|
|
533
|
+
child.removeMarker()
|
|
534
|
+
}, 500)
|
|
531
535
|
super.removeView(child)
|
|
532
536
|
return
|
|
533
537
|
}
|
|
@@ -541,6 +545,7 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
541
545
|
|
|
542
546
|
/**
|
|
543
547
|
* 按索引移除视图
|
|
548
|
+
* 延迟移除 Marker,让它们跟随地图一起延迟销毁
|
|
544
549
|
*/
|
|
545
550
|
override fun removeViewAt(index: Int) {
|
|
546
551
|
try {
|
|
@@ -551,7 +556,10 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
551
556
|
}
|
|
552
557
|
|
|
553
558
|
if (child is MarkerView) {
|
|
554
|
-
|
|
559
|
+
// 延迟移除 Marker,与地图的延迟销毁时间一致(500ms)
|
|
560
|
+
mainHandler.postDelayed({
|
|
561
|
+
child.removeMarker()
|
|
562
|
+
}, 500)
|
|
555
563
|
}
|
|
556
564
|
|
|
557
565
|
super.removeViewAt(index)
|