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
- child.removeMarker()
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
- child.removeMarker()
559
+ // 延迟移除 Marker,与地图的延迟销毁时间一致(500ms)
560
+ mainHandler.postDelayed({
561
+ child.removeMarker()
562
+ }, 500)
555
563
  }
556
564
 
557
565
  super.removeViewAt(index)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gaode-map",
3
- "version": "2.2.9-next.1",
3
+ "version": "2.2.10-next.0",
4
4
  "description": "一个功能完整的高德地图 React Native 组件库,基于 Expo Modules 开发,提供地图显示、定位、覆盖物等功能。",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",