expo-gaode-map-navigation 2.0.17 → 2.0.19
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/android/build.gradle +10 -25
- package/build/ExpoGaodeMapNaviView.js +2 -1
- package/build/ExpoGaodeMapNaviView.js.map +1 -1
- package/build/ExpoGaodeMapNavigationModule.d.ts +1 -1
- package/build/ExpoGaodeMapNavigationModule.d.ts.map +1 -1
- package/build/ExpoGaodeMapNavigationModule.js.map +1 -1
- package/build/map/ExpoGaodeMapModule.d.ts +3 -2
- package/build/map/ExpoGaodeMapModule.d.ts.map +1 -1
- package/build/map/ExpoGaodeMapModule.js +13 -4
- package/build/map/ExpoGaodeMapModule.js.map +1 -1
- package/build/map/ExpoGaodeMapOfflineModule.js +1 -1
- package/build/map/ExpoGaodeMapOfflineModule.js.map +1 -1
- package/build/map/ExpoGaodeMapView.js +2 -8
- package/build/map/ExpoGaodeMapView.js.map +1 -1
- package/build/map/components/FoldableMapView.d.ts +3 -2
- package/build/map/components/FoldableMapView.d.ts.map +1 -1
- package/build/map/components/FoldableMapView.js +2 -1
- package/build/map/components/FoldableMapView.js.map +1 -1
- package/build/map/components/MapUI.js +2 -1
- package/build/map/components/MapUI.js.map +1 -1
- package/build/map/components/overlays/Circle.d.ts +1 -1
- package/build/map/components/overlays/Circle.d.ts.map +1 -1
- package/build/map/components/overlays/Circle.js +2 -1
- package/build/map/components/overlays/Circle.js.map +1 -1
- package/build/map/components/overlays/Cluster.d.ts +1 -1
- package/build/map/components/overlays/Cluster.d.ts.map +1 -1
- package/build/map/components/overlays/Cluster.js +2 -1
- package/build/map/components/overlays/Cluster.js.map +1 -1
- package/build/map/components/overlays/HeatMap.d.ts +1 -1
- package/build/map/components/overlays/HeatMap.d.ts.map +1 -1
- package/build/map/components/overlays/HeatMap.js +2 -1
- package/build/map/components/overlays/HeatMap.js.map +1 -1
- package/build/map/components/overlays/Marker.d.ts +1 -1
- package/build/map/components/overlays/Marker.d.ts.map +1 -1
- package/build/map/components/overlays/Marker.js +2 -5
- package/build/map/components/overlays/Marker.js.map +1 -1
- package/build/map/components/overlays/MultiPoint.d.ts +1 -2
- package/build/map/components/overlays/MultiPoint.d.ts.map +1 -1
- package/build/map/components/overlays/MultiPoint.js +2 -1
- package/build/map/components/overlays/MultiPoint.js.map +1 -1
- package/build/map/components/overlays/Polygon.d.ts +1 -1
- package/build/map/components/overlays/Polygon.d.ts.map +1 -1
- package/build/map/components/overlays/Polygon.js +2 -1
- package/build/map/components/overlays/Polygon.js.map +1 -1
- package/build/map/components/overlays/Polyline.d.ts +1 -1
- package/build/map/components/overlays/Polyline.d.ts.map +1 -1
- package/build/map/components/overlays/Polyline.js +2 -1
- package/build/map/components/overlays/Polyline.js.map +1 -1
- package/build/map/search/ExpoGaodeMapSearchModule.d.ts +1 -1
- package/build/map/search/ExpoGaodeMapSearchModule.d.ts.map +1 -1
- package/build/map/search/ExpoGaodeMapSearchModule.js.map +1 -1
- package/build/map/types/common.types.d.ts +1 -1
- package/build/map/types/common.types.d.ts.map +1 -1
- package/build/map/types/common.types.js.map +1 -1
- package/build/map/types/map-view.types.d.ts +2 -2
- package/build/map/types/map-view.types.d.ts.map +1 -1
- package/build/map/types/map-view.types.js.map +1 -1
- package/build/map/utils/ErrorHandler.d.ts +4 -0
- package/build/map/utils/ErrorHandler.d.ts.map +1 -1
- package/build/map/utils/ErrorHandler.js +8 -0
- package/build/map/utils/ErrorHandler.js.map +1 -1
- package/build/map/utils/GeoUtils.d.ts +1 -1
- package/build/map/utils/GeoUtils.d.ts.map +1 -1
- package/build/map/utils/GeoUtils.js +2 -2
- package/build/map/utils/GeoUtils.js.map +1 -1
- package/build/route-geometry.d.ts.map +1 -1
- package/build/route-geometry.js +24 -8
- package/build/route-geometry.js.map +1 -1
- package/build/src/ExpoGaodeMapNaviView.d.ts +67 -0
- package/build/src/ExpoGaodeMapNaviView.d.ts.map +1 -0
- package/build/src/ExpoGaodeMapNaviView.js +138 -0
- package/build/src/ExpoGaodeMapNaviView.js.map +1 -0
- package/build/src/ExpoGaodeMapNavigation.types.d.ts +2 -0
- package/build/src/ExpoGaodeMapNavigation.types.d.ts.map +1 -0
- package/build/src/ExpoGaodeMapNavigation.types.js +3 -0
- package/build/src/ExpoGaodeMapNavigation.types.js.map +1 -0
- package/build/src/ExpoGaodeMapNavigationModule.d.ts +4 -0
- package/build/src/ExpoGaodeMapNavigationModule.d.ts.map +1 -0
- package/build/src/ExpoGaodeMapNavigationModule.js +27 -0
- package/build/src/ExpoGaodeMapNavigationModule.js.map +1 -0
- package/build/src/index.d.ts +47 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +48 -0
- package/build/src/index.js.map +1 -0
- package/build/src/map/ExpoGaodeMapModule.d.ts +256 -0
- package/build/src/map/ExpoGaodeMapModule.d.ts.map +1 -0
- package/build/src/map/ExpoGaodeMapModule.js +813 -0
- package/build/src/map/ExpoGaodeMapModule.js.map +1 -0
- package/build/src/map/ExpoGaodeMapOfflineModule.d.ts +145 -0
- package/build/src/map/ExpoGaodeMapOfflineModule.d.ts.map +1 -0
- package/build/src/map/ExpoGaodeMapOfflineModule.js +24 -0
- package/build/src/map/ExpoGaodeMapOfflineModule.js.map +1 -0
- package/build/src/map/ExpoGaodeMapView.d.ts +23 -0
- package/build/src/map/ExpoGaodeMapView.d.ts.map +1 -0
- package/build/src/map/ExpoGaodeMapView.js +173 -0
- package/build/src/map/ExpoGaodeMapView.js.map +1 -0
- package/build/src/map/components/FoldableMapView.d.ts +39 -0
- package/build/src/map/components/FoldableMapView.d.ts.map +1 -0
- package/build/src/map/components/FoldableMapView.js +171 -0
- package/build/src/map/components/FoldableMapView.js.map +1 -0
- package/build/src/map/components/MapContext.d.ts +13 -0
- package/build/src/map/components/MapContext.d.ts.map +1 -0
- package/build/src/map/components/MapContext.js +18 -0
- package/build/src/map/components/MapContext.js.map +1 -0
- package/build/src/map/components/MapUI.d.ts +19 -0
- package/build/src/map/components/MapUI.d.ts.map +1 -0
- package/build/src/map/components/MapUI.js +24 -0
- package/build/src/map/components/MapUI.js.map +1 -0
- package/build/src/map/components/overlays/Circle.d.ts +13 -0
- package/build/src/map/components/overlays/Circle.d.ts.map +1 -0
- package/build/src/map/components/overlays/Circle.js +20 -0
- package/build/src/map/components/overlays/Circle.js.map +1 -0
- package/build/src/map/components/overlays/Cluster.d.ts +12 -0
- package/build/src/map/components/overlays/Cluster.d.ts.map +1 -0
- package/build/src/map/components/overlays/Cluster.js +16 -0
- package/build/src/map/components/overlays/Cluster.js.map +1 -0
- package/build/src/map/components/overlays/HeatMap.d.ts +12 -0
- package/build/src/map/components/overlays/HeatMap.d.ts.map +1 -0
- package/build/src/map/components/overlays/HeatMap.js +46 -0
- package/build/src/map/components/overlays/HeatMap.js.map +1 -0
- package/build/src/map/components/overlays/Marker.d.ts +16 -0
- package/build/src/map/components/overlays/Marker.d.ts.map +1 -0
- package/build/src/map/components/overlays/Marker.js +125 -0
- package/build/src/map/components/overlays/Marker.js.map +1 -0
- package/build/src/map/components/overlays/MultiPoint.d.ts +9 -0
- package/build/src/map/components/overlays/MultiPoint.d.ts.map +1 -0
- package/build/src/map/components/overlays/MultiPoint.js +15 -0
- package/build/src/map/components/overlays/MultiPoint.js.map +1 -0
- package/build/src/map/components/overlays/Polygon.d.ts +12 -0
- package/build/src/map/components/overlays/Polygon.d.ts.map +1 -0
- package/build/src/map/components/overlays/Polygon.js +20 -0
- package/build/src/map/components/overlays/Polygon.js.map +1 -0
- package/build/src/map/components/overlays/Polyline.d.ts +12 -0
- package/build/src/map/components/overlays/Polyline.d.ts.map +1 -0
- package/build/src/map/components/overlays/Polyline.js +20 -0
- package/build/src/map/components/overlays/Polyline.js.map +1 -0
- package/build/src/map/components/overlays/index.d.ts +8 -0
- package/build/src/map/components/overlays/index.d.ts.map +1 -0
- package/build/src/map/components/overlays/index.js +8 -0
- package/build/src/map/components/overlays/index.js.map +1 -0
- package/build/src/map/index.d.ts +35 -0
- package/build/src/map/index.d.ts.map +1 -0
- package/build/src/map/index.js +48 -0
- package/build/src/map/index.js.map +1 -0
- package/build/src/map/search/ExpoGaodeMapSearch.types.d.ts +340 -0
- package/build/src/map/search/ExpoGaodeMapSearch.types.d.ts.map +1 -0
- package/build/src/map/search/ExpoGaodeMapSearch.types.js +19 -0
- package/build/src/map/search/ExpoGaodeMapSearch.types.js.map +1 -0
- package/build/src/map/search/ExpoGaodeMapSearchModule.d.ts +74 -0
- package/build/src/map/search/ExpoGaodeMapSearchModule.d.ts.map +1 -0
- package/build/src/map/search/ExpoGaodeMapSearchModule.js +48 -0
- package/build/src/map/search/ExpoGaodeMapSearchModule.js.map +1 -0
- package/build/src/map/search/index.d.ts +156 -0
- package/build/src/map/search/index.d.ts.map +1 -0
- package/build/src/map/search/index.js +171 -0
- package/build/src/map/search/index.js.map +1 -0
- package/build/src/map/types/common.types.d.ts +199 -0
- package/build/src/map/types/common.types.d.ts.map +1 -0
- package/build/src/map/types/common.types.js +33 -0
- package/build/src/map/types/common.types.js.map +1 -0
- package/build/src/map/types/index.d.ts +13 -0
- package/build/src/map/types/index.d.ts.map +1 -0
- package/build/src/map/types/index.js +7 -0
- package/build/src/map/types/index.js.map +1 -0
- package/build/src/map/types/location.types.d.ts +358 -0
- package/build/src/map/types/location.types.d.ts.map +1 -0
- package/build/src/map/types/location.types.js +93 -0
- package/build/src/map/types/location.types.js.map +1 -0
- package/build/src/map/types/map-view.types.d.ts +340 -0
- package/build/src/map/types/map-view.types.d.ts.map +1 -0
- package/build/src/map/types/map-view.types.js +6 -0
- package/build/src/map/types/map-view.types.js.map +1 -0
- package/build/src/map/types/native-module.types.d.ts +395 -0
- package/build/src/map/types/native-module.types.d.ts.map +1 -0
- package/build/src/map/types/native-module.types.js +5 -0
- package/build/src/map/types/native-module.types.js.map +1 -0
- package/build/src/map/types/offline.types.d.ts +133 -0
- package/build/src/map/types/offline.types.d.ts.map +1 -0
- package/build/src/map/types/offline.types.js +5 -0
- package/build/src/map/types/offline.types.js.map +1 -0
- package/build/src/map/types/overlays.types.d.ts +456 -0
- package/build/src/map/types/overlays.types.d.ts.map +1 -0
- package/build/src/map/types/overlays.types.js +6 -0
- package/build/src/map/types/overlays.types.js.map +1 -0
- package/build/src/map/types/route-playback.types.d.ts +28 -0
- package/build/src/map/types/route-playback.types.d.ts.map +1 -0
- package/build/src/map/types/route-playback.types.js +2 -0
- package/build/src/map/types/route-playback.types.js.map +1 -0
- package/build/src/map/utils/ErrorHandler.d.ts +121 -0
- package/build/src/map/utils/ErrorHandler.d.ts.map +1 -0
- package/build/src/map/utils/ErrorHandler.js +470 -0
- package/build/src/map/utils/ErrorHandler.js.map +1 -0
- package/build/src/map/utils/GeoUtils.d.ts +21 -0
- package/build/src/map/utils/GeoUtils.d.ts.map +1 -0
- package/build/src/map/utils/GeoUtils.js +78 -0
- package/build/src/map/utils/GeoUtils.js.map +1 -0
- package/build/src/map/utils/OfflineMapManager.d.ts +153 -0
- package/build/src/map/utils/OfflineMapManager.d.ts.map +1 -0
- package/build/src/map/utils/OfflineMapManager.js +217 -0
- package/build/src/map/utils/OfflineMapManager.js.map +1 -0
- package/build/src/map/utils/PermissionUtils.d.ts +92 -0
- package/build/src/map/utils/PermissionUtils.d.ts.map +1 -0
- package/build/src/map/utils/PermissionUtils.js +252 -0
- package/build/src/map/utils/PermissionUtils.js.map +1 -0
- package/build/src/map/utils/PlatformDetector.d.ts +103 -0
- package/build/src/map/utils/PlatformDetector.d.ts.map +1 -0
- package/build/src/map/utils/PlatformDetector.js +178 -0
- package/build/src/map/utils/PlatformDetector.js.map +1 -0
- package/build/src/map/utils/lazyNativeViewManager.d.ts +3 -0
- package/build/src/map/utils/lazyNativeViewManager.d.ts.map +1 -0
- package/build/src/map/utils/lazyNativeViewManager.js +11 -0
- package/build/src/map/utils/lazyNativeViewManager.js.map +1 -0
- package/build/src/route-geometry.d.ts +13 -0
- package/build/src/route-geometry.d.ts.map +1 -0
- package/build/src/route-geometry.js +154 -0
- package/build/src/route-geometry.js.map +1 -0
- package/build/src/route-planning.d.ts +21 -0
- package/build/src/route-planning.d.ts.map +1 -0
- package/build/src/route-planning.js +67 -0
- package/build/src/route-planning.js.map +1 -0
- package/build/src/types/coordinates.types.d.ts +25 -0
- package/build/src/types/coordinates.types.d.ts.map +1 -0
- package/build/src/types/coordinates.types.js +6 -0
- package/build/src/types/coordinates.types.js.map +1 -0
- package/build/src/types/independent.types.d.ts +385 -0
- package/build/src/types/independent.types.d.ts.map +1 -0
- package/build/src/types/independent.types.js +2 -0
- package/build/src/types/independent.types.js.map +1 -0
- package/build/src/types/index.d.ts +6 -0
- package/build/src/types/index.d.ts.map +1 -0
- package/build/src/types/index.js +7 -0
- package/build/src/types/index.js.map +1 -0
- package/build/src/types/native-module.types.d.ts +74 -0
- package/build/src/types/native-module.types.d.ts.map +1 -0
- package/build/src/types/native-module.types.js +3 -0
- package/build/src/types/native-module.types.js.map +1 -0
- package/build/src/types/naviview.types.d.ts +562 -0
- package/build/src/types/naviview.types.d.ts.map +1 -0
- package/build/src/types/naviview.types.js +2 -0
- package/build/src/types/naviview.types.js.map +1 -0
- package/build/src/types/route.types.d.ts +414 -0
- package/build/src/types/route.types.d.ts.map +1 -0
- package/build/src/types/route.types.js +137 -0
- package/build/src/types/route.types.js.map +1 -0
- package/build/src/web-api-fallback.d.ts +5 -0
- package/build/src/web-api-fallback.d.ts.map +1 -0
- package/build/src/web-api-fallback.js +160 -0
- package/build/src/web-api-fallback.js.map +1 -0
- package/build/src/web-route-following.d.ts +3 -0
- package/build/src/web-route-following.d.ts.map +1 -0
- package/build/src/web-route-following.js +178 -0
- package/build/src/web-route-following.js.map +1 -0
- package/build/types/native-module.types.d.ts +2 -2
- package/build/types/native-module.types.d.ts.map +1 -1
- package/build/types/native-module.types.js.map +1 -1
- package/build/types/naviview.types.d.ts +1 -1
- package/build/types/naviview.types.d.ts.map +1 -1
- package/build/types/naviview.types.js.map +1 -1
- package/build/web-api-fallback.d.ts.map +1 -1
- package/build/web-api-fallback.js +0 -1
- package/build/web-api-fallback.js.map +1 -1
- package/ios/map/ExpoGaodeMapView.swift +145 -3
- package/ios/map/cpp/ClusterEngine.cpp +4 -14
- package/ios/map/cpp/ClusterEngine.hpp +1 -12
- package/ios/map/cpp/ClusterTypes.hpp +18 -0
- package/ios/map/cpp/ColorParser.cpp +22 -3
- package/ios/map/cpp/GeometryEngine.cpp +1 -1
- package/ios/map/cpp/QuadTree.hpp +1 -1
- package/ios/map/managers/UIManager.swift +3 -0
- package/package.json +16 -8
- package/plugin/build/withGaodeMap.js +19 -14
- package/shared/cpp/ClusterEngine.cpp +4 -14
- package/shared/cpp/ClusterEngine.hpp +1 -12
- package/shared/cpp/ClusterTypes.hpp +18 -0
- package/shared/cpp/ColorParser.cpp +22 -3
- package/shared/cpp/GeometryEngine.cpp +1 -1
- package/shared/cpp/QuadTree.hpp +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoGaodeMapView.js","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAKhD,MAAM,aAAa,GAAG,2BAA2B,CAAiD,kBAAkB,CAAC,CAAC;AACtH,MAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,SAAS,YAAY,CAAC,aAAqB,EAAE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AM,CAAC,CAAC,CAAC;IAEvD,+BAA+B;IAC/B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,OAAO,CAC5C,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAChC,CAAC,QAAQ,CAAC,CACX,CAAC;IACF,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAClC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,EAC/B,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CACjC;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAC1B;QAAA,CAAC,UAAU,CACT,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAC/B,IAAI,UAAU,CAAC,CAEf;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,UAAU,CACZ;QAAA,CAAC,UAAU,CACb;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,UAAU,CAAC,QAAQ,CAAC,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,eAAe,gBAAgB,CAAC;AAEhC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {\n MapViewProps,\n MapViewRef,\n CameraPosition,\n CameraUpdate,\n LatLng,\n Point,\n LatLngPoint,\n} from './types';\nimport ExpoGaodeMapModule from './ExpoGaodeMapModule';\nimport { normalizeLatLng } from './utils/GeoUtils';\nimport { ErrorHandler } from './utils/ErrorHandler';\nimport { MapContext } from './components/MapContext';\nimport { MapUI } from './components/MapUI';\nimport { createLazyNativeViewManager } from './utils/lazyNativeViewManager';\nimport { View, StyleSheet } from 'react-native';\nimport type { FitToCoordinatesOptions } from './types/route-playback.types';\n\nexport type { MapViewRef } from './types';\n\nconst getNativeView = createLazyNativeViewManager<MapViewProps & { ref?: React.Ref<MapViewRef> }>('ExpoGaodeMapView');\nconst MIN_ZOOM = 3;\nconst MAX_ZOOM = 20;\n\nfunction estimateZoom(latitudeDelta: number, longitudeDelta: number, options?: FitToCoordinatesOptions) {\n const span = Math.max(latitudeDelta, longitudeDelta, 0.0001);\n const rawZoom = Math.log2(360 / span);\n return Math.max(options?.minZoom ?? MIN_ZOOM, Math.min(options?.maxZoom ?? MAX_ZOOM, Number(rawZoom.toFixed(2))));\n}\n\nfunction splitMapChildren(children: React.ReactNode) {\n const overlays: React.ReactNode[] = [];\n const uiControls: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (\n React.isValidElement(child) &&\n (child.type === MapUI || (child.type as { isMapUI?: boolean })?.isMapUI)\n ) {\n uiControls.push(child);\n } else {\n overlays.push(child);\n }\n });\n\n return { overlays, uiControls };\n}\n\n/**\n * 高德地图视图组件,提供地图操作API和覆盖物管理功能\n * \n * @param props - 组件属性\n * @param ref - 外部ref引用,用于访问地图API方法\n * @returns 返回包含地图视图和上下文提供者的React组件\n * \n * @remarks\n * 该组件内部维护 nativeRef,用于将 JS ref API 转发到原生地图视图。\n * MapContext 会向子组件共享同一组地图 API 方法。\n * \n * 提供的主要API功能包括:\n * - 相机控制(移动、缩放、获取当前位置)\n * - 屏幕坐标转换、截图、根据坐标集合拟合相机\n * \n * 所有API方法都会检查地图是否已初始化,未初始化时抛出错误\n */\nconst ExpoGaodeMapView = React.forwardRef<MapViewRef, MapViewProps>((props, ref) => {\n const privacyStatus = ExpoGaodeMapModule.getPrivacyStatus();\n if (!privacyStatus.isReady) {\n throw ErrorHandler.privacyNotAgreed('map');\n }\n\n const nativeRef = React.useRef<MapViewRef>(null);\n const NativeView = React.useMemo(() => getNativeView(), []);\n\n const callNativeMethod = React.useCallback(<T extends (...args: never[]) => unknown>(\n methodName: keyof MapViewRef,\n ...args: Parameters<T>\n ) => {\n if (!nativeRef.current) {\n throw ErrorHandler.mapViewNotInitialized(methodName as string);\n }\n\n const nativeMethod = Reflect.get(\n nativeRef.current as object,\n methodName,\n nativeRef.current as object\n );\n\n if (typeof nativeMethod !== 'function') {\n throw new Error(`Method '${methodName}' is not available on native view. Make sure the native module is linked and rebuilt.`);\n }\n\n return (nativeMethod as (...methodArgs: Parameters<T>) => ReturnType<T>).apply(\n nativeRef.current,\n args\n );\n }, []);\n \n /**\n * 通用 API 方法包装器,统一处理初始化检查和错误包装。\n */\n const createApiMethod = React.useCallback(<T extends (...args: never[]) => unknown>(\n methodName: keyof MapViewRef\n ) => {\n return ((...args: Parameters<T>) => {\n try {\n return callNativeMethod<T>(methodName, ...args);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, methodName as string);\n }\n }) as T;\n }, [callNativeMethod]);\n\n /**\n * 使用通用包装器创建所有 API 方法\n * 所有方法共享相同的错误处理逻辑\n */\n const apiRef: MapViewRef = React.useMemo(() => ({\n moveCamera: (position: CameraUpdate, duration?: number) => {\n try {\n const normalizedPosition = {\n ...position,\n target: position.target ? normalizeLatLng(position.target) : undefined,\n };\n return callNativeMethod<(cameraPosition: CameraUpdate, animationDuration: number) => Promise<void>>(\n 'moveCamera',\n normalizedPosition,\n duration ?? 0\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'moveCamera');\n }\n },\n getLatLng: createApiMethod<(point: Point) => Promise<LatLng>>('getLatLng'),\n setCenter: (center: LatLngPoint, animated?: boolean) => {\n try {\n return callNativeMethod<(normalizedCenter: LatLng, animatedFlag: boolean) => Promise<void>>(\n 'setCenter',\n normalizeLatLng(center),\n animated ?? false\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'setCenter');\n }\n },\n setZoom: (zoom: number, animated?: boolean) => {\n try {\n return callNativeMethod<(zoomLevel: number, animatedFlag: boolean) => Promise<void>>(\n 'setZoom',\n zoom,\n animated ?? false\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'setZoom');\n }\n },\n getCameraPosition: createApiMethod<() => Promise<CameraPosition>>('getCameraPosition'),\n takeSnapshot: createApiMethod<() => Promise<string>>('takeSnapshot'),\n fitToCoordinates: async (points: LatLngPoint[], options?: FitToCoordinatesOptions) => {\n try {\n const normalized = points.map((point) => normalizeLatLng(point));\n if (normalized.length === 0) {\n return;\n }\n\n const currentCamera = await callNativeMethod<() => Promise<CameraPosition>>('getCameraPosition');\n if (normalized.length === 1) {\n await callNativeMethod<(cameraPosition: CameraUpdate, animationDuration: number) => Promise<void>>(\n 'moveCamera',\n {\n target: normalized[0],\n zoom: options?.singlePointZoom ?? currentCamera.zoom ?? 16,\n bearing: options?.preserveBearing === false ? options?.bearing : currentCamera.bearing ?? options?.bearing,\n tilt: options?.preserveTilt === false ? options?.tilt : currentCamera.tilt ?? options?.tilt,\n },\n options?.duration ?? 0\n );\n return;\n }\n\n const latitudes = normalized.map((point) => point.latitude);\n const longitudes = normalized.map((point) => point.longitude);\n const paddingFactor = options?.paddingFactor ?? 1.2;\n const north = Math.max(...latitudes);\n const south = Math.min(...latitudes);\n const east = Math.max(...longitudes);\n const west = Math.min(...longitudes);\n\n await callNativeMethod<(cameraPosition: CameraUpdate, animationDuration: number) => Promise<void>>(\n 'moveCamera',\n {\n target: {\n latitude: (north + south) / 2,\n longitude: (east + west) / 2,\n },\n zoom: estimateZoom((north - south) * paddingFactor, (east - west) * paddingFactor, options),\n bearing: options?.preserveBearing === false ? options?.bearing : currentCamera.bearing ?? options?.bearing,\n tilt: options?.preserveTilt === false ? options?.tilt : currentCamera.tilt ?? options?.tilt,\n },\n options?.duration ?? 0\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'fitToCoordinates');\n }\n },\n }), [callNativeMethod, createApiMethod]);\n\n /**\n * 获取当前地图实例的API引用\n * @returns 返回地图API的引用对象,可用于调用地图相关方法\n */\n React.useImperativeHandle(ref, () => apiRef, [apiRef]);\n\n // 分离 children:区分原生覆盖物和普通 UI 组件\n const { children, style, ...otherProps } = props;\n const { overlays, uiControls } = React.useMemo(\n () => splitMapChildren(children),\n [children]\n );\n const containerStyle = React.useMemo(\n () => [styles.container, style],\n [style]\n );\n\n return (\n <MapContext.Provider value={apiRef}>\n <View style={containerStyle}>\n <NativeView\n ref={nativeRef}\n style={StyleSheet.absoluteFill}\n {...otherProps}\n >\n {overlays}\n </NativeView>\n {uiControls}\n </View>\n </MapContext.Provider>\n );\n});\n\nExpoGaodeMapView.displayName = 'ExpoGaodeMapView';\n\nexport default ExpoGaodeMapView;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n position: 'relative',\n overflow: 'hidden',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"ExpoGaodeMapView.js","sourceRoot":"","sources":["../../src/map/ExpoGaodeMapView.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAKhD,MAAM,aAAa,GAAG,2BAA2B,CAAiD,kBAAkB,CAAC,CAAC;AACtH,MAAM,QAAQ,GAAG,CAAC,CA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,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvD,+BAA+B;IAC/B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,OAAO,CAC5C,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAChC,CAAC,QAAQ,CAAC,CACX,CAAC;IACF,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAClC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,EAC/B,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,CACL,KAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YAChC,MAAC,IAAI,IAAC,KAAK,EAAE,cAAc,aACzB,KAAC,UAAU,IACT,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,UAAU,CAAC,YAAY,KAC1B,UAAU,YAEb,QAAQ,GACE,EACZ,UAAU,IACN,GACa,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,eAAe,gBAAgB,CAAC;AAEhC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {\n MapViewProps,\n MapViewRef,\n CameraPosition,\n CameraUpdate,\n LatLng,\n Point,\n LatLngPoint,\n} from './types';\nimport ExpoGaodeMapModule from './ExpoGaodeMapModule';\nimport { normalizeLatLng } from './utils/GeoUtils';\nimport { ErrorHandler } from './utils/ErrorHandler';\nimport { MapContext } from './components/MapContext';\nimport { MapUI } from './components/MapUI';\nimport { createLazyNativeViewManager } from './utils/lazyNativeViewManager';\nimport { View, StyleSheet } from 'react-native';\nimport type { FitToCoordinatesOptions } from './types/route-playback.types';\n\nexport type { MapViewRef } from './types';\n\nconst getNativeView = createLazyNativeViewManager<MapViewProps & { ref?: React.Ref<MapViewRef> }>('ExpoGaodeMapView');\nconst MIN_ZOOM = 3;\nconst MAX_ZOOM = 20;\n\nfunction estimateZoom(latitudeDelta: number, longitudeDelta: number, options?: FitToCoordinatesOptions) {\n const span = Math.max(latitudeDelta, longitudeDelta, 0.0001);\n const rawZoom = Math.log2(360 / span);\n return Math.max(options?.minZoom ?? MIN_ZOOM, Math.min(options?.maxZoom ?? MAX_ZOOM, Number(rawZoom.toFixed(2))));\n}\n\nfunction splitMapChildren(children: React.ReactNode) {\n const overlays: React.ReactNode[] = [];\n const uiControls: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (\n React.isValidElement(child) &&\n (child.type === MapUI || (child.type as { isMapUI?: boolean })?.isMapUI)\n ) {\n uiControls.push(child);\n } else {\n overlays.push(child);\n }\n });\n\n return { overlays, uiControls };\n}\n\n/**\n * 高德地图视图组件,提供地图操作API和覆盖物管理功能\n * \n * @param props - 组件属性\n * @param ref - 外部ref引用,用于访问地图API方法\n * @returns 返回包含地图视图和上下文提供者的React组件\n * \n * @remarks\n * 该组件内部维护 nativeRef,用于将 JS ref API 转发到原生地图视图。\n * MapContext 会向子组件共享同一组地图 API 方法。\n * \n * 提供的主要API功能包括:\n * - 相机控制(移动、缩放、获取当前位置)\n * - 屏幕坐标转换、截图、根据坐标集合拟合相机\n * \n * 所有API方法都会检查地图是否已初始化,未初始化时抛出错误\n */\nconst ExpoGaodeMapView = React.forwardRef<MapViewRef, MapViewProps>((props, ref) => {\n const privacyStatus = ExpoGaodeMapModule.getPrivacyStatus();\n if (!privacyStatus.isReady) {\n throw ErrorHandler.privacyNotAgreed('map');\n }\n\n const nativeRef = React.useRef<MapViewRef>(null);\n const NativeView = React.useMemo(() => getNativeView(), []);\n\n const callNativeMethod = React.useCallback(<T extends (...args: never[]) => unknown>(\n methodName: keyof MapViewRef,\n ...args: Parameters<T>\n ) => {\n if (!nativeRef.current) {\n throw ErrorHandler.mapViewNotInitialized(methodName as string);\n }\n\n const nativeMethod = Reflect.get(\n nativeRef.current as object,\n methodName,\n nativeRef.current as object\n );\n\n if (typeof nativeMethod !== 'function') {\n throw new Error(`Method '${methodName}' is not available on native view. Make sure the native module is linked and rebuilt.`);\n }\n\n return (nativeMethod as (...methodArgs: Parameters<T>) => ReturnType<T>).apply(\n nativeRef.current,\n args\n );\n }, []);\n \n /**\n * 通用 API 方法包装器,统一处理初始化检查和错误包装。\n */\n const createApiMethod = React.useCallback(<T extends (...args: never[]) => unknown>(\n methodName: keyof MapViewRef\n ) => {\n return ((...args: Parameters<T>) => {\n try {\n return callNativeMethod<T>(methodName, ...args);\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, methodName as string);\n }\n }) as T;\n }, [callNativeMethod]);\n\n /**\n * 使用通用包装器创建所有 API 方法\n * 所有方法共享相同的错误处理逻辑\n */\n const apiRef: MapViewRef = React.useMemo(() => ({\n moveCamera: (position: CameraUpdate, duration?: number) => {\n try {\n const normalizedPosition = {\n ...position,\n target: position.target ? normalizeLatLng(position.target) : undefined,\n };\n return callNativeMethod<(cameraPosition: CameraUpdate, animationDuration: number) => Promise<void>>(\n 'moveCamera',\n normalizedPosition,\n duration ?? 0\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'moveCamera');\n }\n },\n getLatLng: createApiMethod<(point: Point) => Promise<LatLng>>('getLatLng'),\n setCenter: (center: LatLngPoint, animated?: boolean) => {\n try {\n return callNativeMethod<(normalizedCenter: LatLng, animatedFlag: boolean) => Promise<void>>(\n 'setCenter',\n normalizeLatLng(center),\n animated ?? false\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'setCenter');\n }\n },\n setZoom: (zoom: number, animated?: boolean) => {\n try {\n return callNativeMethod<(zoomLevel: number, animatedFlag: boolean) => Promise<void>>(\n 'setZoom',\n zoom,\n animated ?? false\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'setZoom');\n }\n },\n getCameraPosition: createApiMethod<() => Promise<CameraPosition>>('getCameraPosition'),\n takeSnapshot: createApiMethod<() => Promise<string>>('takeSnapshot'),\n fitToCoordinates: async (points: LatLngPoint[], options?: FitToCoordinatesOptions) => {\n try {\n const normalized = points.map((point) => normalizeLatLng(point));\n if (normalized.length === 0) {\n return;\n }\n\n const currentCamera = await callNativeMethod<() => Promise<CameraPosition>>('getCameraPosition');\n if (normalized.length === 1) {\n await callNativeMethod<(cameraPosition: CameraUpdate, animationDuration: number) => Promise<void>>(\n 'moveCamera',\n {\n target: normalized[0],\n zoom: options?.singlePointZoom ?? currentCamera.zoom ?? 16,\n bearing: options?.preserveBearing === false ? options?.bearing : currentCamera.bearing ?? options?.bearing,\n tilt: options?.preserveTilt === false ? options?.tilt : currentCamera.tilt ?? options?.tilt,\n },\n options?.duration ?? 0\n );\n return;\n }\n\n const latitudes = normalized.map((point) => point.latitude);\n const longitudes = normalized.map((point) => point.longitude);\n const paddingFactor = options?.paddingFactor ?? 1.2;\n const north = Math.max(...latitudes);\n const south = Math.min(...latitudes);\n const east = Math.max(...longitudes);\n const west = Math.min(...longitudes);\n\n await callNativeMethod<(cameraPosition: CameraUpdate, animationDuration: number) => Promise<void>>(\n 'moveCamera',\n {\n target: {\n latitude: (north + south) / 2,\n longitude: (east + west) / 2,\n },\n zoom: estimateZoom((north - south) * paddingFactor, (east - west) * paddingFactor, options),\n bearing: options?.preserveBearing === false ? options?.bearing : currentCamera.bearing ?? options?.bearing,\n tilt: options?.preserveTilt === false ? options?.tilt : currentCamera.tilt ?? options?.tilt,\n },\n options?.duration ?? 0\n );\n } catch (error) {\n throw ErrorHandler.wrapNativeError(error, 'fitToCoordinates');\n }\n },\n }), [callNativeMethod, createApiMethod]);\n\n /**\n * 获取当前地图实例的API引用\n * @returns 返回地图API的引用对象,可用于调用地图相关方法\n */\n React.useImperativeHandle(ref, () => apiRef, [apiRef]);\n\n // 分离 children:区分原生覆盖物和普通 UI 组件\n const { children, style, ...otherProps } = props;\n const { overlays, uiControls } = React.useMemo(\n () => splitMapChildren(children),\n [children]\n );\n const containerStyle = React.useMemo(\n () => [styles.container, style],\n [style]\n );\n\n return (\n <MapContext.Provider value={apiRef}>\n <View style={containerStyle}>\n <NativeView\n ref={nativeRef}\n style={StyleSheet.absoluteFill}\n {...otherProps}\n >\n {overlays}\n </NativeView>\n {uiControls}\n </View>\n </MapContext.Provider>\n );\n});\n\nExpoGaodeMapView.displayName = 'ExpoGaodeMapView';\n\nexport default ExpoGaodeMapView;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n position: 'relative',\n overflow: 'hidden',\n },\n});\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FoldState } from '../utils/PlatformDetector';
|
|
3
|
+
import type { DeviceInfo } from '../utils/PlatformDetector';
|
|
4
|
+
import type { MapViewProps, MapViewRef } from '../types';
|
|
4
5
|
/**
|
|
5
6
|
* 折叠屏适配配置
|
|
6
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldableMapView.d.ts","sourceRoot":"","sources":["../../../src/map/components/FoldableMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAoB,
|
|
1
|
+
{"version":3,"file":"FoldableMapView.d.ts","sourceRoot":"","sources":["../../../src/map/components/FoldableMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAoB,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe;IACf,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IACvE,eAAe;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,cAAc;IACd,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwI1D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,EACnC,MAAM,CAAC,EAAE,cAAc;;;;EAkExB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { Platform } from 'react-native';
|
|
3
4
|
import MapView from '../ExpoGaodeMapView';
|
|
@@ -103,7 +104,7 @@ export const FoldableMapView = ({ foldableConfig, ...mapProps }) => {
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
|
-
return (
|
|
107
|
+
return (_jsx(MapView, { ref: mapRef, ...mapProps }));
|
|
107
108
|
};
|
|
108
109
|
/**
|
|
109
110
|
* 折叠屏适配 Hook
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldableMapView.js","sourceRoot":"","sources":["../../../src/map/components/FoldableMapView.tsx"],"names":[],"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C;QACxD,CAAC,CACF,CAAC;QAEF,MAAM,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACrD,YAAY,CAAC,YAAY,CAAC,CAAC;QAE3B,OAAO,GAAG,EAAE;YACV,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAEvC,OAAO;QACL,SAAS;QACT,UAAU;QACV,UAAU,EAAE,UAAU,CAAC,UAAU;KAClC,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\nimport MapView from '../ExpoGaodeMapView';\n\nimport { PlatformDetector, DeviceInfo, FoldState } from '../utils/PlatformDetector';\nimport { MapViewProps, MapViewRef } from '../types';\n\n/**\n * 折叠屏适配配置\n */\nexport interface FoldableConfig {\n /** 折叠时是否自动调整缩放级别 */\n autoAdjustZoom?: boolean;\n /** 展开时的缩放级别增量 */\n unfoldedZoomDelta?: number;\n /** 是否在折叠/展开时保持中心点 */\n keepCenterOnFold?: boolean;\n /** 折叠状态变化回调 */\n onFoldStateChange?: (state: FoldState, deviceInfo: DeviceInfo) => void;\n /** 是否启用调试日志 */\n debug?: boolean;\n}\n\n/**\n * 折叠屏地图视图组件\n * \n * 自动适配折叠屏设备的展开/折叠状态变化\n */\nexport interface FoldableMapViewProps extends MapViewProps {\n /** 折叠屏适配配置 */\n foldableConfig?: FoldableConfig;\n}\n\nexport const FoldableMapView: React.FC<FoldableMapViewProps> = ({\n foldableConfig,\n ...mapProps\n}) => {\n const mapRef = useRef<MapViewRef>(null);\n const [currentFoldState, setCurrentFoldState] = useState<FoldState>(FoldState.UNKNOWN);\n const [deviceInfo, setDeviceInfo] = useState<DeviceInfo>(PlatformDetector.getDeviceInfo());\n\n const config: Required<FoldableConfig> = {\n autoAdjustZoom: true,\n unfoldedZoomDelta: 1,\n keepCenterOnFold: true,\n onFoldStateChange: () => {},\n debug: false,\n ...foldableConfig,\n };\n\n useEffect(() => {\n // 仅在 Android 折叠屏设备上启用\n if (Platform.OS !== 'android' || !deviceInfo.isFoldable) {\n if (config.debug) {\n console.log('[FoldableMapView] 非折叠屏设备,跳过适配');\n }\n return;\n }\n\n if (config.debug) {\n console.log('[FoldableMapView] 初始化折叠屏适配');\n console.log('设备信息:', deviceInfo);\n console.log('初始折叠状态:', currentFoldState);\n }\n\n // 监听屏幕尺寸变化\n const removeListener = PlatformDetector.addDimensionChangeListener(\n async (newInfo: DeviceInfo) => {\n const newFoldState = PlatformDetector.getFoldState();\n \n if (config.debug) {\n console.log('[FoldableMapView] 屏幕尺寸变化');\n console.log('新设备信息:', newInfo);\n console.log('新折叠状态:', newFoldState);\n }\n\n // 折叠状态变化时的处理\n if (newFoldState !== currentFoldState && currentFoldState !== FoldState.UNKNOWN) {\n await handleFoldStateChange(currentFoldState, newFoldState, newInfo);\n }\n\n setCurrentFoldState(newFoldState);\n setDeviceInfo(newInfo);\n \n // 触发回调\n config.onFoldStateChange(newFoldState, newInfo);\n }\n );\n\n // 设置初始状态\n const initialState = PlatformDetector.getFoldState();\n setCurrentFoldState(initialState);\n\n return () => {\n removeListener();\n };\n }, []);\n\n /**\n * 处理折叠状态变化\n */\n const handleFoldStateChange = async (\n oldState: FoldState,\n newState: FoldState,\n newInfo: DeviceInfo\n ) => {\n if (!mapRef.current) {\n return;\n }\n\n try {\n // 获取当前地图状态\n const currentCamera = await mapRef.current.getCameraPosition?.();\n \n if (!currentCamera) {\n if (config.debug) {\n console.warn('[FoldableMapView] 无法获取相机位置');\n }\n return;\n }\n\n const isUnfolding = newState === FoldState.UNFOLDED && oldState === FoldState.FOLDED;\n const isFolding = newState === FoldState.FOLDED && oldState === FoldState.UNFOLDED;\n\n if (config.debug) {\n console.log('[FoldableMapView] 折叠状态变化:', {\n oldState,\n newState,\n isUnfolding,\n isFolding,\n currentZoom: currentCamera.zoom,\n });\n }\n\n // 展开时增加缩放级别,折叠时减少\n if (config.autoAdjustZoom && (isUnfolding || isFolding)) {\n const currentZoom = currentCamera.zoom ?? 15;\n const zoomDelta = isUnfolding ? config.unfoldedZoomDelta : -config.unfoldedZoomDelta;\n const newZoom = Math.max(3, Math.min(20, currentZoom + zoomDelta));\n\n if (config.debug) {\n console.log('[FoldableMapView] 调整缩放:', {\n oldZoom: currentZoom,\n newZoom,\n delta: zoomDelta,\n });\n }\n\n // 保持中心点,只调整缩放\n await mapRef.current.moveCamera({\n target: config.keepCenterOnFold ? currentCamera.target : undefined,\n zoom: newZoom,\n }, 300);\n }\n } catch (error) {\n if (config.debug) {\n console.error('[FoldableMapView] 处理折叠状态变化失败:');\n }\n }\n };\n\n \n\n return (\n <MapView\n ref={mapRef}\n {...mapProps}\n />\n );\n};\n\n/**\n * 折叠屏适配 Hook\n * \n * 用于在现有地图组件中添加折叠屏适配功能\n */\nexport function useFoldableMap(\n mapRef: React.RefObject<MapViewRef>,\n config?: FoldableConfig\n) {\n const [foldState, setFoldState] = useState<FoldState>(FoldState.UNKNOWN);\n const [deviceInfo, setDeviceInfo] = useState<DeviceInfo>(PlatformDetector.getDeviceInfo());\n\n const mergedConfig: Required<FoldableConfig> = {\n autoAdjustZoom: true,\n unfoldedZoomDelta: 1,\n keepCenterOnFold: true,\n onFoldStateChange: () => {},\n debug: false,\n ...config,\n };\n\n useEffect(() => {\n if (Platform.OS !== 'android' || !deviceInfo.isFoldable) {\n return;\n }\n\n const removeListener = PlatformDetector.addDimensionChangeListener(\n async (newInfo: DeviceInfo) => {\n const newFoldState = PlatformDetector.getFoldState();\n \n if (newFoldState !== foldState && foldState !== FoldState.UNKNOWN) {\n // 处理折叠状态变化\n if (mapRef.current && mergedConfig.autoAdjustZoom) {\n try {\n const currentCamera = await mapRef.current.getCameraPosition();\n if (currentCamera) {\n const currentZoom = currentCamera.zoom ?? 15;\n const isUnfolding = newFoldState === FoldState.UNFOLDED && foldState === FoldState.FOLDED;\n const zoomDelta = isUnfolding ? mergedConfig.unfoldedZoomDelta : -mergedConfig.unfoldedZoomDelta;\n const newZoom = Math.max(3, Math.min(20, currentZoom + zoomDelta));\n\n await mapRef.current.moveCamera({\n target: mergedConfig.keepCenterOnFold ? currentCamera.target : undefined,\n zoom: newZoom,\n }, 300);\n }\n } catch (error) {\n if (mergedConfig.debug) {\n console.error('[useFoldableMap] 调整失败:');\n }\n }\n }\n }\n\n setFoldState(newFoldState);\n setDeviceInfo(newInfo);\n mergedConfig.onFoldStateChange(newFoldState, newInfo);\n }\n );\n\n const initialState = PlatformDetector.getFoldState();\n setFoldState(initialState);\n\n return () => {\n removeListener();\n };\n }, [foldState, deviceInfo.isFoldable]);\n\n return {\n foldState,\n deviceInfo,\n isFoldable: deviceInfo.isFoldable,\n };\n}"]}
|
|
1
|
+
{"version":3,"file":"FoldableMapView.js","sourceRoot":"","sources":["../../../src/map/components/FoldableMapView.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA8BxE,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAC9D,cAAc,EACd,GAAG,QAAQ,EACZ,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,MAAM,CAAa,IAAI,CAAC,CAAC;IACxC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAY,SAAS,CAAC,OAAO,CAAC,CAAC;IACvF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAa,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC;IAE3F,MAAM,MAAM,GAA6B;QACvC,cAAc,EAAE,IAAI;QACpB,iBAAiB,EAAE,CAAC;QACpB,gBAA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MAAM,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;gCAC9B,MAAM,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gCACxE,IAAI,EAAE,OAAO;6BACd,EAAE,GAAG,CAAC,CAAC;wBACV,CAAC;oBACH,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;4BACvB,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;wBAC1C,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,YAAY,CAAC,YAAY,CAAC,CAAC;YAC3B,aAAa,CAAC,OAAO,CAAC,CAAC;YACvB,YAAY,CAAC,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC,CACF,CAAC;QAEF,MAAM,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACrD,YAAY,CAAC,YAAY,CAAC,CAAC;QAE3B,OAAO,GAAG,EAAE;YACV,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAEvC,OAAO;QACL,SAAS;QACT,UAAU;QACV,UAAU,EAAE,UAAU,CAAC,UAAU;KAClC,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\nimport MapView from '../ExpoGaodeMapView';\n\nimport { PlatformDetector, FoldState } from '../utils/PlatformDetector';\nimport type { DeviceInfo } from '../utils/PlatformDetector';\nimport type { MapViewProps, MapViewRef } from '../types';\n\n/**\n * 折叠屏适配配置\n */\nexport interface FoldableConfig {\n /** 折叠时是否自动调整缩放级别 */\n autoAdjustZoom?: boolean;\n /** 展开时的缩放级别增量 */\n unfoldedZoomDelta?: number;\n /** 是否在折叠/展开时保持中心点 */\n keepCenterOnFold?: boolean;\n /** 折叠状态变化回调 */\n onFoldStateChange?: (state: FoldState, deviceInfo: DeviceInfo) => void;\n /** 是否启用调试日志 */\n debug?: boolean;\n}\n\n/**\n * 折叠屏地图视图组件\n * \n * 自动适配折叠屏设备的展开/折叠状态变化\n */\nexport interface FoldableMapViewProps extends MapViewProps {\n /** 折叠屏适配配置 */\n foldableConfig?: FoldableConfig;\n}\n\nexport const FoldableMapView: React.FC<FoldableMapViewProps> = ({\n foldableConfig,\n ...mapProps\n}) => {\n const mapRef = useRef<MapViewRef>(null);\n const [currentFoldState, setCurrentFoldState] = useState<FoldState>(FoldState.UNKNOWN);\n const [deviceInfo, setDeviceInfo] = useState<DeviceInfo>(PlatformDetector.getDeviceInfo());\n\n const config: Required<FoldableConfig> = {\n autoAdjustZoom: true,\n unfoldedZoomDelta: 1,\n keepCenterOnFold: true,\n onFoldStateChange: () => {},\n debug: false,\n ...foldableConfig,\n };\n\n useEffect(() => {\n // 仅在 Android 折叠屏设备上启用\n if (Platform.OS !== 'android' || !deviceInfo.isFoldable) {\n if (config.debug) {\n console.log('[FoldableMapView] 非折叠屏设备,跳过适配');\n }\n return;\n }\n\n if (config.debug) {\n console.log('[FoldableMapView] 初始化折叠屏适配');\n console.log('设备信息:', deviceInfo);\n console.log('初始折叠状态:', currentFoldState);\n }\n\n // 监听屏幕尺寸变化\n const removeListener = PlatformDetector.addDimensionChangeListener(\n async (newInfo: DeviceInfo) => {\n const newFoldState = PlatformDetector.getFoldState();\n \n if (config.debug) {\n console.log('[FoldableMapView] 屏幕尺寸变化');\n console.log('新设备信息:', newInfo);\n console.log('新折叠状态:', newFoldState);\n }\n\n // 折叠状态变化时的处理\n if (newFoldState !== currentFoldState && currentFoldState !== FoldState.UNKNOWN) {\n await handleFoldStateChange(currentFoldState, newFoldState, newInfo);\n }\n\n setCurrentFoldState(newFoldState);\n setDeviceInfo(newInfo);\n \n // 触发回调\n config.onFoldStateChange(newFoldState, newInfo);\n }\n );\n\n // 设置初始状态\n const initialState = PlatformDetector.getFoldState();\n setCurrentFoldState(initialState);\n\n return () => {\n removeListener();\n };\n }, []);\n\n /**\n * 处理折叠状态变化\n */\n const handleFoldStateChange = async (\n oldState: FoldState,\n newState: FoldState,\n newInfo: DeviceInfo\n ) => {\n if (!mapRef.current) {\n return;\n }\n\n try {\n // 获取当前地图状态\n const currentCamera = await mapRef.current.getCameraPosition?.();\n \n if (!currentCamera) {\n if (config.debug) {\n console.warn('[FoldableMapView] 无法获取相机位置');\n }\n return;\n }\n\n const isUnfolding = newState === FoldState.UNFOLDED && oldState === FoldState.FOLDED;\n const isFolding = newState === FoldState.FOLDED && oldState === FoldState.UNFOLDED;\n\n if (config.debug) {\n console.log('[FoldableMapView] 折叠状态变化:', {\n oldState,\n newState,\n isUnfolding,\n isFolding,\n currentZoom: currentCamera.zoom,\n });\n }\n\n // 展开时增加缩放级别,折叠时减少\n if (config.autoAdjustZoom && (isUnfolding || isFolding)) {\n const currentZoom = currentCamera.zoom ?? 15;\n const zoomDelta = isUnfolding ? config.unfoldedZoomDelta : -config.unfoldedZoomDelta;\n const newZoom = Math.max(3, Math.min(20, currentZoom + zoomDelta));\n\n if (config.debug) {\n console.log('[FoldableMapView] 调整缩放:', {\n oldZoom: currentZoom,\n newZoom,\n delta: zoomDelta,\n });\n }\n\n // 保持中心点,只调整缩放\n await mapRef.current.moveCamera({\n target: config.keepCenterOnFold ? currentCamera.target : undefined,\n zoom: newZoom,\n }, 300);\n }\n } catch (error) {\n if (config.debug) {\n console.error('[FoldableMapView] 处理折叠状态变化失败:');\n }\n }\n };\n\n \n\n return (\n <MapView\n ref={mapRef}\n {...mapProps}\n />\n );\n};\n\n/**\n * 折叠屏适配 Hook\n * \n * 用于在现有地图组件中添加折叠屏适配功能\n */\nexport function useFoldableMap(\n mapRef: React.RefObject<MapViewRef>,\n config?: FoldableConfig\n) {\n const [foldState, setFoldState] = useState<FoldState>(FoldState.UNKNOWN);\n const [deviceInfo, setDeviceInfo] = useState<DeviceInfo>(PlatformDetector.getDeviceInfo());\n\n const mergedConfig: Required<FoldableConfig> = {\n autoAdjustZoom: true,\n unfoldedZoomDelta: 1,\n keepCenterOnFold: true,\n onFoldStateChange: () => {},\n debug: false,\n ...config,\n };\n\n useEffect(() => {\n if (Platform.OS !== 'android' || !deviceInfo.isFoldable) {\n return;\n }\n\n const removeListener = PlatformDetector.addDimensionChangeListener(\n async (newInfo: DeviceInfo) => {\n const newFoldState = PlatformDetector.getFoldState();\n \n if (newFoldState !== foldState && foldState !== FoldState.UNKNOWN) {\n // 处理折叠状态变化\n if (mapRef.current && mergedConfig.autoAdjustZoom) {\n try {\n const currentCamera = await mapRef.current.getCameraPosition();\n if (currentCamera) {\n const currentZoom = currentCamera.zoom ?? 15;\n const isUnfolding = newFoldState === FoldState.UNFOLDED && foldState === FoldState.FOLDED;\n const zoomDelta = isUnfolding ? mergedConfig.unfoldedZoomDelta : -mergedConfig.unfoldedZoomDelta;\n const newZoom = Math.max(3, Math.min(20, currentZoom + zoomDelta));\n\n await mapRef.current.moveCamera({\n target: mergedConfig.keepCenterOnFold ? currentCamera.target : undefined,\n zoom: newZoom,\n }, 300);\n }\n } catch (error) {\n if (mergedConfig.debug) {\n console.error('[useFoldableMap] 调整失败:');\n }\n }\n }\n }\n\n setFoldState(newFoldState);\n setDeviceInfo(newInfo);\n mergedConfig.onFoldStateChange(newFoldState, newInfo);\n }\n );\n\n const initialState = PlatformDetector.getFoldState();\n setFoldState(initialState);\n\n return () => {\n removeListener();\n };\n }, [foldState, deviceInfo.isFoldable]);\n\n return {\n foldState,\n deviceInfo,\n isFoldable: deviceInfo.isFoldable,\n };\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* MapUI 组件
|
|
@@ -16,7 +17,7 @@ import React from 'react';
|
|
|
16
17
|
* </MapView>
|
|
17
18
|
*/
|
|
18
19
|
export const MapUI = ({ children }) => {
|
|
19
|
-
return
|
|
20
|
+
return _jsx(_Fragment, { children: children });
|
|
20
21
|
};
|
|
21
22
|
// 静态标志,用于识别
|
|
22
23
|
MapUI.isMapUI = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUI.js","sourceRoot":"","sources":["../../../src/map/components/MapUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,KAAK,GAA0C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"MapUI.js","sourceRoot":"","sources":["../../../src/map/components/MapUI.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,KAAK,GAA0C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3E,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF,YAAY;AACX,KAAyC,CAAC,OAAO,GAAG,IAAI,CAAC","sourcesContent":["import React from 'react';\n\n/**\n * MapUI 组件\n * 用于包裹不需要作为地图原生子组件(如 Marker)的普通 React 组件。\n * 被此组件包裹的内容将渲染在地图视图的上方(兄弟节点),而不是内部。\n * 这解决了在地图内部放置普通 View 导致的触摸事件冲突问题。\n * \n * 示例:\n * <MapView>\n * <Marker ... />\n * <MapUI>\n * <View style={{ position: 'absolute', ... }}>\n * <Text>悬浮层</Text>\n * </View>\n * </MapUI>\n * </MapView>\n */\nexport const MapUI: React.FC<React.PropsWithChildren<{}>> = ({ children }) => {\n return <>{children}</>;\n};\n\n// 静态标志,用于识别\n(MapUI as React.FC & { isMapUI: boolean }).isMapUI = true;\n"]}
|
|
@@ -7,7 +7,7 @@ import type { CircleProps } from '../../types';
|
|
|
7
7
|
* @param props 圆形组件的属性配置
|
|
8
8
|
* @returns 渲染原生圆形组件
|
|
9
9
|
*/
|
|
10
|
-
declare function Circle(props: CircleProps):
|
|
10
|
+
declare function Circle(props: CircleProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare const _default: React.MemoExoticComponent<typeof Circle>;
|
|
12
12
|
export default _default;
|
|
13
13
|
//# sourceMappingURL=Circle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C;;;;;;GAMG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C;;;;;;GAMG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CAWjC;;AAED,wBAAkC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { normalizeLatLng } from '../../utils/GeoUtils';
|
|
3
4
|
import { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';
|
|
@@ -13,7 +14,7 @@ function Circle(props) {
|
|
|
13
14
|
const NativeCircleView = React.useMemo(() => getNativeCircleView(), []);
|
|
14
15
|
const { center, ...restProps } = props;
|
|
15
16
|
const normalizedCenter = normalizeLatLng(center);
|
|
16
|
-
return (
|
|
17
|
+
return (_jsx(NativeCircleView, { center: normalizedCenter, ...restProps }));
|
|
17
18
|
}
|
|
18
19
|
export default React.memo(Circle);
|
|
19
20
|
//# sourceMappingURL=Circle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,mBAAmB,GAAG,2BAA2B,CAAc,YAAY,CAAC,CAAC;AAEnF;;;;;;GAMG;AACH,SAAS,MAAM,CAAC,KAAkB;IAChC,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,gBAAgB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAEjD,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Circle.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,mBAAmB,GAAG,2BAA2B,CAAc,YAAY,CAAC,CAAC;AAEnF;;;;;;GAMG;AACH,SAAS,MAAM,CAAC,KAAkB;IAChC,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,gBAAgB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAEjD,OAAO,CACL,KAAC,gBAAgB,IACf,MAAM,EAAE,gBAAgB,KACpB,SAAS,GACb,CACH,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { CircleProps } from '../../types';\nimport { normalizeLatLng } from '../../utils/GeoUtils';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\n\nconst getNativeCircleView = createLazyNativeViewManager<CircleProps>('CircleView');\n\n/**\n * 高德地图圆形覆盖物组件(声明式)\n *\n *\n * @param props 圆形组件的属性配置\n * @returns 渲染原生圆形组件\n */\nfunction Circle(props: CircleProps) {\n const NativeCircleView = React.useMemo(() => getNativeCircleView(), []);\n const { center, ...restProps } = props;\n const normalizedCenter = normalizeLatLng(center);\n \n return (\n <NativeCircleView \n center={normalizedCenter}\n {...restProps} \n />\n );\n}\n\nexport default React.memo(Circle);\n"]}
|
|
@@ -6,7 +6,7 @@ import type { ClusterProps } from '../../types';
|
|
|
6
6
|
* @param props 点聚合组件的属性配置
|
|
7
7
|
* @returns 渲染原生点聚合组件
|
|
8
8
|
*/
|
|
9
|
-
declare function Cluster(props: ClusterProps):
|
|
9
|
+
declare function Cluster(props: ClusterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare const _default: React.MemoExoticComponent<typeof Cluster>;
|
|
11
11
|
export default _default;
|
|
12
12
|
//# sourceMappingURL=Cluster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cluster.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Cluster.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Cluster.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Cluster.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAGnC;;AAED,wBAAmC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';
|
|
3
4
|
const getNativeCluster = createLazyNativeViewManager('ClusterView');
|
|
@@ -9,7 +10,7 @@ const getNativeCluster = createLazyNativeViewManager('ClusterView');
|
|
|
9
10
|
*/
|
|
10
11
|
function Cluster(props) {
|
|
11
12
|
const NativeCluster = React.useMemo(() => getNativeCluster(), []);
|
|
12
|
-
return
|
|
13
|
+
return _jsx(NativeCluster, { ...props });
|
|
13
14
|
}
|
|
14
15
|
export default React.memo(Cluster);
|
|
15
16
|
//# sourceMappingURL=Cluster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cluster.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Cluster.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,gBAAgB,GAAG,2BAA2B,CAAe,aAAa,CAAC,CAAC;AAElF;;;;;GAKG;AACH,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"Cluster.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Cluster.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,gBAAgB,GAAG,2BAA2B,CAAe,aAAa,CAAC,CAAC;AAElF;;;;;GAKG;AACH,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAClE,OAAO,KAAC,aAAa,OAAK,KAAK,GAAI,CAAC;AACtC,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { ClusterProps } from '../../types';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\n\nconst getNativeCluster = createLazyNativeViewManager<ClusterProps>('ClusterView');\n\n/**\n * 高德地图点聚合组件\n *\n * @param props 点聚合组件的属性配置\n * @returns 渲染原生点聚合组件\n */\nfunction Cluster(props: ClusterProps) {\n const NativeCluster = React.useMemo(() => getNativeCluster(), []);\n return <NativeCluster {...props} />;\n}\n\nexport default React.memo(Cluster);\n"]}
|
|
@@ -6,7 +6,7 @@ import type { HeatMapProps } from '../../types';
|
|
|
6
6
|
* @param props - 热力图配置属性,继承自NativeHeatMap组件的属性
|
|
7
7
|
* @returns 渲染高德地图原生热力图组件
|
|
8
8
|
*/
|
|
9
|
-
declare function HeatMap(props: HeatMapProps):
|
|
9
|
+
declare function HeatMap(props: HeatMapProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare const _default: React.MemoExoticComponent<typeof HeatMap>;
|
|
11
11
|
export default _default;
|
|
12
12
|
//# sourceMappingURL=HeatMap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatMap.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/HeatMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAmBhD;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"HeatMap.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/HeatMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAmBhD;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAcnC;;AA+BD,wBAAmC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { StyleSheet } from 'react-native';
|
|
3
4
|
import { normalizeLatLng } from '../../utils/GeoUtils';
|
|
@@ -13,7 +14,7 @@ function HeatMap(props) {
|
|
|
13
14
|
const NativeHeatMap = React.useMemo(() => getNativeHeatMap(), []);
|
|
14
15
|
const { data, ...restProps } = props;
|
|
15
16
|
const normalizedData = React.useMemo(() => normalizeHeatMapData(data), [data]);
|
|
16
|
-
return (
|
|
17
|
+
return (_jsx(NativeHeatMap, { data: normalizedData, ...restProps, collapsable: false, pointerEvents: "none", style: styles.hidden }));
|
|
17
18
|
}
|
|
18
19
|
const styles = StyleSheet.create({
|
|
19
20
|
hidden: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatMap.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/HeatMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAahF,MA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,CAAC","sourcesContent":["import * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport type { ViewProps } from 'react-native';\nimport type { HeatMapProps } from '../../types';\nimport type { LatLng } from '../../types';\nimport { normalizeLatLng } from '../../utils/GeoUtils';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\n\ntype NativeHeatMapPoint = LatLng & {\n intensity?: number;\n weight?: number;\n count?: number;\n value?: number;\n};\n\ntype NativeHeatMapProps = Omit<HeatMapProps, 'data'> & ViewProps & {\n data: NativeHeatMapPoint[];\n};\n\nconst getNativeHeatMap = createLazyNativeViewManager<NativeHeatMapProps>('HeatMapView');\n\n\n/**\n * 高德地图热力图组件\n *\n * @param props - 热力图配置属性,继承自NativeHeatMap组件的属性\n * @returns 渲染高德地图原生热力图组件\n */\nfunction HeatMap(props: HeatMapProps) {\n const NativeHeatMap = React.useMemo(() => getNativeHeatMap(), []);\n const { data, ...restProps } = props;\n const normalizedData = React.useMemo(() => normalizeHeatMapData(data), [data]);\n\n return (\n <NativeHeatMap\n data={normalizedData}\n {...restProps}\n collapsable={false}\n pointerEvents=\"none\"\n style={styles.hidden}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n hidden: {\n width: 0,\n height: 0,\n backgroundColor: 'transparent',\n },\n});\n\nfunction normalizeHeatMapData(data: HeatMapProps['data']): NativeHeatMapPoint[] {\n return data.map((point) => {\n const normalized = normalizeLatLng(point);\n if (Array.isArray(point)) {\n return {\n ...normalized,\n intensity: typeof point[2] === 'number' ? point[2] : undefined,\n };\n }\n\n const extra = point as Partial<NativeHeatMapPoint>;\n return {\n ...normalized,\n intensity: typeof extra.intensity === 'number' ? extra.intensity : undefined,\n weight: typeof extra.weight === 'number' ? extra.weight : undefined,\n count: typeof extra.count === 'number' ? extra.count : undefined,\n value: typeof extra.value === 'number' ? extra.value : undefined,\n };\n });\n}\n\nexport default React.memo(HeatMap);\n"]}
|
|
@@ -10,7 +10,7 @@ import type { MarkerProps } from '../../types';
|
|
|
10
10
|
* - 拖拽功能
|
|
11
11
|
* - 所有事件回调
|
|
12
12
|
*/
|
|
13
|
-
declare function Marker(props: MarkerProps):
|
|
13
|
+
declare function Marker(props: MarkerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
declare const _default: React.MemoExoticComponent<typeof Marker>;
|
|
15
15
|
export default _default;
|
|
16
16
|
//# sourceMappingURL=Marker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB/C;;;;;;;;;GASG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB/C;;;;;;;;;GASG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CAiJjC;;AAED,wBAAkC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { StyleSheet, View } from 'react-native';
|
|
3
4
|
import ExpoGaodeMapModule from '../../ExpoGaodeMapModule';
|
|
@@ -111,11 +112,7 @@ function Marker(props) {
|
|
|
111
112
|
? resolvedContentHeight
|
|
112
113
|
: (iconHeight && iconHeight > 0 ? iconHeight : 40);
|
|
113
114
|
const optionalNativeProps = cacheKey != null ? { cacheKey } : undefined;
|
|
114
|
-
return (
|
|
115
|
-
{hasChildren && shouldWrapChildrenForMeasurement ? (<View collapsable={false} onLayout={handleAutoMeasure} style={styles.measureContainer}>
|
|
116
|
-
{children}
|
|
117
|
-
</View>) : children}
|
|
118
|
-
</NativeMarkerView>);
|
|
115
|
+
return (_jsx(NativeMarkerView, { ...restProps, ...optionalNativeProps, latitude: normalizedPosition.latitude, longitude: normalizedPosition.longitude, iconWidth: finalIconWidth, iconHeight: finalIconHeight, contentWidth: hasChildren ? finalIconWidth : 0, contentHeight: hasChildren ? finalIconHeight : 0, smoothMovePath: normalizedSmoothMovePath, children: hasChildren && shouldWrapChildrenForMeasurement ? (_jsx(View, { collapsable: false, onLayout: handleAutoMeasure, style: styles.measureContainer, children: children })) : children }));
|
|
119
116
|
}
|
|
120
117
|
export default React.memo(Marker);
|
|
121
118
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAShF,MAAM,mBAAmB,GAAG,2BAA2B,CAAwB,YAAY,CAAC,CAAC;AAE7F,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAEnD;;;;;;;;;GASG;AACH,SAAS,MAAM,CAAC,KAAkB;IAChC,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC3E,mCA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AAgB,CACf,IAAI,SAAS,CAAC,CACd,IAAI,mBAAmB,CAAC,CACxB,QAAQ,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CACtC,SAAS,CAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,CACxC,SAAS,CAAC,CAAC,cAAc,CAAC,CAC1B,UAAU,CAAC,CAAC,eAAe,CAAC,CAC5B,YAAY,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAC/C,aAAa,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CACjD,cAAc,CAAC,CAAC,wBAAwB,CAAC,CAEzC;MAAA,CAAC,WAAW,IAAI,gCAAgC,CAAC,CAAC,CAAC,CACjD,CAAC,IAAI,CACH,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAC5B,KAAK,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAE/B;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,QAAQ,CACd;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAElC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,gBAAgB,EAAE;QAChB,SAAS,EAAE,YAAY;QACvB,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\nimport type { MarkerProps } from '../../types';\nimport ExpoGaodeMapModule from '../../ExpoGaodeMapModule';\nimport { normalizeLatLng, normalizeLatLngList } from '../../utils/GeoUtils';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\n\ntype NativeMarkerViewProps = Omit<MarkerProps, 'position'> & {\n latitude: number;\n longitude: number;\n contentWidth?: number;\n contentHeight?: number;\n};\n\nconst getNativeMarkerView = createLazyNativeViewManager<NativeMarkerViewProps>('MarkerView');\n\nconst AUTO_SIZE_FALLBACK = { width: 0, height: 0 };\n\n/**\n * Marker 组件 - 完全声明式 API\n *\n * 支持:\n * - 自定义图标(icon)\n * - 自定义内容(children)- 自动测量尺寸\n * - 大头针样式(pinColor)\n * - 拖拽功能\n * - 所有事件回调\n */\nfunction Marker(props: MarkerProps) {\n const NativeMarkerView = React.useMemo(() => getNativeMarkerView(), []);\n const [measuredSize, setMeasuredSize] = React.useState(AUTO_SIZE_FALLBACK);\n // 从 props 中排除 position 属性,避免传递到原生层\n const {\n position,\n iconWidth,\n iconHeight,\n children,\n smoothMovePath,\n cacheKey,\n ...restProps\n } = props;\n\n // 归一化坐标处理\n const normalizedPosition = normalizeLatLng(position);\n const normalizedSmoothMovePath = smoothMovePath ? normalizeLatLngList(smoothMovePath) : undefined;\n\n // 根据是否有 children 来决定使用哪个尺寸属性\n const hasChildren = !!children;\n const shouldWrapChildrenForMeasurement = hasChildren;\n // Android 的 children marker 之前始终透传 0 尺寸,点击后重新快照时容易直接消失。\n // 统一走自动测量后,两个平台都会拿到稳定尺寸。\n const shouldUseAutoMeasuredSize = hasChildren;\n const resolvedContentWidth = shouldUseAutoMeasuredSize ? measuredSize.width : 0;\n const resolvedContentHeight = shouldUseAutoMeasuredSize ? measuredSize.height : 0;\n\n React.useEffect(() => {\n if (\n !normalizedSmoothMovePath ||\n normalizedSmoothMovePath.length < 2 ||\n !props.smoothMoveDuration ||\n props.smoothMoveDuration <= 0\n ) {\n return undefined;\n }\n\n const totalDistance = ExpoGaodeMapModule.calculatePathLength(normalizedSmoothMovePath);\n if (totalDistance <= 0) {\n props.onSmoothMoveEnd?.({\n nativeEvent: {\n position: normalizedSmoothMovePath[normalizedSmoothMovePath.length - 1],\n angle: 0,\n totalDistance,\n },\n } as never);\n return undefined;\n }\n\n const durationMs = props.smoothMoveDuration * 1000;\n const startedAt = Date.now();\n const tick = () => {\n const progress = Math.min(1, (Date.now() - startedAt) / durationMs);\n const distance = totalDistance * progress;\n const pointInfo = ExpoGaodeMapModule.getPointAtDistance(normalizedSmoothMovePath, distance);\n const point = pointInfo\n ? { latitude: pointInfo.latitude, longitude: pointInfo.longitude }\n : normalizedSmoothMovePath[normalizedSmoothMovePath.length - 1];\n const angle = pointInfo?.angle ?? 0;\n\n props.onSmoothMoveProgress?.({\n nativeEvent: {\n position: point,\n angle,\n progress,\n distance,\n totalDistance,\n },\n } as never);\n\n if (progress >= 1) {\n props.onSmoothMoveEnd?.({\n nativeEvent: {\n position: point,\n angle,\n totalDistance,\n },\n } as never);\n }\n };\n\n tick();\n const intervalId = setInterval(() => {\n tick();\n if (Date.now() - startedAt >= durationMs) {\n clearInterval(intervalId);\n }\n }, 100);\n\n return () => clearInterval(intervalId);\n }, [\n normalizedSmoothMovePath,\n props.onSmoothMoveEnd,\n props.onSmoothMoveProgress,\n props.smoothMoveDuration,\n ]);\n\n const handleAutoMeasure = (event: LayoutChangeEvent) => {\n const nextWidth = Math.ceil(event.nativeEvent.layout.width);\n const nextHeight = Math.ceil(event.nativeEvent.layout.height);\n\n if (nextWidth === measuredSize.width && nextHeight === measuredSize.height) {\n return;\n }\n\n setMeasuredSize({\n width: nextWidth,\n height: nextHeight,\n });\n };\n\n // 智能尺寸计算\n const finalIconWidth = hasChildren\n ? resolvedContentWidth\n : (iconWidth && iconWidth > 0 ? iconWidth : 40);\n\n const finalIconHeight = hasChildren\n ? resolvedContentHeight\n : (iconHeight && iconHeight > 0 ? iconHeight : 40);\n\n const optionalNativeProps = cacheKey != null ? { cacheKey } : undefined;\n\n return (\n <NativeMarkerView\n {...restProps}\n {...optionalNativeProps}\n latitude={normalizedPosition.latitude}\n longitude={normalizedPosition.longitude}\n iconWidth={finalIconWidth}\n iconHeight={finalIconHeight}\n contentWidth={hasChildren ? finalIconWidth : 0}\n contentHeight={hasChildren ? finalIconHeight : 0}\n smoothMovePath={normalizedSmoothMovePath}\n >\n {hasChildren && shouldWrapChildrenForMeasurement ? (\n <View\n collapsable={false}\n onLayout={handleAutoMeasure}\n style={styles.measureContainer}\n >\n {children}\n </View>\n ) : children}\n </NativeMarkerView>\n );\n}\n\nexport default React.memo(Marker);\n\nconst styles = StyleSheet.create({\n measureContainer: {\n alignSelf: 'flex-start',\n alignItems: 'flex-start',\n flexShrink: 0,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"Marker.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Marker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAShF,MAAM,mBAAmB,GAAG,2BAA2B,CAAwB,YAAY,CAAC,CAAC;AAE7F,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAEnD;;;;;;;;;GASG;AACH,SAAS,MAAM,CAAC,KAAkB;IAChC,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC3E,mCAAmC;IACnC,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,UAAU;IACV,MAAM,k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,eAAe,EAC3B,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAC9C,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAChD,cAAc,EAAE,wBAAwB,YAEvC,WAAW,IAAI,gCAAgC,CAAC,CAAC,CAAC,CACjD,KAAC,IAAI,IACH,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,MAAM,CAAC,gBAAgB,YAE7B,QAAQ,GACJ,CACR,CAAC,CAAC,CAAC,QAAQ,GACK,CACpB,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAElC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,gBAAgB,EAAE;QAChB,SAAS,EAAE,YAAY;QACvB,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\nimport type { MarkerProps } from '../../types';\nimport ExpoGaodeMapModule from '../../ExpoGaodeMapModule';\nimport { normalizeLatLng, normalizeLatLngList } from '../../utils/GeoUtils';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\n\ntype NativeMarkerViewProps = Omit<MarkerProps, 'position'> & {\n latitude: number;\n longitude: number;\n contentWidth?: number;\n contentHeight?: number;\n};\n\nconst getNativeMarkerView = createLazyNativeViewManager<NativeMarkerViewProps>('MarkerView');\n\nconst AUTO_SIZE_FALLBACK = { width: 0, height: 0 };\n\n/**\n * Marker 组件 - 完全声明式 API\n *\n * 支持:\n * - 自定义图标(icon)\n * - 自定义内容(children)- 自动测量尺寸\n * - 大头针样式(pinColor)\n * - 拖拽功能\n * - 所有事件回调\n */\nfunction Marker(props: MarkerProps) {\n const NativeMarkerView = React.useMemo(() => getNativeMarkerView(), []);\n const [measuredSize, setMeasuredSize] = React.useState(AUTO_SIZE_FALLBACK);\n // 从 props 中排除 position 属性,避免传递到原生层\n const {\n position,\n iconWidth,\n iconHeight,\n children,\n smoothMovePath,\n cacheKey,\n ...restProps\n } = props;\n\n // 归一化坐标处理\n const normalizedPosition = normalizeLatLng(position);\n const normalizedSmoothMovePath = smoothMovePath ? normalizeLatLngList(smoothMovePath) : undefined;\n\n // 根据是否有 children 来决定使用哪个尺寸属性\n const hasChildren = !!children;\n const shouldWrapChildrenForMeasurement = hasChildren;\n // Android 的 children marker 之前始终透传 0 尺寸,点击后重新快照时容易直接消失。\n // 统一走自动测量后,两个平台都会拿到稳定尺寸。\n const shouldUseAutoMeasuredSize = hasChildren;\n const resolvedContentWidth = shouldUseAutoMeasuredSize ? measuredSize.width : 0;\n const resolvedContentHeight = shouldUseAutoMeasuredSize ? measuredSize.height : 0;\n\n React.useEffect(() => {\n if (\n !normalizedSmoothMovePath ||\n normalizedSmoothMovePath.length < 2 ||\n !props.smoothMoveDuration ||\n props.smoothMoveDuration <= 0\n ) {\n return undefined;\n }\n\n const totalDistance = ExpoGaodeMapModule.calculatePathLength(normalizedSmoothMovePath);\n if (totalDistance <= 0) {\n props.onSmoothMoveEnd?.({\n nativeEvent: {\n position: normalizedSmoothMovePath[normalizedSmoothMovePath.length - 1],\n angle: 0,\n totalDistance,\n },\n } as never);\n return undefined;\n }\n\n const durationMs = props.smoothMoveDuration * 1000;\n const startedAt = Date.now();\n const tick = () => {\n const progress = Math.min(1, (Date.now() - startedAt) / durationMs);\n const distance = totalDistance * progress;\n const pointInfo = ExpoGaodeMapModule.getPointAtDistance(normalizedSmoothMovePath, distance);\n const point = pointInfo\n ? { latitude: pointInfo.latitude, longitude: pointInfo.longitude }\n : normalizedSmoothMovePath[normalizedSmoothMovePath.length - 1];\n const angle = pointInfo?.angle ?? 0;\n\n props.onSmoothMoveProgress?.({\n nativeEvent: {\n position: point,\n angle,\n progress,\n distance,\n totalDistance,\n },\n } as never);\n\n if (progress >= 1) {\n props.onSmoothMoveEnd?.({\n nativeEvent: {\n position: point,\n angle,\n totalDistance,\n },\n } as never);\n }\n };\n\n tick();\n const intervalId = setInterval(() => {\n tick();\n if (Date.now() - startedAt >= durationMs) {\n clearInterval(intervalId);\n }\n }, 100);\n\n return () => clearInterval(intervalId);\n }, [\n normalizedSmoothMovePath,\n props.onSmoothMoveEnd,\n props.onSmoothMoveProgress,\n props.smoothMoveDuration,\n ]);\n\n const handleAutoMeasure = (event: LayoutChangeEvent) => {\n const nextWidth = Math.ceil(event.nativeEvent.layout.width);\n const nextHeight = Math.ceil(event.nativeEvent.layout.height);\n\n if (nextWidth === measuredSize.width && nextHeight === measuredSize.height) {\n return;\n }\n\n setMeasuredSize({\n width: nextWidth,\n height: nextHeight,\n });\n };\n\n // 智能尺寸计算\n const finalIconWidth = hasChildren\n ? resolvedContentWidth\n : (iconWidth && iconWidth > 0 ? iconWidth : 40);\n\n const finalIconHeight = hasChildren\n ? resolvedContentHeight\n : (iconHeight && iconHeight > 0 ? iconHeight : 40);\n\n const optionalNativeProps = cacheKey != null ? { cacheKey } : undefined;\n\n return (\n <NativeMarkerView\n {...restProps}\n {...optionalNativeProps}\n latitude={normalizedPosition.latitude}\n longitude={normalizedPosition.longitude}\n iconWidth={finalIconWidth}\n iconHeight={finalIconHeight}\n contentWidth={hasChildren ? finalIconWidth : 0}\n contentHeight={hasChildren ? finalIconHeight : 0}\n smoothMovePath={normalizedSmoothMovePath}\n >\n {hasChildren && shouldWrapChildrenForMeasurement ? (\n <View\n collapsable={false}\n onLayout={handleAutoMeasure}\n style={styles.measureContainer}\n >\n {children}\n </View>\n ) : children}\n </NativeMarkerView>\n );\n}\n\nexport default React.memo(Marker);\n\nconst styles = StyleSheet.create({\n measureContainer: {\n alignSelf: 'flex-start',\n alignItems: 'flex-start',\n flexShrink: 0,\n },\n});\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { MultiPointProps } from '../../types';
|
|
3
2
|
/**
|
|
4
3
|
* 高德地图多点标记组件
|
|
@@ -6,5 +5,5 @@ import type { MultiPointProps } from '../../types';
|
|
|
6
5
|
* @param props 多点标记的配置属性,继承自MultiPointProps接口
|
|
7
6
|
* @returns 渲染原生高德地图多点标记组件
|
|
8
7
|
*/
|
|
9
|
-
export default function MultiPoint(props: MultiPointProps):
|
|
8
|
+
export default function MultiPoint(props: MultiPointProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
//# sourceMappingURL=MultiPoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiPoint.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiPoint.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,2CAGxD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';
|
|
3
4
|
const getNativeMultiPoint = createLazyNativeViewManager('MultiPointView');
|
|
@@ -9,6 +10,6 @@ const getNativeMultiPoint = createLazyNativeViewManager('MultiPointView');
|
|
|
9
10
|
*/
|
|
10
11
|
export default function MultiPoint(props) {
|
|
11
12
|
const NativeMultiPoint = React.useMemo(() => getNativeMultiPoint(), []);
|
|
12
|
-
return
|
|
13
|
+
return _jsx(NativeMultiPoint, { ...props });
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=MultiPoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiPoint.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/MultiPoint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,mBAAmB,GAAG,2BAA2B,CAAkB,gBAAgB,CAAC,CAAC;AAG3F;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAsB;IACvD,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"MultiPoint.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/MultiPoint.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,MAAM,mBAAmB,GAAG,2BAA2B,CAAkB,gBAAgB,CAAC,CAAC;AAG3F;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAsB;IACvD,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,OAAO,KAAC,gBAAgB,OAAK,KAAK,GAAI,CAAC;AACzC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { MultiPointProps } from '../../types';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\n\nconst getNativeMultiPoint = createLazyNativeViewManager<MultiPointProps>('MultiPointView');\n\n\n/**\n * 高德地图多点标记组件\n * \n * @param props 多点标记的配置属性,继承自MultiPointProps接口\n * @returns 渲染原生高德地图多点标记组件\n */\nexport default function MultiPoint(props: MultiPointProps) {\n const NativeMultiPoint = React.useMemo(() => getNativeMultiPoint(), []);\n return <NativeMultiPoint {...props} />;\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import type { PolygonProps } from '../../types';
|
|
|
6
6
|
* @param props - 多边形属性配置,继承自PolygonProps类型
|
|
7
7
|
* @returns 高德地图原生多边形视图组件
|
|
8
8
|
*/
|
|
9
|
-
declare function Polygon(props: PolygonProps):
|
|
9
|
+
declare function Polygon(props: PolygonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare const _default: React.MemoExoticComponent<typeof Polygon>;
|
|
11
11
|
export default _default;
|
|
12
12
|
//# sourceMappingURL=Polygon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polygon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polygon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAOnC;;AAED,wBAAmC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { normalizeLatLngList } from '../../utils/GeoUtils';
|
|
3
4
|
import { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';
|
|
@@ -13,7 +14,7 @@ function Polygon(props) {
|
|
|
13
14
|
const { points, ...restProps } = props;
|
|
14
15
|
// 归一化坐标数组
|
|
15
16
|
const normalizedPoints = normalizeLatLngList(points);
|
|
16
|
-
return
|
|
17
|
+
return _jsx(NativePolygonView, { points: normalizedPoints, ...restProps });
|
|
17
18
|
}
|
|
18
19
|
export default React.memo(Polygon);
|
|
19
20
|
//# sourceMappingURL=Polygon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polygon.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polygon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,MAAM,oBAAoB,GAAG,2BAA2B,CAAe,aAAa,CAAC,CAAC;AAEtF;;;;;GAKG;AACH,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACvC,UAAU;IACV,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO,
|
|
1
|
+
{"version":3,"file":"Polygon.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polygon.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,MAAM,oBAAoB,GAAG,2BAA2B,CAAe,aAAa,CAAC,CAAC;AAEtF;;;;;GAKG;AACH,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACvC,UAAU;IACV,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO,KAAC,iBAAiB,IAAC,MAAM,EAAE,gBAAgB,KAAM,SAAS,GAAI,CAAC;AACxE,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { PolygonProps } from '../../types';\nimport { normalizeLatLngList } from '../../utils/GeoUtils';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\nconst getNativePolygonView = createLazyNativeViewManager<PolygonProps>('PolygonView');\n\n/**\n * 渲染一个高德地图多边形覆盖物组件\n *\n * @param props - 多边形属性配置,继承自PolygonProps类型\n * @returns 高德地图原生多边形视图组件\n */\nfunction Polygon(props: PolygonProps) {\n const NativePolygonView = React.useMemo(() => getNativePolygonView(), []);\n const { points, ...restProps } = props;\n // 归一化坐标数组\n const normalizedPoints = normalizeLatLngList(points);\n\n return <NativePolygonView points={normalizedPoints} {...restProps} />;\n}\n\nexport default React.memo(Polygon);\n"]}
|
|
@@ -6,7 +6,7 @@ import type { PolylineProps } from '../../types';
|
|
|
6
6
|
* @param props - 折线属性配置,继承自PolylineProps类型
|
|
7
7
|
* @returns 高德地图原生折线视图组件
|
|
8
8
|
*/
|
|
9
|
-
declare function Polyline(props: PolylineProps):
|
|
9
|
+
declare function Polyline(props: PolylineProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare const _default: React.MemoExoticComponent<typeof Polyline>;
|
|
11
11
|
export default _default;
|
|
12
12
|
//# sourceMappingURL=Polyline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polyline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polyline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAOrC;;AAED,wBAAoC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { normalizeLatLngList } from '../../utils/GeoUtils';
|
|
3
4
|
import { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';
|
|
@@ -13,7 +14,7 @@ function Polyline(props) {
|
|
|
13
14
|
const { points, ...restProps } = props;
|
|
14
15
|
// 归一化坐标数组
|
|
15
16
|
const normalizedPoints = normalizeLatLngList(points);
|
|
16
|
-
return
|
|
17
|
+
return _jsx(NativePolylineView, { points: normalizedPoints, ...restProps });
|
|
17
18
|
}
|
|
18
19
|
export default React.memo(Polyline);
|
|
19
20
|
//# sourceMappingURL=Polyline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyline.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polyline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,MAAM,qBAAqB,GAAG,2BAA2B,CAAgB,cAAc,CAAC,CAAC;AAEzF;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACvC,UAAU;IACV,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO,
|
|
1
|
+
{"version":3,"file":"Polyline.js","sourceRoot":"","sources":["../../../../src/map/components/overlays/Polyline.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,MAAM,qBAAqB,GAAG,2BAA2B,CAAgB,cAAc,CAAC,CAAC;AAEzF;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,KAAoB;IACpC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACvC,UAAU;IACV,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO,KAAC,kBAAkB,IAAC,MAAM,EAAE,gBAAgB,KAAM,SAAS,GAAI,CAAC;AACzE,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { PolylineProps } from '../../types';\nimport { normalizeLatLngList } from '../../utils/GeoUtils';\nimport { createLazyNativeViewManager } from '../../utils/lazyNativeViewManager';\nconst getNativePolylineView = createLazyNativeViewManager<PolylineProps>('PolylineView');\n\n/**\n * 渲染高德地图上的折线覆盖物组件\n *\n * @param props - 折线属性配置,继承自PolylineProps类型\n * @returns 高德地图原生折线视图组件\n */\nfunction Polyline(props: PolylineProps) {\n const NativePolylineView = React.useMemo(() => getNativePolylineView(), []);\n const { points, ...restProps } = props;\n // 归一化坐标数组\n const normalizedPoints = normalizeLatLngList(points);\n \n return <NativePolylineView points={normalizedPoints} {...restProps} />;\n}\n\nexport default React.memo(Polyline);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlongSearchOptions, InputTipsOptions, InputTipsResult, NearbySearchOptions, POI, POISearchOptions, PolygonSearchOptions, ReGeocodeOptions, ReGeocodeResult, RoutePOIType, SearchResult } from './ExpoGaodeMapSearch.types';
|
|
1
|
+
import type { AlongSearchOptions, InputTipsOptions, InputTipsResult, NearbySearchOptions, POI, POISearchOptions, PolygonSearchOptions, ReGeocodeOptions, ReGeocodeResult, RoutePOIType, SearchResult } from './ExpoGaodeMapSearch.types';
|
|
2
2
|
declare class ExpoGaodeMapSearchModuleType {
|
|
3
3
|
/**
|
|
4
4
|
* 初始化搜索模块(可选)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoGaodeMapSearchModule.d.ts","sourceRoot":"","sources":["../../../src/map/search/ExpoGaodeMapSearchModule.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExpoGaodeMapSearchModule.d.ts","sourceRoot":"","sources":["../../../src/map/search/ExpoGaodeMapSearchModule.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,GAAG,EACH,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,YAAY,EACb,MAAM,4BAA4B,CAAC;AAwBpC,OAAO,OAAO,4BAA4B;IACxC;;;;;;;;;OASG;IACH,UAAU,IAAI,IAAI;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;IAC3D;;;;;;OAMG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IACjE;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAC/D;;;;;;OAMG;IACH,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IACnE;;;;;;OAMG;IACH,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IACjE;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAC9D;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CACvC;;AA6BD,wBAIG;AAEH,YAAY,EAAE,YAAY,EAAE,CAAC"}
|