expo-gaode-map 1.0.6 → 1.0.8

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 (60) hide show
  1. package/README.en.md +320 -0
  2. package/README.md +2 -0
  3. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapModule.kt +1 -298
  4. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +19 -3
  5. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapViewModule.kt +126 -0
  6. package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +22 -0
  7. package/android/src/main/java/expo/modules/gaodemap/overlays/CircleViewModule.kt +41 -0
  8. package/android/src/main/java/expo/modules/gaodemap/overlays/ClusterViewModule.kt +29 -0
  9. package/android/src/main/java/expo/modules/gaodemap/overlays/HeatMapViewModule.kt +27 -0
  10. package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +53 -0
  11. package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerViewModule.kt +49 -0
  12. package/android/src/main/java/expo/modules/gaodemap/overlays/MultiPointViewModule.kt +21 -0
  13. package/android/src/main/java/expo/modules/gaodemap/overlays/PolygonViewModule.kt +37 -0
  14. package/android/src/main/java/expo/modules/gaodemap/overlays/PolylineView.kt +2 -0
  15. package/android/src/main/java/expo/modules/gaodemap/overlays/PolylineViewModule.kt +45 -0
  16. package/build/ExpoGaodeMapView.js +1 -1
  17. package/build/ExpoGaodeMapView.js.map +1 -1
  18. package/build/components/overlays/Cluster.d.ts.map +1 -1
  19. package/build/components/overlays/Cluster.js +1 -1
  20. package/build/components/overlays/Cluster.js.map +1 -1
  21. package/build/components/overlays/HeatMap.d.ts.map +1 -1
  22. package/build/components/overlays/HeatMap.js +1 -1
  23. package/build/components/overlays/HeatMap.js.map +1 -1
  24. package/build/components/overlays/Marker.d.ts.map +1 -1
  25. package/build/components/overlays/Marker.js +29 -0
  26. package/build/components/overlays/Marker.js.map +1 -1
  27. package/build/components/overlays/MultiPoint.d.ts.map +1 -1
  28. package/build/components/overlays/MultiPoint.js +1 -1
  29. package/build/components/overlays/MultiPoint.js.map +1 -1
  30. package/build/types/map-view.types.d.ts +2 -1
  31. package/build/types/map-view.types.d.ts.map +1 -1
  32. package/build/types/map-view.types.js.map +1 -1
  33. package/docs/API.en.md +418 -0
  34. package/docs/API.md +2 -0
  35. package/docs/ARCHITECTURE.en.md +423 -0
  36. package/docs/ARCHITECTURE.md +2 -0
  37. package/docs/EXAMPLES.en.md +642 -0
  38. package/docs/EXAMPLES.md +2 -0
  39. package/docs/INITIALIZATION.en.md +346 -0
  40. package/docs/INITIALIZATION.md +2 -0
  41. package/expo-module.config.json +22 -2
  42. package/ios/ExpoGaodeMapModule.swift +0 -334
  43. package/ios/ExpoGaodeMapView.swift +19 -5
  44. package/ios/ExpoGaodeMapViewModule.swift +155 -0
  45. package/ios/managers/UIManager.swift +32 -4
  46. package/ios/overlays/CircleViewModule.swift +31 -0
  47. package/ios/overlays/ClusterViewModule.swift +23 -0
  48. package/ios/overlays/HeatMapViewModule.swift +21 -0
  49. package/ios/overlays/MarkerView.swift +50 -2
  50. package/ios/overlays/MarkerViewModule.swift +53 -0
  51. package/ios/overlays/MultiPointViewModule.swift +15 -0
  52. package/ios/overlays/PolygonViewModule.swift +27 -0
  53. package/ios/overlays/PolylineViewModule.swift +39 -0
  54. package/package.json +1 -1
  55. package/src/ExpoGaodeMapView.tsx +1 -1
  56. package/src/components/overlays/Cluster.tsx +2 -1
  57. package/src/components/overlays/HeatMap.tsx +2 -1
  58. package/src/components/overlays/Marker.tsx +47 -0
  59. package/src/components/overlays/MultiPoint.tsx +2 -1
  60. package/src/types/map-view.types.ts +2 -1
@@ -1,6 +1,6 @@
1
1
  import { requireNativeViewManager } from 'expo-modules-core';
2
2
  import * as React from 'react';
3
- const NativeHeatMap = requireNativeViewManager('ExpoGaodeMap_HeatMapView');
3
+ const NativeHeatMap = requireNativeViewManager('HeatMapView');
4
4
  /**
5
5
  * 高德地图热力图组件
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"HeatMap.js","sourceRoot":"","sources":["../../../src/components/overlays/HeatMap.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,aAAa,GAAG,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAmB;IACjD,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACtC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport type { HeatMapProps } from '../../types';\n\nconst NativeHeatMap = requireNativeViewManager('ExpoGaodeMap_HeatMapView');\n\n\n/**\n * 高德地图热力图组件\n * \n * @param props - 热力图配置属性,继承自NativeHeatMap组件的属性\n * @returns 渲染高德地图原生热力图组件\n */\nexport default function HeatMap(props: HeatMapProps) {\n return <NativeHeatMap {...props} />;\n}\n"]}
1
+ {"version":3,"file":"HeatMap.js","sourceRoot":"","sources":["../../../src/components/overlays/HeatMap.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,aAAa,GAAG,wBAAwB,CAAC,aAAa,CAAC,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAmB;IACjD,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACtC,CAAC","sourcesContent":["\nimport { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport type { HeatMapProps } from '../../types';\n\nconst NativeHeatMap = requireNativeViewManager('HeatMapView');\n\n\n/**\n * 高德地图热力图组件\n * \n * @param props - 热力图配置属性,继承自NativeHeatMap组件的属性\n * @returns 渲染高德地图原生热力图组件\n */\nexport default function HeatMap(props: HeatMapProps) {\n return <NativeHeatMap {...props} />;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../src/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,qBAEhD"}
1
+ {"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../src/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,qBAOhD"}
@@ -1,9 +1,38 @@
1
1
  import * as React from 'react';
2
2
  import { Image } from 'react-native';
3
+ import { requireNativeViewManager } from 'expo-modules-core';
3
4
  import { MapContext, MarkerEventContext } from '../../ExpoGaodeMapView';
5
+ const NativeMarkerView = requireNativeViewManager('MarkerView');
4
6
  export default function Marker(props) {
7
+ // 如果有 children,使用声明式 API
8
+ if (props.children) {
9
+ return <MarkerDeclarative {...props}/>;
10
+ }
11
+ // 否则使用命令式 API
5
12
  return <MarkerImperative {...props}/>;
6
13
  }
14
+ function MarkerDeclarative(props) {
15
+ const eventManager = React.useContext(MarkerEventContext);
16
+ const markerIdRef = React.useRef(`marker_${Date.now()}_${Math.random()}`);
17
+ React.useEffect(() => {
18
+ if (eventManager) {
19
+ eventManager.register(markerIdRef.current, {
20
+ onPress: props.onPress,
21
+ onDragStart: props.onDragStart,
22
+ onDrag: props.onDrag,
23
+ onDragEnd: props.onDragEnd,
24
+ });
25
+ }
26
+ return () => {
27
+ if (eventManager) {
28
+ eventManager.unregister(markerIdRef.current);
29
+ }
30
+ };
31
+ }, [props.onPress, props.onDragStart, props.onDrag, props.onDragEnd]);
32
+ return (<NativeMarkerView position={props.position} title={props.title} draggable={props.draggable} opacity={props.opacity} anchor={props.anchor} flat={props.flat} zIndex={props.zIndex} onPress={props.onPress} onDragStart={props.onDragStart} onDrag={props.onDrag} onDragEnd={props.onDragEnd}>
33
+ {props.children}
34
+ </NativeMarkerView>);
35
+ }
7
36
  function MarkerImperative(props) {
8
37
  const mapRef = React.useContext(MapContext);
9
38
  const eventManager = React.useContext(MarkerEventContext);
@@ -1 +1 @@
1
- {"version":3,"file":"Marker.js","sourceRoot":"","sources":["../../../src/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGxE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC/C,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACzC,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAkB;IAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;IAC3B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,KAAK,CAAC,SAAS,CAAC,GAAG,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SAAS;QACf,KAAK,CAAC,UAAU;QAChB,KAAK,CAAC,QAAQ;KACf,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import * as React from 'react';\nimport { Image } from 'react-native';\nimport { MapContext, MarkerEventContext } from '../../ExpoGaodeMapView';\nimport type { MarkerProps } from '../../types';\n\nexport default function Marker(props: MarkerProps) {\n return <MarkerImperative {...props} />;\n}\n\nfunction MarkerImperative(props: MarkerProps) {\n const mapRef = React.useContext(MapContext);\n const eventManager = React.useContext(MarkerEventContext);\n const markerIdRef = React.useRef<string | null>(null);\n const propsRef = React.useRef(props);\n \n React.useEffect(() => {\n propsRef.current = props;\n }, [props]);\n \n React.useEffect(() => {\n const checkAndAdd = () => {\n if (!mapRef?.current) {\n setTimeout(checkAndAdd, 50);\n return;\n }\n \n const markerId = `marker_${Date.now()}_${Math.random()}`;\n markerIdRef.current = markerId;\n \n if (eventManager) {\n eventManager.register(markerId, {\n onPress: props.onPress,\n onDragStart: props.onDragStart,\n onDrag: props.onDrag,\n onDragEnd: props.onDragEnd,\n });\n }\n \n const processedProps = { ...propsRef.current };\n if (processedProps.icon && typeof processedProps.icon === 'number') {\n const resolved = Image.resolveAssetSource(processedProps.icon);\n processedProps.icon = resolved;\n }\n \n mapRef.current.addMarker(markerId, processedProps);\n };\n \n checkAndAdd();\n \n return () => {\n if (markerIdRef.current) {\n if (eventManager) {\n eventManager.unregister(markerIdRef.current);\n }\n if (mapRef?.current) {\n mapRef.current.removeMarker(markerIdRef.current);\n }\n }\n };\n }, []);\n\n React.useEffect(() => {\n if (markerIdRef.current && eventManager) {\n eventManager.register(markerIdRef.current, {\n onPress: props.onPress,\n onDragStart: props.onDragStart,\n onDrag: props.onDrag,\n onDragEnd: props.onDragEnd,\n });\n }\n }, [props.onPress, props.onDragStart, props.onDrag, props.onDragEnd]);\n\n React.useEffect(() => {\n if (markerIdRef.current && mapRef?.current) {\n const processedProps = { ...props };\n if (processedProps.icon && typeof processedProps.icon === 'number') {\n const resolved = Image.resolveAssetSource(processedProps.icon);\n processedProps.icon = resolved;\n }\n mapRef.current.updateMarker(markerIdRef.current, processedProps);\n }\n }, [\n props.position?.latitude,\n props.position?.longitude,\n props.title,\n props.draggable,\n props.icon,\n props.iconWidth,\n props.iconHeight,\n props.pinColor\n ]);\n \n return null;\n}\n"]}
1
+ {"version":3,"file":"Marker.js","sourceRoot":"","sources":["../../../src/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGxE,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC;AAEhE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC/C,yBAAyB;IACzB,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC1C,CAAC;IACD,cAAc;IACd,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACzC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAkB;IAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE1E,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,YAAY,EAAE,CAAC;YACjB,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE;gBACzC,OAAO,EAAE,KAAK,CAAC,OAAO;gBAC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AAc,CAAC,IAAI,GAAG,QAAQ,CAAC;YACjC,CAAC;YACD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACnE,CAAC;IACH,CAAC,EAAE;QACD,KAAK,CAAC,QAAQ,EAAE,QAAQ;QACxB,KAAK,CAAC,QAAQ,EAAE,SAAS;QACzB,KAAK,CAAC,KAAK;QACX,KAAK,CAAC,SAAS;QACf,KAAK,CAAC,IAAI;QACV,KAAK,CAAC,SAAS;QACf,KAAK,CAAC,UAAU;QAChB,KAAK,CAAC,QAAQ;KACf,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import * as React from 'react';\nimport { Image } from 'react-native';\nimport { requireNativeViewManager } from 'expo-modules-core';\nimport { MapContext, MarkerEventContext } from '../../ExpoGaodeMapView';\nimport type { MarkerProps } from '../../types';\n\nconst NativeMarkerView = requireNativeViewManager('MarkerView');\n\nexport default function Marker(props: MarkerProps) {\n // 如果有 children,使用声明式 API\n if (props.children) {\n return <MarkerDeclarative {...props} />;\n }\n // 否则使用命令式 API\n return <MarkerImperative {...props} />;\n}\n\nfunction MarkerDeclarative(props: MarkerProps) {\n const eventManager = React.useContext(MarkerEventContext);\n const markerIdRef = React.useRef(`marker_${Date.now()}_${Math.random()}`);\n \n React.useEffect(() => {\n if (eventManager) {\n eventManager.register(markerIdRef.current, {\n onPress: props.onPress,\n onDragStart: props.onDragStart,\n onDrag: props.onDrag,\n onDragEnd: props.onDragEnd,\n });\n }\n return () => {\n if (eventManager) {\n eventManager.unregister(markerIdRef.current);\n }\n };\n }, [props.onPress, props.onDragStart, props.onDrag, props.onDragEnd]);\n \n return (\n <NativeMarkerView\n position={props.position}\n title={props.title}\n draggable={props.draggable}\n opacity={props.opacity}\n anchor={props.anchor}\n flat={props.flat}\n zIndex={props.zIndex}\n onPress={props.onPress}\n onDragStart={props.onDragStart}\n onDrag={props.onDrag}\n onDragEnd={props.onDragEnd}\n >\n {props.children}\n </NativeMarkerView>\n );\n}\n\nfunction MarkerImperative(props: MarkerProps) {\n const mapRef = React.useContext(MapContext);\n const eventManager = React.useContext(MarkerEventContext);\n const markerIdRef = React.useRef<string | null>(null);\n const propsRef = React.useRef(props);\n \n React.useEffect(() => {\n propsRef.current = props;\n }, [props]);\n \n React.useEffect(() => {\n const checkAndAdd = () => {\n if (!mapRef?.current) {\n setTimeout(checkAndAdd, 50);\n return;\n }\n \n const markerId = `marker_${Date.now()}_${Math.random()}`;\n markerIdRef.current = markerId;\n \n if (eventManager) {\n eventManager.register(markerId, {\n onPress: props.onPress,\n onDragStart: props.onDragStart,\n onDrag: props.onDrag,\n onDragEnd: props.onDragEnd,\n });\n }\n \n const processedProps = { ...propsRef.current };\n if (processedProps.icon && typeof processedProps.icon === 'number') {\n const resolved = Image.resolveAssetSource(processedProps.icon);\n processedProps.icon = resolved;\n }\n \n mapRef.current.addMarker(markerId, processedProps);\n };\n \n checkAndAdd();\n \n return () => {\n if (markerIdRef.current) {\n if (eventManager) {\n eventManager.unregister(markerIdRef.current);\n }\n if (mapRef?.current) {\n mapRef.current.removeMarker(markerIdRef.current);\n }\n }\n };\n }, []);\n\n React.useEffect(() => {\n if (markerIdRef.current && eventManager) {\n eventManager.register(markerIdRef.current, {\n onPress: props.onPress,\n onDragStart: props.onDragStart,\n onDrag: props.onDrag,\n onDragEnd: props.onDragEnd,\n });\n }\n }, [props.onPress, props.onDragStart, props.onDrag, props.onDragEnd]);\n\n React.useEffect(() => {\n if (markerIdRef.current && mapRef?.current) {\n const processedProps = { ...props };\n if (processedProps.icon && typeof processedProps.icon === 'number') {\n const resolved = Image.resolveAssetSource(processedProps.icon);\n processedProps.icon = resolved;\n }\n mapRef.current.updateMarker(markerIdRef.current, processedProps);\n }\n }, [\n props.position?.latitude,\n props.position?.longitude,\n props.title,\n props.draggable,\n props.icon,\n props.iconWidth,\n props.iconHeight,\n props.pinColor\n ]);\n \n return null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MultiPoint.d.ts","sourceRoot":"","sources":["../../../src/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAKnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,qBAExD"}
1
+ {"version":3,"file":"MultiPoint.d.ts","sourceRoot":"","sources":["../../../src/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAKnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,qBAExD"}
@@ -1,6 +1,6 @@
1
1
  import { requireNativeViewManager } from 'expo-modules-core';
2
2
  import * as React from 'react';
3
- const NativeMultiPoint = requireNativeViewManager('ExpoGaodeMap_MultiPointView');
3
+ const NativeMultiPoint = requireNativeViewManager('MultiPointView');
4
4
  /**
5
5
  * 高德地图多点标记组件
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"MultiPoint.js","sourceRoot":"","sources":["../../../src/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,6BAA6B,CAAC,CAAC;AAGjF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAsB;IACvD,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACzC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport type { MultiPointProps } from '../../types';\n\nconst NativeMultiPoint = requireNativeViewManager('ExpoGaodeMap_MultiPointView');\n\n\n/**\n * 高德地图多点标记组件\n * \n * @param props 多点标记的配置属性,继承自MultiPointProps接口\n * @returns 渲染原生高德地图多点标记组件\n */\nexport default function MultiPoint(props: MultiPointProps) {\n return <NativeMultiPoint {...props} />;\n}\n"]}
1
+ {"version":3,"file":"MultiPoint.js","sourceRoot":"","sources":["../../../src/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAGpE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAsB;IACvD,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACzC,CAAC","sourcesContent":["\nimport { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport type { MultiPointProps } from '../../types';\n\nconst NativeMultiPoint = requireNativeViewManager('MultiPointView');\n\n\n/**\n * 高德地图多点标记组件\n * \n * @param props 多点标记的配置属性,继承自MultiPointProps接口\n * @returns 渲染原生高德地图多点标记组件\n */\nexport default function MultiPoint(props: MultiPointProps) {\n return <NativeMultiPoint {...props} />;\n}\n"]}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { StyleProp, ViewStyle } from 'react-native';
6
6
  import type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';
7
+ import type { Coordinates, ReGeocode } from './location.types';
7
8
  /**
8
9
  * 地图相机事件
9
10
  */
@@ -165,7 +166,7 @@ export interface MapViewProps {
165
166
  /**
166
167
  * 地图定位更新事件
167
168
  */
168
- onLocation?: (event: Location) => void;
169
+ onLocation?: (event: Coordinates | ReGeocode) => void;
169
170
  /**
170
171
  * Marker 点击事件
171
172
  */
@@ -1 +1 @@
1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,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnG"}
@@ -1 +1 @@
1
- {"version":3,"file":"map-view.types.js","sourceRoot":"","sources":["../../src/types/map-view.types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * 高德地图视图相关类型定义\n * 基于 Expo Modules API\n */\n\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';\n\n/**\n * 地图相机事件\n */\nexport interface CameraEvent {\n /**\n * 相机位置\n */\n cameraPosition: CameraPosition;\n\n /**\n * 可见区域边界\n */\n latLngBounds: LatLngBounds;\n}\n\n/**\n * 地图视图属性\n */\nexport interface MapViewProps {\n /**\n * 地图类型\n */\n mapType?: MapType;\n\n /**\n * 初始相机位置\n */\n initialCameraPosition?: CameraPosition;\n\n /**\n * 是否显示当前定位\n */\n myLocationEnabled?: boolean;\n\n /**\n * 是否跟随用户位置\n * @default false\n */\n followUserLocation?: boolean;\n\n /**\n * 定位蓝点配置\n */\n userLocationRepresentation?: {\n /** 精度圈是否显示 @default true */\n showsAccuracyRing?: boolean;\n /** 是否显示方向指示 @default true @platform ios */\n showsHeadingIndicator?: boolean;\n /** 精度圈填充颜色 支持 '#RRGGBB'、'red' 或 ARGB 数字 */\n fillColor?: string | number;\n /** 精度圈边线颜色 */\n strokeColor?: string | number;\n /** 精度圈边线宽度 @default 0 */\n lineWidth?: number;\n /** 内部蓝色圆点是否使用律动效果 @default true @platform ios */\n enablePulseAnimation?: boolean;\n /** 定位点背景色 @default 'white' @platform ios */\n locationDotBgColor?: string | number;\n /** 定位点蓝色圆点颜色 @default 'blue' @platform ios */\n locationDotFillColor?: string | number;\n /** 定位图标 支持网络图片(http/https)、本地文件(file://)或资源名称 */\n image?: string;\n /** 定位图标宽度(像素) */\n imageWidth?: number;\n /** 定位图标高度(像素) */\n imageHeight?: number;\n };\n\n /**\n * 是否显示室内地图\n * \n */\n indoorViewEnabled?: boolean;\n\n /**\n * 是否显示3D建筑\n */\n buildingsEnabled?: boolean;\n\n /**\n * 是否显示标注\n */\n labelsEnabled?: boolean;\n\n /**\n * 是否显示指南针\n */\n compassEnabled?: boolean;\n\n /**\n * 是否显示缩放按钮\n * @platform android\n */\n zoomControlsEnabled?: boolean;\n\n /**\n * 是否显示比例尺\n */\n scaleControlsEnabled?: boolean;\n\n /**\n * 是否显示定位按钮\n * @platform android\n */\n myLocationButtonEnabled?: boolean;\n\n /**\n * 是否显示路况\n */\n trafficEnabled?: boolean;\n\n /**\n * 最大缩放级别\n */\n maxZoom?: number;\n\n /**\n * 最小缩放级别\n */\n minZoom?: number;\n\n /**\n * 是否启用缩放手势\n */\n zoomGesturesEnabled?: boolean;\n\n /**\n * 是否启用滑动手势\n */\n scrollGesturesEnabled?: boolean;\n\n /**\n * 是否启用旋转手势\n */\n rotateGesturesEnabled?: boolean;\n\n /**\n * 是否启用倾斜手势\n */\n tiltGesturesEnabled?: boolean;\n\n /**\n * 定位的最小更新距离(米)\n * @platform ios\n */\n distanceFilter?: number;\n\n /**\n * 最小更新角度(度)\n * @platform ios\n */\n headingFilter?: number;\n\n /**\n * 样式\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * 点击地图事件\n */\n onMapPress?: (event: LatLng) => void;\n\n /**\n * 点击标注点事件\n */\n onPressPoi?: (event: MapPoi) => void;\n\n /**\n * 长按地图事件\n */\n onMapLongPress?: (event: LatLng) => void;\n\n /**\n * 地图状态改变事件(实时触发)\n */\n onCameraMove?: (event: CameraEvent) => void;\n\n /**\n * 地图状态改变完成事件\n */\n onCameraIdle?: (event: CameraEvent) => void;\n\n /**\n * 地图加载完成事件\n */\n onLoad?: (event: {}) => void;\n\n /**\n * 地图定位更新事件\n */\n onLocation?: (event: Location) => void;\n\n /**\n * Marker 点击事件\n */\n onMarkerPress?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Marker 拖拽开始事件\n */\n onMarkerDragStart?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Marker 拖拽中事件\n */\n onMarkerDrag?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Marker 拖拽结束事件\n */\n onMarkerDragEnd?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Circle 点击事件\n */\n onCirclePress?: (event: { circleId: string } & LatLng) => void;\n\n /**\n * Polygon 点击事件\n */\n onPolygonPress?: (event: { polygonId: string } & LatLng) => void;\n\n /**\n * Polyline 点击事件\n */\n onPolylinePress?: (event: { polylineId: string } & LatLng) => void;\n\n /**\n * 子组件\n */\n children?: React.ReactNode;\n}\n\n/**\n * 地图视图方法\n */\nexport interface MapViewMethods {\n /**\n * 移动相机\n * @param cameraPosition 目标相机位置\n * @param duration 动画时长(毫秒)\n */\n moveCamera(cameraPosition: CameraPosition, duration?: number): void;\n\n /**\n * 将屏幕坐标转换为地理坐标\n * @param point 屏幕坐标\n * @returns 地理坐标\n */\n getLatLng(point: Point): Promise<LatLng>;\n}\n\n/**\n * MapView Ref 公开接口(用户使用)\n */\nexport interface MapViewRef {\n moveCamera(position: CameraPosition, duration?: number): Promise<void>;\n getLatLng(point: Point): Promise<LatLng>;\n setCenter(center: LatLng, animated?: boolean): Promise<void>;\n setZoom(zoom: number, animated?: boolean): Promise<void>;\n getCameraPosition(): Promise<CameraPosition>;\n addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;\n removeCircle(id: string): Promise<void>;\n updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;\n addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;\n removeMarker(id: string): Promise<void>;\n updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;\n addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;\n removePolyline(id: string): Promise<void>;\n updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;\n addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;\n removePolygon(id: string): Promise<void>;\n updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;\n}\n\n/**\n * 原生 MapView Ref 接口(所有参数必需)\n */\nexport interface NativeMapViewRef {\n moveCamera(position: CameraPosition, duration: number): Promise<void>;\n getLatLng(point: Point): Promise<LatLng>;\n setCenter(center: LatLng, animated: boolean): Promise<void>;\n setZoom(zoom: number, animated: boolean): Promise<void>;\n getCameraPosition(): Promise<CameraPosition>;\n addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;\n removeCircle(id: string): Promise<void>;\n updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;\n addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;\n removeMarker(id: string): Promise<void>;\n updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;\n addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;\n removePolyline(id: string): Promise<void>;\n updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;\n addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;\n removePolygon(id: string): Promise<void>;\n updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"map-view.types.js","sourceRoot":"","sources":["../../src/types/map-view.types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * 高德地图视图相关类型定义\n * 基于 Expo Modules API\n */\n\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';\nimport type { Coordinates, ReGeocode } from './location.types';\n\n/**\n * 地图相机事件\n */\nexport interface CameraEvent {\n /**\n * 相机位置\n */\n cameraPosition: CameraPosition;\n\n /**\n * 可见区域边界\n */\n latLngBounds: LatLngBounds;\n}\n\n/**\n * 地图视图属性\n */\nexport interface MapViewProps {\n /**\n * 地图类型\n */\n mapType?: MapType;\n\n /**\n * 初始相机位置\n */\n initialCameraPosition?: CameraPosition;\n\n /**\n * 是否显示当前定位\n */\n myLocationEnabled?: boolean;\n\n /**\n * 是否跟随用户位置\n * @default false\n */\n followUserLocation?: boolean;\n\n /**\n * 定位蓝点配置\n */\n userLocationRepresentation?: {\n /** 精度圈是否显示 @default true */\n showsAccuracyRing?: boolean;\n /** 是否显示方向指示 @default true @platform ios */\n showsHeadingIndicator?: boolean;\n /** 精度圈填充颜色 支持 '#RRGGBB'、'red' 或 ARGB 数字 */\n fillColor?: string | number;\n /** 精度圈边线颜色 */\n strokeColor?: string | number;\n /** 精度圈边线宽度 @default 0 */\n lineWidth?: number;\n /** 内部蓝色圆点是否使用律动效果 @default true @platform ios */\n enablePulseAnimation?: boolean;\n /** 定位点背景色 @default 'white' @platform ios */\n locationDotBgColor?: string | number;\n /** 定位点蓝色圆点颜色 @default 'blue' @platform ios */\n locationDotFillColor?: string | number;\n /** 定位图标 支持网络图片(http/https)、本地文件(file://)或资源名称 */\n image?: string;\n /** 定位图标宽度(像素) */\n imageWidth?: number;\n /** 定位图标高度(像素) */\n imageHeight?: number;\n };\n\n /**\n * 是否显示室内地图\n * \n */\n indoorViewEnabled?: boolean;\n\n /**\n * 是否显示3D建筑\n */\n buildingsEnabled?: boolean;\n\n /**\n * 是否显示标注\n */\n labelsEnabled?: boolean;\n\n /**\n * 是否显示指南针\n */\n compassEnabled?: boolean;\n\n /**\n * 是否显示缩放按钮\n * @platform android\n */\n zoomControlsEnabled?: boolean;\n\n /**\n * 是否显示比例尺\n */\n scaleControlsEnabled?: boolean;\n\n /**\n * 是否显示定位按钮\n * @platform android\n */\n myLocationButtonEnabled?: boolean;\n\n /**\n * 是否显示路况\n */\n trafficEnabled?: boolean;\n\n /**\n * 最大缩放级别\n */\n maxZoom?: number;\n\n /**\n * 最小缩放级别\n */\n minZoom?: number;\n\n /**\n * 是否启用缩放手势\n */\n zoomGesturesEnabled?: boolean;\n\n /**\n * 是否启用滑动手势\n */\n scrollGesturesEnabled?: boolean;\n\n /**\n * 是否启用旋转手势\n */\n rotateGesturesEnabled?: boolean;\n\n /**\n * 是否启用倾斜手势\n */\n tiltGesturesEnabled?: boolean;\n\n /**\n * 定位的最小更新距离(米)\n * @platform ios\n */\n distanceFilter?: number;\n\n /**\n * 最小更新角度(度)\n * @platform ios\n */\n headingFilter?: number;\n\n /**\n * 样式\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * 点击地图事件\n */\n onMapPress?: (event: LatLng) => void;\n\n /**\n * 点击标注点事件\n */\n onPressPoi?: (event: MapPoi) => void;\n\n /**\n * 长按地图事件\n */\n onMapLongPress?: (event: LatLng) => void;\n\n /**\n * 地图状态改变事件(实时触发)\n */\n onCameraMove?: (event: CameraEvent) => void;\n\n /**\n * 地图状态改变完成事件\n */\n onCameraIdle?: (event: CameraEvent) => void;\n\n /**\n * 地图加载完成事件\n */\n onLoad?: (event: {}) => void;\n\n /**\n * 地图定位更新事件\n */\n onLocation?: (event: Coordinates | ReGeocode) => void;\n\n /**\n * Marker 点击事件\n */\n onMarkerPress?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Marker 拖拽开始事件\n */\n onMarkerDragStart?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Marker 拖拽中事件\n */\n onMarkerDrag?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Marker 拖拽结束事件\n */\n onMarkerDragEnd?: (event: { markerId: string } & LatLng) => void;\n\n /**\n * Circle 点击事件\n */\n onCirclePress?: (event: { circleId: string } & LatLng) => void;\n\n /**\n * Polygon 点击事件\n */\n onPolygonPress?: (event: { polygonId: string } & LatLng) => void;\n\n /**\n * Polyline 点击事件\n */\n onPolylinePress?: (event: { polylineId: string } & LatLng) => void;\n\n /**\n * 子组件\n */\n children?: React.ReactNode;\n}\n\n/**\n * 地图视图方法\n */\nexport interface MapViewMethods {\n /**\n * 移动相机\n * @param cameraPosition 目标相机位置\n * @param duration 动画时长(毫秒)\n */\n moveCamera(cameraPosition: CameraPosition, duration?: number): void;\n\n /**\n * 将屏幕坐标转换为地理坐标\n * @param point 屏幕坐标\n * @returns 地理坐标\n */\n getLatLng(point: Point): Promise<LatLng>;\n}\n\n/**\n * MapView Ref 公开接口(用户使用)\n */\nexport interface MapViewRef {\n moveCamera(position: CameraPosition, duration?: number): Promise<void>;\n getLatLng(point: Point): Promise<LatLng>;\n setCenter(center: LatLng, animated?: boolean): Promise<void>;\n setZoom(zoom: number, animated?: boolean): Promise<void>;\n getCameraPosition(): Promise<CameraPosition>;\n addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;\n removeCircle(id: string): Promise<void>;\n updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;\n addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;\n removeMarker(id: string): Promise<void>;\n updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;\n addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;\n removePolyline(id: string): Promise<void>;\n updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;\n addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;\n removePolygon(id: string): Promise<void>;\n updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;\n}\n\n/**\n * 原生 MapView Ref 接口(所有参数必需)\n */\nexport interface NativeMapViewRef {\n moveCamera(position: CameraPosition, duration: number): Promise<void>;\n getLatLng(point: Point): Promise<LatLng>;\n setCenter(center: LatLng, animated: boolean): Promise<void>;\n setZoom(zoom: number, animated: boolean): Promise<void>;\n getCameraPosition(): Promise<CameraPosition>;\n addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;\n removeCircle(id: string): Promise<void>;\n updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;\n addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;\n removeMarker(id: string): Promise<void>;\n updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;\n addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;\n removePolyline(id: string): Promise<void>;\n updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;\n addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;\n removePolygon(id: string): Promise<void>;\n updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;\n}\n"]}
package/docs/API.en.md ADDED
@@ -0,0 +1,418 @@
1
+ # API Documentation
2
+
3
+ English | [简体中文](./API.md)
4
+
5
+ Complete API reference documentation.
6
+
7
+ > ⚠️ **Permission and Privacy Compliance Warning**
8
+ >
9
+ > Before using map and location features, ensure:
10
+ > 1. ✅ Required permission declarations configured in native projects
11
+ > 2. ✅ Runtime user authorization requested
12
+ > 3. ✅ Compliance with privacy laws (e.g., PIPL in China)
13
+ > 4. ✅ AMap SDK privacy compliance interface configured
14
+ >
15
+ > For detailed configuration, see [README.md](../README.md#permission-configuration)
16
+
17
+ ## Table of Contents
18
+
19
+ - [MapView Props](#mapview-props)
20
+ - [MapView Methods](#mapview-methods)
21
+ - [Location API](#location-api)
22
+ - [Type Definitions](#type-definitions)
23
+
24
+ ## MapView Props
25
+
26
+ ### Basic Configuration
27
+
28
+ | Property | Type | Default | Description |
29
+ |----------|------|---------|-------------|
30
+ | `mapType` | `MapType` | `0` | Map type (0: Normal, 1: Satellite, 2: Night, 3: Navigation, 4: Bus) |
31
+ | `initialCameraPosition` | `CameraPosition` | - | Initial camera position |
32
+ | `style` | `ViewStyle` | - | Component style |
33
+
34
+ ### Location Related
35
+
36
+ > ⚠️ **Permission Required**: Location features require user authorization
37
+ > - Android: `ACCESS_FINE_LOCATION` + `ACCESS_COARSE_LOCATION`
38
+ > - iOS: `NSLocationWhenInUseUsageDescription` (Info.plist)
39
+
40
+ | Property | Type | Default | Description |
41
+ |----------|------|---------|-------------|
42
+ | `myLocationEnabled` | `boolean` | `false` | Show user location |
43
+ | `followUserLocation` | `boolean` | `false` | Follow user location |
44
+ | `userLocationRepresentation` | `object` | - | User location style configuration |
45
+
46
+ #### userLocationRepresentation Configuration
47
+
48
+ | Property | Type | Platform | Default | Description |
49
+ |----------|------|----------|---------|-------------|
50
+ | `showsAccuracyRing` | `boolean` | All | `true` | Show accuracy ring |
51
+ | `fillColor` | `string \| number` | All | - | Accuracy ring fill color |
52
+ | `strokeColor` | `string \| number` | All | - | Accuracy ring stroke color |
53
+ | `lineWidth` | `number` | All | `0` | Accuracy ring stroke width |
54
+ | `image` | `string` | All | - | Custom location icon |
55
+ | `imageWidth` | `number` | All | - | Icon width (dp/pt) |
56
+ | `imageHeight` | `number` | All | - | Icon height (dp/pt) |
57
+ | `showsHeadingIndicator` | `boolean` | iOS only | `true` | Show heading indicator |
58
+ | `enablePulseAnimation` | `boolean` | iOS only | `true` | Enable pulse animation |
59
+ | `locationDotBgColor` | `string \| number` | iOS only | `'white'` | Location dot background color |
60
+ | `locationDotFillColor` | `string \| number` | iOS only | `'blue'` | Location dot fill color |
61
+
62
+ ### UI Controls
63
+
64
+ | Property | Type | Default | Description |
65
+ |----------|------|---------|-------------|
66
+ | `zoomControlsEnabled` | `boolean` | `true` | Show zoom controls (Android) |
67
+ | `compassEnabled` | `boolean` | `true` | Show compass |
68
+ | `scaleControlsEnabled` | `boolean` | `true` | Show scale controls |
69
+
70
+ ### Gesture Controls
71
+
72
+ | Property | Type | Default | Description |
73
+ |----------|------|---------|-------------|
74
+ | `zoomGesturesEnabled` | `boolean` | `true` | Enable zoom gestures |
75
+ | `scrollGesturesEnabled` | `boolean` | `true` | Enable scroll gestures |
76
+ | `rotateGesturesEnabled` | `boolean` | `true` | Enable rotate gestures |
77
+ | `tiltGesturesEnabled` | `boolean` | `true` | Enable tilt gestures |
78
+
79
+ ### Zoom Controls
80
+
81
+ | Property | Type | Default | Description |
82
+ |----------|------|---------|-------------|
83
+ | `maxZoom` | `number` | `20` | Maximum zoom level (3-20) |
84
+ | `minZoom` | `number` | `3` | Minimum zoom level (3-20) |
85
+
86
+ ### Layer Display
87
+
88
+ | Property | Type | Default | Description |
89
+ |----------|------|---------|-------------|
90
+ | `trafficEnabled` | `boolean` | `false` | Show traffic layer |
91
+ | `buildingsEnabled` | `boolean` | `true` | Show 3D buildings |
92
+ | `indoorViewEnabled` | `boolean` | `false` | Show indoor maps |
93
+
94
+ ### Event Callbacks
95
+
96
+ | Event | Parameters | Description |
97
+ |-------|------------|-------------|
98
+ | `onMapPress` | `(event: LatLng) => void` | Map press event |
99
+ | `onMapLongPress` | `(event: LatLng) => void` | Map long press event |
100
+ | `onLoad` | `() => void` | Map load complete event |
101
+
102
+ ## MapView Methods
103
+
104
+ Called via Ref:
105
+
106
+ ```tsx
107
+ interface MapViewRef {
108
+ // Camera control
109
+ moveCamera(position: CameraPosition, duration?: number): Promise<void>;
110
+ setCenter(center: LatLng, animated?: boolean): Promise<void>;
111
+ setZoom(zoom: number, animated?: boolean): Promise<void>;
112
+ getCameraPosition(): Promise<CameraPosition>;
113
+ getLatLng(point: Point): Promise<LatLng>;
114
+
115
+ // Circle operations
116
+ addCircle(id: string, props: CircleProps): Promise<void>;
117
+ removeCircle(id: string): Promise<void>;
118
+ updateCircle(id: string, props: Partial<CircleProps>): Promise<void>;
119
+
120
+ // Marker operations
121
+ addMarker(id: string, props: MarkerProps): Promise<void>;
122
+ removeMarker(id: string): Promise<void>;
123
+ updateMarker(id: string, props: Partial<MarkerProps>): Promise<void>;
124
+
125
+ // Polyline operations
126
+ addPolyline(id: string, props: PolylineProps): Promise<void>;
127
+ removePolyline(id: string): Promise<void>;
128
+ updatePolyline(id: string, props: Partial<PolylineProps>): Promise<void>;
129
+
130
+ // Polygon operations
131
+ addPolygon(id: string, props: PolygonProps): Promise<void>;
132
+ removePolygon(id: string): Promise<void>;
133
+ updatePolygon(id: string, props: Partial<PolygonProps>): Promise<void>;
134
+ }
135
+ ```
136
+
137
+ ## Location API
138
+
139
+ > ⚠️ **Permission Required**: All location APIs require location permission
140
+ >
141
+ > Call `checkLocationPermission()` and `requestLocationPermission()` before use
142
+ >
143
+ > Details: [INITIALIZATION.md](./INITIALIZATION.md)
144
+
145
+ ### Location Control
146
+
147
+ | Method | Parameters | Return | Description |
148
+ |--------|------------|--------|-------------|
149
+ | `initSDK` | `{androidKey, iosKey}` | `void` | Initialize SDK |
150
+ | `start` | - | `void` | Start continuous location |
151
+ | `stop` | - | `void` | Stop location |
152
+ | `isStarted` | - | `Promise<boolean>` | Check if locating |
153
+ | `getCurrentLocation` | - | `Promise<Location>` | Get current location |
154
+
155
+ ### Location Configuration
156
+
157
+ #### configure() Unified Configuration
158
+
159
+ ```tsx
160
+ import { configure } from 'expo-gaode-map';
161
+
162
+ configure({
163
+ withReGeocode: true,
164
+ mode: 0,
165
+ interval: 2000,
166
+ // ... more options
167
+ });
168
+ ```
169
+
170
+ #### Individual Configuration Methods
171
+
172
+ > **Platform Support**: Some configuration methods are platform-specific, others will be silently ignored
173
+
174
+ ##### Common Configuration (All Platforms)
175
+
176
+ | Method | Parameters | Description |
177
+ |--------|------------|-------------|
178
+ | `setLocatingWithReGeocode` | `boolean` | Return reverse geocoding info |
179
+ | `setInterval` | `number` | Location interval (ms) / distance filter (m) |
180
+ | `setGeoLanguage` | `string` | Reverse geocoding language |
181
+
182
+ ##### Android-Specific Configuration
183
+
184
+ | Method | Parameters | Description |
185
+ |--------|------------|-------------|
186
+ | `setLocationMode` | `0 \| 1 \| 2` | Location mode (0: High accuracy, 1: Battery saving, 2: Device only) |
187
+ | `setOnceLocation` | `boolean` | Single location |
188
+ | `setSensorEnable` | `boolean` | Use device sensors |
189
+ | `setWifiScan` | `boolean` | Allow WiFi scanning |
190
+ | `setGpsFirst` | `boolean` | GPS priority |
191
+ | `setOnceLocationLatest` | `boolean` | Wait for WiFi list refresh |
192
+ | `setLocationCacheEnable` | `boolean` | Use cache strategy |
193
+ | `setHttpTimeOut` | `number` | Network request timeout (ms) |
194
+
195
+ ##### iOS-Specific Configuration
196
+
197
+ | Method | Parameters | Description |
198
+ |--------|------------|-------------|
199
+ | `setLocationTimeout` | `number` | Location timeout (seconds, default 2s) |
200
+ | `setReGeocodeTimeout` | `number` | Reverse geocoding timeout (seconds, default 2s) |
201
+ | `setDesiredAccuracy` | `number` | Desired accuracy (0-5, default 3: 100m accuracy) |
202
+ | `setDistanceFilter` | `number` | Distance filter (meters, default 10m) |
203
+ | `setPausesLocationUpdatesAutomatically` | `boolean` | Auto pause location updates (default false) |
204
+
205
+ **iOS Default Location Configuration:**
206
+
207
+ Based on AMap official recommendations, this library uses the following default configuration for fast location:
208
+ - **Accuracy**: `kCLLocationAccuracyHundredMeters` (100m accuracy, level 3)
209
+ - **Location Timeout**: 2 seconds
210
+ - **Reverse Geocoding Timeout**: 2 seconds
211
+ - **Distance Filter**: 10 meters
212
+
213
+ > **Accuracy Notes**:
214
+ > - **100m Accuracy** (Recommended): Get results in 2-3 seconds, suitable for most scenarios
215
+ > - **High Accuracy**: Use `setDesiredAccuracy(1)` to switch to `kCLLocationAccuracyBest`, requires `setLocationTimeout(10)` and `setReGeocodeTimeout(10)`, takes ~10 seconds for 10m accuracy
216
+ > - Apple's initial location result is coarse, high accuracy requires more time
217
+
218
+ **Accuracy Level Reference:**
219
+
220
+ | Level | Constant | Description | Recommended Timeout |
221
+ |-------|----------|-------------|---------------------|
222
+ | 0 | `kCLLocationAccuracyBestForNavigation` | Best for navigation | 10s |
223
+ | 1 | `kCLLocationAccuracyBest` | Best accuracy (~10m) | 10s |
224
+ | 2 | `kCLLocationAccuracyNearestTenMeters` | 10m accuracy | 5s |
225
+ | 3 | `kCLLocationAccuracyHundredMeters` | 100m accuracy (default) | 2-3s |
226
+ | 4 | `kCLLocationAccuracyKilometer` | 1km accuracy | 1s |
227
+ | 5 | `kCLLocationAccuracyThreeKilometers` | 3km accuracy | 1s |
228
+
229
+ ##### Background Location Configuration (All Platforms)
230
+
231
+ | Method | Parameters | Description |
232
+ |--------|------------|-------------|
233
+ | `setAllowsBackgroundLocationUpdates` | `boolean` | Allow background location |
234
+
235
+ > **Background Location Notes**:
236
+ > - **iOS**: Requires `NSLocationAlwaysAndWhenInUseUsageDescription` and `UIBackgroundModes` (including `location`) in Info.plist
237
+ > - **Android**: Automatically starts foreground service, requires `ACCESS_BACKGROUND_LOCATION` permission (Android 10+)
238
+ > - Background location increases battery consumption, use with caution
239
+
240
+ ### Heading Updates (iOS)
241
+
242
+ | Method | Description |
243
+ |--------|-------------|
244
+ | `startUpdatingHeading` | Start heading updates |
245
+ | `stopUpdatingHeading` | Stop heading updates |
246
+
247
+ ### Coordinate Conversion
248
+
249
+ | Method | Parameters | Return | Description |
250
+ |--------|------------|--------|-------------|
251
+ | `coordinateConvert` | `coordinate, type` | `Promise<LatLng>` | Convert to AMap coordinates |
252
+
253
+ ## Overlay Components
254
+
255
+ > **Event Callback Note**: Event callbacks (e.g., `onPress`) for all overlays only work in **declarative usage**. Overlays added via imperative APIs (e.g., `addCircle`, `addMarker`) cannot trigger these events.
256
+
257
+ ### Circle
258
+
259
+ #### Properties
260
+
261
+ | Property | Type | Platform | Default | Description |
262
+ |----------|------|----------|---------|-------------|
263
+ | `center` | `LatLng` | All | - | Circle center (required) |
264
+ | `radius` | `number` | All | - | Radius (meters) |
265
+ | `fillColor` | `string` | All | - | Fill color (ARGB format: `#AARRGGBB`) |
266
+ | `strokeColor` | `string` | All | - | Stroke color (ARGB format: `#AARRGGBB`) |
267
+ | `strokeWidth` | `number` | All | `1` | Stroke width (pt/dp) |
268
+
269
+ #### Events
270
+
271
+ | Event | Parameters | Description |
272
+ |-------|------------|-------------|
273
+ | `onPress` | `() => void` | Circle press |
274
+
275
+ ### Polyline
276
+
277
+ #### Properties
278
+
279
+ | Property | Type | Platform | Default | Description |
280
+ |----------|------|----------|---------|-------------|
281
+ | `points` | `LatLng[]` | All | - | Polyline points (required) |
282
+ | `width` | `number` | All | `5` | Line width (pt/dp) |
283
+ | `color` | `string` | All | - | Line color (ARGB format: `#AARRGGBB`) |
284
+ | `texture` | `string` | All | - | Texture image URL |
285
+ | `dotted` | `boolean` | Android only | `false` | Draw dashed line |
286
+ | `geodesic` | `boolean` | Android only | `false` | Draw geodesic line |
287
+ | `zIndex` | `number` | All | `0` | Z-index |
288
+
289
+ #### Events
290
+
291
+ | Event | Parameters | Description |
292
+ |-------|------------|-------------|
293
+ | `onPress` | `() => void` | Polyline press |
294
+
295
+ > **Texture Notes**:
296
+ > - Supports network images (http/https) and local files (use `Image.resolveAssetSource()`)
297
+ > - Texture tiles along the polyline direction
298
+ > - Recommend larger `width` values (e.g., 20) for better texture display
299
+ > - **Segment Texture Limitation**: Single Polyline can only have one texture. For different textures on segments, create multiple Polyline components
300
+
301
+ ### Polygon
302
+
303
+ #### Properties
304
+
305
+ | Property | Type | Platform | Default | Description |
306
+ |----------|------|----------|---------|-------------|
307
+ | `points` | `LatLng[]` | All | - | Polygon vertices (required) |
308
+ | `fillColor` | `string` | All | - | Fill color (ARGB format: `#AARRGGBB`) |
309
+ | `strokeColor` | `string` | All | - | Stroke color (ARGB format: `#AARRGGBB`) |
310
+ | `strokeWidth` | `number` | All | `1` | Stroke width (pt/dp) |
311
+
312
+ #### Events
313
+
314
+ | Event | Parameters | Description |
315
+ |-------|------------|-------------|
316
+ | `onPress` | `() => void` | Polygon press |
317
+
318
+ ### Marker
319
+
320
+ #### Properties
321
+
322
+ | Property | Type | Platform | Default | Description |
323
+ |----------|------|----------|---------|-------------|
324
+ | `position` | `LatLng` | All | - | Marker position (required) |
325
+ | `title` | `string` | All | - | Title |
326
+ | `snippet` | `string` | All | - | Description |
327
+ | `draggable` | `boolean` | All | `false` | Draggable |
328
+ | `icon` | `string \| ImageSourcePropType` | All | - | Custom icon |
329
+ | `iconWidth` | `number` | All | `40` | Icon width (pt/dp) |
330
+ | `iconHeight` | `number` | All | `40` | Icon height (pt/dp) |
331
+ | `opacity` | `number` | Android only | `1.0` | Opacity [0, 1] |
332
+ | `flat` | `boolean` | Android only | `false` | Flat on map |
333
+ | `zIndex` | `number` | Android only | `0` | Z-index |
334
+ | `anchor` | `Point` | Android only | `{x: 0.5, y: 1.0}` | Anchor ratio |
335
+ | `centerOffset` | `Point` | iOS only | - | Center offset |
336
+ | `animatesDrop` | `boolean` | iOS only | `false` | Drop animation |
337
+ | `pinColor` | `'red' \| 'green' \| 'purple'` | iOS only | `'red'` | Pin color |
338
+
339
+ #### Events
340
+
341
+ | Event | Parameters | Description |
342
+ |-------|------------|-------------|
343
+ | `onPress` | `() => void` | Marker press |
344
+ | `onDragStart` | `() => void` | Drag start |
345
+ | `onDrag` | `() => void` | Dragging |
346
+ | `onDragEnd` | `(event: { nativeEvent: LatLng }) => void` | Drag end |
347
+
348
+ > **⚠️ Important**: Event callbacks only work in **declarative usage**. Markers added via imperative API (`addMarker`) cannot trigger these events.
349
+
350
+ #### Icon Notes
351
+
352
+ - **Icon Format**: Supports network images (http/https), local files (use `Image.resolveAssetSource()`)
353
+ - **Size Unit**: `iconWidth` and `iconHeight` use points, auto-scale on different density screens
354
+ - **Anchor**: `anchor` defines icon position relative to coordinate, `{x: 0.5, y: 1.0}` means bottom-center aligned
355
+
356
+ ## Type Definitions
357
+
358
+ ### MapType
359
+
360
+ ```typescript
361
+ enum MapType {
362
+ NORMAL = 0, // Normal map
363
+ SATELLITE = 1, // Satellite map
364
+ NIGHT = 2, // Night map
365
+ NAVI = 3, // Navigation map
366
+ BUS = 4, // Bus map
367
+ }
368
+ ```
369
+
370
+ ### CameraPosition
371
+
372
+ ```typescript
373
+ interface CameraPosition {
374
+ target: LatLng; // Target position
375
+ zoom: number; // Zoom level (3-20)
376
+ tilt?: number; // Tilt angle (0-60)
377
+ bearing?: number; // Rotation angle (0-360)
378
+ }
379
+ ```
380
+
381
+ ### LatLng
382
+
383
+ ```typescript
384
+ interface LatLng {
385
+ latitude: number; // Latitude
386
+ longitude: number; // Longitude
387
+ }
388
+ ```
389
+
390
+ ### Location
391
+
392
+ ```typescript
393
+ interface Location {
394
+ // Basic location info
395
+ latitude: number;
396
+ longitude: number;
397
+ accuracy: number;
398
+ altitude: number;
399
+ bearing: number;
400
+ speed: number;
401
+
402
+ // Address info (requires reverse geocoding)
403
+ address?: string;
404
+ province?: string;
405
+ city?: string;
406
+ district?: string;
407
+ street?: string;
408
+ streetNumber?: string;
409
+ country?: string;
410
+ cityCode?: string;
411
+ adCode?: string;
412
+ poiName?: string;
413
+ aoiName?: string;
414
+
415
+ // Other info
416
+ provider?: string;
417
+ timestamp?: number;
418
+ }
package/docs/API.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # API 文档
2
2
 
3
+ [English](./API.en.md) | 简体中文
4
+
3
5
  完整的 API 参考文档。
4
6
 
5
7
  > ⚠️ **权限和隐私合规警告**