expo-gaode-map 2.2.8-next.1 → 2.2.9-next.1

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.
@@ -600,25 +600,4 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
600
600
  override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
601
601
  super.onLayout(changed, left, top, right, bottom)
602
602
  }
603
-
604
- /**
605
- * 析构函数 - 当视图被垃圾回收时调用
606
- *
607
- * 类似于 iOS 的 deinit,在视图真正被释放时才销毁地图
608
- * 这样可以避免页面退出动画未完成时地图就变成白屏的问题
609
- */
610
- protected fun finalize() {
611
- try {
612
- onDestroy()
613
- } catch (e: Exception) {
614
- // 静默处理 finalize 中的异常
615
- android.util.Log.e("ExpoGaodeMapView", "Error in finalize", e)
616
- }
617
- try {
618
- super.finalize()
619
- } catch (e: Exception) {
620
- // 静默处理异常
621
- }
622
- }
623
-
624
603
  }
@@ -15,9 +15,13 @@ class ExpoGaodeMapViewModule : Module() {
15
15
 
16
16
  // ✅ 关键修复:拦截 React Native 的视图操作异常
17
17
 
18
- // 移除 OnViewDestroys 回调,让地图在视图真正释放时才销毁
19
- // 这样可以避免页面退出动画未完成时地图就变成白屏的问题
20
- // 地图会在 finalize() 或 GC 时通过 finalize() 方法自动清理
18
+ // 延迟销毁地图,避免页面退出动画未完成时地图就变成白屏
19
+ OnViewDestroys { view: ExpoGaodeMapView ->
20
+ // 延迟 500ms 销毁地图,让页面退出动画先完成
21
+ android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
22
+ view.onDestroy()
23
+ }, 500)
24
+ }
21
25
 
22
26
 
23
27
  Prop<Int>("mapType") { view, type ->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gaode-map",
3
- "version": "2.2.8-next.1",
3
+ "version": "2.2.9-next.1",
4
4
  "description": "一个功能完整的高德地图 React Native 组件库,基于 Expo Modules 开发,提供地图显示、定位、覆盖物等功能。",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",