expo-gaode-map-navigation 1.1.5-next.2 → 1.1.5-next.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.
@@ -1,11 +1,11 @@
1
1
  cmake_minimum_required(VERSION 3.22.1)
2
2
 
3
- project(gaodecluster)
3
+ project(gaodecluster_nav)
4
4
 
5
5
  set(CMAKE_CXX_STANDARD 17)
6
6
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
7
 
8
- add_library(gaodecluster SHARED
8
+ add_library(gaodecluster_nav SHARED
9
9
  cluster_jni.cpp
10
10
  ../../../../shared/cpp/ClusterEngine.cpp
11
11
  ../../../../shared/cpp/QuadTree.cpp
@@ -13,12 +13,12 @@ add_library(gaodecluster SHARED
13
13
  ../../../../shared/cpp/ColorParser.cpp
14
14
  )
15
15
 
16
- target_include_directories(gaodecluster PRIVATE
16
+ target_include_directories(gaodecluster_nav PRIVATE
17
17
  ../../../../shared/cpp
18
18
  )
19
19
 
20
20
  find_library(log-lib log)
21
21
 
22
- target_link_libraries(gaodecluster
22
+ target_link_libraries(gaodecluster_nav
23
23
  ${log-lib}
24
24
  )
@@ -2,7 +2,7 @@ package expo.modules.gaodemap.map.utils
2
2
 
3
3
  object ClusterNative {
4
4
  init {
5
- System.loadLibrary("gaodecluster")
5
+ System.loadLibrary("gaodecluster_nav")
6
6
  }
7
7
 
8
8
  external fun clusterPoints(
@@ -6,7 +6,7 @@ import androidx.core.graphics.toColorInt
6
6
  object ColorParser {
7
7
  init {
8
8
  try {
9
- System.loadLibrary("gaodecluster")
9
+ System.loadLibrary("gaodecluster_nav")
10
10
  } catch (_: Throwable) {
11
11
  // Ignore if already loaded
12
12
  }
@@ -12,7 +12,7 @@ import kotlin.math.*
12
12
  object GeometryUtils {
13
13
 
14
14
  init {
15
- System.loadLibrary("gaodecluster")
15
+ System.loadLibrary("gaodecluster_nav")
16
16
  }
17
17
 
18
18
  private external fun nativeIsPointInCircle(
@@ -1,7 +1,8 @@
1
+ import { ExpoGaodeMapNavigationModule as ExpoGaodeMapNavigationModuleType } from './types/native-module.types';
1
2
  /**
2
3
  * 高德地图导航模块
3
4
  *
4
5
  * 提供路径规划功能,包括驾车、步行、骑行、公交、货车等多种出行方式
5
6
  */
6
- declare const ExpoGaodeMapNavigationModule: any;
7
+ declare const ExpoGaodeMapNavigationModule: ExpoGaodeMapNavigationModuleType;
7
8
  export default ExpoGaodeMapNavigationModule;
package/build/index.d.ts CHANGED
@@ -1,16 +1,17 @@
1
+ import ExpoGaodeMapNavigationModule from './ExpoGaodeMapNavigationModule';
1
2
  export * from './map';
2
3
  import { RouteType, DriveStrategy, WalkStrategy, RideStrategy, TruckSize, TravelStrategy } from './types';
3
4
  import type { NaviPoint, RouteOptions, DriveRouteOptions, WalkRouteOptions, RideRouteOptions, EBikeRouteOptions, TruckRouteOptions, RouteResult, DriveRouteResult, IndependentRouteResult, IndependentDriveRouteOptions, IndependentTruckRouteOptions, IndependentWalkRouteOptions, IndependentRideRouteOptions, SelectIndependentRouteOptions, StartNaviWithIndependentPathOptions, ClearIndependentRouteOptions, MotorcycleRouteOptions, IndependentMotorcycleRouteOptions } from './types';
4
- export { ExpoGaodeMapNaviView, type ExpoGaodeMapNaviViewRef } from './ExpoGaodeMapNaviView';
5
+ export { ExpoGaodeMapNaviView, type ExpoGaodeMapNaviViewRef, ExpoGaodeMapNaviView as NaviView, type ExpoGaodeMapNaviViewRef as NaviViewRef } from './ExpoGaodeMapNaviView';
5
6
  /**
6
7
  * 初始化导航模块(可选)
7
8
  */
8
- export declare function initNavigation(): void;
9
+ export declare const initNavigation: () => void;
9
10
  /**
10
11
  * 销毁所有路径计算器实例
11
12
  * 用于页面切换时释放资源,避免"Another route calculation is in progress"错误
12
13
  */
13
- export declare function destroyAllCalculators(): void;
14
+ export declare const destroyAllCalculators: () => void;
14
15
  /**
15
16
  * 路径规划(通用方法)
16
17
  * 注意:公交路径规划暂未实现
@@ -19,69 +20,70 @@ export declare function calculateRoute(options: RouteOptions): Promise<RouteResu
19
20
  /**
20
21
  * 驾车路径规划
21
22
  */
22
- export declare function calculateDriveRoute(options: DriveRouteOptions): Promise<DriveRouteResult>;
23
+ export declare const calculateDriveRoute: (options: DriveRouteOptions) => Promise<DriveRouteResult>;
23
24
  /**
24
25
  * 步行路径规划
25
26
  */
26
- export declare function calculateWalkRoute(options: WalkRouteOptions): Promise<RouteResult>;
27
+ export declare const calculateWalkRoute: (options: WalkRouteOptions) => Promise<RouteResult>;
27
28
  /**
28
29
  * 骑行路径规划
29
30
  */
30
- export declare function calculateRideRoute(options: RideRouteOptions): Promise<RouteResult>;
31
+ export declare const calculateRideRoute: (options: RideRouteOptions) => Promise<RouteResult>;
31
32
  /**
32
33
  * 骑行电动车路径规划
33
34
  */
34
- export declare function calculateEBikeRoute(options: EBikeRouteOptions): Promise<RouteResult>;
35
+ export declare const calculateEBikeRoute: (options: EBikeRouteOptions) => Promise<RouteResult>;
35
36
  /**
36
37
  * 货车路径规划
37
38
  */
38
- export declare function calculateTruckRoute(options: TruckRouteOptions): Promise<DriveRouteResult>;
39
+ export declare const calculateTruckRoute: (options: TruckRouteOptions) => Promise<DriveRouteResult>;
39
40
  /**
40
41
  * 摩托车路径规划(车类型为 11,支持传入排量)
41
42
  */
42
- export declare function calculateMotorcycleRoute(options: MotorcycleRouteOptions): Promise<DriveRouteResult>;
43
+ export declare const calculateMotorcycleRoute: (options: MotorcycleRouteOptions) => Promise<DriveRouteResult>;
43
44
  /**
44
45
  * 独立路径规划(不会影响当前导航;适合路线预览/行前选路)
45
46
  */
46
- export declare function independentDriveRoute(options: IndependentDriveRouteOptions): Promise<IndependentRouteResult>;
47
- export declare function independentTruckRoute(options: IndependentTruckRouteOptions): Promise<IndependentRouteResult>;
48
- export declare function independentWalkRoute(options: IndependentWalkRouteOptions): Promise<IndependentRouteResult>;
49
- export declare function independentRideRoute(options: IndependentRideRouteOptions): Promise<IndependentRouteResult>;
47
+ export declare const independentDriveRoute: (options: IndependentDriveRouteOptions) => Promise<IndependentRouteResult>;
48
+ export declare const independentTruckRoute: (options: IndependentTruckRouteOptions) => Promise<IndependentRouteResult>;
49
+ export declare const independentWalkRoute: (options: IndependentWalkRouteOptions) => Promise<IndependentRouteResult>;
50
+ export declare const independentRideRoute: (options: IndependentRideRouteOptions) => Promise<IndependentRouteResult>;
50
51
  /**
51
52
  * 独立摩托车路径规划(不干扰当前导航)
52
53
  */
53
- export declare function independentMotorcycleRoute(options: IndependentMotorcycleRouteOptions): Promise<IndependentRouteResult>;
54
+ export declare const independentMotorcycleRoute: (options: IndependentMotorcycleRouteOptions) => Promise<IndependentRouteResult>;
54
55
  /**
55
56
  * 独立路径组:选主路线
56
57
  */
57
- export declare function selectIndependentRoute(options: SelectIndependentRouteOptions): Promise<boolean>;
58
+ export declare const selectIndependentRoute: (options: SelectIndependentRouteOptions) => Promise<boolean>;
58
59
  /**
59
60
  * 独立路径组:使用指定路线启动导航
60
61
  */
61
- export declare function startNaviWithIndependentPath(options: StartNaviWithIndependentPathOptions): Promise<boolean>;
62
+ export declare const startNaviWithIndependentPath: (options: StartNaviWithIndependentPathOptions) => Promise<boolean>;
62
63
  /**
63
64
  * 独立路径组:清理
64
65
  */
65
- export declare function clearIndependentRoute(options: ClearIndependentRouteOptions): Promise<boolean>;
66
+ export declare const clearIndependentRoute: (options: ClearIndependentRouteOptions) => Promise<boolean>;
66
67
  export type { NaviPoint, RouteOptions, DriveRouteOptions, WalkRouteOptions, RideRouteOptions, EBikeRouteOptions, TruckRouteOptions, RouteResult, DriveRouteResult, IndependentRouteResult, IndependentDriveRouteOptions, IndependentTruckRouteOptions, IndependentWalkRouteOptions, IndependentRideRouteOptions, SelectIndependentRouteOptions, StartNaviWithIndependentPathOptions, ClearIndependentRouteOptions, MotorcycleRouteOptions, IndependentMotorcycleRouteOptions, };
67
68
  export { RouteType, DriveStrategy, WalkStrategy, RideStrategy, TruckSize, TravelStrategy, };
68
69
  declare const _default: {
69
- initNavigation: typeof initNavigation;
70
- destroyAllCalculators: typeof destroyAllCalculators;
70
+ initNavigation: () => void;
71
+ destroyAllCalculators: () => void;
71
72
  calculateRoute: typeof calculateRoute;
72
- calculateDriveRoute: typeof calculateDriveRoute;
73
- calculateWalkRoute: typeof calculateWalkRoute;
74
- calculateRideRoute: typeof calculateRideRoute;
75
- calculateEBikeRoute: typeof calculateEBikeRoute;
76
- calculateTruckRoute: typeof calculateTruckRoute;
77
- calculateMotorcycleRoute: typeof calculateMotorcycleRoute;
78
- independentDriveRoute: typeof independentDriveRoute;
79
- independentTruckRoute: typeof independentTruckRoute;
80
- independentWalkRoute: typeof independentWalkRoute;
81
- independentRideRoute: typeof independentRideRoute;
82
- independentMotorcycleRoute: typeof independentMotorcycleRoute;
83
- selectIndependentRoute: typeof selectIndependentRoute;
84
- startNaviWithIndependentPath: typeof startNaviWithIndependentPath;
85
- clearIndependentRoute: typeof clearIndependentRoute;
73
+ calculateDriveRoute: (options: DriveRouteOptions) => Promise<DriveRouteResult>;
74
+ calculateWalkRoute: (options: WalkRouteOptions) => Promise<RouteResult>;
75
+ calculateRideRoute: (options: RideRouteOptions) => Promise<RouteResult>;
76
+ calculateEBikeRoute: (options: EBikeRouteOptions) => Promise<RouteResult>;
77
+ calculateTruckRoute: (options: TruckRouteOptions) => Promise<DriveRouteResult>;
78
+ calculateMotorcycleRoute: (options: MotorcycleRouteOptions) => Promise<DriveRouteResult>;
79
+ independentDriveRoute: (options: IndependentDriveRouteOptions) => Promise<IndependentRouteResult>;
80
+ independentTruckRoute: (options: IndependentTruckRouteOptions) => Promise<IndependentRouteResult>;
81
+ independentWalkRoute: (options: IndependentWalkRouteOptions) => Promise<IndependentRouteResult>;
82
+ independentRideRoute: (options: IndependentRideRouteOptions) => Promise<IndependentRouteResult>;
83
+ independentMotorcycleRoute: (options: IndependentMotorcycleRouteOptions) => Promise<IndependentRouteResult>;
84
+ selectIndependentRoute: (options: SelectIndependentRouteOptions) => Promise<boolean>;
85
+ startNaviWithIndependentPath: (options: StartNaviWithIndependentPathOptions) => Promise<boolean>;
86
+ clearIndependentRoute: (options: ClearIndependentRouteOptions) => Promise<boolean>;
86
87
  };
87
88
  export default _default;
89
+ export { ExpoGaodeMapNavigationModule, };
package/build/index.js CHANGED
@@ -17,25 +17,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.TravelStrategy = exports.TruckSize = exports.RideStrategy = exports.WalkStrategy = exports.DriveStrategy = exports.RouteType = exports.ExpoGaodeMapNaviView = void 0;
21
- exports.initNavigation = initNavigation;
22
- exports.destroyAllCalculators = destroyAllCalculators;
20
+ exports.ExpoGaodeMapNavigationModule = exports.TravelStrategy = exports.TruckSize = exports.RideStrategy = exports.WalkStrategy = exports.DriveStrategy = exports.RouteType = exports.clearIndependentRoute = exports.startNaviWithIndependentPath = exports.selectIndependentRoute = exports.independentMotorcycleRoute = exports.independentRideRoute = exports.independentWalkRoute = exports.independentTruckRoute = exports.independentDriveRoute = exports.calculateMotorcycleRoute = exports.calculateTruckRoute = exports.calculateEBikeRoute = exports.calculateRideRoute = exports.calculateWalkRoute = exports.calculateDriveRoute = exports.destroyAllCalculators = exports.initNavigation = exports.NaviView = exports.ExpoGaodeMapNaviView = void 0;
23
21
  exports.calculateRoute = calculateRoute;
24
- exports.calculateDriveRoute = calculateDriveRoute;
25
- exports.calculateWalkRoute = calculateWalkRoute;
26
- exports.calculateRideRoute = calculateRideRoute;
27
- exports.calculateEBikeRoute = calculateEBikeRoute;
28
- exports.calculateTruckRoute = calculateTruckRoute;
29
- exports.calculateMotorcycleRoute = calculateMotorcycleRoute;
30
- exports.independentDriveRoute = independentDriveRoute;
31
- exports.independentTruckRoute = independentTruckRoute;
32
- exports.independentWalkRoute = independentWalkRoute;
33
- exports.independentRideRoute = independentRideRoute;
34
- exports.independentMotorcycleRoute = independentMotorcycleRoute;
35
- exports.selectIndependentRoute = selectIndependentRoute;
36
- exports.startNaviWithIndependentPath = startNaviWithIndependentPath;
37
- exports.clearIndependentRoute = clearIndependentRoute;
38
22
  const ExpoGaodeMapNavigationModule_1 = __importDefault(require("./ExpoGaodeMapNavigationModule"));
23
+ exports.ExpoGaodeMapNavigationModule = ExpoGaodeMapNavigationModule_1.default;
39
24
  // 重新导出地图模块的所有内容
40
25
  __exportStar(require("./map"), exports);
41
26
  const types_1 = require("./types");
@@ -48,149 +33,128 @@ Object.defineProperty(exports, "TravelStrategy", { enumerable: true, get: functi
48
33
  // 导出官方导航界面组件
49
34
  var ExpoGaodeMapNaviView_1 = require("./ExpoGaodeMapNaviView");
50
35
  Object.defineProperty(exports, "ExpoGaodeMapNaviView", { enumerable: true, get: function () { return ExpoGaodeMapNaviView_1.ExpoGaodeMapNaviView; } });
36
+ // 兼容旧版本名称
37
+ Object.defineProperty(exports, "NaviView", { enumerable: true, get: function () { return ExpoGaodeMapNaviView_1.ExpoGaodeMapNaviView; } });
51
38
  /**
52
39
  * 初始化导航模块(可选)
53
40
  */
54
- function initNavigation() {
55
- ExpoGaodeMapNavigationModule_1.default.initNavigation();
56
- }
41
+ const initNavigation = () => ExpoGaodeMapNavigationModule_1.default.initNavigation();
42
+ exports.initNavigation = initNavigation;
57
43
  /**
58
44
  * 销毁所有路径计算器实例
59
45
  * 用于页面切换时释放资源,避免"Another route calculation is in progress"错误
60
46
  */
61
- function destroyAllCalculators() {
62
- ExpoGaodeMapNavigationModule_1.default.destroyAllCalculators();
63
- }
47
+ const destroyAllCalculators = () => ExpoGaodeMapNavigationModule_1.default.destroyAllCalculators();
48
+ exports.destroyAllCalculators = destroyAllCalculators;
64
49
  /**
65
50
  * 路径规划(通用方法)
66
51
  * 注意:公交路径规划暂未实现
67
52
  */
68
53
  async function calculateRoute(options) {
69
- // 根据传入的选项类型调用对应的方法
70
- if ('carNumber' in options || 'avoidPolygons' in options) {
71
- // 驾车或摩托车
72
- return await calculateDriveRoute(options);
54
+ // 1. 货车
55
+ if ('size' in options) {
56
+ return (0, exports.calculateTruckRoute)(options);
73
57
  }
74
- else if ('size' in options) {
75
- // 货车
76
- return await calculateTruckRoute(options);
77
- }
78
- else if ('multiple' in options || 'travelStrategy' in options) {
79
- // 步行或骑行
80
- if ('usePoi' in options) {
81
- // 电动车
82
- return await calculateEBikeRoute(options);
83
- }
84
- else if (options.strategy === 0 || options.strategy === 1) {
85
- // 骑行
86
- return await calculateRideRoute(options);
87
- }
88
- else {
89
- // 步行
90
- return await calculateWalkRoute(options);
58
+ // 2. 步行、骑行、电动车
59
+ if ('multiple' in options || 'travelStrategy' in options) {
60
+ if ('usePoi' in options)
61
+ return (0, exports.calculateEBikeRoute)(options);
62
+ // 策略判断:0 1 通常为骑行策略,其余默认步行
63
+ const strategy = options.strategy;
64
+ if (strategy === 0 || strategy === 1) {
65
+ return (0, exports.calculateRideRoute)(options);
91
66
  }
67
+ return (0, exports.calculateWalkRoute)(options);
92
68
  }
93
- else {
94
- // 默认当作驾车处理
95
- return await calculateDriveRoute(options);
69
+ // 3. 摩托车 (通过 carType 或 motorcycleCC 判断)
70
+ if ('motorcycleCC' in options || options.carType === 11) {
71
+ return (0, exports.calculateMotorcycleRoute)(options);
96
72
  }
73
+ // 4. 默认驾车
74
+ return (0, exports.calculateDriveRoute)(options);
97
75
  }
98
76
  /**
99
77
  * 驾车路径规划
100
78
  */
101
- async function calculateDriveRoute(options) {
102
- return await ExpoGaodeMapNavigationModule_1.default.calculateDriveRoute(options);
103
- }
79
+ const calculateDriveRoute = (options) => ExpoGaodeMapNavigationModule_1.default.calculateDriveRoute(options);
80
+ exports.calculateDriveRoute = calculateDriveRoute;
104
81
  /**
105
82
  * 步行路径规划
106
83
  */
107
- async function calculateWalkRoute(options) {
108
- return await ExpoGaodeMapNavigationModule_1.default.calculateWalkRoute(options);
109
- }
84
+ const calculateWalkRoute = (options) => ExpoGaodeMapNavigationModule_1.default.calculateWalkRoute(options);
85
+ exports.calculateWalkRoute = calculateWalkRoute;
110
86
  /**
111
87
  * 骑行路径规划
112
88
  */
113
- async function calculateRideRoute(options) {
114
- return await ExpoGaodeMapNavigationModule_1.default.calculateRideRoute(options);
115
- }
89
+ const calculateRideRoute = (options) => ExpoGaodeMapNavigationModule_1.default.calculateRideRoute(options);
90
+ exports.calculateRideRoute = calculateRideRoute;
116
91
  /**
117
92
  * 骑行电动车路径规划
118
93
  */
119
- async function calculateEBikeRoute(options) {
120
- return await ExpoGaodeMapNavigationModule_1.default.calculateEBikeRoute(options);
121
- }
94
+ const calculateEBikeRoute = (options) => ExpoGaodeMapNavigationModule_1.default.calculateEBikeRoute(options);
95
+ exports.calculateEBikeRoute = calculateEBikeRoute;
122
96
  /**
123
97
  * 货车路径规划
124
98
  */
125
- async function calculateTruckRoute(options) {
126
- return await ExpoGaodeMapNavigationModule_1.default.calculateTruckRoute(options);
127
- }
99
+ const calculateTruckRoute = (options) => ExpoGaodeMapNavigationModule_1.default.calculateTruckRoute(options);
100
+ exports.calculateTruckRoute = calculateTruckRoute;
128
101
  /**
129
102
  * 摩托车路径规划(车类型为 11,支持传入排量)
130
103
  */
131
- async function calculateMotorcycleRoute(options) {
132
- return await ExpoGaodeMapNavigationModule_1.default.calculateMotorcycleRoute(options);
133
- }
104
+ const calculateMotorcycleRoute = (options) => ExpoGaodeMapNavigationModule_1.default.calculateMotorcycleRoute(options);
105
+ exports.calculateMotorcycleRoute = calculateMotorcycleRoute;
134
106
  /**
135
107
  * 独立路径规划(不会影响当前导航;适合路线预览/行前选路)
136
108
  */
137
- async function independentDriveRoute(options) {
138
- return await ExpoGaodeMapNavigationModule_1.default.independentDriveRoute(options);
139
- }
140
- async function independentTruckRoute(options) {
141
- return await ExpoGaodeMapNavigationModule_1.default.independentTruckRoute(options);
142
- }
143
- async function independentWalkRoute(options) {
144
- return await ExpoGaodeMapNavigationModule_1.default.independentWalkRoute(options);
145
- }
146
- async function independentRideRoute(options) {
147
- return await ExpoGaodeMapNavigationModule_1.default.independentRideRoute(options);
148
- }
109
+ const independentDriveRoute = (options) => ExpoGaodeMapNavigationModule_1.default.independentDriveRoute(options);
110
+ exports.independentDriveRoute = independentDriveRoute;
111
+ const independentTruckRoute = (options) => ExpoGaodeMapNavigationModule_1.default.independentTruckRoute(options);
112
+ exports.independentTruckRoute = independentTruckRoute;
113
+ const independentWalkRoute = (options) => ExpoGaodeMapNavigationModule_1.default.independentWalkRoute(options);
114
+ exports.independentWalkRoute = independentWalkRoute;
115
+ const independentRideRoute = (options) => ExpoGaodeMapNavigationModule_1.default.independentRideRoute(options);
116
+ exports.independentRideRoute = independentRideRoute;
149
117
  /**
150
118
  * 独立摩托车路径规划(不干扰当前导航)
151
119
  */
152
- async function independentMotorcycleRoute(options) {
153
- return await ExpoGaodeMapNavigationModule_1.default.independentMotorcycleRoute(options);
154
- }
120
+ const independentMotorcycleRoute = (options) => ExpoGaodeMapNavigationModule_1.default.independentMotorcycleRoute(options);
121
+ exports.independentMotorcycleRoute = independentMotorcycleRoute;
155
122
  /**
156
123
  * 独立路径组:选主路线
157
124
  */
158
- async function selectIndependentRoute(options) {
159
- return await ExpoGaodeMapNavigationModule_1.default.selectIndependentRoute(options);
160
- }
125
+ const selectIndependentRoute = (options) => ExpoGaodeMapNavigationModule_1.default.selectIndependentRoute(options);
126
+ exports.selectIndependentRoute = selectIndependentRoute;
161
127
  /**
162
128
  * 独立路径组:使用指定路线启动导航
163
129
  */
164
- async function startNaviWithIndependentPath(options) {
165
- return await ExpoGaodeMapNavigationModule_1.default.startNaviWithIndependentPath(options);
166
- }
130
+ const startNaviWithIndependentPath = (options) => ExpoGaodeMapNavigationModule_1.default.startNaviWithIndependentPath(options);
131
+ exports.startNaviWithIndependentPath = startNaviWithIndependentPath;
167
132
  /**
168
133
  * 独立路径组:清理
169
134
  */
170
- async function clearIndependentRoute(options) {
171
- return await ExpoGaodeMapNavigationModule_1.default.clearIndependentRoute(options);
172
- }
135
+ const clearIndependentRoute = (options) => ExpoGaodeMapNavigationModule_1.default.clearIndependentRoute(options);
136
+ exports.clearIndependentRoute = clearIndependentRoute;
173
137
  // 精简后的默认导出
174
138
  exports.default = {
175
139
  // 初始化
176
- initNavigation,
177
- destroyAllCalculators,
140
+ initNavigation: exports.initNavigation,
141
+ destroyAllCalculators: exports.destroyAllCalculators,
178
142
  // 路径规划
179
143
  calculateRoute,
180
- calculateDriveRoute,
181
- calculateWalkRoute,
182
- calculateRideRoute,
183
- calculateEBikeRoute,
184
- calculateTruckRoute,
185
- calculateMotorcycleRoute,
144
+ calculateDriveRoute: exports.calculateDriveRoute,
145
+ calculateWalkRoute: exports.calculateWalkRoute,
146
+ calculateRideRoute: exports.calculateRideRoute,
147
+ calculateEBikeRoute: exports.calculateEBikeRoute,
148
+ calculateTruckRoute: exports.calculateTruckRoute,
149
+ calculateMotorcycleRoute: exports.calculateMotorcycleRoute,
186
150
  // 独立路径规划
187
- independentDriveRoute,
188
- independentTruckRoute,
189
- independentWalkRoute,
190
- independentRideRoute,
191
- independentMotorcycleRoute,
151
+ independentDriveRoute: exports.independentDriveRoute,
152
+ independentTruckRoute: exports.independentTruckRoute,
153
+ independentWalkRoute: exports.independentWalkRoute,
154
+ independentRideRoute: exports.independentRideRoute,
155
+ independentMotorcycleRoute: exports.independentMotorcycleRoute,
192
156
  // 独立路径组操作
193
- selectIndependentRoute,
194
- startNaviWithIndependentPath,
195
- clearIndependentRoute,
157
+ selectIndependentRoute: exports.selectIndependentRoute,
158
+ startNaviWithIndependentPath: exports.startNaviWithIndependentPath,
159
+ clearIndependentRoute: exports.clearIndependentRoute,
196
160
  };
@@ -2,3 +2,4 @@ export * from './coordinates.types';
2
2
  export * from './route.types';
3
3
  export * from './independent.types';
4
4
  export * from './naviview.types';
5
+ export * from './native-module.types';
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gaode-map-navigation",
3
- "version": "1.1.5-next.2",
3
+ "version": "1.1.5-next.4",
4
4
  "description": "高德地图导航功能模块 - 路径规划、导航引导,独立版本包含完整地图功能",
5
5
  "author": "<TomWq> (https://github.com/TomWq)",
6
6
  "repository": "https://github.com/TomWq/expo-gaode-map",
@@ -36,6 +36,7 @@
36
36
  "build",
37
37
  "android",
38
38
  "ios",
39
+ "shared",
39
40
  "app.plugin.js",
40
41
  "expo-module.config.json",
41
42
  "plugin/build"