expo-gaode-map-navigation 2.0.5 → 2.0.6

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.
Files changed (55) hide show
  1. package/README.md +52 -1
  2. package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapView.kt +182 -86
  3. package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapViewModule.kt +5 -2
  4. package/android/src/main/java/expo/modules/gaodemap/map/managers/UIManager.kt +19 -5
  5. package/android/src/main/java/expo/modules/gaodemap/map/overlays/MarkerView.kt +319 -48
  6. package/android/src/main/java/expo/modules/gaodemap/map/overlays/MarkerViewModule.kt +3 -3
  7. package/build/index.d.ts +8 -4
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +79 -1
  10. package/build/index.js.map +1 -1
  11. package/build/map/ExpoGaodeMapModule.d.ts +4 -4
  12. package/build/map/ExpoGaodeMapModule.d.ts.map +1 -1
  13. package/build/map/ExpoGaodeMapModule.js +10 -8
  14. package/build/map/ExpoGaodeMapModule.js.map +1 -1
  15. package/build/map/ExpoGaodeMapView.d.ts.map +1 -1
  16. package/build/map/ExpoGaodeMapView.js +79 -17
  17. package/build/map/ExpoGaodeMapView.js.map +1 -1
  18. package/build/map/components/overlays/Cluster.d.ts.map +1 -1
  19. package/build/map/components/overlays/Cluster.js +12 -0
  20. package/build/map/components/overlays/Cluster.js.map +1 -1
  21. package/build/map/components/overlays/Marker.d.ts.map +1 -1
  22. package/build/map/components/overlays/Marker.js +70 -6
  23. package/build/map/components/overlays/Marker.js.map +1 -1
  24. package/build/map/types/common.types.d.ts +29 -5
  25. package/build/map/types/common.types.d.ts.map +1 -1
  26. package/build/map/types/common.types.js +5 -5
  27. package/build/map/types/common.types.js.map +1 -1
  28. package/build/map/types/index.d.ts +2 -1
  29. package/build/map/types/index.d.ts.map +1 -1
  30. package/build/map/types/index.js.map +1 -1
  31. package/build/map/types/location.types.d.ts +23 -0
  32. package/build/map/types/location.types.d.ts.map +1 -1
  33. package/build/map/types/location.types.js.map +1 -1
  34. package/build/map/types/map-view.types.d.ts +20 -22
  35. package/build/map/types/map-view.types.d.ts.map +1 -1
  36. package/build/map/types/map-view.types.js.map +1 -1
  37. package/build/map/types/overlays.types.d.ts +9 -2
  38. package/build/map/types/overlays.types.d.ts.map +1 -1
  39. package/build/map/types/overlays.types.js.map +1 -1
  40. package/build/map/types/route-playback.types.d.ts +12 -0
  41. package/build/map/types/route-playback.types.d.ts.map +1 -0
  42. package/build/map/types/route-playback.types.js +2 -0
  43. package/build/map/types/route-playback.types.js.map +1 -0
  44. package/build/types/route.types.d.ts +10 -1
  45. package/build/types/route.types.d.ts.map +1 -1
  46. package/build/types/route.types.js +2 -0
  47. package/build/types/route.types.js.map +1 -1
  48. package/ios/map/ExpoGaodeMapView.swift +151 -76
  49. package/ios/map/ExpoGaodeMapViewModule.swift +14 -1
  50. package/ios/map/managers/UIManager.swift +5 -4
  51. package/ios/map/overlays/ClusterView.swift +207 -147
  52. package/ios/map/overlays/ClusterViewModule.swift +5 -1
  53. package/ios/map/overlays/MarkerView.swift +214 -60
  54. package/ios/map/overlays/MarkerViewModule.swift +1 -1
  55. package/package.json +1 -1
package/build/index.js CHANGED
@@ -2,6 +2,67 @@ import ExpoGaodeMapNavigationModule from './ExpoGaodeMapNavigationModule';
2
2
  // 重新导出地图模块的所有内容
3
3
  export * from './map';
4
4
  import { RouteType, DriveStrategy, WalkStrategy, RideStrategy, TruckSize, TravelStrategy, } from './types';
5
+ function parsePolyline(polyline) {
6
+ if (!polyline?.trim()) {
7
+ return [];
8
+ }
9
+ return polyline
10
+ .split(';')
11
+ .map((segment) => segment.trim())
12
+ .filter(Boolean)
13
+ .map((segment) => {
14
+ const [longitude, latitude] = segment.split(',').map((value) => Number(value.trim()));
15
+ if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {
16
+ return null;
17
+ }
18
+ return {
19
+ latitude,
20
+ longitude,
21
+ };
22
+ })
23
+ .filter((point) => point !== null);
24
+ }
25
+ async function loadWebApiTransitFallback() {
26
+ try {
27
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
28
+ const webApi = require('expo-gaode-map-web-api');
29
+ if (typeof webApi?.GaodeWebAPI !== 'function') {
30
+ throw new Error('expo-gaode-map-web-api 未导出 GaodeWebAPI');
31
+ }
32
+ return webApi;
33
+ }
34
+ catch {
35
+ throw new Error('公交路径规划依赖 expo-gaode-map-web-api。请安装该包,并在 ExpoGaodeMapModule.initSDK 中提供 webKey。');
36
+ }
37
+ }
38
+ function normalizeTransitRouteResult(options, result) {
39
+ // 导航包内部仍保持独立实现;
40
+ // 这里只是在“公交无法由导航 SDK 直算”时,把 Web API 结果映射成现有 RouteResult 形状。
41
+ const routes = (result?.route?.transits ?? []).map((transit, index) => {
42
+ const polyline = (transit?.segments ?? []).flatMap((segment) => [
43
+ ...(segment.walking?.steps?.flatMap((step) => parsePolyline(step.polyline)) ?? []),
44
+ ...(segment.bus?.buslines?.flatMap((line) => parsePolyline(line.polyline)) ?? []),
45
+ ...(segment.railway?.buslines?.flatMap((line) => parsePolyline(line.polyline)) ?? []),
46
+ ]);
47
+ return {
48
+ id: index,
49
+ start: options.from,
50
+ end: options.to,
51
+ distance: Number(transit?.distance ?? 0),
52
+ duration: Number(transit?.cost?.duration ?? 0),
53
+ segments: [],
54
+ polyline,
55
+ tollDistance: 0,
56
+ tollCost: Number(transit?.cost?.transit_fee ?? 0),
57
+ strategy: options.strategy,
58
+ };
59
+ });
60
+ return {
61
+ count: routes.length,
62
+ mainPathIndex: 0,
63
+ routes,
64
+ };
65
+ }
5
66
  function hasStrategyOption(options) {
6
67
  return 'strategy' in options;
7
68
  }
@@ -23,9 +84,11 @@ export const initNavigation = () => ExpoGaodeMapNavigationModule.initNavigation(
23
84
  export const destroyAllCalculators = () => ExpoGaodeMapNavigationModule.destroyAllCalculators();
24
85
  /**
25
86
  * 路径规划(通用方法)
26
- * 注意:公交路径规划暂未实现
27
87
  */
28
88
  export async function calculateRoute(options) {
89
+ if ('type' in options && options.type === RouteType.TRANSIT) {
90
+ return calculateTransitRoute(options);
91
+ }
29
92
  // 1. 货车
30
93
  if ('size' in options) {
31
94
  return calculateTruckRoute(options);
@@ -72,6 +135,20 @@ export const calculateTruckRoute = (options) => ExpoGaodeMapNavigationModule.cal
72
135
  * 摩托车路径规划(车类型为 11,支持传入排量)
73
136
  */
74
137
  export const calculateMotorcycleRoute = (options) => ExpoGaodeMapNavigationModule.calculateMotorcycleRoute(options);
138
+ /**
139
+ * 公交换乘路径规划(运行时 fallback 到 Web API)
140
+ */
141
+ export async function calculateTransitRoute(options) {
142
+ // 运行时按需加载,避免把 navigation 包和 web-api 包在构建期强绑定。
143
+ const { GaodeWebAPI, TransitStrategy } = await loadWebApiTransitFallback();
144
+ const api = new GaodeWebAPI();
145
+ const result = await api.route.transit(`${options.from.longitude},${options.from.latitude}`, `${options.to.longitude},${options.to.latitude}`, options.city1, options.city2, {
146
+ strategy: options.strategy ?? TransitStrategy.RECOMMENDED,
147
+ AlternativeRoute: options.alternativeRoute,
148
+ show_fields: 'cost,polyline',
149
+ });
150
+ return normalizeTransitRouteResult(options, result);
151
+ }
75
152
  /**
76
153
  * 独立路径规划(不会影响当前导航;适合路线预览/行前选路)
77
154
  */
@@ -107,6 +184,7 @@ export default {
107
184
  calculateWalkRoute,
108
185
  calculateRideRoute,
109
186
  calculateEBikeRoute,
187
+ calculateTransitRoute,
110
188
  calculateTruckRoute,
111
189
  calculateMotorcycleRoute,
112
190
  // 独立路径规划
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAE1E,gBAAgB;AAChB,cAAc,OAAO,CAAC;AACtB,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,GACf,MAAM,SAAS,CAAC;AAuBjB,SAAS,iBAAiB,CACxB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oBAAoB,GAAG,CAAC,OAAoC,EAAE,EAAE,CAC3E,4BAA4B,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAA0C,EAAE,EAAE,CACvF,4BAA4B,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAsC,EAAE,EAAE,CAC/E,4BAA4B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,OAA4C,EAAE,EAAE,CAC3F,4BAA4B,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAqC,EAAE,EAAE,CAC7E,4BAA4B,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAyB9D,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,GACf,CAAC;AAEF,WAAW;AACX,eAAe;IACb,MAAM;IACN,cAAc;IACd,qBAAqB;IAErB,OAAO;IACP,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,wBAAwB;IAExB,SAAS;IACT,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAE1B,UAAU;IACV,sBAAsB;IACtB,4BAA4B;IAC5B,qBAAqB;CACtB,CAAC;AAEF,OAAO,EACL,4BAA4B,GAC7B,CAAA","sourcesContent":["import ExpoGaodeMapNavigationModule from './ExpoGaodeMapNavigationModule';\n\n// 重新导出地图模块的所有内容\nexport * from './map';\nimport {\n RouteType,\n DriveStrategy,\n WalkStrategy,\n RideStrategy,\n TruckSize,\n TravelStrategy,\n} from './types';\nimport type {\n NaviPoint,\n RouteOptions,\n DriveRouteOptions,\n WalkRouteOptions,\n RideRouteOptions,\n EBikeRouteOptions,\n TruckRouteOptions,\n RouteResult,\n DriveRouteResult,\n IndependentRouteResult,\n IndependentDriveRouteOptions,\n IndependentTruckRouteOptions,\n IndependentWalkRouteOptions,\n IndependentRideRouteOptions,\n SelectIndependentRouteOptions,\n StartNaviWithIndependentPathOptions,\n ClearIndependentRouteOptions,\n MotorcycleRouteOptions,\n IndependentMotorcycleRouteOptions,\n} from './types';\n\nfunction hasStrategyOption(\n options: RouteOptions\n): options is WalkRouteOptions | RideRouteOptions {\n return 'strategy' in options;\n}\n\nfunction isMotorcycleRouteOptions(\n options: RouteOptions | MotorcycleRouteOptions\n): options is MotorcycleRouteOptions {\n return 'motorcycleCC' in options;\n}\n\n// 导出官方导航界面组件\nexport { \n ExpoGaodeMapNaviView, \n type ExpoGaodeMapNaviViewRef,\n // 兼容旧版本名称\n ExpoGaodeMapNaviView as NaviView,\n type ExpoGaodeMapNaviViewRef as NaviViewRef \n} from './ExpoGaodeMapNaviView';\n\n/**\n * 初始化导航模块(可选)\n */\nexport const initNavigation = () => ExpoGaodeMapNavigationModule.initNavigation();\n\n/**\n * 销毁所有路径计算器实例\n * 用于页面切换时释放资源,避免\"Another route calculation is in progress\"错误\n */\nexport const destroyAllCalculators = () => ExpoGaodeMapNavigationModule.destroyAllCalculators();\n\n/**\n * 路径规划(通用方法)\n * 注意:公交路径规划暂未实现\n */\nexport async function calculateRoute(\n options: RouteOptions\n): Promise<RouteResult | DriveRouteResult> {\n // 1. 货车\n if ('size' in options) {\n return calculateTruckRoute(options as TruckRouteOptions);\n }\n \n // 2. 步行、骑行、电动车\n if ('multiple' in options || 'travelStrategy' in options) {\n if ('usePoi' in options) return calculateEBikeRoute(options as EBikeRouteOptions);\n \n // 策略判断:0 或 1 通常为骑行策略,其余默认步行\n const strategy = hasStrategyOption(options) ? options.strategy : undefined;\n if (strategy === 0 || strategy === 1) {\n return calculateRideRoute(options as RideRouteOptions);\n }\n return calculateWalkRoute(options as WalkRouteOptions);\n }\n\n // 3. 摩托车 (通过 carType 或 motorcycleCC 判断)\n if (isMotorcycleRouteOptions(options)) {\n return calculateMotorcycleRoute(options as MotorcycleRouteOptions);\n }\n\n // 4. 默认驾车\n return calculateDriveRoute(options as DriveRouteOptions);\n}\n\n/**\n * 驾车路径规划\n */\nexport const calculateDriveRoute = (options: DriveRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateDriveRoute(options);\n\n/**\n * 步行路径规划\n */\nexport const calculateWalkRoute = (options: WalkRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateWalkRoute(options);\n\n/**\n * 骑行路径规划\n */\nexport const calculateRideRoute = (options: RideRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateRideRoute(options);\n\n/**\n * 骑行电动车路径规划\n */\nexport const calculateEBikeRoute = (options: EBikeRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateEBikeRoute(options);\n\n/**\n * 货车路径规划\n */\nexport const calculateTruckRoute = (options: TruckRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateTruckRoute(options);\n\n/**\n * 摩托车路径规划(车类型为 11,支持传入排量)\n */\nexport const calculateMotorcycleRoute = (options: MotorcycleRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateMotorcycleRoute(options);\n\n/**\n* 独立路径规划(不会影响当前导航;适合路线预览/行前选路)\n*/\nexport const independentDriveRoute = (options: IndependentDriveRouteOptions) => \n ExpoGaodeMapNavigationModule.independentDriveRoute(options);\n\nexport const independentTruckRoute = (options: IndependentTruckRouteOptions) => \n ExpoGaodeMapNavigationModule.independentTruckRoute(options);\n\nexport const independentWalkRoute = (options: IndependentWalkRouteOptions) => \n ExpoGaodeMapNavigationModule.independentWalkRoute(options);\n\nexport const independentRideRoute = (options: IndependentRideRouteOptions) => \n ExpoGaodeMapNavigationModule.independentRideRoute(options);\n\n/**\n * 独立摩托车路径规划(不干扰当前导航)\n */\nexport const independentMotorcycleRoute = (options: IndependentMotorcycleRouteOptions) => \n ExpoGaodeMapNavigationModule.independentMotorcycleRoute(options);\n\n/**\n * 独立路径组:选主路线\n */\nexport const selectIndependentRoute = (options: SelectIndependentRouteOptions) => \n ExpoGaodeMapNavigationModule.selectIndependentRoute(options);\n\n/**\n * 独立路径组:使用指定路线启动导航\n */\nexport const startNaviWithIndependentPath = (options: StartNaviWithIndependentPathOptions) => \n ExpoGaodeMapNavigationModule.startNaviWithIndependentPath(options);\n\n/**\n * 独立路径组:清理\n */\nexport const clearIndependentRoute = (options: ClearIndependentRouteOptions) => \n ExpoGaodeMapNavigationModule.clearIndependentRoute(options);\n\n// 导出导航相关类型与枚举(Coordinates 从 map 模块导出)\nexport type {\n NaviPoint,\n RouteOptions,\n DriveRouteOptions,\n WalkRouteOptions,\n RideRouteOptions,\n EBikeRouteOptions,\n TruckRouteOptions,\n RouteResult,\n DriveRouteResult,\n IndependentRouteResult,\n IndependentDriveRouteOptions,\n IndependentTruckRouteOptions,\n IndependentWalkRouteOptions,\n IndependentRideRouteOptions,\n SelectIndependentRouteOptions,\n StartNaviWithIndependentPathOptions,\n ClearIndependentRouteOptions,\n MotorcycleRouteOptions,\n IndependentMotorcycleRouteOptions,\n};\n\nexport {\n RouteType,\n DriveStrategy,\n WalkStrategy,\n RideStrategy,\n TruckSize,\n TravelStrategy,\n};\n\n// 精简后的默认导出\nexport default {\n // 初始化\n initNavigation,\n destroyAllCalculators,\n\n // 路径规划\n calculateRoute,\n calculateDriveRoute,\n calculateWalkRoute,\n calculateRideRoute,\n calculateEBikeRoute,\n calculateTruckRoute,\n calculateMotorcycleRoute,\n\n // 独立路径规划\n independentDriveRoute,\n independentTruckRoute,\n independentWalkRoute,\n independentRideRoute,\n independentMotorcycleRoute,\n\n // 独立路径组操作\n selectIndependentRoute,\n startNaviWithIndependentPath,\n clearIndependentRoute,\n};\n\nexport {\n ExpoGaodeMapNavigationModule,\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"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EAAE,CAC3E,4BAA4B,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAA0C,EAAE,EAAE,CACvF,4BAA4B,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAsC,EAAE,EAAE,CAC/E,4BAA4B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,OAA4C,EAAE,EAAE,CAC3F,4BAA4B,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAqC,EAAE,EAAE,CAC7E,4BAA4B,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AA0B9D,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,GACf,CAAC;AAEF,WAAW;AACX,eAAe;IACb,MAAM;IACN,cAAc;IACd,qBAAqB;IAErB,OAAO;IACP,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,wBAAwB;IAExB,SAAS;IACT,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAE1B,UAAU;IACV,sBAAsB;IACtB,4BAA4B;IAC5B,qBAAqB;CACtB,CAAC;AAEF,OAAO,EACL,4BAA4B,GAC7B,CAAA","sourcesContent":["import ExpoGaodeMapNavigationModule from './ExpoGaodeMapNavigationModule';\n\n// 重新导出地图模块的所有内容\nexport * from './map';\nimport {\n RouteType,\n DriveStrategy,\n WalkStrategy,\n RideStrategy,\n TruckSize,\n TravelStrategy,\n type TransitRouteOptions,\n} from './types';\nimport type {\n NaviPoint,\n RouteOptions,\n DriveRouteOptions,\n WalkRouteOptions,\n RideRouteOptions,\n EBikeRouteOptions,\n TransitRouteOptions as TransitRouteOptionsType,\n TruckRouteOptions,\n RouteResult,\n DriveRouteResult,\n IndependentRouteResult,\n IndependentDriveRouteOptions,\n IndependentTruckRouteOptions,\n IndependentWalkRouteOptions,\n IndependentRideRouteOptions,\n SelectIndependentRouteOptions,\n StartNaviWithIndependentPathOptions,\n ClearIndependentRouteOptions,\n MotorcycleRouteOptions,\n IndependentMotorcycleRouteOptions,\n} from './types';\n\nfunction parsePolyline(polyline?: string): NaviPoint[] {\n if (!polyline?.trim()) {\n return [];\n }\n\n return polyline\n .split(';')\n .map((segment) => segment.trim())\n .filter(Boolean)\n .map((segment) => {\n const [longitude, latitude] = segment.split(',').map((value) => Number(value.trim()));\n if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {\n return null;\n }\n\n return {\n latitude,\n longitude,\n };\n })\n .filter((point): point is NaviPoint => point !== null);\n}\n\nasync function loadWebApiTransitFallback() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const webApi = require('expo-gaode-map-web-api');\n if (typeof webApi?.GaodeWebAPI !== 'function') {\n throw new Error('expo-gaode-map-web-api 未导出 GaodeWebAPI');\n }\n return webApi;\n } catch {\n throw new Error(\n '公交路径规划依赖 expo-gaode-map-web-api。请安装该包,并在 ExpoGaodeMapModule.initSDK 中提供 webKey。'\n );\n }\n}\n\nfunction normalizeTransitRouteResult(\n options: TransitRouteOptions,\n result: any\n): DriveRouteResult {\n // 导航包内部仍保持独立实现;\n // 这里只是在“公交无法由导航 SDK 直算”时,把 Web API 结果映射成现有 RouteResult 形状。\n const routes = (result?.route?.transits ?? []).map((transit: any, index: number) => {\n const polyline = (transit?.segments ?? []).flatMap((segment: any) => [\n ...(segment.walking?.steps?.flatMap((step: any) => parsePolyline(step.polyline)) ?? []),\n ...(segment.bus?.buslines?.flatMap((line: any) => parsePolyline(line.polyline)) ?? []),\n ...(segment.railway?.buslines?.flatMap((line: any) => parsePolyline(line.polyline)) ?? []),\n ]);\n\n return {\n id: index,\n start: options.from,\n end: options.to,\n distance: Number(transit?.distance ?? 0),\n duration: Number(transit?.cost?.duration ?? 0),\n segments: [],\n polyline,\n tollDistance: 0,\n tollCost: Number(transit?.cost?.transit_fee ?? 0),\n strategy: options.strategy,\n };\n });\n\n return {\n count: routes.length,\n mainPathIndex: 0,\n routes,\n };\n}\n\nfunction hasStrategyOption(\n options: RouteOptions\n): options is WalkRouteOptions | RideRouteOptions {\n return 'strategy' in options;\n}\n\nfunction isMotorcycleRouteOptions(\n options: RouteOptions | MotorcycleRouteOptions\n): options is MotorcycleRouteOptions {\n return 'motorcycleCC' in options;\n}\n\n// 导出官方导航界面组件\nexport { \n ExpoGaodeMapNaviView, \n type ExpoGaodeMapNaviViewRef,\n // 兼容旧版本名称\n ExpoGaodeMapNaviView as NaviView,\n type ExpoGaodeMapNaviViewRef as NaviViewRef \n} from './ExpoGaodeMapNaviView';\n\n/**\n * 初始化导航模块(可选)\n */\nexport const initNavigation = () => ExpoGaodeMapNavigationModule.initNavigation();\n\n/**\n * 销毁所有路径计算器实例\n * 用于页面切换时释放资源,避免\"Another route calculation is in progress\"错误\n */\nexport const destroyAllCalculators = () => ExpoGaodeMapNavigationModule.destroyAllCalculators();\n\n/**\n * 路径规划(通用方法)\n */\nexport async function calculateRoute(\n options: RouteOptions\n): Promise<RouteResult | DriveRouteResult> {\n if ('type' in options && options.type === RouteType.TRANSIT) {\n return calculateTransitRoute(options as TransitRouteOptions);\n }\n\n // 1. 货车\n if ('size' in options) {\n return calculateTruckRoute(options as TruckRouteOptions);\n }\n \n // 2. 步行、骑行、电动车\n if ('multiple' in options || 'travelStrategy' in options) {\n if ('usePoi' in options) return calculateEBikeRoute(options as EBikeRouteOptions);\n \n // 策略判断:0 或 1 通常为骑行策略,其余默认步行\n const strategy = hasStrategyOption(options) ? options.strategy : undefined;\n if (strategy === 0 || strategy === 1) {\n return calculateRideRoute(options as RideRouteOptions);\n }\n return calculateWalkRoute(options as WalkRouteOptions);\n }\n\n // 3. 摩托车 (通过 carType 或 motorcycleCC 判断)\n if (isMotorcycleRouteOptions(options)) {\n return calculateMotorcycleRoute(options as MotorcycleRouteOptions);\n }\n\n // 4. 默认驾车\n return calculateDriveRoute(options as DriveRouteOptions);\n}\n\n/**\n * 驾车路径规划\n */\nexport const calculateDriveRoute = (options: DriveRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateDriveRoute(options);\n\n/**\n * 步行路径规划\n */\nexport const calculateWalkRoute = (options: WalkRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateWalkRoute(options);\n\n/**\n * 骑行路径规划\n */\nexport const calculateRideRoute = (options: RideRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateRideRoute(options);\n\n/**\n * 骑行电动车路径规划\n */\nexport const calculateEBikeRoute = (options: EBikeRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateEBikeRoute(options);\n\n/**\n * 货车路径规划\n */\nexport const calculateTruckRoute = (options: TruckRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateTruckRoute(options);\n\n/**\n * 摩托车路径规划(车类型为 11,支持传入排量)\n */\nexport const calculateMotorcycleRoute = (options: MotorcycleRouteOptions) => \n ExpoGaodeMapNavigationModule.calculateMotorcycleRoute(options);\n\n/**\n * 公交换乘路径规划(运行时 fallback 到 Web API)\n */\nexport async function calculateTransitRoute(options: TransitRouteOptions): Promise<DriveRouteResult> {\n // 运行时按需加载,避免把 navigation 包和 web-api 包在构建期强绑定。\n const { GaodeWebAPI, TransitStrategy } = await loadWebApiTransitFallback();\n const api = new GaodeWebAPI();\n const result = await api.route.transit(\n `${options.from.longitude},${options.from.latitude}`,\n `${options.to.longitude},${options.to.latitude}`,\n options.city1,\n options.city2,\n {\n strategy: options.strategy ?? TransitStrategy.RECOMMENDED,\n AlternativeRoute: options.alternativeRoute,\n show_fields: 'cost,polyline',\n }\n );\n\n return normalizeTransitRouteResult(options, result);\n}\n\n/**\n* 独立路径规划(不会影响当前导航;适合路线预览/行前选路)\n*/\nexport const independentDriveRoute = (options: IndependentDriveRouteOptions) => \n ExpoGaodeMapNavigationModule.independentDriveRoute(options);\n\nexport const independentTruckRoute = (options: IndependentTruckRouteOptions) => \n ExpoGaodeMapNavigationModule.independentTruckRoute(options);\n\nexport const independentWalkRoute = (options: IndependentWalkRouteOptions) => \n ExpoGaodeMapNavigationModule.independentWalkRoute(options);\n\nexport const independentRideRoute = (options: IndependentRideRouteOptions) => \n ExpoGaodeMapNavigationModule.independentRideRoute(options);\n\n/**\n * 独立摩托车路径规划(不干扰当前导航)\n */\nexport const independentMotorcycleRoute = (options: IndependentMotorcycleRouteOptions) => \n ExpoGaodeMapNavigationModule.independentMotorcycleRoute(options);\n\n/**\n * 独立路径组:选主路线\n */\nexport const selectIndependentRoute = (options: SelectIndependentRouteOptions) => \n ExpoGaodeMapNavigationModule.selectIndependentRoute(options);\n\n/**\n * 独立路径组:使用指定路线启动导航\n */\nexport const startNaviWithIndependentPath = (options: StartNaviWithIndependentPathOptions) => \n ExpoGaodeMapNavigationModule.startNaviWithIndependentPath(options);\n\n/**\n * 独立路径组:清理\n */\nexport const clearIndependentRoute = (options: ClearIndependentRouteOptions) => \n ExpoGaodeMapNavigationModule.clearIndependentRoute(options);\n\n// 导出导航相关类型与枚举(Coordinates 从 map 模块导出)\nexport type {\n NaviPoint,\n RouteOptions,\n DriveRouteOptions,\n WalkRouteOptions,\n RideRouteOptions,\n EBikeRouteOptions,\n TransitRouteOptionsType as TransitRouteOptions,\n TruckRouteOptions,\n RouteResult,\n DriveRouteResult,\n IndependentRouteResult,\n IndependentDriveRouteOptions,\n IndependentTruckRouteOptions,\n IndependentWalkRouteOptions,\n IndependentRideRouteOptions,\n SelectIndependentRouteOptions,\n StartNaviWithIndependentPathOptions,\n ClearIndependentRouteOptions,\n MotorcycleRouteOptions,\n IndependentMotorcycleRouteOptions,\n};\n\nexport {\n RouteType,\n DriveStrategy,\n WalkStrategy,\n RideStrategy,\n TruckSize,\n TravelStrategy,\n};\n\n// 精简后的默认导出\nexport default {\n // 初始化\n initNavigation,\n destroyAllCalculators,\n\n // 路径规划\n calculateRoute,\n calculateDriveRoute,\n calculateWalkRoute,\n calculateRideRoute,\n calculateEBikeRoute,\n calculateTransitRoute,\n calculateTruckRoute,\n calculateMotorcycleRoute,\n\n // 独立路径规划\n independentDriveRoute,\n independentTruckRoute,\n independentWalkRoute,\n independentRideRoute,\n independentMotorcycleRoute,\n\n // 独立路径组操作\n selectIndependentRoute,\n startNaviWithIndependentPath,\n clearIndependentRoute,\n};\n\nexport {\n ExpoGaodeMapNavigationModule,\n}\n"]}
@@ -91,16 +91,16 @@ declare const helperMethods: {
91
91
  /**
92
92
  * 判断点是否在多边形内
93
93
  * @param point 要判断的点
94
- * @param polygon 多边形的顶点坐标数组
94
+ * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞)
95
95
  * @returns 是否在多边形内
96
96
  */
97
- isPointInPolygon(point: LatLngPoint, polygon: LatLngPoint[]): boolean;
97
+ isPointInPolygon(point: LatLngPoint, polygon: LatLngPoint[] | LatLngPoint[][]): boolean;
98
98
  /**
99
99
  * 计算多边形面积
100
- * @param polygon 多边形的顶点坐标数组
100
+ * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞)
101
101
  * @returns 面积(单位:平方米)
102
102
  */
103
- calculatePolygonArea(polygon: LatLngPoint[]): number;
103
+ calculatePolygonArea(polygon: LatLngPoint[] | LatLngPoint[][]): number;
104
104
  /**
105
105
  * 计算矩形面积
106
106
  * @param southWest 西南角坐标
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGaodeMapModule.d.ts","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapModule.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO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U/F;;;;OAIG;uBACgB;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI;IAUtE;;;;;OAKG;8BACuB,WAAW,QAAQ,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAUrF;;;;;OAKG;yBACkB;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,QAAQ,MAAM,GAAG,MAAM,GAAG,IAAI;IAU3E;;;;;OAKG;+BACwB,WAAW,YAAY,WAAW,EAAE,EAAE,GAAG,WAAW,EAAE,EAAE,EAAE,GAAG,MAAM;IA6B9F;;;;;OAKG;gCAEO,KAAK,CAAC,WAAW,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,kBAChC,MAAM,GACrB,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CASrE,CAAC;AAEF;;EAEE;AACF,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED,MAAM,MAAM,kBAAkB,GAC5B,IAAI,CAAC,wBAAwB,EAAE,MAAM,OAAO,aAAa,CAAC,GAAG,OAAO,aAAa,CAAC;AAEpF,QAAA,MAAM,6BAA6B,EAwB7B,kBAAkB,CAAC;AAEzB;;EAEE;AACF,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C;AAED,eAAe,6BAA6B,CAAC"}
@@ -465,7 +465,7 @@ const helperMethods = {
465
465
  /**
466
466
  * 判断点是否在多边形内
467
467
  * @param point 要判断的点
468
- * @param polygon 多边形的顶点坐标数组
468
+ * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞)
469
469
  * @returns 是否在多边形内
470
470
  */
471
471
  isPointInPolygon(point, polygon) {
@@ -481,7 +481,7 @@ const helperMethods = {
481
481
  },
482
482
  /**
483
483
  * 计算多边形面积
484
- * @param polygon 多边形的顶点坐标数组
484
+ * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞)
485
485
  * @returns 面积(单位:平方米)
486
486
  */
487
487
  calculatePolygonArea(polygon) {
@@ -736,15 +736,17 @@ const helperMethods = {
736
736
  return -1;
737
737
  try {
738
738
  const normalizedPoint = normalizeLatLng(point);
739
- let normalizedPolygons;
740
739
  // 处理三维数组 (LatLngPoint[][][]) 和二维数组 (LatLngPoint[][])
741
740
  if (Array.isArray(polygons[0]) && Array.isArray(polygons[0][0])) {
742
- // LatLngPoint[][][] -> 扁平化为 LatLngPoint[][] 用于 C++ 遍历
743
- normalizedPolygons = polygons.reduce((acc, val) => acc.concat(val), []);
744
- }
745
- else {
746
- normalizedPolygons = polygons;
741
+ const normalizedMultiPolygons = polygons.map((polygonRings) => normalizeLatLngList(polygonRings));
742
+ for (let index = 0; index < normalizedMultiPolygons.length; index += 1) {
743
+ if (nativeModule.isPointInPolygon(normalizedPoint, normalizedMultiPolygons[index])) {
744
+ return index;
745
+ }
746
+ }
747
+ return -1;
747
748
  }
749
+ const normalizedPolygons = polygons;
748
750
  const processedPolygons = normalizedPolygons.map(p => normalizeLatLngList(p));
749
751
  return nativeModule.findPointInPolygons(normalizedPoint, processedPolygons);
750
752
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGaodeMapModule.js","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAWxC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC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QAED,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAsB,EAAE,IAAI,EAAE,YAAsB,CAAC,CAAC;QAChF,IACE,OAAO,IAAI,KAAK,QAAQ;YACxB,2BAA2B,CAAC,GAAG,CAAC,IAAI,CAAC;YACrC,OAAO,KAAK,KAAK,UAAU,EAC3B,CAAC;YACD,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE;gBAC5B,kBAAkB,CAAC,KAAK,CAAC,CAAC;gBAC1B,OAAQ,KAA2C,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YAChF,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;CACF,CAAuB,CAAC;AAEzB;;EAEE;AACF,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,EAAE,MAAM,CAAC;AAC5B,CAAC;AAED,eAAe,6BAA6B,CAAC","sourcesContent":["import { requireNativeModule } from 'expo';\nimport { Platform } from 'react-native';\n\nimport {\n LatLng,\n Coordinates,\n ReGeocode,\n LocationListener,\n LatLngPoint,\n CoordinateType,\n} from './types';\nimport type { ExpoGaodeMapModule as NativeExpoGaodeMapModule } from './types/native-module.types';\nimport { ErrorHandler, ErrorLogger } from './utils/ErrorHandler';\nimport { PrivacyConfig, PrivacyStatus, SDKConfig, PermissionStatus } from './types/common.types';\nimport { normalizeLatLng, normalizeLatLngList } from './utils/GeoUtils';\n\nlet nativeModuleCache: NativeExpoGaodeMapModule | null = null;\n\nfunction getNativeModule(optional = false): NativeExpoGaodeMapModule | null {\n if (nativeModuleCache) {\n return nativeModuleCache;\n }\n\n try {\n nativeModuleCache = requireNativeModule<NativeExpoGaodeMapModule>('ExpoGaodeMap');\n return nativeModuleCache;\n } catch (error) {\n if (optional) {\n return null;\n }\n const moduleError = ErrorHandler.nativeModuleUnavailable();\n ErrorLogger.log(moduleError);\n throw moduleError;\n }\n}\n\nfunction getBoundNativeValue(\n module: NativeExpoGaodeMapModule,\n prop: PropertyKey\n): unknown {\n const value = Reflect.get(module as object, prop, module as object);\n if (typeof value === 'function') {\n return (...args: unknown[]) =>\n (value as (...fnArgs: unknown[]) => unknown).apply(module, args);\n }\n return value;\n}\n\nconst nativeModule = new Proxy({} as NativeExpoGaodeMapModule, {\n get(_target, prop) {\n const module = getNativeModule(true);\n return module ? getBoundNativeValue(module, prop) : undefined;\n },\n});\n\n// 记录最近一次 initSDK 的配置(含 webKey)\nlet _sdkConfig: SDKConfig | null = null;\nlet _isSDKInitialized = false;\n\nconst privacySensitiveMethodNames = new Set<string>([\n 'start',\n 'stop',\n 'isStarted',\n 'getCurrentLocation',\n 'coordinateConvert',\n 'setLocatingWithReGeocode',\n 'setLocationMode',\n 'setInterval',\n 'setOnceLocation',\n 'setSensorEnable',\n 'setWifiScan',\n 'setGpsFirst',\n 'setOnceLocationLatest',\n 'setGeoLanguage',\n 'setLocationCacheEnable',\n 'setHttpTimeOut',\n 'setDesiredAccuracy',\n 'setLocationTimeout',\n 'setReGeocodeTimeout',\n 'setDistanceFilter',\n 'setPausesLocationUpdatesAutomatically',\n 'setAllowsBackgroundLocationUpdates',\n 'setLocationProtocol',\n 'startUpdatingHeading',\n 'stopUpdatingHeading',\n 'checkLocationPermission',\n 'requestLocationPermission',\n 'requestBackgroundLocationPermission',\n 'addLocationListener',\n]);\n\nfunction assertPrivacyReady(scene: 'map' | 'sdk' = 'sdk'): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n const status = nativeModule.getPrivacyStatus();\n if (!status.isReady) {\n throw ErrorHandler.privacyNotAgreed(scene);\n }\n}\n\n// 扩展原生模块,添加便捷方法\nconst helperMethods = {\n\n /**\n * 初始化 SDK,并缓存配置(包含 webKey)\n * 注意:允许不提供任何 API Key,因为原生端可能已通过 Config Plugin 配置\n */\n initSDK(config: SDKConfig): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n try {\n\n // 检查是否有任何 key 被提供\n const hasJSKeys = !!(config.androidKey || config.iosKey);\n const hasWebKey = !!config.webKey;\n // 如果 JS 端没有提供 androidKey/iosKey,检查原生端是否已配置\n if (!hasJSKeys) {\n const isNativeConfigured = nativeModule.isNativeSDKConfigured();\n if (!isNativeConfigured && !hasWebKey){\n throw ErrorHandler.invalidApiKey('both');\n }\n // 如果原生已配置,或者只提供了 webKey,继续初始化\n ErrorLogger.warn(\n isNativeConfigured \n ? 'SDK 使用原生端配置的 API Key' \n : 'SDK 初始化仅使用 webKey',\n { config }\n );\n }\n _sdkConfig = config ?? null;\n nativeModule.initSDK(config);\n _isSDKInitialized = true;\n ErrorLogger.warn('SDK 初始化成功', { config });\n } catch (error) {\n _isSDKInitialized = false;\n throw ErrorHandler.wrapNativeError(error, 'SDK 初始化');\n }\n },\n\n isSDKInitialized(): boolean {\n return _isSDKInitialized;\n },\n\n /**\n * 设置是否显示隐私政策弹窗\n * @deprecated 请优先使用 `setPrivacyConfig`\n */\n setPrivacyShow(hasShow: boolean, hasContainsPrivacy?: boolean): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.setPrivacyShow(hasShow, hasContainsPrivacy ?? hasShow);\n },\n\n /**\n * 设置用户是否同意隐私政策\n * @deprecated 请优先使用 `setPrivacyConfig`\n */\n setPrivacyAgree(hasAgree: boolean): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.setPrivacyAgree(hasAgree);\n },\n\n /**\n * 设置当前隐私协议版本\n * 当版本号变化时,之前的同意状态会失效\n */\n setPrivacyVersion(version: string): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.setPrivacyVersion(version);\n },\n\n /**\n * 清空已持久化的隐私同意状态\n */\n resetPrivacyConsent(): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.resetPrivacyConsent();\n },\n\n /**\n * 一次性同步完整的隐私状态\n * 推荐业务层只调用这个方法\n */\n setPrivacyConfig(config: PrivacyConfig): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n if (typeof config.privacyVersion === 'string') {\n nativeModule.setPrivacyVersion(config.privacyVersion);\n }\n nativeModule.setPrivacyShow(\n config.hasShow,\n config.hasContainsPrivacy ?? config.hasShow\n );\n nativeModule.setPrivacyAgree(config.hasAgree);\n },\n\n getPrivacyStatus(): PrivacyStatus {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n return {\n hasShow: false,\n hasContainsPrivacy: false,\n hasAgree: false,\n isReady: false,\n privacyVersion: null,\n agreedPrivacyVersion: null,\n restoredFromStorage: false,\n };\n }\n return nativeModule.getPrivacyStatus();\n },\n\n calculateDistanceBetweenPoints(p1: LatLngPoint, p2: LatLngPoint): number {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n return nativeModule.distanceBetweenCoordinates(\n normalizeLatLng(p1),\n normalizeLatLng(p2)\n );\n },\n\n calculateDistance(lat1: number, lon1: number, lat2: number, lon2: number): number {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n return nativeModule.distanceBetweenCoordinates(\n { latitude: lat1, longitude: lon1 },\n { latitude: lat2, longitude: lon2 }\n );\n },\n\n setLoadWorldVectorMap(enabled: boolean): void {\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.setLoadWorldVectorMap(enabled);\n } catch (error) {\n ErrorLogger.warn('setLoadWorldVectorMap 失败', { enabled, error });\n }\n },\n\n getVersion(): string {\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return '0.0.0';\n try {\n return nativeModule.getVersion();\n } catch (error) {\n ErrorLogger.warn('getVersion 失败', { error });\n return '0.0.0';\n }\n },\n\n start(): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.start();\n } catch (error) {\n ErrorLogger.warn('start 失败', { error });\n }\n },\n\n stop(): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.stop();\n } catch (error) {\n ErrorLogger.warn('stop 失败', { error });\n }\n },\n\n isStarted(): Promise<boolean> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return Promise.resolve(false);\n try {\n return nativeModule.isStarted();\n } catch (error) {\n ErrorLogger.warn('isStarted 失败', { error });\n return Promise.resolve(false);\n }\n },\n\n async getCurrentLocation(): Promise<Coordinates | ReGeocode> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return await nativeModule.getCurrentLocation();\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '获取当前位置');\n }\n },\n\n async coordinateConvert(coordinate: LatLngPoint, type: CoordinateType): Promise<LatLng> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return await nativeModule.coordinateConvert(normalizeLatLng(coordinate), type);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '坐标转换');\n }\n },\n\n setLocatingWithReGeocode(isReGeocode: boolean): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.setLocatingWithReGeocode(isReGeocode);\n } catch (error) {\n ErrorLogger.warn('setLocatingWithReGeocode 失败', { isReGeocode, error });\n }\n },\n\n get isBackgroundLocationEnabled(): boolean {\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return false;\n return nativeModule.isBackgroundLocationEnabled === true;\n },\n\n /**\n * 检查位置权限状态\n */\n async checkLocationPermission(): Promise<PermissionStatus> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return await nativeModule.checkLocationPermission();\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '检查权限');\n }\n },\n\n /**\n * 请求前台位置权限(增强版)\n */\n async requestLocationPermission(): Promise<PermissionStatus> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n const result = await nativeModule.requestLocationPermission();\n if (!result.granted) {\n ErrorLogger.warn('前台位置权限未授予', result);\n }\n return result;\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '请求前台权限');\n }\n },\n\n /**\n * 请求后台位置权限\n * 注意:必须在前台权限已授予后才能请求\n */\n async requestBackgroundLocationPermission(): Promise<PermissionStatus> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n const result = await nativeModule.requestBackgroundLocationPermission();\n if (!result.granted) {\n ErrorLogger.warn('后台位置权限未授予', result);\n }\n return result;\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '请求后台权限');\n }\n },\n\n /**\n * 打开应用设置页面\n * 引导用户手动授予权限\n */\n openAppSettings(): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n nativeModule.openAppSettings();\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '打开设置');\n }\n },\n\n setAllowsBackgroundLocationUpdates(allows: boolean): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n\n if (\n Platform.OS === 'ios' &&\n allows &&\n nativeModule &&\n nativeModule.isBackgroundLocationEnabled === false\n ) {\n ErrorLogger.warn(\n '⚠️ [ExpoGaodeMap] iOS 后台定位未正确配置,setAllowsBackgroundLocationUpdates(true) 可能不会生效,请检查 Info.plist 是否包含 UIBackgroundModes: location,或者在 app.json 中配置 enableBackgroundLocation: true,然后重新执行 npx expo prebuild',\n );\n }\n\n if (\n Platform.OS === 'android' &&\n allows &&\n nativeModule &&\n nativeModule.checkLocationPermission\n ) {\n nativeModule\n .checkLocationPermission()\n .then((status: PermissionStatus) => {\n if (!status.backgroundLocation) {\n ErrorLogger.warn(\n '⚠️ [ExpoGaodeMap] Android 后台位置权限未授予,setAllowsBackgroundLocationUpdates(true) 可能不会生效,请先通过 requestBackgroundLocationPermission 或系统设置授予后台定位权限,或者检查是否在 app.json 中配置了 enableBackgroundLocation: true,然后重新执行 npx expo prebuild',\n );\n }\n })\n .catch(() => {\n // 忽略检查失败,只影响日志,不影响功能\n });\n }\n\n nativeModule.setAllowsBackgroundLocationUpdates(allows);\n },\n\n /**\n * 添加定位监听器(便捷方法)\n * 自动订阅 onLocationUpdate 事件,提供容错处理\n * @param listener 定位回调函数\n * @returns 订阅对象,调用 remove() 取消监听\n * 注意:如果使用 Config Plugin 配置了 API Key,无需调用 initSDK()\n */\n addLocationListener(listener: LocationListener): { remove: () => void } {\n assertPrivacyReady('sdk');\n const module = getNativeModule();\n if (!module) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n if (!module.addListener) {\n ErrorLogger.warn('Native module does not support events');\n return {\n remove: () => { },\n };\n }\n\n return module.addListener('onLocationUpdate', listener) || {\n remove: () => { },\n };\n },\n\n // ==================== 几何计算方法 ====================\n\n /**\n * 计算两个坐标点之间的距离\n * @param coordinate1 第一个坐标点\n * @param coordinate2 第二个坐标点\n * @returns 两点之间的距离(单位:米)\n */\n distanceBetweenCoordinates(coordinate1: LatLngPoint, coordinate2: LatLngPoint): number {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.distanceBetweenCoordinates(\n normalizeLatLng(coordinate1),\n normalizeLatLng(coordinate2)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算距离');\n }\n },\n\n /**\n * 判断点是否在圆内\n * @param point 要判断的点\n * @param center 圆心坐标\n * @param radius 圆半径(单位:米)\n * @returns 是否在圆内\n */\n isPointInCircle(point: LatLngPoint, center: LatLngPoint, radius: number): boolean {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.isPointInCircle(\n normalizeLatLng(point),\n normalizeLatLng(center),\n radius\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '判断点是否在圆内');\n }\n },\n\n /**\n * 判断点是否在多边形内\n * @param point 要判断的点\n * @param polygon 多边形的顶点坐标数组\n * @returns 是否在多边形内\n */\n isPointInPolygon(point: LatLngPoint, polygon: LatLngPoint[]): boolean {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.isPointInPolygon(\n normalizeLatLng(point),\n normalizeLatLngList(polygon)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '判断点是否在多边形内');\n }\n },\n\n /**\n * 计算多边形面积\n * @param polygon 多边形的顶点坐标数组\n * @returns 面积(单位:平方米)\n */\n calculatePolygonArea(polygon: LatLngPoint[]): number {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.calculatePolygonArea(normalizeLatLngList(polygon));\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算多边形面积');\n }\n },\n\n /**\n * 计算矩形面积\n * @param southWest 西南角坐标\n * @param northEast 东北角坐标\n * @returns 面积(单位:平方米)\n */\n calculateRectangleArea(southWest: LatLngPoint, northEast: LatLngPoint): number {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.calculateRectangleArea(\n normalizeLatLng(southWest),\n normalizeLatLng(northEast)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算矩形面积');\n }\n },\n\n /**\n * 获取路径上距离目标点最近的点\n * @param path 路径点集合\n * @param target 目标点\n * @returns 最近点信息,包含坐标、索引和距离\n */\n getNearestPointOnPath(path: LatLngPoint[], target: LatLngPoint): {\n latitude: number;\n longitude: number;\n index: number;\n distanceMeters: number;\n } | null {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.getNearestPointOnPath(\n normalizeLatLngList(path),\n normalizeLatLng(target)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '获取最近点');\n }\n },\n\n /**\n * 计算多边形质心\n * @param polygon 多边形顶点坐标数组\n * @returns 质心坐标\n */\n calculateCentroid(polygon: LatLngPoint[]): LatLng | null {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.calculateCentroid(normalizeLatLngList(polygon));\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算质心');\n }\n },\n\n /**\n * 计算路径边界和中心点\n * @param points 路径点集合\n * @returns 边界信息,包含 north, south, east, west 和 center\n */\n calculatePathBounds(points: LatLngPoint[]): {\n north: number;\n south: number;\n east: number;\n west: number;\n center: LatLngPoint;\n } | null {\n if (!nativeModule) return null;\n try {\n const normalized = normalizeLatLngList(points);\n if (normalized.length === 0) return null;\n return nativeModule.calculatePathBounds(normalized);\n } catch (error) {\n ErrorLogger.warn('calculatePathBounds 失败', { pointsCount: points.length, error });\n return null;\n }\n },\n\n /**\n * GeoHash 编码\n * @param coordinate 坐标点\n * @param precision 精度 (1-12)\n * @returns GeoHash 字符串\n */\n encodeGeoHash(coordinate: LatLngPoint, precision: number): string {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.encodeGeoHash(normalizeLatLng(coordinate), precision);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'GeoHash 编码');\n }\n },\n\n /**\n * 轨迹抽稀 (RDP 算法)\n * @param points 原始轨迹点\n * @param tolerance 允许误差(米)\n * @returns 简化后的轨迹点\n */\n simplifyPolyline(points: LatLngPoint[], tolerance: number): LatLng[] {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.simplifyPolyline(normalizeLatLngList(points), tolerance);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '轨迹抽稀');\n }\n },\n\n /**\n * 计算路径总长度\n * @param points 路径点\n * @returns 长度(米)\n */\n calculatePathLength(points: LatLngPoint[]): number {\n if (!nativeModule) return 0;\n try {\n return nativeModule.calculatePathLength(normalizeLatLngList(points));\n } catch (error) {\n ErrorLogger.warn('calculatePathLength 失败', { pointsCount: points.length, error });\n return 0;\n }\n },\n\n /**\n * 解析高德地图 API 返回的 Polyline 字符串\n * 格式: \"lng,lat;lng,lat;...\"\n * @param polylineStr 高德原始 polyline 字符串,或包含 polyline 属性的对象\n * @returns 解析后的点集\n */\n parsePolyline(polylineStr: string | { polyline: string }): LatLng[] {\n if (!nativeModule || !polylineStr) return [];\n try {\n // 兼容性处理:如果传入的是对象 { polyline: '...' },自动提取字符串\n let finalStr: string = '';\n if (typeof polylineStr === 'object' && polylineStr !== null && 'polyline' in polylineStr) {\n finalStr = polylineStr.polyline || '';\n } else if (typeof polylineStr === 'string') {\n finalStr = polylineStr;\n }\n\n if (!finalStr) return [];\n return nativeModule.parsePolyline(finalStr);\n } catch (error) {\n ErrorLogger.warn('解析 Polyline 失败', { polylineStr, error });\n return [];\n }\n },\n\n /**\n * 获取路径上指定距离的点\n * @param points 路径点\n * @param distance 距离起点的米数\n * @returns 点信息(坐标+角度)\n */\n getPointAtDistance(points: LatLngPoint[], distance: number): {\n latitude: number;\n longitude: number;\n angle: number;\n } | null {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.getPointAtDistance(normalizeLatLngList(points), distance);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '获取路径上的点');\n }\n },\n\n /**\n * 经纬度转换为地图瓦片坐标\n * @param coordinate 经纬度点\n * @param zoom 缩放级别\n * @returns 瓦片坐标(x, y, z)\n */\n latLngToTile(coordinate: LatLngPoint, zoom: number): { x: number; y: number; z: number } | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.latLngToTile(normalizeLatLng(coordinate), zoom);\n } catch (error) {\n ErrorLogger.warn('latLngToTile 失败', { coordinate, zoom, error });\n return null;\n }\n },\n\n /**\n * 地图瓦片坐标转换为经纬度\n * @param tile 瓦片坐标(x, y, z)\n * @returns 经纬度点\n */\n tileToLatLng(tile: { x: number; y: number; z: number }): LatLng | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.tileToLatLng(tile);\n } catch (error) {\n ErrorLogger.warn('tileToLatLng 失败', { tile, error });\n return null;\n }\n },\n\n /**\n * 经纬度转换为地图像素坐标\n * @param coordinate 经纬度点\n * @param zoom 缩放级别\n * @returns 像素坐标(x, y)\n */\n latLngToPixel(coordinate: LatLngPoint, zoom: number): { x: number; y: number } | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.latLngToPixel(normalizeLatLng(coordinate), zoom);\n } catch (error) {\n ErrorLogger.warn('latLngToPixel 失败', { coordinate, zoom, error });\n return null;\n }\n },\n\n /**\n * 地图像素坐标转换为经纬度\n * @param pixel 像素坐标(x, y)\n * @param zoom 缩放级别\n * @returns 经纬度点\n */\n pixelToLatLng(pixel: { x: number; y: number }, zoom: number): LatLng | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.pixelToLatLng(pixel, zoom);\n } catch (error) {\n ErrorLogger.warn('pixelToLatLng 失败', { pixel, zoom, error });\n return null;\n }\n },\n\n /**\n * 批量地理围栏检测\n * @param point 待检查的点\n * @param polygons 多边形数组,格式为 LatLngPoint[][] 或 LatLngPoint[][][]\n * @returns 包含点索引的数组(-1 表示不在任何多边形内)\n */\n findPointInPolygons(point: LatLngPoint, polygons: LatLngPoint[][] | LatLngPoint[][][]): number {\n if (!nativeModule) return -1;\n try {\n const normalizedPoint = normalizeLatLng(point);\n let normalizedPolygons: LatLngPoint[][];\n\n // 处理三维数组 (LatLngPoint[][][]) 和二维数组 (LatLngPoint[][])\n if (Array.isArray(polygons[0]) && Array.isArray(polygons[0][0])) {\n // LatLngPoint[][][] -> 扁平化为 LatLngPoint[][] 用于 C++ 遍历\n normalizedPolygons = (polygons as LatLngPoint[][][]).reduce((acc, val) => acc.concat(val), []);\n } else {\n normalizedPolygons = polygons as LatLngPoint[][];\n }\n\n const processedPolygons = normalizedPolygons.map(p => normalizeLatLngList(p));\n return nativeModule.findPointInPolygons(normalizedPoint, processedPolygons);\n } catch (error) {\n ErrorLogger.warn('findPointInPolygons 失败', { point, error });\n return -1;\n }\n },\n\n /**\n * 生成网格聚合数据 (常用于展示网格聚合图或大规模点数据处理)\n * @param points 包含经纬度和权重的点数组\n * @param gridSizeMeters 网格大小(米)\n * @returns 包含经纬度和强度的网格点数组\n */\n generateHeatmapGrid(\n points: Array<LatLngPoint & { weight?: number }>,\n gridSizeMeters: number\n ): Array<{ latitude: number; longitude: number; intensity: number }> {\n if (!nativeModule || points.length === 0) return [];\n try {\n return nativeModule.generateHeatmapGrid(points, gridSizeMeters);\n } catch (error) {\n ErrorLogger.warn('generateHeatmapGrid 失败', { pointsCount: points.length, gridSizeMeters, error });\n return [];\n }\n },\n};\n\n/**\n* 获取最近一次 initSDK 的配置\n*/\nexport function getSDKConfig(): SDKConfig | null {\n return _sdkConfig;\n};\n\nexport type ExpoGaodeMapModule =\n Omit<NativeExpoGaodeMapModule, keyof typeof helperMethods> & typeof helperMethods;\n\nconst ExpoGaodeMapModuleWithHelpers = new Proxy(helperMethods, {\n get(target, prop, receiver) {\n if (Reflect.has(target, prop)) {\n return Reflect.get(target, prop, receiver);\n }\n const nativeModule = getNativeModule(true);\n if (!nativeModule) {\n return undefined;\n }\n\n const value = Reflect.get(nativeModule as object, prop, nativeModule as object);\n if (\n typeof prop === 'string' &&\n privacySensitiveMethodNames.has(prop) &&\n typeof value === 'function'\n ) {\n return (...args: unknown[]) => {\n assertPrivacyReady('sdk');\n return (value as (...fnArgs: unknown[]) => unknown).apply(nativeModule, args);\n };\n }\n\n return getBoundNativeValue(nativeModule, prop);\n },\n}) as ExpoGaodeMapModule;\n\n/**\n* 获取用于 Web API 的 webKey(若未初始化或未提供则返回 undefined)\n*/\nexport function getWebKey(): string | undefined {\n return _sdkConfig?.webKey;\n}\n\nexport default ExpoGaodeMapModuleWithHelpers;\n"]}
1
+ {"version":3,"file":"ExpoGaodeMapModule.js","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAWxC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAExE,IAAI,iBAAiB,GAAoC,IAAI,CAAC;AAE9D,SAAS,eAAe,CAAC,QAAQ,GAAG,KAAK;IACvC,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC;QACH,iBAAiB,GAAG,mBAAmB,CAA2B,cAAc,CAAC,CAAC;QAClF,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,WAAW,GAAG,YAAY,CAAC,uBAAuB,EAAE,CAAC;QAC3D,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7B,MAAM,WAAW,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,MAAgC,EAChC,IAAiB;IAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAgB,EAAE,IAAI,EAAE,MAAgB,CAAC,CAAC;IACpE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE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EE;AACF,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,EAAE,MAAM,CAAC;AAC5B,CAAC;AAED,eAAe,6BAA6B,CAAC","sourcesContent":["import { requireNativeModule } from 'expo';\nimport { Platform } from 'react-native';\n\nimport {\n LatLng,\n Coordinates,\n ReGeocode,\n LocationListener,\n LatLngPoint,\n CoordinateType,\n} from './types';\nimport type { ExpoGaodeMapModule as NativeExpoGaodeMapModule } from './types/native-module.types';\nimport { ErrorHandler, ErrorLogger } from './utils/ErrorHandler';\nimport { PrivacyConfig, PrivacyStatus, SDKConfig, PermissionStatus } from './types/common.types';\nimport { normalizeLatLng, normalizeLatLngList } from './utils/GeoUtils';\n\nlet nativeModuleCache: NativeExpoGaodeMapModule | null = null;\n\nfunction getNativeModule(optional = false): NativeExpoGaodeMapModule | null {\n if (nativeModuleCache) {\n return nativeModuleCache;\n }\n\n try {\n nativeModuleCache = requireNativeModule<NativeExpoGaodeMapModule>('ExpoGaodeMap');\n return nativeModuleCache;\n } catch (error) {\n if (optional) {\n return null;\n }\n const moduleError = ErrorHandler.nativeModuleUnavailable();\n ErrorLogger.log(moduleError);\n throw moduleError;\n }\n}\n\nfunction getBoundNativeValue(\n module: NativeExpoGaodeMapModule,\n prop: PropertyKey\n): unknown {\n const value = Reflect.get(module as object, prop, module as object);\n if (typeof value === 'function') {\n return (...args: unknown[]) =>\n (value as (...fnArgs: unknown[]) => unknown).apply(module, args);\n }\n return value;\n}\n\nconst nativeModule = new Proxy({} as NativeExpoGaodeMapModule, {\n get(_target, prop) {\n const module = getNativeModule(true);\n return module ? getBoundNativeValue(module, prop) : undefined;\n },\n});\n\n// 记录最近一次 initSDK 的配置(含 webKey)\nlet _sdkConfig: SDKConfig | null = null;\nlet _isSDKInitialized = false;\n\nconst privacySensitiveMethodNames = new Set<string>([\n 'start',\n 'stop',\n 'isStarted',\n 'getCurrentLocation',\n 'coordinateConvert',\n 'setLocatingWithReGeocode',\n 'setLocationMode',\n 'setInterval',\n 'setOnceLocation',\n 'setSensorEnable',\n 'setWifiScan',\n 'setGpsFirst',\n 'setOnceLocationLatest',\n 'setGeoLanguage',\n 'setLocationCacheEnable',\n 'setHttpTimeOut',\n 'setDesiredAccuracy',\n 'setLocationTimeout',\n 'setReGeocodeTimeout',\n 'setDistanceFilter',\n 'setPausesLocationUpdatesAutomatically',\n 'setAllowsBackgroundLocationUpdates',\n 'setLocationProtocol',\n 'startUpdatingHeading',\n 'stopUpdatingHeading',\n 'checkLocationPermission',\n 'requestLocationPermission',\n 'requestBackgroundLocationPermission',\n 'addLocationListener',\n]);\n\nfunction assertPrivacyReady(scene: 'map' | 'sdk' = 'sdk'): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n const status = nativeModule.getPrivacyStatus();\n if (!status.isReady) {\n throw ErrorHandler.privacyNotAgreed(scene);\n }\n}\n\n// 扩展原生模块,添加便捷方法\nconst helperMethods = {\n\n /**\n * 初始化 SDK,并缓存配置(包含 webKey)\n * 注意:允许不提供任何 API Key,因为原生端可能已通过 Config Plugin 配置\n */\n initSDK(config: SDKConfig): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n try {\n\n // 检查是否有任何 key 被提供\n const hasJSKeys = !!(config.androidKey || config.iosKey);\n const hasWebKey = !!config.webKey;\n // 如果 JS 端没有提供 androidKey/iosKey,检查原生端是否已配置\n if (!hasJSKeys) {\n const isNativeConfigured = nativeModule.isNativeSDKConfigured();\n if (!isNativeConfigured && !hasWebKey){\n throw ErrorHandler.invalidApiKey('both');\n }\n // 如果原生已配置,或者只提供了 webKey,继续初始化\n ErrorLogger.warn(\n isNativeConfigured \n ? 'SDK 使用原生端配置的 API Key' \n : 'SDK 初始化仅使用 webKey',\n { config }\n );\n }\n _sdkConfig = config ?? null;\n nativeModule.initSDK(config);\n _isSDKInitialized = true;\n ErrorLogger.warn('SDK 初始化成功', { config });\n } catch (error) {\n _isSDKInitialized = false;\n throw ErrorHandler.wrapNativeError(error, 'SDK 初始化');\n }\n },\n\n isSDKInitialized(): boolean {\n return _isSDKInitialized;\n },\n\n /**\n * 设置是否显示隐私政策弹窗\n * @deprecated 请优先使用 `setPrivacyConfig`\n */\n setPrivacyShow(hasShow: boolean, hasContainsPrivacy?: boolean): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.setPrivacyShow(hasShow, hasContainsPrivacy ?? hasShow);\n },\n\n /**\n * 设置用户是否同意隐私政策\n * @deprecated 请优先使用 `setPrivacyConfig`\n */\n setPrivacyAgree(hasAgree: boolean): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.setPrivacyAgree(hasAgree);\n },\n\n /**\n * 设置当前隐私协议版本\n * 当版本号变化时,之前的同意状态会失效\n */\n setPrivacyVersion(version: string): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.setPrivacyVersion(version);\n },\n\n /**\n * 清空已持久化的隐私同意状态\n */\n resetPrivacyConsent(): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n nativeModule.resetPrivacyConsent();\n },\n\n /**\n * 一次性同步完整的隐私状态\n * 推荐业务层只调用这个方法\n */\n setPrivacyConfig(config: PrivacyConfig): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) throw ErrorHandler.nativeModuleUnavailable();\n if (typeof config.privacyVersion === 'string') {\n nativeModule.setPrivacyVersion(config.privacyVersion);\n }\n nativeModule.setPrivacyShow(\n config.hasShow,\n config.hasContainsPrivacy ?? config.hasShow\n );\n nativeModule.setPrivacyAgree(config.hasAgree);\n },\n\n getPrivacyStatus(): PrivacyStatus {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n return {\n hasShow: false,\n hasContainsPrivacy: false,\n hasAgree: false,\n isReady: false,\n privacyVersion: null,\n agreedPrivacyVersion: null,\n restoredFromStorage: false,\n };\n }\n return nativeModule.getPrivacyStatus();\n },\n\n calculateDistanceBetweenPoints(p1: LatLngPoint, p2: LatLngPoint): number {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n return nativeModule.distanceBetweenCoordinates(\n normalizeLatLng(p1),\n normalizeLatLng(p2)\n );\n },\n\n calculateDistance(lat1: number, lon1: number, lat2: number, lon2: number): number {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n return nativeModule.distanceBetweenCoordinates(\n { latitude: lat1, longitude: lon1 },\n { latitude: lat2, longitude: lon2 }\n );\n },\n\n setLoadWorldVectorMap(enabled: boolean): void {\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.setLoadWorldVectorMap(enabled);\n } catch (error) {\n ErrorLogger.warn('setLoadWorldVectorMap 失败', { enabled, error });\n }\n },\n\n getVersion(): string {\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return '0.0.0';\n try {\n return nativeModule.getVersion();\n } catch (error) {\n ErrorLogger.warn('getVersion 失败', { error });\n return '0.0.0';\n }\n },\n\n start(): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.start();\n } catch (error) {\n ErrorLogger.warn('start 失败', { error });\n }\n },\n\n stop(): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.stop();\n } catch (error) {\n ErrorLogger.warn('stop 失败', { error });\n }\n },\n\n isStarted(): Promise<boolean> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return Promise.resolve(false);\n try {\n return nativeModule.isStarted();\n } catch (error) {\n ErrorLogger.warn('isStarted 失败', { error });\n return Promise.resolve(false);\n }\n },\n\n async getCurrentLocation(): Promise<Coordinates | ReGeocode> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return await nativeModule.getCurrentLocation();\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '获取当前位置');\n }\n },\n\n async coordinateConvert(coordinate: LatLngPoint, type: CoordinateType): Promise<LatLng> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return await nativeModule.coordinateConvert(normalizeLatLng(coordinate), type);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '坐标转换');\n }\n },\n\n setLocatingWithReGeocode(isReGeocode: boolean): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return;\n try {\n nativeModule.setLocatingWithReGeocode(isReGeocode);\n } catch (error) {\n ErrorLogger.warn('setLocatingWithReGeocode 失败', { isReGeocode, error });\n }\n },\n\n get isBackgroundLocationEnabled(): boolean {\n const nativeModule = getNativeModule(true);\n if (!nativeModule) return false;\n return nativeModule.isBackgroundLocationEnabled === true;\n },\n\n /**\n * 检查位置权限状态\n */\n async checkLocationPermission(): Promise<PermissionStatus> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return await nativeModule.checkLocationPermission();\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '检查权限');\n }\n },\n\n /**\n * 请求前台位置权限(增强版)\n */\n async requestLocationPermission(): Promise<PermissionStatus> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n const result = await nativeModule.requestLocationPermission();\n if (!result.granted) {\n ErrorLogger.warn('前台位置权限未授予', result);\n }\n return result;\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '请求前台权限');\n }\n },\n\n /**\n * 请求后台位置权限\n * 注意:必须在前台权限已授予后才能请求\n */\n async requestBackgroundLocationPermission(): Promise<PermissionStatus> {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n const result = await nativeModule.requestBackgroundLocationPermission();\n if (!result.granted) {\n ErrorLogger.warn('后台位置权限未授予', result);\n }\n return result;\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '请求后台权限');\n }\n },\n\n /**\n * 打开应用设置页面\n * 引导用户手动授予权限\n */\n openAppSettings(): void {\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n nativeModule.openAppSettings();\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '打开设置');\n }\n },\n\n setAllowsBackgroundLocationUpdates(allows: boolean): void {\n assertPrivacyReady('sdk');\n const nativeModule = getNativeModule();\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n\n if (\n Platform.OS === 'ios' &&\n allows &&\n nativeModule &&\n nativeModule.isBackgroundLocationEnabled === false\n ) {\n ErrorLogger.warn(\n '⚠️ [ExpoGaodeMap] iOS 后台定位未正确配置,setAllowsBackgroundLocationUpdates(true) 可能不会生效,请检查 Info.plist 是否包含 UIBackgroundModes: location,或者在 app.json 中配置 enableBackgroundLocation: true,然后重新执行 npx expo prebuild',\n );\n }\n\n if (\n Platform.OS === 'android' &&\n allows &&\n nativeModule &&\n nativeModule.checkLocationPermission\n ) {\n nativeModule\n .checkLocationPermission()\n .then((status: PermissionStatus) => {\n if (!status.backgroundLocation) {\n ErrorLogger.warn(\n '⚠️ [ExpoGaodeMap] Android 后台位置权限未授予,setAllowsBackgroundLocationUpdates(true) 可能不会生效,请先通过 requestBackgroundLocationPermission 或系统设置授予后台定位权限,或者检查是否在 app.json 中配置了 enableBackgroundLocation: true,然后重新执行 npx expo prebuild',\n );\n }\n })\n .catch(() => {\n // 忽略检查失败,只影响日志,不影响功能\n });\n }\n\n nativeModule.setAllowsBackgroundLocationUpdates(allows);\n },\n\n /**\n * 添加定位监听器(便捷方法)\n * 自动订阅 onLocationUpdate 事件,提供容错处理\n * @param listener 定位回调函数\n * @returns 订阅对象,调用 remove() 取消监听\n * 注意:如果使用 Config Plugin 配置了 API Key,无需调用 initSDK()\n */\n addLocationListener(listener: LocationListener): { remove: () => void } {\n assertPrivacyReady('sdk');\n const module = getNativeModule();\n if (!module) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n if (!module.addListener) {\n ErrorLogger.warn('Native module does not support events');\n return {\n remove: () => { },\n };\n }\n\n return module.addListener('onLocationUpdate', listener) || {\n remove: () => { },\n };\n },\n\n // ==================== 几何计算方法 ====================\n\n /**\n * 计算两个坐标点之间的距离\n * @param coordinate1 第一个坐标点\n * @param coordinate2 第二个坐标点\n * @returns 两点之间的距离(单位:米)\n */\n distanceBetweenCoordinates(coordinate1: LatLngPoint, coordinate2: LatLngPoint): number {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.distanceBetweenCoordinates(\n normalizeLatLng(coordinate1),\n normalizeLatLng(coordinate2)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算距离');\n }\n },\n\n /**\n * 判断点是否在圆内\n * @param point 要判断的点\n * @param center 圆心坐标\n * @param radius 圆半径(单位:米)\n * @returns 是否在圆内\n */\n isPointInCircle(point: LatLngPoint, center: LatLngPoint, radius: number): boolean {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.isPointInCircle(\n normalizeLatLng(point),\n normalizeLatLng(center),\n radius\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '判断点是否在圆内');\n }\n },\n\n /**\n * 判断点是否在多边形内\n * @param point 要判断的点\n * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞)\n * @returns 是否在多边形内\n */\n isPointInPolygon(point: LatLngPoint, polygon: LatLngPoint[] | LatLngPoint[][]): boolean {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.isPointInPolygon(\n normalizeLatLng(point),\n normalizeLatLngList(polygon)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '判断点是否在多边形内');\n }\n },\n\n /**\n * 计算多边形面积\n * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞)\n * @returns 面积(单位:平方米)\n */\n calculatePolygonArea(polygon: LatLngPoint[] | LatLngPoint[][]): number {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.calculatePolygonArea(normalizeLatLngList(polygon));\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算多边形面积');\n }\n },\n\n /**\n * 计算矩形面积\n * @param southWest 西南角坐标\n * @param northEast 东北角坐标\n * @returns 面积(单位:平方米)\n */\n calculateRectangleArea(southWest: LatLngPoint, northEast: LatLngPoint): number {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.calculateRectangleArea(\n normalizeLatLng(southWest),\n normalizeLatLng(northEast)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算矩形面积');\n }\n },\n\n /**\n * 获取路径上距离目标点最近的点\n * @param path 路径点集合\n * @param target 目标点\n * @returns 最近点信息,包含坐标、索引和距离\n */\n getNearestPointOnPath(path: LatLngPoint[], target: LatLngPoint): {\n latitude: number;\n longitude: number;\n index: number;\n distanceMeters: number;\n } | null {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.getNearestPointOnPath(\n normalizeLatLngList(path),\n normalizeLatLng(target)\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '获取最近点');\n }\n },\n\n /**\n * 计算多边形质心\n * @param polygon 多边形顶点坐标数组\n * @returns 质心坐标\n */\n calculateCentroid(polygon: LatLngPoint[]): LatLng | null {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.calculateCentroid(normalizeLatLngList(polygon));\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '计算质心');\n }\n },\n\n /**\n * 计算路径边界和中心点\n * @param points 路径点集合\n * @returns 边界信息,包含 north, south, east, west 和 center\n */\n calculatePathBounds(points: LatLngPoint[]): {\n north: number;\n south: number;\n east: number;\n west: number;\n center: LatLngPoint;\n } | null {\n if (!nativeModule) return null;\n try {\n const normalized = normalizeLatLngList(points);\n if (normalized.length === 0) return null;\n return nativeModule.calculatePathBounds(normalized);\n } catch (error) {\n ErrorLogger.warn('calculatePathBounds 失败', { pointsCount: points.length, error });\n return null;\n }\n },\n\n /**\n * GeoHash 编码\n * @param coordinate 坐标点\n * @param precision 精度 (1-12)\n * @returns GeoHash 字符串\n */\n encodeGeoHash(coordinate: LatLngPoint, precision: number): string {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.encodeGeoHash(normalizeLatLng(coordinate), precision);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'GeoHash 编码');\n }\n },\n\n /**\n * 轨迹抽稀 (RDP 算法)\n * @param points 原始轨迹点\n * @param tolerance 允许误差(米)\n * @returns 简化后的轨迹点\n */\n simplifyPolyline(points: LatLngPoint[], tolerance: number): LatLng[] {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.simplifyPolyline(normalizeLatLngList(points), tolerance);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '轨迹抽稀');\n }\n },\n\n /**\n * 计算路径总长度\n * @param points 路径点\n * @returns 长度(米)\n */\n calculatePathLength(points: LatLngPoint[]): number {\n if (!nativeModule) return 0;\n try {\n return nativeModule.calculatePathLength(normalizeLatLngList(points));\n } catch (error) {\n ErrorLogger.warn('calculatePathLength 失败', { pointsCount: points.length, error });\n return 0;\n }\n },\n\n /**\n * 解析高德地图 API 返回的 Polyline 字符串\n * 格式: \"lng,lat;lng,lat;...\"\n * @param polylineStr 高德原始 polyline 字符串,或包含 polyline 属性的对象\n * @returns 解析后的点集\n */\n parsePolyline(polylineStr: string | { polyline: string }): LatLng[] {\n if (!nativeModule || !polylineStr) return [];\n try {\n // 兼容性处理:如果传入的是对象 { polyline: '...' },自动提取字符串\n let finalStr: string = '';\n if (typeof polylineStr === 'object' && polylineStr !== null && 'polyline' in polylineStr) {\n finalStr = polylineStr.polyline || '';\n } else if (typeof polylineStr === 'string') {\n finalStr = polylineStr;\n }\n\n if (!finalStr) return [];\n return nativeModule.parsePolyline(finalStr);\n } catch (error) {\n ErrorLogger.warn('解析 Polyline 失败', { polylineStr, error });\n return [];\n }\n },\n\n /**\n * 获取路径上指定距离的点\n * @param points 路径点\n * @param distance 距离起点的米数\n * @returns 点信息(坐标+角度)\n */\n getPointAtDistance(points: LatLngPoint[], distance: number): {\n latitude: number;\n longitude: number;\n angle: number;\n } | null {\n if (!nativeModule) {\n throw ErrorHandler.nativeModuleUnavailable();\n }\n try {\n return nativeModule.getPointAtDistance(normalizeLatLngList(points), distance);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, '获取路径上的点');\n }\n },\n\n /**\n * 经纬度转换为地图瓦片坐标\n * @param coordinate 经纬度点\n * @param zoom 缩放级别\n * @returns 瓦片坐标(x, y, z)\n */\n latLngToTile(coordinate: LatLngPoint, zoom: number): { x: number; y: number; z: number } | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.latLngToTile(normalizeLatLng(coordinate), zoom);\n } catch (error) {\n ErrorLogger.warn('latLngToTile 失败', { coordinate, zoom, error });\n return null;\n }\n },\n\n /**\n * 地图瓦片坐标转换为经纬度\n * @param tile 瓦片坐标(x, y, z)\n * @returns 经纬度点\n */\n tileToLatLng(tile: { x: number; y: number; z: number }): LatLng | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.tileToLatLng(tile);\n } catch (error) {\n ErrorLogger.warn('tileToLatLng 失败', { tile, error });\n return null;\n }\n },\n\n /**\n * 经纬度转换为地图像素坐标\n * @param coordinate 经纬度点\n * @param zoom 缩放级别\n * @returns 像素坐标(x, y)\n */\n latLngToPixel(coordinate: LatLngPoint, zoom: number): { x: number; y: number } | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.latLngToPixel(normalizeLatLng(coordinate), zoom);\n } catch (error) {\n ErrorLogger.warn('latLngToPixel 失败', { coordinate, zoom, error });\n return null;\n }\n },\n\n /**\n * 地图像素坐标转换为经纬度\n * @param pixel 像素坐标(x, y)\n * @param zoom 缩放级别\n * @returns 经纬度点\n */\n pixelToLatLng(pixel: { x: number; y: number }, zoom: number): LatLng | null {\n if (!nativeModule) return null;\n try {\n return nativeModule.pixelToLatLng(pixel, zoom);\n } catch (error) {\n ErrorLogger.warn('pixelToLatLng 失败', { pixel, zoom, error });\n return null;\n }\n },\n\n /**\n * 批量地理围栏检测\n * @param point 待检查的点\n * @param polygons 多边形数组,格式为 LatLngPoint[][] 或 LatLngPoint[][][]\n * @returns 包含点索引的数组(-1 表示不在任何多边形内)\n */\n findPointInPolygons(point: LatLngPoint, polygons: LatLngPoint[][] | LatLngPoint[][][]): number {\n if (!nativeModule) return -1;\n try {\n const normalizedPoint = normalizeLatLng(point);\n\n // 处理三维数组 (LatLngPoint[][][]) 和二维数组 (LatLngPoint[][])\n if (Array.isArray(polygons[0]) && Array.isArray(polygons[0][0])) {\n const normalizedMultiPolygons = (polygons as LatLngPoint[][][]).map((polygonRings) =>\n normalizeLatLngList(polygonRings)\n );\n\n for (let index = 0; index < normalizedMultiPolygons.length; index += 1) {\n if (nativeModule.isPointInPolygon(normalizedPoint, normalizedMultiPolygons[index])) {\n return index;\n }\n }\n\n return -1;\n }\n\n const normalizedPolygons = polygons as LatLngPoint[][];\n const processedPolygons = normalizedPolygons.map(p => normalizeLatLngList(p));\n return nativeModule.findPointInPolygons(normalizedPoint, processedPolygons);\n } catch (error) {\n ErrorLogger.warn('findPointInPolygons 失败', { point, error });\n return -1;\n }\n },\n\n /**\n * 生成网格聚合数据 (常用于展示网格聚合图或大规模点数据处理)\n * @param points 包含经纬度和权重的点数组\n * @param gridSizeMeters 网格大小(米)\n * @returns 包含经纬度和强度的网格点数组\n */\n generateHeatmapGrid(\n points: Array<LatLngPoint & { weight?: number }>,\n gridSizeMeters: number\n ): Array<{ latitude: number; longitude: number; intensity: number }> {\n if (!nativeModule || points.length === 0) return [];\n try {\n return nativeModule.generateHeatmapGrid(points, gridSizeMeters);\n } catch (error) {\n ErrorLogger.warn('generateHeatmapGrid 失败', { pointsCount: points.length, gridSizeMeters, error });\n return [];\n }\n },\n};\n\n/**\n* 获取最近一次 initSDK 的配置\n*/\nexport function getSDKConfig(): SDKConfig | null {\n return _sdkConfig;\n};\n\nexport type ExpoGaodeMapModule =\n Omit<NativeExpoGaodeMapModule, keyof typeof helperMethods> & typeof helperMethods;\n\nconst ExpoGaodeMapModuleWithHelpers = new Proxy(helperMethods, {\n get(target, prop, receiver) {\n if (Reflect.has(target, prop)) {\n return Reflect.get(target, prop, receiver);\n }\n const nativeModule = getNativeModule(true);\n if (!nativeModule) {\n return undefined;\n }\n\n const value = Reflect.get(nativeModule as object, prop, nativeModule as object);\n if (\n typeof prop === 'string' &&\n privacySensitiveMethodNames.has(prop) &&\n typeof value === 'function'\n ) {\n return (...args: unknown[]) => {\n assertPrivacyReady('sdk');\n return (value as (...fnArgs: unknown[]) => unknown).apply(nativeModule, args);\n };\n }\n\n return getBoundNativeValue(nativeModule, prop);\n },\n}) as ExpoGaodeMapModule;\n\n/**\n* 获取用于 Web API 的 webKey(若未初始化或未提供则返回 undefined)\n*/\nexport function getWebKey(): string | undefined {\n return _sdkConfig?.webKey;\n}\n\nexport default ExpoGaodeMapModuleWithHelpers;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGaodeMapView.d.ts","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAKX,MAAM,SAAS,CAAC;AASjB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,gBAAgB,iFAiGpB,CAAC;AAIH,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ExpoGaodeMapView.d.ts","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAMX,MAAM,SAAS,CAAC;AAUjB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAa1C;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,gBAAgB,iFAyLpB,CAAC;AAIH,eAAe,gBAAgB,CAAC"}
@@ -7,6 +7,13 @@ import { MapUI } from './components/MapUI';
7
7
  import { createLazyNativeViewManager } from './utils/lazyNativeViewManager';
8
8
  import { View, StyleSheet } from 'react-native';
9
9
  const getNativeView = createLazyNativeViewManager('ExpoGaodeMapView');
10
+ const MIN_ZOOM = 3;
11
+ const MAX_ZOOM = 20;
12
+ function estimateZoom(latitudeDelta, longitudeDelta, options) {
13
+ const span = Math.max(latitudeDelta, longitudeDelta, 0.0001);
14
+ const rawZoom = Math.log2(360 / span);
15
+ return Math.max(options?.minZoom ?? MIN_ZOOM, Math.min(options?.maxZoom ?? MAX_ZOOM, Number(rawZoom.toFixed(2))));
16
+ }
10
17
  /**
11
18
  * 高德地图视图组件,提供地图操作API和覆盖物管理功能
12
19
  *
@@ -33,49 +40,104 @@ const ExpoGaodeMapView = React.forwardRef((props, ref) => {
33
40
  const nativeRef = React.useRef(null);
34
41
  const internalRef = React.useRef(null);
35
42
  const NativeView = React.useMemo(() => getNativeView(), []);
43
+ const callNativeMethod = React.useCallback((methodName, ...args) => {
44
+ if (!nativeRef.current) {
45
+ throw ErrorHandler.mapViewNotInitialized(methodName);
46
+ }
47
+ const nativeMethod = Reflect.get(nativeRef.current, methodName, nativeRef.current);
48
+ if (typeof nativeMethod !== 'function') {
49
+ throw new Error(`Method '${methodName}' is not available on native view. Make sure the native module is linked and rebuilt.`);
50
+ }
51
+ return nativeMethod.apply(nativeRef.current, args);
52
+ }, []);
36
53
  /**
37
54
  * 🔑 性能优化:通用 API 方法包装器
38
55
  * 统一处理初始化检查和错误处理,减少重复代码
39
56
  */
40
57
  const createApiMethod = React.useCallback((methodName) => {
41
58
  return ((...args) => {
42
- if (!nativeRef.current) {
43
- throw ErrorHandler.mapViewNotInitialized(methodName);
44
- }
45
59
  try {
46
- return nativeRef.current[methodName](...args);
60
+ return callNativeMethod(methodName, ...args);
47
61
  }
48
62
  catch (error) {
49
63
  throw ErrorHandler.wrapNativeError(error, methodName);
50
64
  }
51
65
  });
52
- }, []);
66
+ }, [callNativeMethod]);
53
67
  /**
54
68
  * 使用通用包装器创建所有 API 方法
55
69
  * 所有方法共享相同的错误处理逻辑
56
70
  */
57
71
  const apiRef = React.useMemo(() => ({
58
72
  moveCamera: (position, duration) => {
59
- if (!nativeRef.current) {
60
- throw ErrorHandler.mapViewNotInitialized('moveCamera');
73
+ try {
74
+ const normalizedPosition = {
75
+ ...position,
76
+ target: position.target ? normalizeLatLng(position.target) : undefined,
77
+ };
78
+ return callNativeMethod('moveCamera', normalizedPosition, duration ?? 0);
79
+ }
80
+ catch (error) {
81
+ throw ErrorHandler.wrapNativeError(error, 'moveCamera');
61
82
  }
62
- const normalizedPosition = {
63
- ...position,
64
- target: position.target ? normalizeLatLng(position.target) : undefined,
65
- };
66
- return nativeRef.current.moveCamera(normalizedPosition, duration);
67
83
  },
68
84
  getLatLng: createApiMethod('getLatLng'),
69
85
  setCenter: (center, animated) => {
70
- if (!nativeRef.current) {
71
- throw ErrorHandler.mapViewNotInitialized('setCenter');
86
+ try {
87
+ return callNativeMethod('setCenter', normalizeLatLng(center), animated ?? false);
88
+ }
89
+ catch (error) {
90
+ throw ErrorHandler.wrapNativeError(error, 'setCenter');
91
+ }
92
+ },
93
+ setZoom: (zoom, animated) => {
94
+ try {
95
+ return callNativeMethod('setZoom', zoom, animated ?? false);
96
+ }
97
+ catch (error) {
98
+ throw ErrorHandler.wrapNativeError(error, 'setZoom');
72
99
  }
73
- return nativeRef.current.setCenter(normalizeLatLng(center), animated);
74
100
  },
75
- setZoom: createApiMethod('setZoom'),
76
101
  getCameraPosition: createApiMethod('getCameraPosition'),
77
102
  takeSnapshot: createApiMethod('takeSnapshot'),
78
- }), [createApiMethod]);
103
+ fitToCoordinates: async (points, options) => {
104
+ try {
105
+ const normalized = points.map((point) => normalizeLatLng(point));
106
+ if (normalized.length === 0) {
107
+ return;
108
+ }
109
+ const currentCamera = await callNativeMethod('getCameraPosition');
110
+ if (normalized.length === 1) {
111
+ await callNativeMethod('moveCamera', {
112
+ target: normalized[0],
113
+ zoom: options?.singlePointZoom ?? currentCamera.zoom ?? 16,
114
+ bearing: options?.preserveBearing === false ? options?.bearing : currentCamera.bearing ?? options?.bearing,
115
+ tilt: options?.preserveTilt === false ? options?.tilt : currentCamera.tilt ?? options?.tilt,
116
+ }, options?.duration ?? 0);
117
+ return;
118
+ }
119
+ const latitudes = normalized.map((point) => point.latitude);
120
+ const longitudes = normalized.map((point) => point.longitude);
121
+ const paddingFactor = options?.paddingFactor ?? 1.2;
122
+ const north = Math.max(...latitudes);
123
+ const south = Math.min(...latitudes);
124
+ const east = Math.max(...longitudes);
125
+ const west = Math.min(...longitudes);
126
+ await callNativeMethod('moveCamera', {
127
+ target: {
128
+ latitude: (north + south) / 2,
129
+ longitude: (east + west) / 2,
130
+ },
131
+ zoom: estimateZoom((north - south) * paddingFactor, (east - west) * paddingFactor, options),
132
+ bearing: options?.preserveBearing === false ? options?.bearing : currentCamera.bearing ?? options?.bearing,
133
+ tilt: options?.preserveTilt === false ? options?.tilt : currentCamera.tilt ?? options?.tilt,
134
+ }, options?.duration ?? 0);
135
+ }
136
+ catch (error) {
137
+ throw ErrorHandler.wrapNativeError(error, 'fitToCoordinates');
138
+ }
139
+ },
140
+ }), [callNativeMethod, createApiMethod]);
79
141
  /**
80
142
  * 将传入的apiRef赋值给internalRef.current
81
143
  * 用于在组件内部保存对地图API实例的引用