expo-gaode-map 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -0
- package/PUBLISHING.md +244 -0
- package/README.md +990 -0
- package/android/build.gradle +48 -0
- package/android/src/main/AndroidManifest.xml +40 -0
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapModule.kt +455 -0
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +337 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/CameraManager.kt +128 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/OverlayManager.kt +324 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +122 -0
- package/android/src/main/java/expo/modules/gaodemap/modules/LocationManager.kt +247 -0
- package/android/src/main/java/expo/modules/gaodemap/modules/SDKInitializer.kt +45 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/CircleView.kt +151 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/ClusterView.kt +127 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/HeatMapView.kt +97 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +204 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/MultiPointView.kt +103 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolygonView.kt +114 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolylineView.kt +138 -0
- package/build/ExpoGaodeMap.types.d.ts +24 -0
- package/build/ExpoGaodeMap.types.d.ts.map +1 -0
- package/build/ExpoGaodeMap.types.js +14 -0
- package/build/ExpoGaodeMap.types.js.map +1 -0
- package/build/ExpoGaodeMapModule.d.ts +7 -0
- package/build/ExpoGaodeMapModule.d.ts.map +1 -0
- package/build/ExpoGaodeMapModule.js +14 -0
- package/build/ExpoGaodeMapModule.js.map +1 -0
- package/build/ExpoGaodeMapView.d.ts +31 -0
- package/build/ExpoGaodeMapView.d.ts.map +1 -0
- package/build/ExpoGaodeMapView.js +141 -0
- package/build/ExpoGaodeMapView.js.map +1 -0
- package/build/components/overlays/Circle.d.ts +18 -0
- package/build/components/overlays/Circle.d.ts.map +1 -0
- package/build/components/overlays/Circle.js +63 -0
- package/build/components/overlays/Circle.js.map +1 -0
- package/build/components/overlays/Cluster.d.ts +22 -0
- package/build/components/overlays/Cluster.d.ts.map +1 -0
- package/build/components/overlays/Cluster.js +35 -0
- package/build/components/overlays/Cluster.js.map +1 -0
- package/build/components/overlays/HeatMap.d.ts +21 -0
- package/build/components/overlays/HeatMap.d.ts.map +1 -0
- package/build/components/overlays/HeatMap.js +34 -0
- package/build/components/overlays/HeatMap.js.map +1 -0
- package/build/components/overlays/Marker.d.ts +17 -0
- package/build/components/overlays/Marker.d.ts.map +1 -0
- package/build/components/overlays/Marker.js +57 -0
- package/build/components/overlays/Marker.js.map +1 -0
- package/build/components/overlays/MultiPoint.d.ts +21 -0
- package/build/components/overlays/MultiPoint.d.ts.map +1 -0
- package/build/components/overlays/MultiPoint.js +34 -0
- package/build/components/overlays/MultiPoint.js.map +1 -0
- package/build/components/overlays/Polygon.d.ts +22 -0
- package/build/components/overlays/Polygon.d.ts.map +1 -0
- package/build/components/overlays/Polygon.js +100 -0
- package/build/components/overlays/Polygon.js.map +1 -0
- package/build/components/overlays/Polyline.d.ts +20 -0
- package/build/components/overlays/Polyline.d.ts.map +1 -0
- package/build/components/overlays/Polyline.js +60 -0
- package/build/components/overlays/Polyline.js.map +1 -0
- package/build/components/overlays/index.d.ts +8 -0
- package/build/components/overlays/index.d.ts.map +1 -0
- package/build/components/overlays/index.js +18 -0
- package/build/components/overlays/index.js.map +1 -0
- package/build/index.d.ts +10 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +28 -0
- package/build/index.js.map +1 -0
- package/build/modules/AMapLocation.d.ts +58 -0
- package/build/modules/AMapLocation.d.ts.map +1 -0
- package/build/modules/AMapLocation.js +141 -0
- package/build/modules/AMapLocation.js.map +1 -0
- package/build/modules/AMapSDK.d.ts +27 -0
- package/build/modules/AMapSDK.d.ts.map +1 -0
- package/build/modules/AMapSDK.js +43 -0
- package/build/modules/AMapSDK.js.map +1 -0
- package/build/modules/AMapView.d.ts +39 -0
- package/build/modules/AMapView.d.ts.map +1 -0
- package/build/modules/AMapView.js +61 -0
- package/build/modules/AMapView.js.map +1 -0
- package/build/types/common.types.d.ts +133 -0
- package/build/types/common.types.d.ts.map +1 -0
- package/build/types/common.types.js +31 -0
- package/build/types/common.types.js.map +1 -0
- package/build/types/index.d.ts +12 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +17 -0
- package/build/types/index.js.map +1 -0
- package/build/types/location.types.d.ts +306 -0
- package/build/types/location.types.d.ts.map +1 -0
- package/build/types/location.types.js +93 -0
- package/build/types/location.types.js.map +1 -0
- package/build/types/map-view.types.d.ts +213 -0
- package/build/types/map-view.types.d.ts.map +1 -0
- package/build/types/map-view.types.js +6 -0
- package/build/types/map-view.types.js.map +1 -0
- package/build/types/overlays.types.d.ts +296 -0
- package/build/types/overlays.types.d.ts.map +1 -0
- package/build/types/overlays.types.js +6 -0
- package/build/types/overlays.types.js.map +1 -0
- package/build/types/sdk.types.d.ts +113 -0
- package/build/types/sdk.types.d.ts.map +1 -0
- package/build/types/sdk.types.js +6 -0
- package/build/types/sdk.types.js.map +1 -0
- package/docs/followUserLocation.md +186 -0
- package/expo-module.config.json +9 -0
- package/ios/ExpoGaodeMap.podspec +29 -0
- package/ios/ExpoGaodeMapModule.swift +48 -0
- package/ios/ExpoGaodeMapView.swift +38 -0
- package/package.json +45 -0
- package/src/ExpoGaodeMap.types.ts +68 -0
- package/src/ExpoGaodeMapModule.ts +21 -0
- package/src/ExpoGaodeMapView.tsx +151 -0
- package/src/components/overlays/Circle.tsx +73 -0
- package/src/components/overlays/Cluster.tsx +38 -0
- package/src/components/overlays/HeatMap.tsx +37 -0
- package/src/components/overlays/Marker.tsx +66 -0
- package/src/components/overlays/MultiPoint.tsx +37 -0
- package/src/components/overlays/Polygon.tsx +107 -0
- package/src/components/overlays/Polyline.tsx +69 -0
- package/src/components/overlays/index.ts +18 -0
- package/src/index.ts +55 -0
- package/src/modules/AMapLocation.ts +164 -0
- package/src/modules/AMapSDK.ts +48 -0
- package/src/modules/AMapView.ts +68 -0
- package/src/types/README.md +186 -0
- package/src/types/common.types.ts +155 -0
- package/src/types/index.ts +74 -0
- package/src/types/location.types.ts +364 -0
- package/src/types/map-view.types.ts +249 -0
- package/src/types/overlays.types.ts +346 -0
- package/src/types/sdk.types.ts +128 -0
- package/tsconfig.json +9 -0
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ExpoGaodeMap.types';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export { default as ExpoGaodeMapModule } from './ExpoGaodeMapModule';
|
|
4
|
+
export { default as AMapSDK, initSDK, setApiKey, getVersion } from './modules/AMapSDK';
|
|
5
|
+
export { default as AMapLocation, configure, start, stop, isStarted, getCurrentLocation, addLocationListener, coordinateConvert, startUpdatingHeading, stopUpdatingHeading, } from './modules/AMapLocation';
|
|
6
|
+
export { default as MapView } from './ExpoGaodeMapView';
|
|
7
|
+
export type { MapViewRef } from './ExpoGaodeMapView';
|
|
8
|
+
export { Marker, Polyline, Polygon, Circle, HeatMap, MultiPoint, Cluster, } from './components/overlays';
|
|
9
|
+
export { default } from './ExpoGaodeMapModule';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGvF,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,SAAS,EACT,KAAK,EACL,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,OAAO,GACR,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
+
* @Date : 2025-11-13 14:45:15
|
|
4
|
+
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
+
* @LastEditTime : 2025-11-13 18:26:20
|
|
6
|
+
* @FilePath : /expo-gaode-map/src/index.ts
|
|
7
|
+
* @Description : 高德地图 Expo Module 主导出文件
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
+
*/
|
|
11
|
+
// 导出类型定义
|
|
12
|
+
export * from './ExpoGaodeMap.types';
|
|
13
|
+
export * from './types';
|
|
14
|
+
// 导出原生模块
|
|
15
|
+
export { default as ExpoGaodeMapModule } from './ExpoGaodeMapModule';
|
|
16
|
+
// 导出 SDK 模块
|
|
17
|
+
export { default as AMapSDK, initSDK, setApiKey, getVersion } from './modules/AMapSDK';
|
|
18
|
+
// 导出定位模块
|
|
19
|
+
export { default as AMapLocation, configure, start, stop, isStarted, getCurrentLocation, addLocationListener, coordinateConvert, startUpdatingHeading, stopUpdatingHeading, } from './modules/AMapLocation';
|
|
20
|
+
// 地图视图控制已移至 MapView 的 ref 调用
|
|
21
|
+
// 使用方式: const mapRef = useRef<MapViewRef>(null); mapRef.current.moveCamera() 等
|
|
22
|
+
// 导出地图视图组件
|
|
23
|
+
export { default as MapView } from './ExpoGaodeMapView';
|
|
24
|
+
// 导出覆盖物组件
|
|
25
|
+
export { Marker, Polyline, Polygon, Circle, HeatMap, MultiPoint, Cluster, } from './components/overlays';
|
|
26
|
+
// 默认导出:直接重新导出所有模块
|
|
27
|
+
export { default } from './ExpoGaodeMapModule';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,SAAS;AACT,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AAExB,SAAS;AACT,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvF,SAAS;AACT,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,SAAS,EACT,KAAK,EACL,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,6BAA6B;AAC7B,+EAA+E;AAE/E,WAAW;AACX,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGxD,UAAU;AACV,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,OAAO,GACR,MAAM,uBAAuB,CAAC;AAE/B,kBAAkB;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * @Author : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @Date : 2025-11-13 14:45:15\n * @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @LastEditTime : 2025-11-13 18:26:20\n * @FilePath : /expo-gaode-map/src/index.ts\n * @Description : 高德地图 Expo Module 主导出文件\n * \n * Copyright (c) 2025 by 尚博信_王强, All Rights Reserved. \n */\n\n// 导出类型定义\nexport * from './ExpoGaodeMap.types';\nexport * from './types';\n\n// 导出原生模块\nexport { default as ExpoGaodeMapModule } from './ExpoGaodeMapModule';\n\n// 导出 SDK 模块\nexport { default as AMapSDK, initSDK, setApiKey, getVersion } from './modules/AMapSDK';\n\n// 导出定位模块\nexport {\n default as AMapLocation,\n configure,\n start,\n stop,\n isStarted,\n getCurrentLocation,\n addLocationListener,\n coordinateConvert,\n startUpdatingHeading,\n stopUpdatingHeading,\n} from './modules/AMapLocation';\n\n// 地图视图控制已移至 MapView 的 ref 调用\n// 使用方式: const mapRef = useRef<MapViewRef>(null); mapRef.current.moveCamera() 等\n\n// 导出地图视图组件\nexport { default as MapView } from './ExpoGaodeMapView';\nexport type { MapViewRef } from './ExpoGaodeMapView';\n\n// 导出覆盖物组件\nexport {\n Marker,\n Polyline,\n Polygon,\n Circle,\n HeatMap,\n MultiPoint,\n Cluster,\n} from './components/overlays';\n\n// 默认导出:直接重新导出所有模块\nexport { default } from './ExpoGaodeMapModule';\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { EventSubscription } from 'expo-modules-core';
|
|
2
|
+
import type { Coordinates, ReGeocode, LocationOptions, LocationListener, LatLng, CoordinateType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 配置定位选项
|
|
5
|
+
*/
|
|
6
|
+
export declare function configure(options: LocationOptions): void;
|
|
7
|
+
/**
|
|
8
|
+
* 开始连续定位
|
|
9
|
+
*/
|
|
10
|
+
export declare function start(): void;
|
|
11
|
+
/**
|
|
12
|
+
* 停止定位
|
|
13
|
+
*/
|
|
14
|
+
export declare function stop(): void;
|
|
15
|
+
/**
|
|
16
|
+
* 是否正在定位
|
|
17
|
+
*/
|
|
18
|
+
export declare function isStarted(): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* 获取当前位置(单次定位)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCurrentLocation(): Promise<Coordinates | ReGeocode>;
|
|
23
|
+
/**
|
|
24
|
+
* 添加定位监听器
|
|
25
|
+
*/
|
|
26
|
+
export declare function addLocationListener(listener: LocationListener): EventSubscription;
|
|
27
|
+
/**
|
|
28
|
+
* 坐标转换
|
|
29
|
+
*/
|
|
30
|
+
export declare function coordinateConvert(coordinate: LatLng, type: CoordinateType): Promise<LatLng>;
|
|
31
|
+
/**
|
|
32
|
+
* 开始获取设备朝向
|
|
33
|
+
* @platform ios
|
|
34
|
+
*/
|
|
35
|
+
export declare function startUpdatingHeading(): void;
|
|
36
|
+
/**
|
|
37
|
+
* 停止获取设备朝向
|
|
38
|
+
* @platform ios
|
|
39
|
+
*/
|
|
40
|
+
export declare function stopUpdatingHeading(): void;
|
|
41
|
+
/**
|
|
42
|
+
* 设置 API Key
|
|
43
|
+
*/
|
|
44
|
+
export declare function setApiKey(key: string): void;
|
|
45
|
+
declare const _default: {
|
|
46
|
+
configure: typeof configure;
|
|
47
|
+
start: typeof start;
|
|
48
|
+
stop: typeof stop;
|
|
49
|
+
isStarted: typeof isStarted;
|
|
50
|
+
getCurrentLocation: typeof getCurrentLocation;
|
|
51
|
+
addLocationListener: typeof addLocationListener;
|
|
52
|
+
coordinateConvert: typeof coordinateConvert;
|
|
53
|
+
startUpdatingHeading: typeof startUpdatingHeading;
|
|
54
|
+
stopUpdatingHeading: typeof stopUpdatingHeading;
|
|
55
|
+
setApiKey: typeof setApiKey;
|
|
56
|
+
};
|
|
57
|
+
export default _default;
|
|
58
|
+
//# sourceMappingURL=AMapLocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AMapLocation.d.ts","sourceRoot":"","sources":["../../src/modules/AMapLocation.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,cAAc,EACf,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAuDxD;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAElD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,iBAAiB,CAIjF;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;;;;;;;;;;;;;AAED,wBAWE"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
+
* @Date : 2025-11-13 14:42:10
|
|
4
|
+
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
+
* @LastEditTime : 2025-11-13 14:42:15
|
|
6
|
+
* @FilePath : /expo-gaode-map/src/modules/AMapLocation.ts
|
|
7
|
+
* @Description : 高德地图定位模块
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
+
*/
|
|
11
|
+
import ExpoGaodeMapModule from '../ExpoGaodeMapModule';
|
|
12
|
+
/**
|
|
13
|
+
* 配置定位选项
|
|
14
|
+
*/
|
|
15
|
+
export function configure(options) {
|
|
16
|
+
if (options.withReGeocode !== undefined) {
|
|
17
|
+
ExpoGaodeMapModule.setLocatingWithReGeocode?.(options.withReGeocode);
|
|
18
|
+
}
|
|
19
|
+
if (options.accuracy !== undefined) {
|
|
20
|
+
ExpoGaodeMapModule.setDesiredAccuracy?.(options.accuracy);
|
|
21
|
+
}
|
|
22
|
+
if (options.mode !== undefined) {
|
|
23
|
+
ExpoGaodeMapModule.setLocationMode?.(options.mode);
|
|
24
|
+
}
|
|
25
|
+
if (options.onceLocation !== undefined) {
|
|
26
|
+
ExpoGaodeMapModule.setOnceLocation?.(options.onceLocation);
|
|
27
|
+
}
|
|
28
|
+
if (options.interval !== undefined) {
|
|
29
|
+
ExpoGaodeMapModule.setInterval?.(options.interval);
|
|
30
|
+
}
|
|
31
|
+
if (options.timeout !== undefined) {
|
|
32
|
+
ExpoGaodeMapModule.setLocationTimeout?.(options.timeout);
|
|
33
|
+
}
|
|
34
|
+
if (options.reGeocodeTimeout !== undefined) {
|
|
35
|
+
ExpoGaodeMapModule.setReGeocodeTimeout?.(options.reGeocodeTimeout);
|
|
36
|
+
}
|
|
37
|
+
if (options.distanceFilter !== undefined) {
|
|
38
|
+
ExpoGaodeMapModule.setDistanceFilter?.(options.distanceFilter);
|
|
39
|
+
}
|
|
40
|
+
if (options.sensorEnable !== undefined) {
|
|
41
|
+
ExpoGaodeMapModule.setSensorEnable?.(options.sensorEnable);
|
|
42
|
+
}
|
|
43
|
+
if (options.wifiScan !== undefined) {
|
|
44
|
+
ExpoGaodeMapModule.setWifiScan?.(options.wifiScan);
|
|
45
|
+
}
|
|
46
|
+
if (options.gpsFirst !== undefined) {
|
|
47
|
+
ExpoGaodeMapModule.setGpsFirst?.(options.gpsFirst);
|
|
48
|
+
}
|
|
49
|
+
if (options.onceLocationLatest !== undefined) {
|
|
50
|
+
ExpoGaodeMapModule.setOnceLocationLatest?.(options.onceLocationLatest);
|
|
51
|
+
}
|
|
52
|
+
if (options.geoLanguage !== undefined) {
|
|
53
|
+
ExpoGaodeMapModule.setGeoLanguage?.(options.geoLanguage);
|
|
54
|
+
}
|
|
55
|
+
if (options.allowsBackgroundLocationUpdates !== undefined) {
|
|
56
|
+
ExpoGaodeMapModule.setAllowsBackgroundLocationUpdates?.(options.allowsBackgroundLocationUpdates);
|
|
57
|
+
}
|
|
58
|
+
if (options.pausesLocationUpdatesAutomatically !== undefined) {
|
|
59
|
+
ExpoGaodeMapModule.setPausesLocationUpdatesAutomatically?.(options.pausesLocationUpdatesAutomatically);
|
|
60
|
+
}
|
|
61
|
+
if (options.locationCacheEnable !== undefined) {
|
|
62
|
+
ExpoGaodeMapModule.setLocationCacheEnable?.(options.locationCacheEnable);
|
|
63
|
+
}
|
|
64
|
+
if (options.httpTimeout !== undefined) {
|
|
65
|
+
ExpoGaodeMapModule.setHttpTimeOut?.(options.httpTimeout);
|
|
66
|
+
}
|
|
67
|
+
if (options.protocol !== undefined) {
|
|
68
|
+
ExpoGaodeMapModule.setLocationProtocol?.(options.protocol);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 开始连续定位
|
|
73
|
+
*/
|
|
74
|
+
export function start() {
|
|
75
|
+
ExpoGaodeMapModule.start?.();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 停止定位
|
|
79
|
+
*/
|
|
80
|
+
export function stop() {
|
|
81
|
+
ExpoGaodeMapModule.stop?.();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 是否正在定位
|
|
85
|
+
*/
|
|
86
|
+
export async function isStarted() {
|
|
87
|
+
return ExpoGaodeMapModule.isStarted?.() || Promise.resolve(false);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 获取当前位置(单次定位)
|
|
91
|
+
*/
|
|
92
|
+
export async function getCurrentLocation() {
|
|
93
|
+
return ExpoGaodeMapModule.getCurrentLocation?.();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* 添加定位监听器
|
|
97
|
+
*/
|
|
98
|
+
export function addLocationListener(listener) {
|
|
99
|
+
return ExpoGaodeMapModule.addListener?.('onLocationUpdate', listener) || {
|
|
100
|
+
remove: () => { },
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 坐标转换
|
|
105
|
+
*/
|
|
106
|
+
export async function coordinateConvert(coordinate, type) {
|
|
107
|
+
return ExpoGaodeMapModule.coordinateConvert?.(coordinate, type) || Promise.resolve(coordinate);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 开始获取设备朝向
|
|
111
|
+
* @platform ios
|
|
112
|
+
*/
|
|
113
|
+
export function startUpdatingHeading() {
|
|
114
|
+
ExpoGaodeMapModule.startUpdatingHeading?.();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 停止获取设备朝向
|
|
118
|
+
* @platform ios
|
|
119
|
+
*/
|
|
120
|
+
export function stopUpdatingHeading() {
|
|
121
|
+
ExpoGaodeMapModule.stopUpdatingHeading?.();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 设置 API Key
|
|
125
|
+
*/
|
|
126
|
+
export function setApiKey(key) {
|
|
127
|
+
ExpoGaodeMapModule.setApiKey?.(key);
|
|
128
|
+
}
|
|
129
|
+
export default {
|
|
130
|
+
configure,
|
|
131
|
+
start,
|
|
132
|
+
stop,
|
|
133
|
+
isStarted,
|
|
134
|
+
getCurrentLocation,
|
|
135
|
+
addLocationListener,
|
|
136
|
+
coordinateConvert,
|
|
137
|
+
startUpdatingHeading,
|
|
138
|
+
stopUpdatingHeading,
|
|
139
|
+
setApiKey,
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=AMapLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AMapLocation.js","sourceRoot":"","sources":["../../src/modules/AMapLocation.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * @Author : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @Date : 2025-11-13 14:42:10\n * @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @LastEditTime : 2025-11-13 14:42:15\n * @FilePath : /expo-gaode-map/src/modules/AMapLocation.ts\n * @Description : 高德地图定位模块\n * \n * Copyright (c) 2025 by 尚博信_王强, All Rights Reserved. \n */\n\nimport { EventSubscription } from 'expo-modules-core';\nimport ExpoGaodeMapModule from '../ExpoGaodeMapModule';\nimport type {\n Coordinates,\n ReGeocode,\n LocationOptions,\n LocationListener,\n LatLng,\n CoordinateType,\n} from '../types';\n\n/**\n * 配置定位选项\n */\nexport function configure(options: LocationOptions): void {\n if (options.withReGeocode !== undefined) {\n ExpoGaodeMapModule.setLocatingWithReGeocode?.(options.withReGeocode);\n }\n if (options.accuracy !== undefined) {\n ExpoGaodeMapModule.setDesiredAccuracy?.(options.accuracy);\n }\n if (options.mode !== undefined) {\n ExpoGaodeMapModule.setLocationMode?.(options.mode);\n }\n if (options.onceLocation !== undefined) {\n ExpoGaodeMapModule.setOnceLocation?.(options.onceLocation);\n }\n if (options.interval !== undefined) {\n ExpoGaodeMapModule.setInterval?.(options.interval);\n }\n if (options.timeout !== undefined) {\n ExpoGaodeMapModule.setLocationTimeout?.(options.timeout);\n }\n if (options.reGeocodeTimeout !== undefined) {\n ExpoGaodeMapModule.setReGeocodeTimeout?.(options.reGeocodeTimeout);\n }\n if (options.distanceFilter !== undefined) {\n ExpoGaodeMapModule.setDistanceFilter?.(options.distanceFilter);\n }\n if (options.sensorEnable !== undefined) {\n ExpoGaodeMapModule.setSensorEnable?.(options.sensorEnable);\n }\n if (options.wifiScan !== undefined) {\n ExpoGaodeMapModule.setWifiScan?.(options.wifiScan);\n }\n if (options.gpsFirst !== undefined) {\n ExpoGaodeMapModule.setGpsFirst?.(options.gpsFirst);\n }\n if (options.onceLocationLatest !== undefined) {\n ExpoGaodeMapModule.setOnceLocationLatest?.(options.onceLocationLatest);\n }\n if (options.geoLanguage !== undefined) {\n ExpoGaodeMapModule.setGeoLanguage?.(options.geoLanguage);\n }\n if (options.allowsBackgroundLocationUpdates !== undefined) {\n ExpoGaodeMapModule.setAllowsBackgroundLocationUpdates?.(options.allowsBackgroundLocationUpdates);\n }\n if (options.pausesLocationUpdatesAutomatically !== undefined) {\n ExpoGaodeMapModule.setPausesLocationUpdatesAutomatically?.(options.pausesLocationUpdatesAutomatically);\n }\n if (options.locationCacheEnable !== undefined) {\n ExpoGaodeMapModule.setLocationCacheEnable?.(options.locationCacheEnable);\n }\n if (options.httpTimeout !== undefined) {\n ExpoGaodeMapModule.setHttpTimeOut?.(options.httpTimeout);\n }\n if (options.protocol !== undefined) {\n ExpoGaodeMapModule.setLocationProtocol?.(options.protocol);\n }\n}\n\n/**\n * 开始连续定位\n */\nexport function start(): void {\n ExpoGaodeMapModule.start?.();\n}\n\n/**\n * 停止定位\n */\nexport function stop(): void {\n ExpoGaodeMapModule.stop?.();\n}\n\n/**\n * 是否正在定位\n */\nexport async function isStarted(): Promise<boolean> {\n return ExpoGaodeMapModule.isStarted?.() || Promise.resolve(false);\n}\n\n/**\n * 获取当前位置(单次定位)\n */\nexport async function getCurrentLocation(): Promise<Coordinates | ReGeocode> {\n return ExpoGaodeMapModule.getCurrentLocation?.();\n}\n\n/**\n * 添加定位监听器\n */\nexport function addLocationListener(listener: LocationListener): EventSubscription {\n return ExpoGaodeMapModule.addListener?.('onLocationUpdate', listener) || {\n remove: () => {},\n } as EventSubscription;\n}\n\n/**\n * 坐标转换\n */\nexport async function coordinateConvert(\n coordinate: LatLng,\n type: CoordinateType\n): Promise<LatLng> {\n return ExpoGaodeMapModule.coordinateConvert?.(coordinate, type) || Promise.resolve(coordinate);\n}\n\n/**\n * 开始获取设备朝向\n * @platform ios\n */\nexport function startUpdatingHeading(): void {\n ExpoGaodeMapModule.startUpdatingHeading?.();\n}\n\n/**\n * 停止获取设备朝向\n * @platform ios\n */\nexport function stopUpdatingHeading(): void {\n ExpoGaodeMapModule.stopUpdatingHeading?.();\n}\n\n/**\n * 设置 API Key\n */\nexport function setApiKey(key: string): void {\n ExpoGaodeMapModule.setApiKey?.(key);\n}\n\nexport default {\n configure,\n start,\n stop,\n isStarted,\n getCurrentLocation,\n addLocationListener,\n coordinateConvert,\n startUpdatingHeading,\n stopUpdatingHeading,\n setApiKey,\n};\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图 SDK 模块
|
|
3
|
+
* 基于 Expo Modules 实现
|
|
4
|
+
*/
|
|
5
|
+
import type { SDKConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 初始化高德地图 SDK
|
|
8
|
+
* @param config SDK 配置
|
|
9
|
+
*/
|
|
10
|
+
export declare function initSDK(config: SDKConfig): void;
|
|
11
|
+
/**
|
|
12
|
+
* 设置 API Key
|
|
13
|
+
* @param key API 密钥
|
|
14
|
+
*/
|
|
15
|
+
export declare function setApiKey(key: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* 获取 SDK 版本号
|
|
18
|
+
* @returns SDK 版本
|
|
19
|
+
*/
|
|
20
|
+
export declare function getVersion(): Promise<string>;
|
|
21
|
+
declare const _default: {
|
|
22
|
+
initSDK: typeof initSDK;
|
|
23
|
+
setApiKey: typeof setApiKey;
|
|
24
|
+
getVersion: typeof getVersion;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
27
|
+
//# sourceMappingURL=AMapSDK.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AMapSDK.d.ts","sourceRoot":"","sources":["../../src/modules/AMapSDK.ts"],"names":[],"mappings":"AAUA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAG/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElD;;;;;;AAED,wBAIE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
+
* @Date : 2025-11-13 14:41:55
|
|
4
|
+
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
+
* @LastEditTime : 2025-11-13 14:42:00
|
|
6
|
+
* @FilePath : /expo-gaode-map/src/modules/AMapSDK.ts
|
|
7
|
+
* @Description :
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* 高德地图 SDK 模块
|
|
13
|
+
* 基于 Expo Modules 实现
|
|
14
|
+
*/
|
|
15
|
+
import ExpoGaodeMapModule from '../ExpoGaodeMapModule';
|
|
16
|
+
/**
|
|
17
|
+
* 初始化高德地图 SDK
|
|
18
|
+
* @param config SDK 配置
|
|
19
|
+
*/
|
|
20
|
+
export function initSDK(config) {
|
|
21
|
+
const apiKey = config.iosKey || config.androidKey || '';
|
|
22
|
+
ExpoGaodeMapModule.setApiKey?.(apiKey);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 设置 API Key
|
|
26
|
+
* @param key API 密钥
|
|
27
|
+
*/
|
|
28
|
+
export function setApiKey(key) {
|
|
29
|
+
ExpoGaodeMapModule.setApiKey?.(key);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 获取 SDK 版本号
|
|
33
|
+
* @returns SDK 版本
|
|
34
|
+
*/
|
|
35
|
+
export async function getVersion() {
|
|
36
|
+
return ExpoGaodeMapModule.getVersion?.() || Promise.resolve('unknown');
|
|
37
|
+
}
|
|
38
|
+
export default {
|
|
39
|
+
initSDK,
|
|
40
|
+
setApiKey,
|
|
41
|
+
getVersion,
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=AMapSDK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AMapSDK.js","sourceRoot":"","sources":["../../src/modules/AMapSDK.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH;;;GAGG;AAEH,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAGvD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,MAAiB;IACvC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IACxD,kBAAkB,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,kBAAkB,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,OAAO,kBAAkB,CAAC,UAAU,EAAE,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACzE,CAAC;AAED,eAAe;IACb,OAAO;IACP,SAAS;IACT,UAAU;CACX,CAAC","sourcesContent":["/*\n * @Author : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @Date : 2025-11-13 14:41:55\n * @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @LastEditTime : 2025-11-13 14:42:00\n * @FilePath : /expo-gaode-map/src/modules/AMapSDK.ts\n * @Description : \n * \n * Copyright (c) 2025 by 尚博信_王强, All Rights Reserved. \n */\n/**\n * 高德地图 SDK 模块\n * 基于 Expo Modules 实现\n */\n\nimport ExpoGaodeMapModule from '../ExpoGaodeMapModule';\nimport type { SDKConfig } from '../types';\n\n/**\n * 初始化高德地图 SDK\n * @param config SDK 配置\n */\nexport function initSDK(config: SDKConfig): void {\n const apiKey = config.iosKey || config.androidKey || '';\n ExpoGaodeMapModule.setApiKey?.(apiKey);\n}\n\n/**\n * 设置 API Key\n * @param key API 密钥\n */\nexport function setApiKey(key: string): void {\n ExpoGaodeMapModule.setApiKey?.(key);\n}\n\n/**\n * 获取 SDK 版本号\n * @returns SDK 版本\n */\nexport async function getVersion(): Promise<string> {\n return ExpoGaodeMapModule.getVersion?.() || Promise.resolve('unknown');\n}\n\nexport default {\n initSDK,\n setApiKey,\n getVersion,\n};\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { CameraPosition, Point, LatLng } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 移动地图相机到指定位置
|
|
4
|
+
* @param cameraPosition 相机位置参数
|
|
5
|
+
* @param duration 动画时长(毫秒),默认为0(无动画)
|
|
6
|
+
*/
|
|
7
|
+
export declare function moveCamera(cameraPosition: CameraPosition, duration?: number): void;
|
|
8
|
+
/**
|
|
9
|
+
* 将屏幕坐标转换为地理坐标
|
|
10
|
+
* @param point 屏幕坐标点
|
|
11
|
+
* @returns 地理坐标
|
|
12
|
+
*/
|
|
13
|
+
export declare function getLatLng(point: Point): Promise<LatLng>;
|
|
14
|
+
/**
|
|
15
|
+
* 设置地图中心点
|
|
16
|
+
* @param center 中心点坐标
|
|
17
|
+
* @param animated 是否使用动画
|
|
18
|
+
*/
|
|
19
|
+
export declare function setCenter(center: LatLng, animated?: boolean): void;
|
|
20
|
+
/**
|
|
21
|
+
* 设置地图缩放级别
|
|
22
|
+
* @param zoom 缩放级别(3-20)
|
|
23
|
+
* @param animated 是否使用动画
|
|
24
|
+
*/
|
|
25
|
+
export declare function setZoom(zoom: number, animated?: boolean): void;
|
|
26
|
+
/**
|
|
27
|
+
* 获取当前地图状态
|
|
28
|
+
* @returns 当前相机位置
|
|
29
|
+
*/
|
|
30
|
+
export declare function getCameraPosition(): Promise<CameraPosition>;
|
|
31
|
+
declare const _default: {
|
|
32
|
+
moveCamera: typeof moveCamera;
|
|
33
|
+
getLatLng: typeof getLatLng;
|
|
34
|
+
setCenter: typeof setCenter;
|
|
35
|
+
setZoom: typeof setZoom;
|
|
36
|
+
getCameraPosition: typeof getCameraPosition;
|
|
37
|
+
};
|
|
38
|
+
export default _default;
|
|
39
|
+
//# sourceMappingURL=AMapView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AMapView.d.ts","sourceRoot":"","sources":["../../src/modules/AMapView.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,IAAI,CAE7E;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAO,GAAG,IAAI,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,UAAO,GAAG,IAAI,CAE3D;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC,CAKjE;;;;;;;;AAED,wBAME"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
+
* @Date : 2025-11-13 14:57:30
|
|
4
|
+
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
+
* @LastEditTime : 2025-11-13 14:57:35
|
|
6
|
+
* @FilePath : /expo-gaode-map/src/modules/AMapView.ts
|
|
7
|
+
* @Description : 高德地图视图控制模块
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
+
*/
|
|
11
|
+
import ExpoGaodeMapModule from '../ExpoGaodeMapModule';
|
|
12
|
+
/**
|
|
13
|
+
* 移动地图相机到指定位置
|
|
14
|
+
* @param cameraPosition 相机位置参数
|
|
15
|
+
* @param duration 动画时长(毫秒),默认为0(无动画)
|
|
16
|
+
*/
|
|
17
|
+
export function moveCamera(cameraPosition, duration = 0) {
|
|
18
|
+
ExpoGaodeMapModule.moveCamera?.(cameraPosition, duration);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 将屏幕坐标转换为地理坐标
|
|
22
|
+
* @param point 屏幕坐标点
|
|
23
|
+
* @returns 地理坐标
|
|
24
|
+
*/
|
|
25
|
+
export async function getLatLng(point) {
|
|
26
|
+
return ExpoGaodeMapModule.getLatLng?.(point) || Promise.resolve({ latitude: 0, longitude: 0 });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 设置地图中心点
|
|
30
|
+
* @param center 中心点坐标
|
|
31
|
+
* @param animated 是否使用动画
|
|
32
|
+
*/
|
|
33
|
+
export function setCenter(center, animated = true) {
|
|
34
|
+
ExpoGaodeMapModule.setCenter?.(center, animated);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 设置地图缩放级别
|
|
38
|
+
* @param zoom 缩放级别(3-20)
|
|
39
|
+
* @param animated 是否使用动画
|
|
40
|
+
*/
|
|
41
|
+
export function setZoom(zoom, animated = true) {
|
|
42
|
+
ExpoGaodeMapModule.setZoom?.(zoom, animated);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 获取当前地图状态
|
|
46
|
+
* @returns 当前相机位置
|
|
47
|
+
*/
|
|
48
|
+
export async function getCameraPosition() {
|
|
49
|
+
return ExpoGaodeMapModule.getCameraPosition?.() || Promise.resolve({
|
|
50
|
+
target: { latitude: 0, longitude: 0 },
|
|
51
|
+
zoom: 10,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export default {
|
|
55
|
+
moveCamera,
|
|
56
|
+
getLatLng,
|
|
57
|
+
setCenter,
|
|
58
|
+
setZoom,
|
|
59
|
+
getCameraPosition,
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=AMapView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AMapView.js","sourceRoot":"","sources":["../../src/modules/AMapView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,cAA8B,EAAE,QAAQ,GAAG,CAAC;IACrE,kBAAkB,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAY;IAC1C,OAAO,kBAAkB,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AACjG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,QAAQ,GAAG,IAAI;IACvD,kBAAkB,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,QAAQ,GAAG,IAAI;IACnD,kBAAkB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,kBAAkB,CAAC,iBAAiB,EAAE,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC;QACjE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;QACrC,IAAI,EAAE,EAAE;KACT,CAAC,CAAC;AACL,CAAC;AAED,eAAe;IACb,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,iBAAiB;CAClB,CAAC","sourcesContent":["/*\n * @Author : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @Date : 2025-11-13 14:57:30\n * @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com\n * @LastEditTime : 2025-11-13 14:57:35\n * @FilePath : /expo-gaode-map/src/modules/AMapView.ts\n * @Description : 高德地图视图控制模块\n * \n * Copyright (c) 2025 by 尚博信_王强, All Rights Reserved. \n */\n\nimport ExpoGaodeMapModule from '../ExpoGaodeMapModule';\nimport type { CameraPosition, Point, LatLng } from '../types';\n\n/**\n * 移动地图相机到指定位置\n * @param cameraPosition 相机位置参数\n * @param duration 动画时长(毫秒),默认为0(无动画)\n */\nexport function moveCamera(cameraPosition: CameraPosition, duration = 0): void {\n ExpoGaodeMapModule.moveCamera?.(cameraPosition, duration);\n}\n\n/**\n * 将屏幕坐标转换为地理坐标\n * @param point 屏幕坐标点\n * @returns 地理坐标\n */\nexport async function getLatLng(point: Point): Promise<LatLng> {\n return ExpoGaodeMapModule.getLatLng?.(point) || Promise.resolve({ latitude: 0, longitude: 0 });\n}\n\n/**\n * 设置地图中心点\n * @param center 中心点坐标\n * @param animated 是否使用动画\n */\nexport function setCenter(center: LatLng, animated = true): void {\n ExpoGaodeMapModule.setCenter?.(center, animated);\n}\n\n/**\n * 设置地图缩放级别\n * @param zoom 缩放级别(3-20)\n * @param animated 是否使用动画\n */\nexport function setZoom(zoom: number, animated = true): void {\n ExpoGaodeMapModule.setZoom?.(zoom, animated);\n}\n\n/**\n * 获取当前地图状态\n * @returns 当前相机位置\n */\nexport async function getCameraPosition(): Promise<CameraPosition> {\n return ExpoGaodeMapModule.getCameraPosition?.() || Promise.resolve({\n target: { latitude: 0, longitude: 0 },\n zoom: 10,\n });\n}\n\nexport default {\n moveCamera,\n getLatLng,\n setCenter,\n setZoom,\n getCameraPosition,\n};\n"]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图通用类型定义
|
|
3
|
+
* 基于 Expo Modules API
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 点坐标(屏幕坐标)
|
|
7
|
+
*/
|
|
8
|
+
export interface Point {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 地理坐标
|
|
14
|
+
*/
|
|
15
|
+
export interface LatLng {
|
|
16
|
+
/**
|
|
17
|
+
* 纬度
|
|
18
|
+
*/
|
|
19
|
+
latitude: number;
|
|
20
|
+
/**
|
|
21
|
+
* 经度
|
|
22
|
+
*/
|
|
23
|
+
longitude: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 地图标注点(POI)
|
|
27
|
+
*/
|
|
28
|
+
export interface MapPoi {
|
|
29
|
+
/**
|
|
30
|
+
* 标注点 ID
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* 标注点名称
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* 标注点坐标
|
|
39
|
+
*/
|
|
40
|
+
position: LatLng;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 矩形坐标边界
|
|
44
|
+
*/
|
|
45
|
+
export interface LatLngBounds {
|
|
46
|
+
/**
|
|
47
|
+
* 西南坐标
|
|
48
|
+
*/
|
|
49
|
+
southwest: LatLng;
|
|
50
|
+
/**
|
|
51
|
+
* 东北坐标
|
|
52
|
+
*/
|
|
53
|
+
northeast: LatLng;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 地图相机位置
|
|
57
|
+
*/
|
|
58
|
+
export interface CameraPosition {
|
|
59
|
+
/**
|
|
60
|
+
* 中心坐标
|
|
61
|
+
*/
|
|
62
|
+
target?: LatLng;
|
|
63
|
+
/**
|
|
64
|
+
* 缩放级别(3-20)
|
|
65
|
+
*/
|
|
66
|
+
zoom?: number;
|
|
67
|
+
/**
|
|
68
|
+
* 朝向、旋转角度(0-360度)
|
|
69
|
+
*/
|
|
70
|
+
bearing?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 倾斜角度(0-60度)
|
|
73
|
+
*/
|
|
74
|
+
tilt?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 地图类型
|
|
78
|
+
*/
|
|
79
|
+
export declare enum MapType {
|
|
80
|
+
/**
|
|
81
|
+
* 标准地图
|
|
82
|
+
*/
|
|
83
|
+
Standard = 0,
|
|
84
|
+
/**
|
|
85
|
+
* 卫星地图
|
|
86
|
+
*/
|
|
87
|
+
Satellite = 1,
|
|
88
|
+
/**
|
|
89
|
+
* 夜间地图
|
|
90
|
+
*/
|
|
91
|
+
Night = 2,
|
|
92
|
+
/**
|
|
93
|
+
* 导航地图
|
|
94
|
+
*/
|
|
95
|
+
Navi = 3,
|
|
96
|
+
/**
|
|
97
|
+
* 公交地图
|
|
98
|
+
*/
|
|
99
|
+
Bus = 4
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 定位信息(基础)
|
|
103
|
+
*/
|
|
104
|
+
export interface Location extends LatLng {
|
|
105
|
+
/**
|
|
106
|
+
* 精度(米)
|
|
107
|
+
*/
|
|
108
|
+
accuracy: number;
|
|
109
|
+
/**
|
|
110
|
+
* 朝向(度)
|
|
111
|
+
*/
|
|
112
|
+
heading: number;
|
|
113
|
+
/**
|
|
114
|
+
* 海拔(米)
|
|
115
|
+
*/
|
|
116
|
+
altitude: number;
|
|
117
|
+
/**
|
|
118
|
+
* 运动速度(米/秒)
|
|
119
|
+
*/
|
|
120
|
+
speed: number;
|
|
121
|
+
/**
|
|
122
|
+
* 时间戳
|
|
123
|
+
*/
|
|
124
|
+
timestamp: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 颜色值类型
|
|
128
|
+
* 支持:
|
|
129
|
+
* - 十六进制字符串: '#AARRGGBB' 或 '#RRGGBB'
|
|
130
|
+
* - 数字格式: 0xAARRGGBB (用于 Android)
|
|
131
|
+
*/
|
|
132
|
+
export type ColorValue = string | number;
|
|
133
|
+
//# sourceMappingURL=common.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../src/types/common.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,oBAAY,OAAO;IACjB;;OAEG;IACH,QAAQ,IAAI;IAEZ;;OAEG;IACH,SAAS,IAAI;IAEb;;OAEG;IACH,KAAK,IAAI;IAET;;OAEG;IACH,IAAI,IAAI;IAER;;OAEG;IACH,GAAG,IAAI;CACR;AAED;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,MAAM;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图通用类型定义
|
|
3
|
+
* 基于 Expo Modules API
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 地图类型
|
|
7
|
+
*/
|
|
8
|
+
export var MapType;
|
|
9
|
+
(function (MapType) {
|
|
10
|
+
/**
|
|
11
|
+
* 标准地图
|
|
12
|
+
*/
|
|
13
|
+
MapType[MapType["Standard"] = 0] = "Standard";
|
|
14
|
+
/**
|
|
15
|
+
* 卫星地图
|
|
16
|
+
*/
|
|
17
|
+
MapType[MapType["Satellite"] = 1] = "Satellite";
|
|
18
|
+
/**
|
|
19
|
+
* 夜间地图
|
|
20
|
+
*/
|
|
21
|
+
MapType[MapType["Night"] = 2] = "Night";
|
|
22
|
+
/**
|
|
23
|
+
* 导航地图
|
|
24
|
+
*/
|
|
25
|
+
MapType[MapType["Navi"] = 3] = "Navi";
|
|
26
|
+
/**
|
|
27
|
+
* 公交地图
|
|
28
|
+
*/
|
|
29
|
+
MapType[MapType["Bus"] = 4] = "Bus";
|
|
30
|
+
})(MapType || (MapType = {}));
|
|
31
|
+
//# sourceMappingURL=common.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.types.js","sourceRoot":"","sources":["../../src/types/common.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqFH;;GAEG;AACH,MAAM,CAAN,IAAY,OAyBX;AAzBD,WAAY,OAAO;IACjB;;OAEG;IACH,6CAAY,CAAA;IAEZ;;OAEG;IACH,+CAAa,CAAA;IAEb;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,qCAAQ,CAAA;IAER;;OAEG;IACH,mCAAO,CAAA;AACT,CAAC,EAzBW,OAAO,KAAP,OAAO,QAyBlB","sourcesContent":["/**\n * 高德地图通用类型定义\n * 基于 Expo Modules API\n */\n\n/**\n * 点坐标(屏幕坐标)\n */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * 地理坐标\n */\nexport interface LatLng {\n /**\n * 纬度\n */\n latitude: number;\n\n /**\n * 经度\n */\n longitude: number;\n}\n\n/**\n * 地图标注点(POI)\n */\nexport interface MapPoi {\n /**\n * 标注点 ID\n */\n id: string;\n\n /**\n * 标注点名称\n */\n name: string;\n\n /**\n * 标注点坐标\n */\n position: LatLng;\n}\n\n/**\n * 矩形坐标边界\n */\nexport interface LatLngBounds {\n /**\n * 西南坐标\n */\n southwest: LatLng;\n\n /**\n * 东北坐标\n */\n northeast: LatLng;\n}\n\n/**\n * 地图相机位置\n */\nexport interface CameraPosition {\n /**\n * 中心坐标\n */\n target?: LatLng;\n\n /**\n * 缩放级别(3-20)\n */\n zoom?: number;\n\n /**\n * 朝向、旋转角度(0-360度)\n */\n bearing?: number;\n\n /**\n * 倾斜角度(0-60度)\n */\n tilt?: number;\n}\n\n/**\n * 地图类型\n */\nexport enum MapType {\n /**\n * 标准地图\n */\n Standard = 0,\n\n /**\n * 卫星地图\n */\n Satellite = 1,\n\n /**\n * 夜间地图\n */\n Night = 2,\n\n /**\n * 导航地图\n */\n Navi = 3,\n\n /**\n * 公交地图\n */\n Bus = 4,\n}\n\n/**\n * 定位信息(基础)\n */\nexport interface Location extends LatLng {\n /**\n * 精度(米)\n */\n accuracy: number;\n\n /**\n * 朝向(度)\n */\n heading: number;\n\n /**\n * 海拔(米)\n */\n altitude: number;\n\n /**\n * 运动速度(米/秒)\n */\n speed: number;\n\n /**\n * 时间戳\n */\n timestamp: number;\n}\n\n/**\n * 颜色值类型\n * 支持:\n * - 十六进制字符串: '#AARRGGBB' 或 '#RRGGBB'\n * - 数字格式: 0xAARRGGBB (用于 Android)\n */\nexport type ColorValue = string | number;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图 Expo Module 类型定义统一导出
|
|
3
|
+
* 基于 Expo Modules API 重新设计
|
|
4
|
+
*/
|
|
5
|
+
export type { Point, LatLng, MapPoi, LatLngBounds, CameraPosition, Location, ColorValue, } from './common.types';
|
|
6
|
+
export { MapType } from './common.types';
|
|
7
|
+
export type { CameraEvent, MapViewProps, MapViewMethods, MapViewRef, NativeMapViewRef, } from './map-view.types';
|
|
8
|
+
export type { Coordinates, ReGeocode, LocationOptions, LocationListener, GeoLanguage, LocationProtocol, } from './location.types';
|
|
9
|
+
export { LocationAccuracy, LocationMode, CoordinateType, } from './location.types';
|
|
10
|
+
export type { MarkerProps, PolylineProps, PolygonProps, CircleProps, HeatMapProps, MultiPointItem, MultiPointProps, ClusterParams, ClusterPoint, ClusterProps, } from './overlays.types';
|
|
11
|
+
export type { SDKConfig, AMapSDKModule, AMapLocationModule, ModuleEvents, } from './sdk.types';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAUA;;;GAGG;AAGH,YAAY,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC,YAAY,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,UAAU,EACV,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,WAAW,EACX,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC"}
|