expo-gaode-map-navigation 1.1.5 → 1.1.7
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 +213 -73
- package/android/build.gradle +10 -0
- package/android/src/main/cpp/CMakeLists.txt +24 -0
- package/android/src/main/cpp/cluster_jni.cpp +848 -0
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapModule.kt +616 -92
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapOfflineModule.kt +493 -0
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapView.kt +230 -14
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapViewModule.kt +37 -27
- package/android/src/main/java/expo/modules/gaodemap/map/MapPreloadManager.kt +494 -0
- package/android/src/main/java/expo/modules/gaodemap/map/companion/BitmapDescriptorCache.kt +30 -0
- package/android/src/main/java/expo/modules/gaodemap/map/companion/IconBitmapCache.kt +37 -0
- package/android/src/main/java/expo/modules/gaodemap/map/managers/UIManager.kt +76 -0
- package/android/src/main/java/expo/modules/gaodemap/map/modules/LocationManager.kt +15 -3
- package/android/src/main/java/expo/modules/gaodemap/map/modules/SDKInitializer.kt +4 -59
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/CircleView.kt +9 -12
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/CircleViewModule.kt +5 -6
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/ClusterView.kt +539 -66
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/ClusterViewModule.kt +17 -1
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/HeatMapView.kt +165 -33
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/HeatMapViewModule.kt +15 -3
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MarkerView.kt +1249 -672
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MarkerViewModule.kt +40 -17
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MultiPointView.kt +177 -22
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MultiPointViewModule.kt +11 -3
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolygonView.kt +57 -14
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolygonViewModule.kt +9 -5
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolylineView.kt +90 -63
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolylineViewModule.kt +7 -3
- package/android/src/main/java/expo/modules/gaodemap/map/services/LocationForegroundService.kt +3 -2
- package/android/src/main/java/expo/modules/gaodemap/map/utils/BitmapDescriptorCache.kt +20 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/ClusterNative.kt +13 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/ColorParser.kt +20 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/GeometryUtils.kt +515 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/LatLngParser.kt +91 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/PermissionHelper.kt +248 -0
- package/build/ExpoGaodeMapNaviView.d.ts +7 -7
- package/build/ExpoGaodeMapNaviView.js +10 -11
- package/build/ExpoGaodeMapNavigationModule.d.ts +2 -1
- package/build/index.d.ts +35 -33
- package/build/index.js +70 -106
- package/build/map/ExpoGaodeMapModule.d.ts +2 -201
- package/build/map/ExpoGaodeMapModule.js +586 -18
- package/build/map/ExpoGaodeMapOfflineModule.d.ts +139 -0
- package/build/map/ExpoGaodeMapOfflineModule.js +8 -0
- package/build/map/ExpoGaodeMapView.js +66 -58
- package/build/map/components/FoldableMapView.d.ts +38 -0
- package/build/map/components/FoldableMapView.js +209 -0
- package/build/map/components/MapContext.d.ts +12 -0
- package/build/map/components/MapContext.js +54 -0
- package/build/map/components/MapUI.d.ts +18 -0
- package/build/map/components/MapUI.js +29 -0
- package/build/map/components/overlays/Circle.js +34 -3
- package/build/map/components/overlays/Cluster.d.ts +3 -1
- package/build/map/components/overlays/Cluster.js +31 -2
- package/build/map/components/overlays/HeatMap.d.ts +3 -1
- package/build/map/components/overlays/HeatMap.js +33 -3
- package/build/map/components/overlays/Marker.d.ts +1 -1
- package/build/map/components/overlays/Marker.js +37 -32
- package/build/map/components/overlays/MultiPoint.js +1 -1
- package/build/map/components/overlays/Polygon.js +30 -3
- package/build/map/components/overlays/Polyline.js +36 -3
- package/build/map/index.d.ts +25 -5
- package/build/map/index.js +59 -18
- package/build/map/types/common.types.d.ts +40 -0
- package/build/map/types/common.types.js +0 -4
- package/build/map/types/index.d.ts +3 -2
- package/build/map/types/map-view.types.d.ts +108 -3
- package/build/map/types/native-module.types.d.ts +363 -0
- package/build/map/types/native-module.types.js +5 -0
- package/build/map/types/offline.types.d.ts +132 -0
- package/build/map/types/offline.types.js +5 -0
- package/build/map/types/overlays.types.d.ts +137 -24
- package/build/map/utils/ErrorHandler.d.ts +110 -0
- package/build/map/utils/ErrorHandler.js +421 -0
- package/build/map/utils/GeoUtils.d.ts +20 -0
- package/build/map/utils/GeoUtils.js +76 -0
- package/build/map/utils/OfflineMapManager.d.ts +148 -0
- package/build/map/utils/OfflineMapManager.js +217 -0
- package/build/map/utils/PermissionUtils.d.ts +91 -0
- package/build/map/utils/PermissionUtils.js +255 -0
- package/build/map/utils/PlatformDetector.d.ts +102 -0
- package/build/map/utils/PlatformDetector.js +186 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -0
- package/build/types/native-module.types.d.ts +69 -0
- package/build/types/native-module.types.js +2 -0
- package/build/types/naviview.types.d.ts +1 -1
- package/expo-module.config.json +12 -10
- package/ios/ExpoGaodeMapNavigation.podspec +9 -0
- package/ios/map/ExpoGaodeMapModule.swift +485 -75
- package/ios/map/ExpoGaodeMapOfflineModule.swift +479 -0
- package/ios/map/ExpoGaodeMapView.swift +611 -62
- package/ios/map/ExpoGaodeMapViewModule.swift +48 -26
- package/ios/map/MapPreloadManager.swift +348 -0
- package/ios/map/cpp/ClusterEngine.cpp +110 -0
- package/ios/map/cpp/ClusterEngine.hpp +20 -0
- package/ios/map/cpp/ColorParser.cpp +135 -0
- package/ios/map/cpp/ColorParser.hpp +14 -0
- package/ios/map/cpp/GeometryEngine.cpp +574 -0
- package/ios/map/cpp/GeometryEngine.hpp +159 -0
- package/ios/map/cpp/QuadTree.cpp +92 -0
- package/ios/map/cpp/QuadTree.hpp +42 -0
- package/ios/map/cpp/README.md +55 -0
- package/ios/map/managers/UIManager.swift +72 -1
- package/ios/map/modules/LocationManager.swift +123 -166
- package/ios/map/overlays/CircleView.swift +16 -32
- package/ios/map/overlays/CircleViewModule.swift +12 -12
- package/ios/map/overlays/ClusterAnnotation.swift +32 -0
- package/ios/map/overlays/ClusterView.swift +331 -45
- package/ios/map/overlays/ClusterViewModule.swift +20 -6
- package/ios/map/overlays/HeatMapView.swift +135 -32
- package/ios/map/overlays/HeatMapViewModule.swift +20 -8
- package/ios/map/overlays/MarkerView.swift +613 -130
- package/ios/map/overlays/MarkerViewModule.swift +38 -18
- package/ios/map/overlays/MultiPointView.swift +168 -10
- package/ios/map/overlays/MultiPointViewModule.swift +27 -5
- package/ios/map/overlays/PolygonView.swift +62 -23
- package/ios/map/overlays/PolygonViewModule.swift +18 -12
- package/ios/map/overlays/PolylineView.swift +21 -13
- package/ios/map/overlays/PolylineViewModule.swift +18 -12
- package/ios/map/utils/ClusterNative.h +96 -0
- package/ios/map/utils/ClusterNative.mm +377 -0
- package/ios/map/utils/ColorParser.swift +12 -1
- package/ios/map/utils/CppBridging.mm +13 -0
- package/ios/map/utils/GeometryUtils.swift +34 -0
- package/ios/map/utils/LatLngParser.swift +87 -0
- package/ios/map/utils/PermissionManager.swift +135 -6
- package/package.json +3 -2
- package/shared/cpp/ClusterEngine.cpp +110 -0
- package/shared/cpp/ClusterEngine.hpp +20 -0
- package/shared/cpp/ColorParser.cpp +135 -0
- package/shared/cpp/ColorParser.hpp +14 -0
- package/shared/cpp/GeometryEngine.cpp +574 -0
- package/shared/cpp/GeometryEngine.hpp +159 -0
- package/shared/cpp/QuadTree.cpp +92 -0
- package/shared/cpp/QuadTree.hpp +42 -0
- package/shared/cpp/README.md +55 -0
- package/shared/cpp/tests/benchmark_js.js +41 -0
- package/shared/cpp/tests/run.sh +17 -0
- package/shared/cpp/tests/test_main.cpp +276 -0
- package/build/map/ExpoGaodeMap.types.d.ts +0 -41
- package/build/map/ExpoGaodeMap.types.js +0 -24
- package/build/map/utils/EventManager.d.ts +0 -10
- package/build/map/utils/EventManager.js +0 -26
- package/build/map/utils/ModuleLoader.d.ts +0 -73
- package/build/map/utils/ModuleLoader.js +0 -112
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 平台检测工具
|
|
4
|
+
* 用于检测设备特性、系统版本等
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isIPad = exports.isFoldable = exports.isTablet = exports.isiOS17Plus = exports.isAndroid14Plus = exports.PlatformDetector = exports.FoldState = exports.DeviceType = void 0;
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
/**
|
|
10
|
+
* 设备类型
|
|
11
|
+
*/
|
|
12
|
+
var DeviceType;
|
|
13
|
+
(function (DeviceType) {
|
|
14
|
+
DeviceType["PHONE"] = "phone";
|
|
15
|
+
DeviceType["TABLET"] = "tablet";
|
|
16
|
+
DeviceType["FOLDABLE"] = "foldable";
|
|
17
|
+
DeviceType["UNKNOWN"] = "unknown";
|
|
18
|
+
})(DeviceType || (exports.DeviceType = DeviceType = {}));
|
|
19
|
+
/**
|
|
20
|
+
* 折叠状态
|
|
21
|
+
*/
|
|
22
|
+
var FoldState;
|
|
23
|
+
(function (FoldState) {
|
|
24
|
+
FoldState["FOLDED"] = "folded";
|
|
25
|
+
FoldState["UNFOLDED"] = "unfolded";
|
|
26
|
+
FoldState["HALF_FOLDED"] = "half_folded";
|
|
27
|
+
FoldState["UNKNOWN"] = "unknown";
|
|
28
|
+
})(FoldState || (exports.FoldState = FoldState = {}));
|
|
29
|
+
/**
|
|
30
|
+
* 平台检测器类
|
|
31
|
+
*/
|
|
32
|
+
class PlatformDetector {
|
|
33
|
+
/**
|
|
34
|
+
* 获取系统版本信息
|
|
35
|
+
*/
|
|
36
|
+
static getSystemVersion() {
|
|
37
|
+
if (this.systemVersion) {
|
|
38
|
+
return this.systemVersion;
|
|
39
|
+
}
|
|
40
|
+
const version = parseInt(react_native_1.Platform.Version.toString(), 10);
|
|
41
|
+
this.systemVersion = {
|
|
42
|
+
platform: react_native_1.Platform.OS,
|
|
43
|
+
version,
|
|
44
|
+
isAndroid14Plus: react_native_1.Platform.OS === 'android' && version >= 34, // Android 14 = API 34
|
|
45
|
+
isIOS17Plus: react_native_1.Platform.OS === 'ios' && version >= 17,
|
|
46
|
+
};
|
|
47
|
+
return this.systemVersion;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 获取设备信息
|
|
51
|
+
*/
|
|
52
|
+
static getDeviceInfo() {
|
|
53
|
+
if (this.deviceInfo) {
|
|
54
|
+
return this.deviceInfo;
|
|
55
|
+
}
|
|
56
|
+
const { width, height, scale, fontScale } = react_native_1.Dimensions.get('window');
|
|
57
|
+
const aspectRatio = Math.max(width, height) / Math.min(width, height);
|
|
58
|
+
const isLandscape = width > height;
|
|
59
|
+
// 判断是否为平板(基于屏幕尺寸和宽高比)
|
|
60
|
+
const smallerDimension = Math.min(width, height);
|
|
61
|
+
const isTablet = smallerDimension >= 600 || aspectRatio < 1.6;
|
|
62
|
+
// 检测折叠屏(基于极端宽高比)
|
|
63
|
+
const isFoldable = this.detectFoldable(width, height, aspectRatio);
|
|
64
|
+
let type = DeviceType.PHONE;
|
|
65
|
+
if (isFoldable) {
|
|
66
|
+
type = DeviceType.FOLDABLE;
|
|
67
|
+
}
|
|
68
|
+
else if (isTablet) {
|
|
69
|
+
type = DeviceType.TABLET;
|
|
70
|
+
}
|
|
71
|
+
this.deviceInfo = {
|
|
72
|
+
type,
|
|
73
|
+
isTablet,
|
|
74
|
+
isFoldable,
|
|
75
|
+
screenSize: { width, height, scale, fontScale },
|
|
76
|
+
aspectRatio,
|
|
77
|
+
isLandscape,
|
|
78
|
+
};
|
|
79
|
+
return this.deviceInfo;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 检测折叠屏设备
|
|
83
|
+
*/
|
|
84
|
+
static detectFoldable(width, height, aspectRatio) {
|
|
85
|
+
// 常见折叠屏特征:
|
|
86
|
+
// 1. 展开时宽高比接近正方形或较小(1.2-1.6)
|
|
87
|
+
// 2. 折叠时宽高比很大(>2.1)
|
|
88
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
89
|
+
// 检查是否为极端宽高比
|
|
90
|
+
if (aspectRatio > 2.1 || aspectRatio < 1.3) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
// 检查是否为特定分辨率(已知折叠屏设备)
|
|
94
|
+
const knownFoldableResolutions = [
|
|
95
|
+
{ w: 2208, h: 1768 }, // Galaxy Z Fold 展开
|
|
96
|
+
{ w: 2176, h: 1812 }, // Galaxy Z Fold 3/4 展开
|
|
97
|
+
{ w: 884, h: 2208 }, // Galaxy Z Fold 折叠
|
|
98
|
+
{ w: 1768, h: 2208 }, // Huawei Mate X
|
|
99
|
+
];
|
|
100
|
+
return knownFoldableResolutions.some((res) => (Math.abs(width - res.w) < 50 && Math.abs(height - res.h) < 50) ||
|
|
101
|
+
(Math.abs(width - res.h) < 50 && Math.abs(height - res.w) < 50));
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 检测当前折叠状态(需要原生支持)
|
|
107
|
+
*/
|
|
108
|
+
static getFoldState() {
|
|
109
|
+
const info = this.getDeviceInfo();
|
|
110
|
+
if (!info.isFoldable) {
|
|
111
|
+
return FoldState.UNKNOWN;
|
|
112
|
+
}
|
|
113
|
+
// 基于宽高比判断折叠状态
|
|
114
|
+
if (info.aspectRatio > 2.0) {
|
|
115
|
+
return FoldState.FOLDED;
|
|
116
|
+
}
|
|
117
|
+
else if (info.aspectRatio < 1.5) {
|
|
118
|
+
return FoldState.UNFOLDED;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return FoldState.HALF_FOLDED;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 是否为 iPad
|
|
126
|
+
*/
|
|
127
|
+
static isIPad() {
|
|
128
|
+
if (react_native_1.Platform.OS !== 'ios') {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return this.getDeviceInfo().isTablet;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 是否支持多任务
|
|
135
|
+
*/
|
|
136
|
+
static supportsMultitasking() {
|
|
137
|
+
return react_native_1.Platform.OS === 'ios' && this.isIPad();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 是否需要 Android 14+ 新权限流程
|
|
141
|
+
*/
|
|
142
|
+
static needsAndroid14Permissions() {
|
|
143
|
+
return this.getSystemVersion().isAndroid14Plus;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* 是否支持 iOS 17+ 新特性
|
|
147
|
+
*/
|
|
148
|
+
static supportsiOS17Features() {
|
|
149
|
+
return this.getSystemVersion().isIOS17Plus;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 监听屏幕尺寸变化(折叠屏展开/折叠)
|
|
153
|
+
*/
|
|
154
|
+
static addDimensionChangeListener(callback) {
|
|
155
|
+
const subscription = react_native_1.Dimensions.addEventListener('change', () => {
|
|
156
|
+
// 清除缓存,重新计算
|
|
157
|
+
this.deviceInfo = null;
|
|
158
|
+
const newInfo = this.getDeviceInfo();
|
|
159
|
+
callback(newInfo);
|
|
160
|
+
});
|
|
161
|
+
return () => subscription.remove();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 重置缓存(用于测试或强制刷新)
|
|
165
|
+
*/
|
|
166
|
+
static resetCache() {
|
|
167
|
+
this.deviceInfo = null;
|
|
168
|
+
this.systemVersion = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.PlatformDetector = PlatformDetector;
|
|
172
|
+
PlatformDetector.deviceInfo = null;
|
|
173
|
+
PlatformDetector.systemVersion = null;
|
|
174
|
+
/**
|
|
175
|
+
* 便捷的导出函数
|
|
176
|
+
*/
|
|
177
|
+
const isAndroid14Plus = () => PlatformDetector.needsAndroid14Permissions();
|
|
178
|
+
exports.isAndroid14Plus = isAndroid14Plus;
|
|
179
|
+
const isiOS17Plus = () => PlatformDetector.supportsiOS17Features();
|
|
180
|
+
exports.isiOS17Plus = isiOS17Plus;
|
|
181
|
+
const isTablet = () => PlatformDetector.getDeviceInfo().isTablet;
|
|
182
|
+
exports.isTablet = isTablet;
|
|
183
|
+
const isFoldable = () => PlatformDetector.getDeviceInfo().isFoldable;
|
|
184
|
+
exports.isFoldable = isFoldable;
|
|
185
|
+
const isIPad = () => PlatformDetector.isIPad();
|
|
186
|
+
exports.isIPad = isIPad;
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
|
@@ -19,3 +19,4 @@ __exportStar(require("./coordinates.types"), exports);
|
|
|
19
19
|
__exportStar(require("./route.types"), exports);
|
|
20
20
|
__exportStar(require("./independent.types"), exports);
|
|
21
21
|
__exportStar(require("./naviview.types"), exports);
|
|
22
|
+
__exportStar(require("./native-module.types"), exports);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { NativeModule } from 'expo';
|
|
2
|
+
import { DriveRouteOptions, DriveRouteResult, EBikeRouteOptions, RideRouteOptions, RouteResult, TruckRouteOptions, WalkRouteOptions } from './route.types';
|
|
3
|
+
import { MotorcycleRouteOptions, IndependentDriveRouteOptions, IndependentTruckRouteOptions, IndependentWalkRouteOptions, IndependentRideRouteOptions, IndependentMotorcycleRouteOptions, IndependentRouteResult, SelectIndependentRouteOptions, StartNaviWithIndependentPathOptions, ClearIndependentRouteOptions } from './independent.types';
|
|
4
|
+
export interface ExpoGaodeMapNavigationModule extends NativeModule {
|
|
5
|
+
/**
|
|
6
|
+
* 初始化导航模块
|
|
7
|
+
*/
|
|
8
|
+
initNavigation: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* 销毁所有路径规划器
|
|
11
|
+
*/
|
|
12
|
+
destroyAllCalculators: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* 驾车路径规划
|
|
15
|
+
*/
|
|
16
|
+
calculateDriveRoute: (options: DriveRouteOptions) => Promise<DriveRouteResult>;
|
|
17
|
+
/**
|
|
18
|
+
* 步行路径规划
|
|
19
|
+
*/
|
|
20
|
+
calculateWalkRoute: (options: WalkRouteOptions) => Promise<RouteResult>;
|
|
21
|
+
/**
|
|
22
|
+
* 骑行路径规划
|
|
23
|
+
*/
|
|
24
|
+
calculateRideRoute: (options: RideRouteOptions) => Promise<RouteResult>;
|
|
25
|
+
/**
|
|
26
|
+
* 骑行电动车路径规划
|
|
27
|
+
*/
|
|
28
|
+
calculateEBikeRoute: (options: EBikeRouteOptions) => Promise<RouteResult>;
|
|
29
|
+
/**
|
|
30
|
+
* 货车路径规划
|
|
31
|
+
*/
|
|
32
|
+
calculateTruckRoute: (options: TruckRouteOptions) => Promise<DriveRouteResult>;
|
|
33
|
+
/**
|
|
34
|
+
* 摩托车路径规划(车类型为 11,支持传入排量)
|
|
35
|
+
*/
|
|
36
|
+
calculateMotorcycleRoute: (options: MotorcycleRouteOptions) => Promise<DriveRouteResult>;
|
|
37
|
+
/**
|
|
38
|
+
* 独立路径规划(不会影响当前导航;适合路线预览/行前选路)
|
|
39
|
+
*/
|
|
40
|
+
independentDriveRoute: (options: IndependentDriveRouteOptions) => Promise<IndependentRouteResult>;
|
|
41
|
+
/**
|
|
42
|
+
* 独立货车路径规划(不会影响当前导航;适合路线预览/行前选路)
|
|
43
|
+
*/
|
|
44
|
+
independentTruckRoute: (options: IndependentTruckRouteOptions) => Promise<IndependentRouteResult>;
|
|
45
|
+
/**
|
|
46
|
+
* 独立步行路径规划(不会影响当前导航;适合路线预览/行前选路)
|
|
47
|
+
*/
|
|
48
|
+
independentWalkRoute: (options: IndependentWalkRouteOptions) => Promise<IndependentRouteResult>;
|
|
49
|
+
/**
|
|
50
|
+
* 独立骑行路径规划(不会影响当前导航;适合路线预览/行前选路)
|
|
51
|
+
*/
|
|
52
|
+
independentRideRoute: (options: IndependentRideRouteOptions) => Promise<IndependentRouteResult>;
|
|
53
|
+
/**
|
|
54
|
+
* 独立摩托车路径规划(不会影响当前导航;适合路线预览/行前选路)
|
|
55
|
+
*/
|
|
56
|
+
independentMotorcycleRoute: (options: IndependentMotorcycleRouteOptions) => Promise<IndependentRouteResult>;
|
|
57
|
+
/**
|
|
58
|
+
* 选择独立路径(会影响当前导航)
|
|
59
|
+
*/
|
|
60
|
+
selectIndependentRoute: (options: SelectIndependentRouteOptions) => Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* 启动独立路径导航(会影响当前导航)
|
|
63
|
+
*/
|
|
64
|
+
startNaviWithIndependentPath: (options: StartNaviWithIndependentPathOptions) => Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* 清除独立路径(会影响当前导航)
|
|
67
|
+
*/
|
|
68
|
+
clearIndependentRoute: (options: ClearIndependentRouteOptions) => Promise<boolean>;
|
|
69
|
+
}
|
package/expo-module.config.json
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
"modules": [
|
|
6
6
|
"ExpoGaodeMapNavigationModule",
|
|
7
7
|
"ExpoGaodeMapNaviViewModule",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
8
|
+
"ExpoGaodeMapModule",
|
|
9
|
+
"ExpoGaodeMapViewModule",
|
|
10
|
+
"MarkerViewModule",
|
|
11
|
+
"CircleViewModule",
|
|
12
|
+
"PolygonViewModule",
|
|
13
|
+
"PolylineViewModule",
|
|
14
|
+
"MultiPointViewModule",
|
|
15
|
+
"HeatMapViewModule",
|
|
16
|
+
"ClusterViewModule",
|
|
17
|
+
"ExpoGaodeMapOfflineModule"
|
|
17
18
|
]
|
|
18
19
|
},
|
|
19
20
|
"android": {
|
|
@@ -28,7 +29,8 @@
|
|
|
28
29
|
"expo.modules.gaodemap.map.overlays.PolylineViewModule",
|
|
29
30
|
"expo.modules.gaodemap.map.overlays.MultiPointViewModule",
|
|
30
31
|
"expo.modules.gaodemap.map.overlays.HeatMapViewModule",
|
|
31
|
-
"expo.modules.gaodemap.map.overlays.ClusterViewModule"
|
|
32
|
+
"expo.modules.gaodemap.map.overlays.ClusterViewModule",
|
|
33
|
+
"expo.modules.gaodemap.map.ExpoGaodeMapOfflineModule"
|
|
32
34
|
]
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -23,10 +23,19 @@ Pod::Spec.new do |s|
|
|
|
23
23
|
s.dependency 'AMapFoundation'
|
|
24
24
|
s.dependency 'AMapLocation'
|
|
25
25
|
|
|
26
|
+
s.library = 'c++'
|
|
27
|
+
|
|
26
28
|
# Swift/Objective-C compatibility
|
|
27
29
|
s.pod_target_xcconfig = {
|
|
28
30
|
'DEFINES_MODULE' => 'YES',
|
|
31
|
+
'HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)/map/cpp" "$(PODS_TARGET_SRCROOT)/../shared/cpp"',
|
|
32
|
+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
|
|
33
|
+
'CLANG_CXX_LIBRARY' => 'libc++'
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
|
|
37
|
+
s.exclude_files = ["**/tests/*", "**/CppBridging.mm"]
|
|
38
|
+
|
|
39
|
+
# 严格只允许 .h 文件作为公共头文件,防止 .hpp 被 Swift 模块引用
|
|
40
|
+
s.public_header_files = "**/*.h"
|
|
32
41
|
end
|