expo-gaode-map 2.2.33 → 2.2.34
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/README.md +20 -14
- package/android/build.gradle +8 -4
- package/android/src/main/AndroidManifest.xml +14 -0
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapModule.kt +7 -8
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapOfflineModule.kt +150 -27
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +24 -14
- package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +38 -41
- package/android/src/main/java/expo/modules/gaodemap/modules/SDKInitializer.kt +18 -17
- package/android/src/main/java/expo/modules/gaodemap/overlays/CircleView.kt +3 -1
- package/android/src/main/java/expo/modules/gaodemap/overlays/ClusterView.kt +6 -1
- package/android/src/main/java/expo/modules/gaodemap/overlays/HeatMapView.kt +124 -10
- package/android/src/main/java/expo/modules/gaodemap/overlays/HeatMapViewModule.kt +2 -2
- package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerBitmapRenderer.kt +10 -9
- package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +7 -11
- package/android/src/main/java/expo/modules/gaodemap/overlays/MultiPointView.kt +3 -1
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolygonView.kt +2 -1
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolylineView.kt +1 -0
- package/android/src/main/java/expo/modules/gaodemap/search/ExpoGaodeMapSearchModule.kt +751 -0
- package/android/src/main/java/expo/modules/gaodemap/utils/GeometryUtils.kt +5 -5
- package/android/src/main/java/expo/modules/gaodemap/utils/PermissionHelper.kt +13 -16
- package/build/ExpoGaodeMapOfflineModule.d.ts +5 -0
- package/build/ExpoGaodeMapOfflineModule.d.ts.map +1 -1
- package/build/ExpoGaodeMapOfflineModule.js.map +1 -1
- package/build/components/overlays/HeatMap.d.ts.map +1 -1
- package/build/components/overlays/HeatMap.js +21 -2
- package/build/components/overlays/HeatMap.js.map +1 -1
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build/search/ExpoGaodeMapSearch.types.d.ts +340 -0
- package/build/search/ExpoGaodeMapSearch.types.d.ts.map +1 -0
- package/build/search/ExpoGaodeMapSearch.types.js +19 -0
- package/build/search/ExpoGaodeMapSearch.types.js.map +1 -0
- package/build/search/ExpoGaodeMapSearchModule.d.ts +74 -0
- package/build/search/ExpoGaodeMapSearchModule.d.ts.map +1 -0
- package/build/search/ExpoGaodeMapSearchModule.js +47 -0
- package/build/search/ExpoGaodeMapSearchModule.js.map +1 -0
- package/build/search/index.d.ts +156 -0
- package/build/search/index.d.ts.map +1 -0
- package/build/search/index.js +171 -0
- package/build/search/index.js.map +1 -0
- package/build/types/map-view.types.d.ts +4 -2
- package/build/types/map-view.types.d.ts.map +1 -1
- package/build/types/map-view.types.js.map +1 -1
- package/build/utils/OfflineMapManager.d.ts +4 -0
- package/build/utils/OfflineMapManager.d.ts.map +1 -1
- package/build/utils/OfflineMapManager.js +6 -0
- package/build/utils/OfflineMapManager.js.map +1 -1
- package/expo-module.config.json +4 -2
- package/ios/ExpoGaodeMap.podspec +2 -2
- package/ios/ExpoGaodeMapOfflineModule.swift +60 -0
- package/ios/ExpoGaodeMapSearchModule.swift +773 -0
- package/ios/modules/LocationManager.swift +9 -3
- package/ios/overlays/PolylineView.swift +6 -12
- package/package.json +1 -1
- package/plugin/build/withGaodeMap.js +12 -0
|
@@ -101,14 +101,20 @@ class LocationManager: NSObject, AMapLocationManagerDelegate {
|
|
|
101
101
|
ensureLocationManager()?.allowsBackgroundLocationUpdates = allows
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
private func setReGeocodeLanguage(_ rawValue: AMapRegionLanguageType.RawValue) {
|
|
105
|
+
if let language = AMapRegionLanguageType(rawValue: rawValue) {
|
|
106
|
+
ensureLocationManager()?.reGeocodeLanguage = language
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
104
110
|
func setGeoLanguage(_ language: String) {
|
|
105
111
|
switch language.uppercased() {
|
|
106
112
|
case "ZH":
|
|
107
|
-
|
|
113
|
+
setReGeocodeLanguage(0)
|
|
108
114
|
case "EN":
|
|
109
|
-
|
|
115
|
+
setReGeocodeLanguage(2)
|
|
110
116
|
default:
|
|
111
|
-
|
|
117
|
+
setReGeocodeLanguage(0)
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
|
|
@@ -71,6 +71,9 @@ class PolylineView: ExpoView {
|
|
|
71
71
|
func setMap(_ map: MAMapView) {
|
|
72
72
|
// 🔑 关键优化:如果是同一个地图引用,跳过重复设置
|
|
73
73
|
if lastSetMapView === map {
|
|
74
|
+
if polyline == nil {
|
|
75
|
+
updatePolyline()
|
|
76
|
+
}
|
|
74
77
|
return
|
|
75
78
|
}
|
|
76
79
|
|
|
@@ -105,10 +108,9 @@ class PolylineView: ExpoView {
|
|
|
105
108
|
// 🔑 至少需要2个点才能绘制折线
|
|
106
109
|
guard coords.count >= 2 else { return }
|
|
107
110
|
|
|
111
|
+
renderer = nil
|
|
108
112
|
polyline = MAPolyline(coordinates: &coords, count: UInt(coords.count))
|
|
109
113
|
mapView.add(polyline!)
|
|
110
|
-
|
|
111
|
-
renderer = nil
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
/**
|
|
@@ -221,18 +223,10 @@ class PolylineView: ExpoView {
|
|
|
221
223
|
|
|
222
224
|
/**
|
|
223
225
|
* 强制重新渲染折线
|
|
224
|
-
*
|
|
226
|
+
* 通过重建 overlay 来触发地图重新请求 renderer
|
|
225
227
|
*/
|
|
226
228
|
private func forceRerender() {
|
|
227
|
-
|
|
228
|
-
return
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// 移除旧的 overlay
|
|
232
|
-
mapView.remove(polyline)
|
|
233
|
-
|
|
234
|
-
// 重新添加(地图会调用 rendererFor overlay)
|
|
235
|
-
mapView.add(polyline)
|
|
229
|
+
updatePolyline()
|
|
236
230
|
}
|
|
237
231
|
|
|
238
232
|
func setDotted(_ dotted: Bool) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gaode-map",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.34",
|
|
4
4
|
"description": "A full-featured React Native AMap (Gaode Map) library for Expo, including map display, location, overlays, offline maps, and geometry utilities.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -186,6 +186,18 @@ configurations.all {
|
|
|
186
186
|
*/
|
|
187
187
|
const withGaodeMapAndroidSdk = (config, props) => {
|
|
188
188
|
return (0, config_plugins_1.withGradleProperties)(config, (config) => {
|
|
189
|
+
const jetifierKey = 'android.enableJetifier';
|
|
190
|
+
const jetifier = config.modResults.find((item) => item.type === 'property' && item.key === jetifierKey);
|
|
191
|
+
if (jetifier && jetifier.type === 'property') {
|
|
192
|
+
jetifier.value = 'true';
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
config.modResults.push({
|
|
196
|
+
type: 'property',
|
|
197
|
+
key: jetifierKey,
|
|
198
|
+
value: 'true',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
189
201
|
if (props.customMapSdkPath) {
|
|
190
202
|
const key = 'EXPO_GAODE_MAP_CUSTOM_SDK_PATH';
|
|
191
203
|
const existing = config.modResults.find((item) => item.type === 'property' && item.key === key);
|