expo-gaode-map 1.1.2 → 1.1.4
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.
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +118 -3
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapViewModule.kt +7 -1
- package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +4 -3
- package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +47 -26
- package/build/types/map-view.types.d.ts +18 -1
- package/build/types/map-view.types.d.ts.map +1 -1
- package/build/types/map-view.types.js.map +1 -1
- package/package.json +1 -1
- package/src/types/map-view.types.ts +22 -2
|
@@ -27,6 +27,18 @@ import expo.modules.gaodemap.overlays.*
|
|
|
27
27
|
@Suppress("ViewConstructor")
|
|
28
28
|
class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* 拦截 React Native 的 ViewManager 操作
|
|
32
|
+
* 重写 requestLayout 防止在移除视图时触发布局异常
|
|
33
|
+
*/
|
|
34
|
+
override fun requestLayout() {
|
|
35
|
+
try {
|
|
36
|
+
super.requestLayout()
|
|
37
|
+
} catch (e: Exception) {
|
|
38
|
+
Log.e(TAG, "requestLayout 异常被捕获", e)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
companion object {
|
|
31
43
|
private const val TAG = "ExpoGaodeMapView"
|
|
32
44
|
}
|
|
@@ -289,7 +301,11 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
289
301
|
fun setMinZoom(minZoom: Float) = cameraManager.setMinZoomLevel(minZoom)
|
|
290
302
|
|
|
291
303
|
/** 设置是否显示用户位置 */
|
|
292
|
-
fun setShowsUserLocation(show: Boolean)
|
|
304
|
+
fun setShowsUserLocation(show: Boolean) {
|
|
305
|
+
mainHandler.post {
|
|
306
|
+
uiManager.setShowsUserLocation(show, followUserLocation)
|
|
307
|
+
}
|
|
308
|
+
}
|
|
293
309
|
|
|
294
310
|
/**
|
|
295
311
|
* 设置是否跟随用户位置
|
|
@@ -298,7 +314,11 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
298
314
|
fun setFollowUserLocation(follow: Boolean) {
|
|
299
315
|
followUserLocation = follow
|
|
300
316
|
// 如果定位已开启,立即应用新设置
|
|
301
|
-
|
|
317
|
+
mainHandler.post {
|
|
318
|
+
if (aMap.isMyLocationEnabled) {
|
|
319
|
+
uiManager.setShowsUserLocation(true, follow)
|
|
320
|
+
}
|
|
321
|
+
}
|
|
302
322
|
}
|
|
303
323
|
|
|
304
324
|
/**
|
|
@@ -476,6 +496,9 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
476
496
|
// 清理覆盖物
|
|
477
497
|
overlayManager.clear()
|
|
478
498
|
|
|
499
|
+
// 清理 MarkerView 列表
|
|
500
|
+
markerViews.clear()
|
|
501
|
+
|
|
479
502
|
// 销毁地图
|
|
480
503
|
mapView.onDestroy()
|
|
481
504
|
}
|
|
@@ -486,13 +509,30 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
486
509
|
mapView.onSaveInstanceState(outState)
|
|
487
510
|
}
|
|
488
511
|
|
|
512
|
+
/**
|
|
513
|
+
* 存储 MarkerView 引用,因为它们不在视图层级中
|
|
514
|
+
*/
|
|
515
|
+
private val markerViews = mutableListOf<MarkerView>()
|
|
516
|
+
|
|
489
517
|
/**
|
|
490
518
|
* 添加子视图时自动连接到地图
|
|
519
|
+
*
|
|
520
|
+
* 关键修复:MarkerView 不进入视图层级,但要确保 React Native 追踪正确
|
|
491
521
|
*/
|
|
492
522
|
override fun addView(child: View?, index: Int) {
|
|
493
523
|
if (child is MarkerView) {
|
|
494
|
-
//
|
|
524
|
+
// ✅ MarkerView 不加入视图层级
|
|
495
525
|
child.setMap(aMap)
|
|
526
|
+
markerViews.add(child)
|
|
527
|
+
Log.d(TAG, "✅ MarkerView 已添加到特殊列表(不在视图层级中),数量: ${markerViews.size}")
|
|
528
|
+
// ⚠️ 不调用 super.addView,所以 React Native 不会追踪它
|
|
529
|
+
return
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// ⚠️ 如果是 MapView 本身,必须添加
|
|
533
|
+
if (child is com.amap.api.maps.MapView) {
|
|
534
|
+
super.addView(child, index)
|
|
535
|
+
Log.d(TAG, "✅ MapView 已添加")
|
|
496
536
|
return
|
|
497
537
|
}
|
|
498
538
|
|
|
@@ -511,6 +551,81 @@ class ExpoGaodeMapView(context: Context, appContext: AppContext) : ExpoView(cont
|
|
|
511
551
|
}
|
|
512
552
|
}
|
|
513
553
|
|
|
554
|
+
/**
|
|
555
|
+
* 移除子视图
|
|
556
|
+
*/
|
|
557
|
+
override fun removeView(child: View?) {
|
|
558
|
+
if (child is MarkerView) {
|
|
559
|
+
// 从 MarkerView 列表中移除并清理
|
|
560
|
+
markerViews.remove(child)
|
|
561
|
+
child.removeMarker()
|
|
562
|
+
Log.d(TAG, "✅ MarkerView 已清理,当前 markerViews 数量: ${markerViews.size}")
|
|
563
|
+
return
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
try {
|
|
567
|
+
super.removeView(child)
|
|
568
|
+
} catch (e: Exception) {
|
|
569
|
+
Log.e(TAG, "removeView 异常", e)
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* 按索引移除视图
|
|
575
|
+
*
|
|
576
|
+
* 终极修复:完全忽略所有无效的移除请求
|
|
577
|
+
*/
|
|
578
|
+
override fun removeViewAt(index: Int) {
|
|
579
|
+
try {
|
|
580
|
+
val actualChildCount = super.getChildCount()
|
|
581
|
+
|
|
582
|
+
Log.d(TAG, "removeViewAt 调用: index=$index, super.childCount=$actualChildCount")
|
|
583
|
+
|
|
584
|
+
// ✅ 如果没有子视图,直接返回
|
|
585
|
+
if (actualChildCount == 0) {
|
|
586
|
+
Log.w(TAG, "⚠️ 无子视图,忽略: index=$index")
|
|
587
|
+
return
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// ✅ 索引越界,直接返回
|
|
591
|
+
if (index < 0 || index >= actualChildCount) {
|
|
592
|
+
Log.w(TAG, "⚠️ 索引越界,忽略: index=$index, childCount=$actualChildCount")
|
|
593
|
+
return
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// 检查要移除的视图类型
|
|
597
|
+
val child = super.getChildAt(index)
|
|
598
|
+
|
|
599
|
+
// ❌ MapView 绝对不能移除
|
|
600
|
+
if (child is com.amap.api.maps.MapView) {
|
|
601
|
+
Log.e(TAG, "❌ 阻止移除 MapView!index=$index")
|
|
602
|
+
// 不移除,直接返回
|
|
603
|
+
return
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// MarkerView 特殊处理(虽然理论上不应该出现在这里)
|
|
607
|
+
if (child is MarkerView) {
|
|
608
|
+
Log.d(TAG, "⚠️ 发现 MarkerView 在视图层级中,使用 removeView")
|
|
609
|
+
removeView(child)
|
|
610
|
+
return
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// 正常移除其他视图
|
|
614
|
+
super.removeViewAt(index)
|
|
615
|
+
Log.d(TAG, "✅ 成功移除视图: index=$index")
|
|
616
|
+
|
|
617
|
+
} catch (e: IllegalArgumentException) {
|
|
618
|
+
// 索引异常,静默忽略
|
|
619
|
+
Log.w(TAG, "⚠️ 索引异常,已忽略: ${e.message}")
|
|
620
|
+
} catch (e: IndexOutOfBoundsException) {
|
|
621
|
+
// 越界异常,静默忽略
|
|
622
|
+
Log.w(TAG, "⚠️ 越界异常,已忽略: ${e.message}")
|
|
623
|
+
} catch (e: Exception) {
|
|
624
|
+
// 其他所有异常,静默忽略
|
|
625
|
+
Log.e(TAG, "⚠️ 移除视图异常,已忽略", e)
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
514
629
|
private fun checkDeclarativePolylinePress(latLng: LatLng): Boolean {
|
|
515
630
|
for (i in 0 until childCount) {
|
|
516
631
|
val child = getChildAt(i)
|
|
@@ -12,6 +12,12 @@ class ExpoGaodeMapViewModule : Module() {
|
|
|
12
12
|
|
|
13
13
|
View(ExpoGaodeMapView::class) {
|
|
14
14
|
Events("onMapPress", "onMapLongPress", "onLoad", "onLocation", "onMarkerPress", "onMarkerDragStart", "onMarkerDrag", "onMarkerDragEnd", "onCirclePress", "onPolygonPress", "onPolylinePress")
|
|
15
|
+
|
|
16
|
+
// ✅ 关键修复:拦截 React Native 的视图操作异常
|
|
17
|
+
OnViewDestroys { view: ExpoGaodeMapView ->
|
|
18
|
+
// 在视图销毁时不做任何抛出异常的操作
|
|
19
|
+
android.util.Log.d("ExpoGaodeMapViewModule", "视图正在销毁,清理资源")
|
|
20
|
+
}
|
|
15
21
|
|
|
16
22
|
Prop<Int>("mapType") { view, type ->
|
|
17
23
|
view.mapType = type
|
|
@@ -35,8 +41,8 @@ class ExpoGaodeMapViewModule : Module() {
|
|
|
35
41
|
Prop<Float>("maxZoom") { view, maxZoom -> view.setMaxZoom(maxZoom) }
|
|
36
42
|
Prop<Float>("minZoom") { view, minZoom -> view.setMinZoom(minZoom) }
|
|
37
43
|
|
|
38
|
-
Prop<Boolean>("myLocationEnabled") { view, show -> view.setShowsUserLocation(show) }
|
|
39
44
|
Prop<Boolean>("followUserLocation") { view, follow -> view.setFollowUserLocation(follow) }
|
|
45
|
+
Prop<Boolean>("myLocationEnabled") { view, show -> view.setShowsUserLocation(show) }
|
|
40
46
|
Prop<Map<String, Any>?>("userLocationRepresentation") { view, representation ->
|
|
41
47
|
representation?.let { view.setUserLocationRepresentation(it) }
|
|
42
48
|
}
|
|
@@ -96,24 +96,25 @@ class UIManager(private val aMap: AMap, private val context: Context) : Location
|
|
|
96
96
|
val locationType = if (followUserLocation) {
|
|
97
97
|
MyLocationStyle.LOCATION_TYPE_FOLLOW // 连续定位并跟随
|
|
98
98
|
} else {
|
|
99
|
-
MyLocationStyle.
|
|
99
|
+
MyLocationStyle.LOCATION_TYPE_SHOW // 只显示定位点,不跟随
|
|
100
100
|
}
|
|
101
101
|
myLocationType(locationType)
|
|
102
102
|
interval(2000) // 2秒定位一次
|
|
103
103
|
showMyLocation(true)
|
|
104
104
|
}
|
|
105
|
-
android.util.Log.d("UIManager", "✨ 创建默认 MyLocationStyle")
|
|
105
|
+
android.util.Log.d("UIManager", "✨ 创建默认 MyLocationStyle,类型: ${if (followUserLocation) "FOLLOW" else "SHOW"}")
|
|
106
106
|
} else {
|
|
107
107
|
// 更新定位类型
|
|
108
108
|
val locationType = if (followUserLocation) {
|
|
109
109
|
MyLocationStyle.LOCATION_TYPE_FOLLOW
|
|
110
110
|
} else {
|
|
111
|
-
MyLocationStyle.
|
|
111
|
+
MyLocationStyle.LOCATION_TYPE_SHOW
|
|
112
112
|
}
|
|
113
113
|
currentLocationStyle?.apply {
|
|
114
114
|
myLocationType(locationType)
|
|
115
115
|
interval(2000)
|
|
116
116
|
}
|
|
117
|
+
android.util.Log.d("UIManager", "🔄 更新定位类型: ${if (followUserLocation) "FOLLOW" else "SHOW"}")
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
// 监听定位变化(用于通知 React Native)
|
|
@@ -547,38 +547,54 @@ class MarkerView(context: Context, appContext: AppContext) : ExpoView(context, a
|
|
|
547
547
|
|
|
548
548
|
override fun removeView(child: View?) {
|
|
549
549
|
android.util.Log.d("MarkerView", "➖ removeView 被调用,child = $child, childCount = $childCount")
|
|
550
|
-
super.removeView(child)
|
|
551
550
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
551
|
+
try {
|
|
552
|
+
// 检查子视图是否确实存在
|
|
553
|
+
if (child != null && indexOfChild(child) >= 0) {
|
|
554
|
+
super.removeView(child)
|
|
555
|
+
|
|
556
|
+
// 子视图被移除后,清除图标或恢复默认图标
|
|
557
|
+
mainHandler.postDelayed({
|
|
558
|
+
android.util.Log.d("MarkerView", "⏰ removeView 延迟更新,childCount = $childCount")
|
|
559
|
+
if (childCount == 0 && marker != null) {
|
|
560
|
+
android.util.Log.d("MarkerView", "📍 所有子视图已移除,恢复默认图标")
|
|
561
|
+
marker?.setIcon(BitmapDescriptorFactory.defaultMarker())
|
|
562
|
+
marker?.setAnchor(0.5f, 1.0f)
|
|
563
|
+
}
|
|
564
|
+
}, 50)
|
|
565
|
+
} else {
|
|
566
|
+
android.util.Log.w("MarkerView", "⚠️ removeView: 子视图不存在或不属于此ViewGroup")
|
|
559
567
|
}
|
|
560
|
-
}
|
|
568
|
+
} catch (e: Exception) {
|
|
569
|
+
android.util.Log.e("MarkerView", "❌ removeView 发生异常", e)
|
|
570
|
+
}
|
|
561
571
|
}
|
|
562
572
|
|
|
563
573
|
override fun removeViewAt(index: Int) {
|
|
564
574
|
android.util.Log.d("MarkerView", "➖ removeViewAt 被调用,index = $index, childCount = $childCount")
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
575
|
+
|
|
576
|
+
try {
|
|
577
|
+
// 确保索引在有效范围内
|
|
578
|
+
if (index >= 0 && index < childCount) {
|
|
579
|
+
super.removeViewAt(index)
|
|
580
|
+
|
|
581
|
+
// 子视图被移除后,清除图标或恢复默认图标
|
|
582
|
+
mainHandler.postDelayed({
|
|
583
|
+
android.util.Log.d("MarkerView", "⏰ removeViewAt 延迟更新,childCount = $childCount")
|
|
584
|
+
if (childCount == 0 && marker != null) {
|
|
585
|
+
android.util.Log.d("MarkerView", "📍 所有子视图已移除,恢复默认图标")
|
|
586
|
+
marker?.setIcon(BitmapDescriptorFactory.defaultMarker())
|
|
587
|
+
marker?.setAnchor(0.5f, 1.0f)
|
|
588
|
+
} else if (childCount > 0 && marker != null) {
|
|
589
|
+
android.util.Log.d("MarkerView", "🔄 还有子视图,更新图标")
|
|
590
|
+
updateMarkerIcon()
|
|
591
|
+
}
|
|
592
|
+
}, 50)
|
|
593
|
+
} else {
|
|
594
|
+
android.util.Log.w("MarkerView", "⚠️ removeViewAt: 无效的索引 $index,childCount = $childCount,忽略此次移除操作")
|
|
595
|
+
}
|
|
596
|
+
} catch (e: Exception) {
|
|
597
|
+
android.util.Log.e("MarkerView", "❌ removeViewAt 发生异常: index=$index, childCount=$childCount", e)
|
|
582
598
|
}
|
|
583
599
|
}
|
|
584
600
|
|
|
@@ -635,6 +651,11 @@ class MarkerView(context: Context, appContext: AppContext) : ExpoView(context, a
|
|
|
635
651
|
|
|
636
652
|
override fun onDetachedFromWindow() {
|
|
637
653
|
super.onDetachedFromWindow()
|
|
654
|
+
|
|
655
|
+
// 清理所有延迟任务
|
|
656
|
+
mainHandler.removeCallbacksAndMessages(null)
|
|
657
|
+
|
|
658
|
+
// 移除 marker
|
|
638
659
|
removeMarker()
|
|
639
660
|
}
|
|
640
661
|
}
|
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';
|
|
6
6
|
import type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';
|
|
7
|
+
/**
|
|
8
|
+
* 定位事件数据
|
|
9
|
+
*/
|
|
10
|
+
export interface LocationEvent {
|
|
11
|
+
/**
|
|
12
|
+
* 纬度
|
|
13
|
+
*/
|
|
14
|
+
latitude: number;
|
|
15
|
+
/**
|
|
16
|
+
* 经度
|
|
17
|
+
*/
|
|
18
|
+
longitude: number;
|
|
19
|
+
/**
|
|
20
|
+
* 定位精度(米)
|
|
21
|
+
*/
|
|
22
|
+
accuracy: number;
|
|
23
|
+
}
|
|
7
24
|
/**
|
|
8
25
|
* 地图相机事件
|
|
9
26
|
*/
|
|
@@ -165,7 +182,7 @@ export interface MapViewProps {
|
|
|
165
182
|
/**
|
|
166
183
|
* 地图定位更新事件
|
|
167
184
|
*/
|
|
168
|
-
onLocation?: (event: NativeSyntheticEvent<
|
|
185
|
+
onLocation?: (event: NativeSyntheticEvent<LocationEvent>) => void;
|
|
169
186
|
/**
|
|
170
187
|
* Marker 点击事件
|
|
171
188
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-view.types.d.ts","sourceRoot":"","sources":["../../src/types/map-view.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"map-view.types.d.ts","sourceRoot":"","sources":["../../src/types/map-view.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEnG;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;IAE/B;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,qBAAqB,CAAC,EAAE,cAAc,CAAC;IAEvC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;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EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChG,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpG,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtF,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-view.types.js","sourceRoot":"","sources":["../../src/types/map-view.types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * 高德地图视图相关类型定义\n * 基于 Expo Modules API\n */\n\nimport type { StyleProp, ViewStyle,NativeSyntheticEvent } from 'react-native';\nimport type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';\n\n\n/**\n * 地图相机事件\n */\nexport interface CameraEvent {\n /**\n * 相机位置\n */\n cameraPosition: CameraPosition;\n\n /**\n * 可见区域边界\n */\n latLngBounds: LatLngBounds;\n}\n\n/**\n * 地图视图属性\n */\nexport interface MapViewProps {\n /**\n * 地图类型\n */\n mapType?: MapType;\n\n /**\n * 初始相机位置\n */\n initialCameraPosition?: CameraPosition;\n\n /**\n * 是否显示当前定位\n */\n myLocationEnabled?: boolean;\n\n /**\n * 是否跟随用户位置\n * @default false\n */\n followUserLocation?: boolean;\n\n /**\n * 定位蓝点配置\n */\n userLocationRepresentation?: {\n /** 精度圈是否显示 @default true */\n showsAccuracyRing?: boolean;\n /** 是否显示方向指示 @default true @platform ios */\n showsHeadingIndicator?: boolean;\n /** 精度圈填充颜色 支持 '#RRGGBB'、'red' 或 ARGB 数字 */\n fillColor?: string | number;\n /** 精度圈边线颜色 */\n strokeColor?: string | number;\n /** 精度圈边线宽度 @default 0 */\n lineWidth?: number;\n /** 内部蓝色圆点是否使用律动效果 @default true @platform ios */\n enablePulseAnimation?: boolean;\n /** 定位点背景色 @default 'white' @platform ios */\n locationDotBgColor?: string | number;\n /** 定位点蓝色圆点颜色 @default 'blue' @platform ios */\n locationDotFillColor?: string | number;\n /** 定位图标 支持网络图片(http/https)、本地文件(file://)或资源名称 */\n image?: string;\n /** 定位图标宽度(像素) */\n imageWidth?: number;\n /** 定位图标高度(像素) */\n imageHeight?: number;\n };\n\n /**\n * 是否显示室内地图\n * \n */\n indoorViewEnabled?: boolean;\n\n /**\n * 是否显示3D建筑\n */\n buildingsEnabled?: boolean;\n\n /**\n * 是否显示标注\n */\n labelsEnabled?: boolean;\n\n /**\n * 是否显示指南针\n */\n compassEnabled?: boolean;\n\n /**\n * 是否显示缩放按钮\n * @platform android\n */\n zoomControlsEnabled?: boolean;\n\n /**\n * 是否显示比例尺\n */\n scaleControlsEnabled?: boolean;\n\n /**\n * 是否显示定位按钮\n * @platform android\n */\n myLocationButtonEnabled?: boolean;\n\n /**\n * 是否显示路况\n */\n trafficEnabled?: boolean;\n\n /**\n * 最大缩放级别\n */\n maxZoom?: number;\n\n /**\n * 最小缩放级别\n */\n minZoom?: number;\n\n /**\n * 是否启用缩放手势\n */\n zoomGesturesEnabled?: boolean;\n\n /**\n * 是否启用滑动手势\n */\n scrollGesturesEnabled?: boolean;\n\n /**\n * 是否启用旋转手势\n */\n rotateGesturesEnabled?: boolean;\n\n /**\n * 是否启用倾斜手势\n */\n tiltGesturesEnabled?: boolean;\n\n /**\n * 定位的最小更新距离(米)\n * @platform ios\n */\n distanceFilter?: number;\n\n /**\n * 最小更新角度(度)\n * @platform ios\n */\n headingFilter?: number;\n\n /**\n * 样式\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * 点击地图事件\n */\n onMapPress?: (event: NativeSyntheticEvent<LatLng>) => void;\n\n /**\n * 点击标注点事件\n */\n onPressPoi?: (event: NativeSyntheticEvent<MapPoi>) => void;\n\n /**\n * 长按地图事件\n */\n onMapLongPress?: (event: NativeSyntheticEvent<LatLng>) => void;\n\n /**\n * 地图状态改变事件(实时触发)\n */\n onCameraMove?: (event: NativeSyntheticEvent<CameraEvent>) => void;\n\n /**\n * 地图状态改变完成事件\n */\n onCameraIdle?: (event: NativeSyntheticEvent<CameraEvent>) => void;\n\n /**\n * 地图加载完成事件\n */\n onLoad?: (event: NativeSyntheticEvent<{}>) => void;\n\n /**\n * 地图定位更新事件\n */\n onLocation?: (event: NativeSyntheticEvent<
|
|
1
|
+
{"version":3,"file":"map-view.types.js","sourceRoot":"","sources":["../../src/types/map-view.types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * 高德地图视图相关类型定义\n * 基于 Expo Modules API\n */\n\nimport type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';\nimport type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';\n\n/**\n * 定位事件数据\n */\nexport interface LocationEvent {\n /**\n * 纬度\n */\n latitude: number;\n \n /**\n * 经度\n */\n longitude: number;\n \n /**\n * 定位精度(米)\n */\n accuracy: number;\n}\n\n\n/**\n * 地图相机事件\n */\nexport interface CameraEvent {\n /**\n * 相机位置\n */\n cameraPosition: CameraPosition;\n\n /**\n * 可见区域边界\n */\n latLngBounds: LatLngBounds;\n}\n\n/**\n * 地图视图属性\n */\nexport interface MapViewProps {\n /**\n * 地图类型\n */\n mapType?: MapType;\n\n /**\n * 初始相机位置\n */\n initialCameraPosition?: CameraPosition;\n\n /**\n * 是否显示当前定位\n */\n myLocationEnabled?: boolean;\n\n /**\n * 是否跟随用户位置\n * @default false\n */\n followUserLocation?: boolean;\n\n /**\n * 定位蓝点配置\n */\n userLocationRepresentation?: {\n /** 精度圈是否显示 @default true */\n showsAccuracyRing?: boolean;\n /** 是否显示方向指示 @default true @platform ios */\n showsHeadingIndicator?: boolean;\n /** 精度圈填充颜色 支持 '#RRGGBB'、'red' 或 ARGB 数字 */\n fillColor?: string | number;\n /** 精度圈边线颜色 */\n strokeColor?: string | number;\n /** 精度圈边线宽度 @default 0 */\n lineWidth?: number;\n /** 内部蓝色圆点是否使用律动效果 @default true @platform ios */\n enablePulseAnimation?: boolean;\n /** 定位点背景色 @default 'white' @platform ios */\n locationDotBgColor?: string | number;\n /** 定位点蓝色圆点颜色 @default 'blue' @platform ios */\n locationDotFillColor?: string | number;\n /** 定位图标 支持网络图片(http/https)、本地文件(file://)或资源名称 */\n image?: string;\n /** 定位图标宽度(像素) */\n imageWidth?: number;\n /** 定位图标高度(像素) */\n imageHeight?: number;\n };\n\n /**\n * 是否显示室内地图\n * \n */\n indoorViewEnabled?: boolean;\n\n /**\n * 是否显示3D建筑\n */\n buildingsEnabled?: boolean;\n\n /**\n * 是否显示标注\n */\n labelsEnabled?: boolean;\n\n /**\n * 是否显示指南针\n */\n compassEnabled?: boolean;\n\n /**\n * 是否显示缩放按钮\n * @platform android\n */\n zoomControlsEnabled?: boolean;\n\n /**\n * 是否显示比例尺\n */\n scaleControlsEnabled?: boolean;\n\n /**\n * 是否显示定位按钮\n * @platform android\n */\n myLocationButtonEnabled?: boolean;\n\n /**\n * 是否显示路况\n */\n trafficEnabled?: boolean;\n\n /**\n * 最大缩放级别\n */\n maxZoom?: number;\n\n /**\n * 最小缩放级别\n */\n minZoom?: number;\n\n /**\n * 是否启用缩放手势\n */\n zoomGesturesEnabled?: boolean;\n\n /**\n * 是否启用滑动手势\n */\n scrollGesturesEnabled?: boolean;\n\n /**\n * 是否启用旋转手势\n */\n rotateGesturesEnabled?: boolean;\n\n /**\n * 是否启用倾斜手势\n */\n tiltGesturesEnabled?: boolean;\n\n /**\n * 定位的最小更新距离(米)\n * @platform ios\n */\n distanceFilter?: number;\n\n /**\n * 最小更新角度(度)\n * @platform ios\n */\n headingFilter?: number;\n\n /**\n * 样式\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * 点击地图事件\n */\n onMapPress?: (event: NativeSyntheticEvent<LatLng>) => void;\n\n /**\n * 点击标注点事件\n */\n onPressPoi?: (event: NativeSyntheticEvent<MapPoi>) => void;\n\n /**\n * 长按地图事件\n */\n onMapLongPress?: (event: NativeSyntheticEvent<LatLng>) => void;\n\n /**\n * 地图状态改变事件(实时触发)\n */\n onCameraMove?: (event: NativeSyntheticEvent<CameraEvent>) => void;\n\n /**\n * 地图状态改变完成事件\n */\n onCameraIdle?: (event: NativeSyntheticEvent<CameraEvent>) => void;\n\n /**\n * 地图加载完成事件\n */\n onLoad?: (event: NativeSyntheticEvent<{}>) => void;\n\n /**\n * 地图定位更新事件\n */\n onLocation?: (event: NativeSyntheticEvent<LocationEvent>) => void;\n\n /**\n * Marker 点击事件\n */\n onMarkerPress?: (event: NativeSyntheticEvent<{ markerId: string } & LatLng>) => void;\n\n /**\n * Marker 拖拽开始事件\n */\n onMarkerDragStart?: (event: NativeSyntheticEvent<{ markerId: string } & LatLng>) => void;\n\n /**\n * Marker 拖拽中事件\n */\n onMarkerDrag?: (event: NativeSyntheticEvent<{ markerId: string } & LatLng>) => void;\n\n /**\n * Marker 拖拽结束事件\n */\n onMarkerDragEnd?: (event: NativeSyntheticEvent<{ markerId: string } & LatLng>) => void;\n\n /**\n * Circle 点击事件\n */\n onCirclePress?: (event: NativeSyntheticEvent<{ circleId: string } & LatLng>) => void;\n\n /**\n * Polygon 点击事件\n */\n onPolygonPress?: (event: NativeSyntheticEvent<{ polygonId: string } & LatLng>) => void;\n\n /**\n * Polyline 点击事件\n */\n onPolylinePress?: (event: NativeSyntheticEvent<{ polylineId: string } & LatLng>) => void;\n\n /**\n * 子组件\n */\n children?: React.ReactNode;\n}\n\n/**\n * 地图视图方法\n */\nexport interface MapViewMethods {\n /**\n * 移动相机\n * @param cameraPosition 目标相机位置\n * @param duration 动画时长(毫秒)\n */\n moveCamera(cameraPosition: CameraPosition, duration?: number): void;\n\n /**\n * 将屏幕坐标转换为地理坐标\n * @param point 屏幕坐标\n * @returns 地理坐标\n */\n getLatLng(point: Point): Promise<LatLng>;\n}\n\n/**\n * MapView Ref 公开接口(用户使用)\n */\nexport interface MapViewRef {\n moveCamera(position: CameraPosition, duration?: number): Promise<void>;\n getLatLng(point: Point): Promise<LatLng>;\n setCenter(center: LatLng, animated?: boolean): Promise<void>;\n setZoom(zoom: number, animated?: boolean): Promise<void>;\n getCameraPosition(): Promise<CameraPosition>;\n addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;\n removeCircle(id: string): Promise<void>;\n updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;\n addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;\n removeMarker(id: string): Promise<void>;\n updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;\n addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;\n removePolyline(id: string): Promise<void>;\n updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;\n addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;\n removePolygon(id: string): Promise<void>;\n updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;\n}\n\n/**\n * 原生 MapView Ref 接口(所有参数必需)\n */\nexport interface NativeMapViewRef {\n moveCamera(position: CameraPosition, duration: number): Promise<void>;\n getLatLng(point: Point): Promise<LatLng>;\n setCenter(center: LatLng, animated: boolean): Promise<void>;\n setZoom(zoom: number, animated: boolean): Promise<void>;\n getCameraPosition(): Promise<CameraPosition>;\n addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;\n removeCircle(id: string): Promise<void>;\n updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;\n addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;\n removeMarker(id: string): Promise<void>;\n updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;\n addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;\n removePolyline(id: string): Promise<void>;\n updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;\n addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;\n removePolygon(id: string): Promise<void>;\n updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,9 +3,29 @@
|
|
|
3
3
|
* 基于 Expo Modules API
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { StyleProp, ViewStyle,NativeSyntheticEvent } from 'react-native';
|
|
6
|
+
import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';
|
|
7
7
|
import type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* 定位事件数据
|
|
11
|
+
*/
|
|
12
|
+
export interface LocationEvent {
|
|
13
|
+
/**
|
|
14
|
+
* 纬度
|
|
15
|
+
*/
|
|
16
|
+
latitude: number;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 经度
|
|
20
|
+
*/
|
|
21
|
+
longitude: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 定位精度(米)
|
|
25
|
+
*/
|
|
26
|
+
accuracy: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
|
|
10
30
|
/**
|
|
11
31
|
* 地图相机事件
|
|
@@ -198,7 +218,7 @@ export interface MapViewProps {
|
|
|
198
218
|
/**
|
|
199
219
|
* 地图定位更新事件
|
|
200
220
|
*/
|
|
201
|
-
onLocation?: (event: NativeSyntheticEvent<
|
|
221
|
+
onLocation?: (event: NativeSyntheticEvent<LocationEvent>) => void;
|
|
202
222
|
|
|
203
223
|
/**
|
|
204
224
|
* Marker 点击事件
|