expo-gaode-map 2.0.0-alpha.2 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +6 -11
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapViewModule.kt +1 -1
- package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +6 -62
- package/android/src/main/java/expo/modules/gaodemap/modules/LocationManager.kt +1 -3
- package/android/src/main/java/expo/modules/gaodemap/modules/SDKInitializer.kt +1 -2
- package/android/src/main/java/expo/modules/gaodemap/overlays/CircleView.kt +10 -2
- package/android/src/main/java/expo/modules/gaodemap/overlays/ClusterView.kt +7 -2
- package/android/src/main/java/expo/modules/gaodemap/overlays/HeatMapView.kt +7 -2
- package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +86 -122
- package/android/src/main/java/expo/modules/gaodemap/overlays/MultiPointView.kt +10 -5
- package/android/src/main/java/expo/modules/gaodemap/overlays/MultiPointViewModule.kt +8 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolygonView.kt +7 -2
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolylineView.kt +7 -2
- package/android/src/main/java/expo/modules/gaodemap/services/LocationForegroundService.kt +1 -2
- package/android/src/main/java/expo/modules/gaodemap/utils/ColorParser.kt +3 -2
- package/build/ExpoGaodeMap.types.d.ts +3 -6
- package/build/ExpoGaodeMap.types.d.ts.map +1 -1
- package/build/ExpoGaodeMap.types.js +4 -2
- package/build/ExpoGaodeMap.types.js.map +1 -1
- package/build/ExpoGaodeMapModule.d.ts +10 -1
- package/build/ExpoGaodeMapModule.d.ts.map +1 -1
- package/build/ExpoGaodeMapModule.js +20 -1
- package/build/ExpoGaodeMapModule.js.map +1 -1
- package/build/ExpoGaodeMapView.d.ts.map +1 -1
- package/build/ExpoGaodeMapView.js.map +1 -1
- package/build/types/common.types.d.ts +0 -25
- package/build/types/common.types.d.ts.map +1 -1
- package/build/types/common.types.js.map +1 -1
- package/build/types/index.d.ts +2 -3
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js.map +1 -1
- package/build/types/map-view.types.d.ts +17 -0
- package/build/types/map-view.types.d.ts.map +1 -1
- package/build/types/map-view.types.js.map +1 -1
- package/docs/API.md +2 -2
- package/docs/EXAMPLES.md +2 -2
- package/docs/MIGRATION.md +3 -3
- package/ios/overlays/MarkerView.swift +3 -1
- package/package.json +1 -1
- package/src/ExpoGaodeMap.types.ts +4 -42
- package/src/ExpoGaodeMapModule.ts +34 -1
- package/src/ExpoGaodeMapView.tsx +0 -1
- package/src/types/common.types.ts +0 -30
- package/src/types/index.ts +1 -11
- package/src/types/map-view.types.ts +22 -0
- package/build/types/sdk.types.d.ts +0 -113
- package/build/types/sdk.types.d.ts.map +0 -1
- package/build/types/sdk.types.js +0 -6
- package/build/types/sdk.types.js.map +0 -1
- package/src/types/sdk.types.ts +0 -128
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 高德地图 SDK 模块类型定义
|
|
3
|
-
* 基于 Expo Modules API
|
|
4
|
-
*/
|
|
5
|
-
import type { LatLng } from './common.types';
|
|
6
|
-
import type { Coordinates, ReGeocode, LocationOptions, LocationListener, CoordinateType } from './location.types';
|
|
7
|
-
/**
|
|
8
|
-
* SDK 初始化配置
|
|
9
|
-
*/
|
|
10
|
-
export interface SDKConfig {
|
|
11
|
-
/**
|
|
12
|
-
* iOS API Key
|
|
13
|
-
*/
|
|
14
|
-
iosKey?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Android API Key
|
|
17
|
-
*/
|
|
18
|
-
androidKey?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 高德地图 SDK 模块接口
|
|
22
|
-
*/
|
|
23
|
-
export interface AMapSDKModule {
|
|
24
|
-
/**
|
|
25
|
-
* 初始化 SDK
|
|
26
|
-
* @param config SDK配置
|
|
27
|
-
*/
|
|
28
|
-
initSDK(config: SDKConfig): void;
|
|
29
|
-
/**
|
|
30
|
-
* 获取 SDK 版本号
|
|
31
|
-
*/
|
|
32
|
-
getVersion(): Promise<string>;
|
|
33
|
-
/**
|
|
34
|
-
* 设置 API Key(单平台)
|
|
35
|
-
* @param key API密钥
|
|
36
|
-
*/
|
|
37
|
-
setApiKey(key: string): void;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 高德定位模块接口
|
|
41
|
-
*/
|
|
42
|
-
export interface AMapLocationModule {
|
|
43
|
-
/**
|
|
44
|
-
* 配置定位选项
|
|
45
|
-
* @param options 定位配置选项
|
|
46
|
-
*/
|
|
47
|
-
configure(options: LocationOptions): void;
|
|
48
|
-
/**
|
|
49
|
-
* 开始连续定位
|
|
50
|
-
*/
|
|
51
|
-
start(): void;
|
|
52
|
-
/**
|
|
53
|
-
* 停止定位
|
|
54
|
-
*/
|
|
55
|
-
stop(): void;
|
|
56
|
-
/**
|
|
57
|
-
* 是否正在定位
|
|
58
|
-
*/
|
|
59
|
-
isStarted(): Promise<boolean>;
|
|
60
|
-
/**
|
|
61
|
-
* 获取当前位置(单次定位)
|
|
62
|
-
*/
|
|
63
|
-
getCurrentLocation(): Promise<Coordinates | ReGeocode>;
|
|
64
|
-
/**
|
|
65
|
-
* 添加定位监听器
|
|
66
|
-
* @param listener 定位回调函数
|
|
67
|
-
* @returns 订阅对象,用于取消监听
|
|
68
|
-
*/
|
|
69
|
-
addLocationListener(listener: LocationListener): {
|
|
70
|
-
remove: () => void;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* 坐标转换
|
|
74
|
-
* @param coordinate 待转换的坐标
|
|
75
|
-
* @param type 坐标系类型
|
|
76
|
-
*/
|
|
77
|
-
coordinateConvert(coordinate: LatLng, type: CoordinateType): Promise<LatLng>;
|
|
78
|
-
/**
|
|
79
|
-
* 开始获取设备朝向
|
|
80
|
-
* @platform ios
|
|
81
|
-
*/
|
|
82
|
-
startUpdatingHeading(): void;
|
|
83
|
-
/**
|
|
84
|
-
* 停止获取设备朝向
|
|
85
|
-
* @platform ios
|
|
86
|
-
*/
|
|
87
|
-
stopUpdatingHeading(): void;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* 模块事件类型
|
|
91
|
-
*/
|
|
92
|
-
export interface ModuleEvents {
|
|
93
|
-
/**
|
|
94
|
-
* 定位更新事件
|
|
95
|
-
*/
|
|
96
|
-
onLocationUpdate: (location: Coordinates | ReGeocode) => void;
|
|
97
|
-
/**
|
|
98
|
-
* 定位错误事件
|
|
99
|
-
*/
|
|
100
|
-
onLocationError: (error: {
|
|
101
|
-
code: number;
|
|
102
|
-
message: string;
|
|
103
|
-
}) => void;
|
|
104
|
-
/**
|
|
105
|
-
* 朝向更新事件
|
|
106
|
-
* @platform ios
|
|
107
|
-
*/
|
|
108
|
-
onHeadingUpdate: (heading: {
|
|
109
|
-
magneticHeading: number;
|
|
110
|
-
trueHeading: number;
|
|
111
|
-
}) => void;
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=sdk.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.types.d.ts","sourceRoot":"","sources":["../../src/types/sdk.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAEj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|
|
1
|
-
{"version":3,"file":"sdk.types.js","sourceRoot":"","sources":["../../src/types/sdk.types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * 高德地图 SDK 模块类型定义\n * 基于 Expo Modules API\n */\n\nimport type { LatLng } from './common.types';\nimport type { \n Coordinates, \n ReGeocode, \n LocationOptions, \n LocationListener,\n CoordinateType \n} from './location.types';\n\n/**\n * SDK 初始化配置\n */\nexport interface SDKConfig {\n /**\n * iOS API Key\n */\n iosKey?: string;\n\n /**\n * Android API Key\n */\n androidKey?: string;\n}\n\n/**\n * 高德地图 SDK 模块接口\n */\nexport interface AMapSDKModule {\n /**\n * 初始化 SDK\n * @param config SDK配置\n */\n initSDK(config: SDKConfig): void;\n\n /**\n * 获取 SDK 版本号\n */\n getVersion(): Promise<string>;\n\n /**\n * 设置 API Key(单平台)\n * @param key API密钥\n */\n setApiKey(key: string): void;\n}\n\n/**\n * 高德定位模块接口\n */\nexport interface AMapLocationModule {\n /**\n * 配置定位选项\n * @param options 定位配置选项\n */\n configure(options: LocationOptions): void;\n\n /**\n * 开始连续定位\n */\n start(): void;\n\n /**\n * 停止定位\n */\n stop(): void;\n\n /**\n * 是否正在定位\n */\n isStarted(): Promise<boolean>;\n\n /**\n * 获取当前位置(单次定位)\n */\n getCurrentLocation(): Promise<Coordinates | ReGeocode>;\n\n /**\n * 添加定位监听器\n * @param listener 定位回调函数\n * @returns 订阅对象,用于取消监听\n */\n addLocationListener(listener: LocationListener): { remove: () => void };\n\n /**\n * 坐标转换\n * @param coordinate 待转换的坐标\n * @param type 坐标系类型\n */\n coordinateConvert(coordinate: LatLng, type: CoordinateType): Promise<LatLng>;\n\n /**\n * 开始获取设备朝向\n * @platform ios\n */\n startUpdatingHeading(): void;\n\n /**\n * 停止获取设备朝向\n * @platform ios\n */\n stopUpdatingHeading(): void;\n}\n\n/**\n * 模块事件类型\n */\nexport interface ModuleEvents {\n /**\n * 定位更新事件\n */\n onLocationUpdate: (location: Coordinates | ReGeocode) => void;\n\n /**\n * 定位错误事件\n */\n onLocationError: (error: { code: number; message: string }) => void;\n\n /**\n * 朝向更新事件\n * @platform ios\n */\n onHeadingUpdate: (heading: { magneticHeading: number; trueHeading: number }) => void;\n}\n"]}
|
package/src/types/sdk.types.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 高德地图 SDK 模块类型定义
|
|
3
|
-
* 基于 Expo Modules API
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { LatLng } from './common.types';
|
|
7
|
-
import type {
|
|
8
|
-
Coordinates,
|
|
9
|
-
ReGeocode,
|
|
10
|
-
LocationOptions,
|
|
11
|
-
LocationListener,
|
|
12
|
-
CoordinateType
|
|
13
|
-
} from './location.types';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* SDK 初始化配置
|
|
17
|
-
*/
|
|
18
|
-
export interface SDKConfig {
|
|
19
|
-
/**
|
|
20
|
-
* iOS API Key
|
|
21
|
-
*/
|
|
22
|
-
iosKey?: string;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Android API Key
|
|
26
|
-
*/
|
|
27
|
-
androidKey?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 高德地图 SDK 模块接口
|
|
32
|
-
*/
|
|
33
|
-
export interface AMapSDKModule {
|
|
34
|
-
/**
|
|
35
|
-
* 初始化 SDK
|
|
36
|
-
* @param config SDK配置
|
|
37
|
-
*/
|
|
38
|
-
initSDK(config: SDKConfig): void;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* 获取 SDK 版本号
|
|
42
|
-
*/
|
|
43
|
-
getVersion(): Promise<string>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 设置 API Key(单平台)
|
|
47
|
-
* @param key API密钥
|
|
48
|
-
*/
|
|
49
|
-
setApiKey(key: string): void;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 高德定位模块接口
|
|
54
|
-
*/
|
|
55
|
-
export interface AMapLocationModule {
|
|
56
|
-
/**
|
|
57
|
-
* 配置定位选项
|
|
58
|
-
* @param options 定位配置选项
|
|
59
|
-
*/
|
|
60
|
-
configure(options: LocationOptions): void;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 开始连续定位
|
|
64
|
-
*/
|
|
65
|
-
start(): void;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 停止定位
|
|
69
|
-
*/
|
|
70
|
-
stop(): void;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 是否正在定位
|
|
74
|
-
*/
|
|
75
|
-
isStarted(): Promise<boolean>;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 获取当前位置(单次定位)
|
|
79
|
-
*/
|
|
80
|
-
getCurrentLocation(): Promise<Coordinates | ReGeocode>;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* 添加定位监听器
|
|
84
|
-
* @param listener 定位回调函数
|
|
85
|
-
* @returns 订阅对象,用于取消监听
|
|
86
|
-
*/
|
|
87
|
-
addLocationListener(listener: LocationListener): { remove: () => void };
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* 坐标转换
|
|
91
|
-
* @param coordinate 待转换的坐标
|
|
92
|
-
* @param type 坐标系类型
|
|
93
|
-
*/
|
|
94
|
-
coordinateConvert(coordinate: LatLng, type: CoordinateType): Promise<LatLng>;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* 开始获取设备朝向
|
|
98
|
-
* @platform ios
|
|
99
|
-
*/
|
|
100
|
-
startUpdatingHeading(): void;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* 停止获取设备朝向
|
|
104
|
-
* @platform ios
|
|
105
|
-
*/
|
|
106
|
-
stopUpdatingHeading(): void;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* 模块事件类型
|
|
111
|
-
*/
|
|
112
|
-
export interface ModuleEvents {
|
|
113
|
-
/**
|
|
114
|
-
* 定位更新事件
|
|
115
|
-
*/
|
|
116
|
-
onLocationUpdate: (location: Coordinates | ReGeocode) => void;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 定位错误事件
|
|
120
|
-
*/
|
|
121
|
-
onLocationError: (error: { code: number; message: string }) => void;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 朝向更新事件
|
|
125
|
-
* @platform ios
|
|
126
|
-
*/
|
|
127
|
-
onHeadingUpdate: (heading: { magneticHeading: number; trueHeading: number }) => void;
|
|
128
|
-
}
|