expo-gaode-map-navigation 1.0.1-next.1 → 1.0.1-next.3
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/build/map/ExpoGaodeMapModule.js +5 -5
- package/package.json +15 -6
- package/package.json.backup +0 -47
- package/plugin/README.md +0 -52
- package/plugin/src/withGaodeMap.ts +0 -231
- package/plugin/tsconfig.tsbuildinfo +0 -1
- package/src/ExpoGaodeMapNaviView.tsx +0 -94
- package/src/ExpoGaodeMapNavigation.types.ts +0 -3
- package/src/ExpoGaodeMapNavigationModule.ts +0 -11
- package/src/index.ts +0 -262
- package/src/map/ExpoGaodeMap.types.ts +0 -46
- package/src/map/ExpoGaodeMapModule.ts +0 -315
- package/src/map/ExpoGaodeMapView.tsx +0 -120
- package/src/map/components/overlays/Circle.tsx +0 -20
- package/src/map/components/overlays/Cluster.tsx +0 -26
- package/src/map/components/overlays/HeatMap.tsx +0 -27
- package/src/map/components/overlays/Marker.tsx +0 -88
- package/src/map/components/overlays/MultiPoint.tsx +0 -27
- package/src/map/components/overlays/Polygon.tsx +0 -19
- package/src/map/components/overlays/Polyline.tsx +0 -19
- package/src/map/components/overlays/index.ts +0 -7
- package/src/map/index.ts +0 -37
- package/src/map/types/common.types.ts +0 -126
- package/src/map/types/index.ts +0 -55
- package/src/map/types/location.types.ts +0 -368
- package/src/map/types/map-view.types.ts +0 -281
- package/src/map/types/overlays.types.ts +0 -404
- package/src/map/utils/EventManager.ts +0 -23
- package/src/map/utils/ModuleLoader.ts +0 -115
- package/src/types/coordinates.types.ts +0 -25
- package/src/types/independent.types.ts +0 -288
- package/src/types/index.ts +0 -5
- package/src/types/naviview.types.ts +0 -330
- package/src/types/route.types.ts +0 -305
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
MapViewProps,
|
|
6
|
-
MapViewRef,
|
|
7
|
-
CameraPosition,
|
|
8
|
-
LatLng,
|
|
9
|
-
Point,
|
|
10
|
-
|
|
11
|
-
} from './types';
|
|
12
|
-
|
|
13
|
-
export type { MapViewRef } from './types';
|
|
14
|
-
|
|
15
|
-
const NativeView: React.ComponentType<MapViewProps & { ref?: React.Ref<MapViewRef> }> = requireNativeViewManager('NaviMapView');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 高德地图视图组件,提供地图操作API和覆盖物管理功能
|
|
20
|
-
*
|
|
21
|
-
* @param props - 组件属性
|
|
22
|
-
* @param ref - 外部ref引用,用于访问地图API方法
|
|
23
|
-
* @returns 返回包含地图视图和上下文提供者的React组件
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* 该组件内部维护两个ref:
|
|
27
|
-
* - nativeRef: 指向原生地图视图的引用
|
|
28
|
-
* - internalRef: 内部使用的API引用,通过MapContext共享
|
|
29
|
-
*
|
|
30
|
-
* 提供的主要API功能包括:
|
|
31
|
-
* - 相机控制(移动、缩放、获取当前位置)
|
|
32
|
-
* - 覆盖物管理(添加/删除/更新标记、折线、多边形、圆形等)
|
|
33
|
-
*
|
|
34
|
-
* 所有API方法都会检查地图是否已初始化,未初始化时抛出错误
|
|
35
|
-
*/
|
|
36
|
-
const ExpoGaodeMapView = React.forwardRef<MapViewRef, MapViewProps>((props, ref) => {
|
|
37
|
-
const nativeRef = React.useRef<MapViewRef>(null);
|
|
38
|
-
const internalRef = React.useRef<MapViewRef | null>(null);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const apiRef: MapViewRef = React.useMemo(() => ({
|
|
42
|
-
/**
|
|
43
|
-
* 移动地图相机到指定位置
|
|
44
|
-
* @param position 相机位置参数对象,包含目标经纬度、缩放级别等信息
|
|
45
|
-
* @param duration 动画持续时间(毫秒),默认300毫秒
|
|
46
|
-
* @throws 如果地图视图未初始化则抛出错误
|
|
47
|
-
* @returns Promise<void> 异步操作完成后的Promise
|
|
48
|
-
*/
|
|
49
|
-
moveCamera: async (position: CameraPosition, duration: number = 300) => {
|
|
50
|
-
if (!nativeRef.current) throw new Error('MapView not initialized');
|
|
51
|
-
return nativeRef.current.moveCamera(position, duration);
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* 将屏幕坐标点转换为地理坐标(经纬度)
|
|
55
|
-
* @param point 屏幕坐标点 {x: number, y: number}
|
|
56
|
-
* @returns 返回Promise,解析为对应的地理坐标 {latitude: number, longitude: number}
|
|
57
|
-
* @throws 如果地图视图未初始化,抛出错误 'MapView not initialized'
|
|
58
|
-
*/
|
|
59
|
-
getLatLng: async (point: Point) => {
|
|
60
|
-
if (!nativeRef.current) throw new Error('MapView not initialized');
|
|
61
|
-
return nativeRef.current.getLatLng(point);
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* 设置地图中心点坐标
|
|
65
|
-
* @param center 要设置的中心点坐标(LatLng格式)
|
|
66
|
-
* @param animated 是否使用动画效果移动地图(默认为false)
|
|
67
|
-
* @throws 如果地图视图未初始化则抛出错误
|
|
68
|
-
*/
|
|
69
|
-
setCenter: async (center: LatLng, animated: boolean = false) => {
|
|
70
|
-
if (!nativeRef.current) throw new Error('MapView not initialized');
|
|
71
|
-
return nativeRef.current.setCenter(center, animated);
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* 设置地图的缩放级别
|
|
75
|
-
* @param zoom 目标缩放级别
|
|
76
|
-
* @param animated 是否使用动画过渡效果,默认为false
|
|
77
|
-
* @throws 如果地图视图未初始化,抛出错误
|
|
78
|
-
*/
|
|
79
|
-
setZoom: async (zoom: number, animated: boolean = false) => {
|
|
80
|
-
if (!nativeRef.current) throw new Error('MapView not initialized');
|
|
81
|
-
return nativeRef.current.setZoom(zoom, animated);
|
|
82
|
-
},
|
|
83
|
-
/**
|
|
84
|
-
* 获取当前地图的相机位置(视角中心点、缩放级别、倾斜角度等)
|
|
85
|
-
* @returns 返回一个Promise,解析为当前相机位置的对象
|
|
86
|
-
* @throws 如果地图视图未初始化,则抛出错误
|
|
87
|
-
*/
|
|
88
|
-
getCameraPosition: async () => {
|
|
89
|
-
if (!nativeRef.current) throw new Error('MapView not initialized');
|
|
90
|
-
return nativeRef.current.getCameraPosition();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
}), []);
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* 将传入的apiRef赋值给internalRef.current
|
|
97
|
-
* 用于在组件内部保存对地图API实例的引用
|
|
98
|
-
*/
|
|
99
|
-
React.useEffect(() => {
|
|
100
|
-
internalRef.current = apiRef;
|
|
101
|
-
}, [apiRef]);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* 获取当前地图实例的API引用
|
|
105
|
-
* @returns 返回地图API的引用对象,可用于调用地图相关方法
|
|
106
|
-
*/
|
|
107
|
-
React.useImperativeHandle(ref, () => apiRef, [apiRef]);
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<NativeView
|
|
111
|
-
ref={nativeRef}
|
|
112
|
-
{...props}>
|
|
113
|
-
{props.children}
|
|
114
|
-
</NativeView>
|
|
115
|
-
);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
ExpoGaodeMapView.displayName = 'ExpoGaodeMapView';
|
|
119
|
-
|
|
120
|
-
export default ExpoGaodeMapView;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
4
|
-
import type { CircleProps } from '../../types';
|
|
5
|
-
|
|
6
|
-
const NativeCircleView = requireNativeViewManager<CircleProps>('NaviCircleView');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 高德地图圆形覆盖物组件(声明式)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param props 圆形组件的属性配置
|
|
13
|
-
* @returns 渲染原生圆形组件
|
|
14
|
-
*/
|
|
15
|
-
function Circle(props: CircleProps) {
|
|
16
|
-
return <NativeCircleView {...props} />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 导出优化后的组件
|
|
20
|
-
export default React.memo(Circle);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
-
* @Date : 2025-12-03 14:27:06
|
|
4
|
-
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
-
* @LastEditTime : 2025-12-05 16:21:29
|
|
6
|
-
* @FilePath : /expo-gaode-map/packages/navigation/src/map/components/overlays/Cluster.tsx
|
|
7
|
-
* @Description :
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import type { ClusterProps } from '../../types';
|
|
15
|
-
|
|
16
|
-
const NativeCluster = requireNativeViewManager('NaviClusterView');
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 高德地图点聚合组件
|
|
20
|
-
*
|
|
21
|
-
* @param props 点聚合组件的属性配置
|
|
22
|
-
* @returns 渲染原生点聚合组件
|
|
23
|
-
*/
|
|
24
|
-
export default function Cluster(props: ClusterProps) {
|
|
25
|
-
return <NativeCluster {...props} />;
|
|
26
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
-
* @Date : 2025-12-03 14:27:06
|
|
4
|
-
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
-
* @LastEditTime : 2025-12-05 16:21:04
|
|
6
|
-
* @FilePath : /expo-gaode-map/packages/navigation/src/map/components/overlays/HeatMap.tsx
|
|
7
|
-
* @Description :
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import type { HeatMapProps } from '../../types';
|
|
15
|
-
|
|
16
|
-
const NativeHeatMap = requireNativeViewManager('NaviHeatMapView');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 高德地图热力图组件
|
|
21
|
-
*
|
|
22
|
-
* @param props - 热力图配置属性,继承自NativeHeatMap组件的属性
|
|
23
|
-
* @returns 渲染高德地图原生热力图组件
|
|
24
|
-
*/
|
|
25
|
-
export default function HeatMap(props: HeatMapProps) {
|
|
26
|
-
return <NativeHeatMap {...props} />;
|
|
27
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
5
|
-
import type { MarkerProps } from '../../types';
|
|
6
|
-
|
|
7
|
-
const NativeMarkerView = requireNativeViewManager('NaviMarkerView');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Marker 组件 - 完全声明式 API
|
|
11
|
-
*
|
|
12
|
-
* 支持:
|
|
13
|
-
* - 自定义图标(icon)
|
|
14
|
-
* - 自定义内容(children)
|
|
15
|
-
* - 大头针样式(pinColor)
|
|
16
|
-
* - 拖拽功能
|
|
17
|
-
* - 所有事件回调
|
|
18
|
-
*/
|
|
19
|
-
function Marker(props: MarkerProps) {
|
|
20
|
-
// 根据是否有 children 来决定使用哪个尺寸属性
|
|
21
|
-
// 有 children:使用 customViewWidth/customViewHeight(默认 200x40)
|
|
22
|
-
// 无 children:使用 iconWidth/iconHeight(用于自定义图标,默认 40x40)
|
|
23
|
-
const containerWidth = props.children
|
|
24
|
-
? (props.customViewWidth && props.customViewWidth > 0 ? props.customViewWidth : 200)
|
|
25
|
-
: (props.iconWidth && props.iconWidth > 0 ? props.iconWidth : 40);
|
|
26
|
-
const containerHeight = props.children
|
|
27
|
-
? (props.customViewHeight && props.customViewHeight > 0 ? props.customViewHeight : 40)
|
|
28
|
-
: (props.iconHeight && props.iconHeight > 0 ? props.iconHeight : 40);
|
|
29
|
-
|
|
30
|
-
// 从 props 中排除 position 属性,避免传递到原生层
|
|
31
|
-
const { position, ...restProps } = props;
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<NativeMarkerView
|
|
35
|
-
latitude={position.latitude}
|
|
36
|
-
longitude={position.longitude}
|
|
37
|
-
iconWidth={containerWidth}
|
|
38
|
-
iconHeight={containerHeight}
|
|
39
|
-
customViewWidth={containerWidth}
|
|
40
|
-
customViewHeight={containerHeight}
|
|
41
|
-
{...restProps}
|
|
42
|
-
>
|
|
43
|
-
{props.children}
|
|
44
|
-
</NativeMarkerView>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 自定义比较函数
|
|
50
|
-
* 深度比较 position 和其他关键属性
|
|
51
|
-
*/
|
|
52
|
-
function arePropsEqual(prevProps: MarkerProps, nextProps: MarkerProps): boolean {
|
|
53
|
-
// 比较 position
|
|
54
|
-
if (
|
|
55
|
-
prevProps.position.latitude !== nextProps.position.latitude ||
|
|
56
|
-
prevProps.position.longitude !== nextProps.position.longitude
|
|
57
|
-
) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// 比较基础属性
|
|
62
|
-
if (
|
|
63
|
-
prevProps.title !== nextProps.title ||
|
|
64
|
-
prevProps.snippet !== nextProps.snippet ||
|
|
65
|
-
prevProps.icon !== nextProps.icon ||
|
|
66
|
-
prevProps.pinColor !== nextProps.pinColor ||
|
|
67
|
-
prevProps.draggable !== nextProps.draggable ||
|
|
68
|
-
prevProps.animatesDrop !== nextProps.animatesDrop ||
|
|
69
|
-
prevProps.iconWidth !== nextProps.iconWidth ||
|
|
70
|
-
prevProps.iconHeight !== nextProps.iconHeight ||
|
|
71
|
-
prevProps.customViewWidth !== nextProps.customViewWidth ||
|
|
72
|
-
prevProps.customViewHeight !== nextProps.customViewHeight
|
|
73
|
-
) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// 比较 children(简单比较,可根据需要深度比较)
|
|
78
|
-
if (prevProps.children !== nextProps.children) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// 其他属性相同,不需要重新渲染
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// 导出优化后的组件
|
|
87
|
-
export default React.memo(Marker, arePropsEqual);
|
|
88
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
|
-
* @Date : 2025-12-03 14:27:06
|
|
4
|
-
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
-
* @LastEditTime : 2025-12-05 16:21:15
|
|
6
|
-
* @FilePath : /expo-gaode-map/packages/navigation/src/map/components/overlays/MultiPoint.tsx
|
|
7
|
-
* @Description :
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import type { MultiPointProps } from '../../types';
|
|
15
|
-
|
|
16
|
-
const NativeMultiPoint = requireNativeViewManager('NaviMultiPointView');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 高德地图多点标记组件
|
|
21
|
-
*
|
|
22
|
-
* @param props 多点标记的配置属性,继承自MultiPointProps接口
|
|
23
|
-
* @returns 渲染原生高德地图多点标记组件
|
|
24
|
-
*/
|
|
25
|
-
export default function MultiPoint(props: MultiPointProps) {
|
|
26
|
-
return <NativeMultiPoint {...props} />;
|
|
27
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import type { PolygonProps } from '../../types';
|
|
4
|
-
|
|
5
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
6
|
-
const NativePolygonView = requireNativeViewManager<PolygonProps>('NaviPolygonView');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 渲染一个高德地图多边形覆盖物组件
|
|
10
|
-
*
|
|
11
|
-
* @param props - 多边形属性配置,继承自PolygonProps类型
|
|
12
|
-
* @returns 高德地图原生多边形视图组件
|
|
13
|
-
*/
|
|
14
|
-
function Polygon(props: PolygonProps) {
|
|
15
|
-
return <NativePolygonView {...props} />;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 导出优化后的组件
|
|
19
|
-
export default React.memo(Polygon);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import type { PolylineProps } from '../../types';
|
|
4
|
-
|
|
5
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
6
|
-
const NativePolylineView = requireNativeViewManager<PolylineProps>('NaviPolylineView');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 渲染高德地图上的折线覆盖物组件
|
|
10
|
-
*
|
|
11
|
-
* @param props - 折线属性配置,继承自PolylineProps类型
|
|
12
|
-
* @returns 高德地图原生折线视图组件
|
|
13
|
-
*/
|
|
14
|
-
function Polyline(props: PolylineProps) {
|
|
15
|
-
return <NativePolylineView {...props} />;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 导出优化后的组件
|
|
19
|
-
export default React.memo(Polyline);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Marker } from './Marker';
|
|
2
|
-
export { default as Polyline } from './Polyline';
|
|
3
|
-
export { default as Polygon } from './Polygon';
|
|
4
|
-
export { default as Circle } from './Circle';
|
|
5
|
-
export { default as HeatMap } from './HeatMap';
|
|
6
|
-
export { default as MultiPoint } from './MultiPoint';
|
|
7
|
-
export { default as Cluster } from './Cluster';
|
package/src/map/index.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// 导出类型定义
|
|
3
|
-
export * from './ExpoGaodeMap.types';
|
|
4
|
-
export * from './types';
|
|
5
|
-
|
|
6
|
-
// 导出原生模块 - 直接使用,无需封装
|
|
7
|
-
export { default as ExpoGaodeMapModule } from './ExpoGaodeMapModule';
|
|
8
|
-
|
|
9
|
-
// 从 ExpoGaodeMapModule 重新导出类型,方便使用
|
|
10
|
-
export type { SDKConfig, PermissionStatus } from './ExpoGaodeMapModule';
|
|
11
|
-
|
|
12
|
-
// 导出地图视图组件
|
|
13
|
-
export { default as MapView } from './ExpoGaodeMapView';
|
|
14
|
-
export type { MapViewRef } from './ExpoGaodeMapView';
|
|
15
|
-
|
|
16
|
-
// 导出覆盖物组件
|
|
17
|
-
export {
|
|
18
|
-
Marker,
|
|
19
|
-
Polyline,
|
|
20
|
-
Polygon,
|
|
21
|
-
Circle,
|
|
22
|
-
HeatMap,
|
|
23
|
-
MultiPoint,
|
|
24
|
-
Cluster,
|
|
25
|
-
} from './components/overlays';
|
|
26
|
-
|
|
27
|
-
// 导出模块检测工具
|
|
28
|
-
export {
|
|
29
|
-
requireModule,
|
|
30
|
-
OptionalModules,
|
|
31
|
-
getInstalledModules,
|
|
32
|
-
printModuleInfo,
|
|
33
|
-
createLazyLoader,
|
|
34
|
-
} from './utils/ModuleLoader';
|
|
35
|
-
|
|
36
|
-
// 默认导出原生模块
|
|
37
|
-
export { default } from './ExpoGaodeMapModule';
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 高德地图通用类型定义
|
|
3
|
-
* 基于 Expo Modules API
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 点坐标(屏幕坐标)
|
|
8
|
-
*/
|
|
9
|
-
export interface Point {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 地理坐标
|
|
16
|
-
*/
|
|
17
|
-
export interface LatLng {
|
|
18
|
-
/**
|
|
19
|
-
* 纬度
|
|
20
|
-
*/
|
|
21
|
-
latitude: number;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 经度
|
|
25
|
-
*/
|
|
26
|
-
longitude: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* 地图标注点(POI)
|
|
31
|
-
*/
|
|
32
|
-
export interface MapPoi {
|
|
33
|
-
/**
|
|
34
|
-
* 标注点 ID
|
|
35
|
-
*/
|
|
36
|
-
id: string;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 标注点名称
|
|
40
|
-
*/
|
|
41
|
-
name: string;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 标注点坐标
|
|
45
|
-
*/
|
|
46
|
-
position: LatLng;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 矩形坐标边界
|
|
51
|
-
*/
|
|
52
|
-
export interface LatLngBounds {
|
|
53
|
-
/**
|
|
54
|
-
* 西南坐标
|
|
55
|
-
*/
|
|
56
|
-
southwest: LatLng;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 东北坐标
|
|
60
|
-
*/
|
|
61
|
-
northeast: LatLng;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 地图相机位置
|
|
66
|
-
*/
|
|
67
|
-
export interface CameraPosition {
|
|
68
|
-
/**
|
|
69
|
-
* 中心坐标
|
|
70
|
-
*/
|
|
71
|
-
target?: LatLng;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* 缩放级别(3-20)
|
|
75
|
-
*/
|
|
76
|
-
zoom?: number;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 朝向、旋转角度(0-360度)
|
|
80
|
-
*/
|
|
81
|
-
bearing?: number;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 倾斜角度(0-60度)
|
|
85
|
-
*/
|
|
86
|
-
tilt?: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* 地图类型
|
|
91
|
-
*/
|
|
92
|
-
export enum MapType {
|
|
93
|
-
/**
|
|
94
|
-
* 标准地图
|
|
95
|
-
*/
|
|
96
|
-
Standard = 0,
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 卫星地图
|
|
100
|
-
*/
|
|
101
|
-
Satellite = 1,
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* 夜间地图
|
|
105
|
-
*/
|
|
106
|
-
Night = 2,
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 导航地图
|
|
110
|
-
*/
|
|
111
|
-
Navi = 3,
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 公交地图
|
|
115
|
-
* @platform android
|
|
116
|
-
*/
|
|
117
|
-
Bus = 4,
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* 颜色值类型
|
|
122
|
-
* 支持:
|
|
123
|
-
* - 十六进制字符串: '#AARRGGBB' 或 '#RRGGBB'
|
|
124
|
-
* - 数字格式: 0xAARRGGBB (用于 Android)
|
|
125
|
-
*/
|
|
126
|
-
export type ColorValue = string | number;
|
package/src/map/types/index.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 高德地图 Expo Module 类型定义统一导出
|
|
3
|
-
* 基于 Expo Modules API 重新设计
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// 通用类型
|
|
7
|
-
export type {
|
|
8
|
-
Point,
|
|
9
|
-
LatLng,
|
|
10
|
-
MapPoi,
|
|
11
|
-
LatLngBounds,
|
|
12
|
-
CameraPosition,
|
|
13
|
-
ColorValue,
|
|
14
|
-
} from './common.types';
|
|
15
|
-
|
|
16
|
-
export { MapType } from './common.types';
|
|
17
|
-
|
|
18
|
-
// 地图视图类型
|
|
19
|
-
export type {
|
|
20
|
-
LocationEvent,
|
|
21
|
-
CameraEvent,
|
|
22
|
-
MapViewProps,
|
|
23
|
-
MapViewMethods,
|
|
24
|
-
MapViewRef,
|
|
25
|
-
} from './map-view.types';
|
|
26
|
-
|
|
27
|
-
// 定位类型
|
|
28
|
-
export type {
|
|
29
|
-
Coordinates,
|
|
30
|
-
ReGeocode,
|
|
31
|
-
LocationOptions,
|
|
32
|
-
LocationListener,
|
|
33
|
-
GeoLanguage,
|
|
34
|
-
LocationProtocol,
|
|
35
|
-
} from './location.types';
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
LocationAccuracy,
|
|
39
|
-
LocationMode,
|
|
40
|
-
CoordinateType,
|
|
41
|
-
} from './location.types';
|
|
42
|
-
|
|
43
|
-
// 覆盖物类型
|
|
44
|
-
export type {
|
|
45
|
-
MarkerProps,
|
|
46
|
-
PolylineProps,
|
|
47
|
-
PolygonProps,
|
|
48
|
-
CircleProps,
|
|
49
|
-
HeatMapProps,
|
|
50
|
-
MultiPointItem,
|
|
51
|
-
MultiPointProps,
|
|
52
|
-
ClusterParams,
|
|
53
|
-
ClusterPoint,
|
|
54
|
-
ClusterProps,
|
|
55
|
-
} from './overlays.types';
|