expo-gaode-map 0.1.0 → 0.1.2
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/ExpoSmartrefreshlayoutModule.swift +119 -0
- package/README.md +35 -496
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapModule.kt +7 -8
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +9 -1
- package/android/src/main/java/expo/modules/gaodemap/managers/CameraManager.kt +14 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/OverlayManager.kt +11 -45
- package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +111 -9
- package/android/src/main/java/expo/modules/gaodemap/utils/ColorParser.kt +48 -0
- package/build/components/overlays/Polyline.d.ts.map +1 -1
- package/build/components/overlays/Polyline.js +10 -17
- package/build/components/overlays/Polyline.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/modules/AMapSDK.d.ts +0 -6
- package/build/modules/AMapSDK.d.ts.map +1 -1
- package/build/modules/AMapSDK.js +2 -11
- package/build/modules/AMapSDK.js.map +1 -1
- package/build/types/map-view.types.d.ts +27 -5
- package/build/types/map-view.types.d.ts.map +1 -1
- package/build/types/map-view.types.js.map +1 -1
- package/docs/API.md +248 -0
- package/docs/EXAMPLES.md +479 -0
- package/ios/ColorParser.swift +158 -0
- package/ios/ExpoGaodeMap.podspec +1 -0
- package/ios/ExpoGaodeMapModule.swift +445 -42
- package/ios/ExpoGaodeMapView.swift +278 -32
- package/ios/UIColorExtension.swift +11 -0
- package/ios/managers/CameraManager.swift +107 -0
- package/ios/managers/OverlayManager.swift +210 -0
- package/ios/managers/UIManager.swift +163 -0
- package/ios/modules/LocationManager.swift +144 -0
- package/ios/overlays/CircleView.swift +76 -0
- package/ios/overlays/ClusterView.swift +56 -0
- package/ios/overlays/HeatMapView.swift +98 -0
- package/ios/overlays/MarkerView.swift +81 -0
- package/ios/overlays/MultiPointView.swift +50 -0
- package/ios/overlays/PolygonView.swift +70 -0
- package/ios/overlays/PolylineView.swift +62 -0
- package/lib/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/lib/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/lib/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/lib/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/lib/android/.gradle/8.9/gc.properties +0 -0
- package/lib/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/lib/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/lib/android/.gradle/vcs-1/gc.properties +0 -0
- package/lib/android/build/.transforms/7df4812a1bb640a0eb92904b45f433ca/results.bin +1 -0
- package/lib/android/build/.transforms/7df4812a1bb640a0eb92904b45f433ca/transformed/classes/classes_dex/classes.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/results.bin +1 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/AMap3DPackage.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/BuildConfig.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/UtilsKt$fetchImage$request$1$1.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/UtilsKt.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Circle.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/CircleManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/HeatMap.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/HeatMapManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView$7.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView$8.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView$animateCallback$1.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapViewManager$commands$1.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapViewManager$commands$2.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapViewManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Marker$setIcon$1.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Marker.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MarkerManager$Companion.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MarkerManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MultiPoint$setIcon$1.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MultiPoint.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MultiPointManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Overlay.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Polygon.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/PolygonManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Polyline.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/PolylineManager.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/modules/SdkModule.dex +0 -0
- package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/desugar_graph.bin +0 -0
- package/lib/android/build/generated/source/buildConfig/debug/qiuxiang/amap3d/BuildConfig.java +10 -0
- package/lib/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +14 -0
- package/lib/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
- package/lib/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
- package/lib/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- package/lib/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/lib/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/lib/android/build/intermediates/compile_symbol_list/debug/R.txt +1 -0
- package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-hdpi-v4_positio_icon.png.flat +0 -0
- package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-mdpi-v4_positio_icon.png.flat +0 -0
- package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-xhdpi-v4_positio_icon.png.flat +0 -0
- package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-xxhdpi-v4_positio_icon.png.flat +0 -0
- package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-xxxhdpi-v4_positio_icon.png.flat +0 -0
- package/lib/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +6 -0
- package/lib/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/lib/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/lib/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/lib/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/lib/android/build/intermediates/java_res/debug/out/META-INF/react-native-amap3d_debug.kotlin_module +0 -0
- package/lib/android/build/intermediates/javac/debug/classes/qiuxiang/amap3d/BuildConfig.class +0 -0
- package/lib/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +3 -0
- package/lib/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +26 -0
- package/lib/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +14 -0
- package/lib/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/lib/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/positio_icon.png +0 -0
- package/lib/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/positio_icon.png +0 -0
- package/lib/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/positio_icon.png +0 -0
- package/lib/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/positio_icon.png +0 -0
- package/lib/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/positio_icon.png +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-amap3d_debug.kotlin_module +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/AMap3DPackage.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/BuildConfig.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/UtilsKt$fetchImage$request$1$1.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/UtilsKt.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Circle.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/CircleManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/HeatMap.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/HeatMapManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView$7.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView$8.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView$animateCallback$1.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$1.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$2.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapViewManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Marker$setIcon$1.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Marker.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MarkerManager$Companion.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MarkerManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MultiPoint$setIcon$1.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MultiPoint.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MultiPointManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Overlay.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Polygon.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/PolygonManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Polyline.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/PolylineManager.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/modules/SdkModule.class +0 -0
- package/lib/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/lib/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +2 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/lib/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/lib/android/build/outputs/logs/manifest-merger-debug-report.txt +41 -0
- package/lib/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/META-INF/react-native-amap3d_debug.kotlin_module +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/AMap3DPackage.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/UtilsKt$fetchImage$request$1$1.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/UtilsKt.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Circle.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/CircleManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/HeatMap.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/HeatMapManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView$7.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView$8.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView$animateCallback$1.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$1.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$2.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapViewManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Marker$setIcon$1.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Marker.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MarkerManager$Companion.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MarkerManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MultiPoint$setIcon$1.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MultiPoint.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MultiPointManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Overlay.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Polygon.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/PolygonManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Polyline.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/PolylineManager.class +0 -0
- package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/modules/SdkModule.class +0 -0
- package/lib/android/build.gradle +34 -0
- package/lib/android/drawable/rn_edit_text_material.xml +37 -0
- package/lib/android/drawable-hdpi/positio_icon.png +0 -0
- package/lib/android/drawable-hdpi/splashscreen_image.png +0 -0
- package/lib/android/drawable-mdpi/splashscreen_image.png +0 -0
- package/lib/android/drawable-xhdpi/splashscreen_image.png +0 -0
- package/lib/android/drawable-xxhdpi/splashscreen_image.png +0 -0
- package/lib/android/drawable-xxxhdpi/splashscreen_image.png +0 -0
- package/lib/android/src/main/AndroidManifest.xml +10 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/AMap3DPackage.kt +30 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/Utils.kt +114 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Circle.kt +65 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/CircleManager.kt +49 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/HeatMap.kt +32 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/HeatMapManager.kt +33 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MapView.kt +190 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MapViewManager.kt +181 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Marker.kt +102 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MarkerManager.kt +78 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MultiPoint.kt +53 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MultiPointManager.kt +33 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Overlay.kt +8 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Polygon.kt +58 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/PolygonManager.kt +44 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Polyline.kt +69 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/map_view/PolylineManager.kt +64 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/modules/AMapGeolocationModule.kt +468 -0
- package/lib/android/src/main/java/qiuxiang/amap3d/modules/SdkModule.kt +31 -0
- package/lib/android/src/main/res/drawable-hdpi/positio_icon.png +0 -0
- package/lib/android/src/main/res/drawable-mdpi/positio_icon.png +0 -0
- package/lib/android/src/main/res/drawable-xhdpi/positio_icon.png +0 -0
- package/lib/android/src/main/res/drawable-xxhdpi/positio_icon.png +0 -0
- package/lib/android/src/main/res/drawable-xxxhdpi/positio_icon.png +0 -0
- package/lib/ios/.swiftformat +2 -0
- package/lib/ios/Bridging-Header.h +4 -0
- package/lib/ios/MapView/CircleManager.m +11 -0
- package/lib/ios/MapView/CircleManager.swift +30 -0
- package/lib/ios/MapView/HeatMapManager.m +9 -0
- package/lib/ios/MapView/HeatMapManager.swift +29 -0
- package/lib/ios/MapView/MapViewManager.m +35 -0
- package/lib/ios/MapView/MapViewManager.swift +188 -0
- package/lib/ios/MapView/MarkerManager.m +18 -0
- package/lib/ios/MapView/MarkerManager.swift +100 -0
- package/lib/ios/MapView/MultiPointManager.m +9 -0
- package/lib/ios/MapView/MultiPointManager.swift +47 -0
- package/lib/ios/MapView/Overlay.swift +4 -0
- package/lib/ios/MapView/PolygonManager.m +10 -0
- package/lib/ios/MapView/PolygonManager.swift +30 -0
- package/lib/ios/MapView/PolylineManager.m +12 -0
- package/lib/ios/MapView/PolylineManager.swift +41 -0
- package/lib/ios/Modules/SdkModule.m +8 -0
- package/lib/ios/Modules/SdkModule.swift +16 -0
- package/lib/ios/RNAMapGeolocation.h +8 -0
- package/lib/ios/RNAMapGeolocation.m +302 -0
- package/lib/ios/Utils.swift +104 -0
- package/lib/ios/react-native-amap3d.podspec +21 -0
- package/lib/src/circle.tsx +36 -0
- package/lib/src/cluster/cluster-view.tsx +58 -0
- package/lib/src/cluster/index.tsx +159 -0
- package/lib/src/component.ts +31 -0
- package/lib/src/geolocation/index.d.ts +287 -0
- package/lib/src/geolocation/index.js +344 -0
- package/lib/src/heat-map.tsx +21 -0
- package/lib/src/index.ts +13 -0
- package/lib/src/location/index.d.ts +287 -0
- package/lib/src/location/index.js +344 -0
- package/lib/src/map-view.tsx +230 -0
- package/lib/src/marker.tsx +128 -0
- package/lib/src/multi-point.tsx +28 -0
- package/lib/src/polygon.tsx +31 -0
- package/lib/src/polyline.tsx +65 -0
- package/lib/src/sdk.ts +11 -0
- package/lib/src/types.ts +137 -0
- package/package.json +2 -2
- package/src/components/overlays/Polyline.tsx +11 -19
- package/src/index.ts +2 -2
- package/src/modules/AMapSDK.ts +2 -12
- package/src/types/map-view.types.ts +27 -5
- package/docs/followUserLocation.md +0 -186
- package/src/types/README.md +0 -186
package/docs/EXAMPLES.md
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# 使用示例
|
|
2
|
+
|
|
3
|
+
完整的使用示例和最佳实践。
|
|
4
|
+
|
|
5
|
+
## 目录
|
|
6
|
+
|
|
7
|
+
- [基础地图应用](#基础地图应用)
|
|
8
|
+
- [定位追踪应用](#定位追踪应用)
|
|
9
|
+
- [覆盖物示例](#覆盖物示例)
|
|
10
|
+
- [高级用法](#高级用法)
|
|
11
|
+
|
|
12
|
+
## 基础地图应用
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import React, { useRef, useEffect } from 'react';
|
|
16
|
+
import { View, StyleSheet, Button } from 'react-native';
|
|
17
|
+
import {
|
|
18
|
+
MapView,
|
|
19
|
+
initSDK,
|
|
20
|
+
Circle,
|
|
21
|
+
Marker,
|
|
22
|
+
Polyline,
|
|
23
|
+
Polygon,
|
|
24
|
+
type MapViewRef
|
|
25
|
+
} from 'expo-gaode-map';
|
|
26
|
+
|
|
27
|
+
export default function App() {
|
|
28
|
+
const mapRef = useRef<MapViewRef>(null);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
initSDK({
|
|
32
|
+
androidKey: 'your-android-api-key',
|
|
33
|
+
iosKey: 'your-ios-api-key',
|
|
34
|
+
});
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
const handleMoveCamera = async () => {
|
|
38
|
+
await mapRef.current?.moveCamera(
|
|
39
|
+
{
|
|
40
|
+
target: { latitude: 40.0, longitude: 116.5 },
|
|
41
|
+
zoom: 15,
|
|
42
|
+
},
|
|
43
|
+
1000
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<View style={styles.container}>
|
|
49
|
+
<MapView
|
|
50
|
+
ref={mapRef}
|
|
51
|
+
style={styles.map}
|
|
52
|
+
initialCameraPosition={{
|
|
53
|
+
target: { latitude: 39.9, longitude: 116.4 },
|
|
54
|
+
zoom: 10,
|
|
55
|
+
}}
|
|
56
|
+
myLocationEnabled={true}
|
|
57
|
+
followUserLocation={false}
|
|
58
|
+
trafficEnabled={true}
|
|
59
|
+
onPress={(e) => console.log('点击地图', e)}
|
|
60
|
+
onLoad={() => console.log('地图加载完成')}
|
|
61
|
+
>
|
|
62
|
+
{/* 圆形覆盖物 */}
|
|
63
|
+
<Circle
|
|
64
|
+
center={{ latitude: 39.9, longitude: 116.4 }}
|
|
65
|
+
radius={1000}
|
|
66
|
+
fillColor="#8800FF00"
|
|
67
|
+
strokeColor="#FFFF0000"
|
|
68
|
+
strokeWidth={2}
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
{/* 标记点 */}
|
|
72
|
+
<Marker
|
|
73
|
+
position={{ latitude: 39.95, longitude: 116.45 }}
|
|
74
|
+
title="这是一个标记"
|
|
75
|
+
draggable={true}
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
{/* 折线 */}
|
|
79
|
+
<Polyline
|
|
80
|
+
points={[
|
|
81
|
+
{ latitude: 39.9, longitude: 116.4 },
|
|
82
|
+
{ latitude: 39.95, longitude: 116.45 },
|
|
83
|
+
{ latitude: 40.0, longitude: 116.5 },
|
|
84
|
+
]}
|
|
85
|
+
strokeWidth={5}
|
|
86
|
+
strokeColor="#FF0000FF"
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
{/* 多边形 */}
|
|
90
|
+
<Polygon
|
|
91
|
+
points={[
|
|
92
|
+
{ latitude: 39.85, longitude: 116.35 },
|
|
93
|
+
{ latitude: 39.85, longitude: 116.45 },
|
|
94
|
+
{ latitude: 39.75, longitude: 116.40 },
|
|
95
|
+
]}
|
|
96
|
+
fillColor="#880000FF"
|
|
97
|
+
strokeColor="#FFFF0000"
|
|
98
|
+
strokeWidth={2}
|
|
99
|
+
/>
|
|
100
|
+
</MapView>
|
|
101
|
+
|
|
102
|
+
<View style={styles.controls}>
|
|
103
|
+
<Button title="移动相机" onPress={handleMoveCamera} />
|
|
104
|
+
</View>
|
|
105
|
+
</View>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
container: {
|
|
111
|
+
flex: 1,
|
|
112
|
+
},
|
|
113
|
+
map: {
|
|
114
|
+
flex: 1,
|
|
115
|
+
},
|
|
116
|
+
controls: {
|
|
117
|
+
position: 'absolute',
|
|
118
|
+
bottom: 20,
|
|
119
|
+
left: 20,
|
|
120
|
+
right: 20,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 定位追踪应用
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import React, { useEffect, useState } from 'react';
|
|
129
|
+
import { View, Text, Button, StyleSheet } from 'react-native';
|
|
130
|
+
import {
|
|
131
|
+
MapView,
|
|
132
|
+
initSDK,
|
|
133
|
+
configure,
|
|
134
|
+
start,
|
|
135
|
+
stop,
|
|
136
|
+
getCurrentLocation,
|
|
137
|
+
addLocationListener,
|
|
138
|
+
type Location,
|
|
139
|
+
} from 'expo-gaode-map';
|
|
140
|
+
|
|
141
|
+
export default function LocationApp() {
|
|
142
|
+
const [location, setLocation] = useState<Location | null>(null);
|
|
143
|
+
const [isTracking, setIsTracking] = useState(false);
|
|
144
|
+
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
// 初始化 SDK
|
|
147
|
+
initSDK({
|
|
148
|
+
androidKey: 'your-android-api-key',
|
|
149
|
+
iosKey: 'your-ios-api-key',
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// 配置定位参数
|
|
153
|
+
configure({
|
|
154
|
+
withReGeocode: true,
|
|
155
|
+
mode: 0,
|
|
156
|
+
interval: 2000,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// 监听位置更新
|
|
160
|
+
const subscription = addLocationListener((loc) => {
|
|
161
|
+
console.log('位置更新:', loc);
|
|
162
|
+
setLocation(loc);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
return () => subscription.remove();
|
|
166
|
+
}, []);
|
|
167
|
+
|
|
168
|
+
const handleStartTracking = () => {
|
|
169
|
+
start();
|
|
170
|
+
setIsTracking(true);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const handleStopTracking = () => {
|
|
174
|
+
stop();
|
|
175
|
+
setIsTracking(false);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const handleGetLocation = async () => {
|
|
179
|
+
try {
|
|
180
|
+
const loc = await getCurrentLocation();
|
|
181
|
+
setLocation(loc);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
console.error('获取位置失败:', error);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<View style={styles.container}>
|
|
189
|
+
<MapView
|
|
190
|
+
style={styles.map}
|
|
191
|
+
myLocationEnabled={true}
|
|
192
|
+
followUserLocation={isTracking}
|
|
193
|
+
initialCameraPosition={{
|
|
194
|
+
target: {
|
|
195
|
+
latitude: location?.latitude || 39.9,
|
|
196
|
+
longitude: location?.longitude || 116.4
|
|
197
|
+
},
|
|
198
|
+
zoom: 15,
|
|
199
|
+
}}
|
|
200
|
+
/>
|
|
201
|
+
|
|
202
|
+
{location && (
|
|
203
|
+
<View style={styles.info}>
|
|
204
|
+
<Text style={styles.infoText}>
|
|
205
|
+
纬度: {location.latitude.toFixed(6)}
|
|
206
|
+
</Text>
|
|
207
|
+
<Text style={styles.infoText}>
|
|
208
|
+
经度: {location.longitude.toFixed(6)}
|
|
209
|
+
</Text>
|
|
210
|
+
<Text style={styles.infoText}>
|
|
211
|
+
精度: {location.accuracy.toFixed(2)} 米
|
|
212
|
+
</Text>
|
|
213
|
+
{location.address && (
|
|
214
|
+
<Text style={styles.infoText}>
|
|
215
|
+
地址: {location.address}
|
|
216
|
+
</Text>
|
|
217
|
+
)}
|
|
218
|
+
</View>
|
|
219
|
+
)}
|
|
220
|
+
|
|
221
|
+
<View style={styles.controls}>
|
|
222
|
+
<Button
|
|
223
|
+
title="获取位置"
|
|
224
|
+
onPress={handleGetLocation}
|
|
225
|
+
/>
|
|
226
|
+
<View style={{ height: 10 }} />
|
|
227
|
+
<Button
|
|
228
|
+
title={isTracking ? '停止追踪' : '开始追踪'}
|
|
229
|
+
onPress={isTracking ? handleStopTracking : handleStartTracking}
|
|
230
|
+
color={isTracking ? '#FF3B30' : '#007AFF'}
|
|
231
|
+
/>
|
|
232
|
+
</View>
|
|
233
|
+
</View>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const styles = StyleSheet.create({
|
|
238
|
+
container: {
|
|
239
|
+
flex: 1,
|
|
240
|
+
},
|
|
241
|
+
map: {
|
|
242
|
+
flex: 1,
|
|
243
|
+
},
|
|
244
|
+
info: {
|
|
245
|
+
position: 'absolute',
|
|
246
|
+
top: 50,
|
|
247
|
+
left: 20,
|
|
248
|
+
right: 20,
|
|
249
|
+
backgroundColor: 'white',
|
|
250
|
+
padding: 15,
|
|
251
|
+
borderRadius: 10,
|
|
252
|
+
shadowColor: '#000',
|
|
253
|
+
shadowOffset: { width: 0, height: 2 },
|
|
254
|
+
shadowOpacity: 0.25,
|
|
255
|
+
shadowRadius: 3.84,
|
|
256
|
+
elevation: 5,
|
|
257
|
+
},
|
|
258
|
+
infoText: {
|
|
259
|
+
fontSize: 14,
|
|
260
|
+
marginBottom: 5,
|
|
261
|
+
color: '#333',
|
|
262
|
+
},
|
|
263
|
+
controls: {
|
|
264
|
+
position: 'absolute',
|
|
265
|
+
bottom: 30,
|
|
266
|
+
left: 20,
|
|
267
|
+
right: 20,
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## 覆盖物示例
|
|
273
|
+
|
|
274
|
+
### Circle (圆形)
|
|
275
|
+
|
|
276
|
+
**声明式用法:**
|
|
277
|
+
```tsx
|
|
278
|
+
<MapView style={{ flex: 1 }}>
|
|
279
|
+
<Circle
|
|
280
|
+
center={{ latitude: 39.9, longitude: 116.4 }}
|
|
281
|
+
radius={1000}
|
|
282
|
+
fillColor="#8800FF00"
|
|
283
|
+
strokeColor="#FFFF0000"
|
|
284
|
+
strokeWidth={2}
|
|
285
|
+
onPress={() => console.log('点击圆形')}
|
|
286
|
+
/>
|
|
287
|
+
</MapView>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**命令式用法:**
|
|
291
|
+
```tsx
|
|
292
|
+
const mapRef = useRef<MapViewRef>(null);
|
|
293
|
+
|
|
294
|
+
await mapRef.current?.addCircle('circle1', {
|
|
295
|
+
center: { latitude: 39.9, longitude: 116.4 },
|
|
296
|
+
radius: 1000,
|
|
297
|
+
fillColor: 0x8800FF00,
|
|
298
|
+
strokeColor: 0xFFFF0000,
|
|
299
|
+
strokeWidth: 2,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
await mapRef.current?.updateCircle('circle1', {
|
|
303
|
+
radius: 2000,
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
await mapRef.current?.removeCircle('circle1');
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Marker (标记点)
|
|
310
|
+
|
|
311
|
+
**声明式用法:**
|
|
312
|
+
```tsx
|
|
313
|
+
<MapView style={{ flex: 1 }}>
|
|
314
|
+
<Marker
|
|
315
|
+
position={{ latitude: 39.9, longitude: 116.4 }}
|
|
316
|
+
title="标题"
|
|
317
|
+
description="描述信息"
|
|
318
|
+
draggable={true}
|
|
319
|
+
onPress={() => console.log('点击标记')}
|
|
320
|
+
onDragEnd={(e) => console.log('拖动结束', e)}
|
|
321
|
+
/>
|
|
322
|
+
</MapView>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**命令式用法:**
|
|
326
|
+
```tsx
|
|
327
|
+
await mapRef.current?.addMarker('marker1', {
|
|
328
|
+
position: { latitude: 39.9, longitude: 116.4 },
|
|
329
|
+
title: '标题',
|
|
330
|
+
draggable: true,
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
await mapRef.current?.updateMarker('marker1', {
|
|
334
|
+
position: { latitude: 40.0, longitude: 116.5 },
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
await mapRef.current?.removeMarker('marker1');
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Polyline (折线)
|
|
341
|
+
|
|
342
|
+
**声明式用法:**
|
|
343
|
+
```tsx
|
|
344
|
+
<MapView style={{ flex: 1 }}>
|
|
345
|
+
<Polyline
|
|
346
|
+
points={[
|
|
347
|
+
{ latitude: 39.9, longitude: 116.4 },
|
|
348
|
+
{ latitude: 39.95, longitude: 116.45 },
|
|
349
|
+
{ latitude: 40.0, longitude: 116.5 },
|
|
350
|
+
]}
|
|
351
|
+
strokeWidth={5}
|
|
352
|
+
strokeColor="#FF0000FF"
|
|
353
|
+
onPress={() => console.log('点击折线')}
|
|
354
|
+
/>
|
|
355
|
+
</MapView>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**命令式用法:**
|
|
359
|
+
```tsx
|
|
360
|
+
await mapRef.current?.addPolyline('polyline1', {
|
|
361
|
+
points: [
|
|
362
|
+
{ latitude: 39.9, longitude: 116.4 },
|
|
363
|
+
{ latitude: 40.0, longitude: 116.5 },
|
|
364
|
+
],
|
|
365
|
+
strokeWidth: 5,
|
|
366
|
+
strokeColor: 0xFFFF0000,
|
|
367
|
+
});
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Polygon (多边形)
|
|
371
|
+
|
|
372
|
+
**声明式用法:**
|
|
373
|
+
```tsx
|
|
374
|
+
<MapView style={{ flex: 1 }}>
|
|
375
|
+
<Polygon
|
|
376
|
+
points={[
|
|
377
|
+
{ latitude: 39.9, longitude: 116.3 },
|
|
378
|
+
{ latitude: 39.9, longitude: 116.4 },
|
|
379
|
+
{ latitude: 39.8, longitude: 116.4 },
|
|
380
|
+
]}
|
|
381
|
+
fillColor="#8800FF00"
|
|
382
|
+
strokeColor="#FFFF0000"
|
|
383
|
+
strokeWidth={2}
|
|
384
|
+
onPress={() => console.log('点击多边形')}
|
|
385
|
+
/>
|
|
386
|
+
</MapView>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**命令式用法:**
|
|
390
|
+
```tsx
|
|
391
|
+
await mapRef.current?.addPolygon('polygon1', {
|
|
392
|
+
points: [
|
|
393
|
+
{ latitude: 39.9, longitude: 116.3 },
|
|
394
|
+
{ latitude: 39.9, longitude: 116.4 },
|
|
395
|
+
{ latitude: 39.8, longitude: 116.4 },
|
|
396
|
+
],
|
|
397
|
+
fillColor: 0x8800FF00,
|
|
398
|
+
strokeColor: 0xFFFF0000,
|
|
399
|
+
strokeWidth: 2,
|
|
400
|
+
});
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
## 高级用法
|
|
404
|
+
|
|
405
|
+
### 自定义定位蓝点
|
|
406
|
+
|
|
407
|
+
```tsx
|
|
408
|
+
import { Image } from 'react-native';
|
|
409
|
+
|
|
410
|
+
const iconUri = Image.resolveAssetSource(require('./assets/location-icon.png')).uri;
|
|
411
|
+
|
|
412
|
+
<MapView
|
|
413
|
+
myLocationEnabled={true}
|
|
414
|
+
userLocationRepresentation={{
|
|
415
|
+
showsAccuracyRing: true,
|
|
416
|
+
fillColor: '#4285F4',
|
|
417
|
+
strokeColor: '#1967D2',
|
|
418
|
+
lineWidth: 2,
|
|
419
|
+
image: iconUri,
|
|
420
|
+
imageWidth: 40,
|
|
421
|
+
imageHeight: 40,
|
|
422
|
+
}}
|
|
423
|
+
/>
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### 批量操作覆盖物
|
|
427
|
+
|
|
428
|
+
```tsx
|
|
429
|
+
const mapRef = useRef<MapViewRef>(null);
|
|
430
|
+
|
|
431
|
+
const addMultipleOverlays = async () => {
|
|
432
|
+
await mapRef.current?.addCircle('circle1', {
|
|
433
|
+
center: { latitude: 39.9, longitude: 116.4 },
|
|
434
|
+
radius: 1000,
|
|
435
|
+
fillColor: 0x8800FF00,
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
await mapRef.current?.addCircle('circle2', {
|
|
439
|
+
center: { latitude: 40.0, longitude: 116.5 },
|
|
440
|
+
radius: 500,
|
|
441
|
+
fillColor: 0x880000FF,
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
await mapRef.current?.addMarker('marker1', {
|
|
445
|
+
position: { latitude: 39.95, longitude: 116.45 },
|
|
446
|
+
title: '北京',
|
|
447
|
+
});
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
const clearAll = async () => {
|
|
451
|
+
await mapRef.current?.removeCircle('circle1');
|
|
452
|
+
await mapRef.current?.removeCircle('circle2');
|
|
453
|
+
await mapRef.current?.removeMarker('marker1');
|
|
454
|
+
};
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### 缩放级别限制
|
|
458
|
+
|
|
459
|
+
```tsx
|
|
460
|
+
<MapView
|
|
461
|
+
maxZoom={18}
|
|
462
|
+
minZoom={5}
|
|
463
|
+
initialCameraPosition={{
|
|
464
|
+
target: { latitude: 39.9, longitude: 116.4 },
|
|
465
|
+
zoom: 10,
|
|
466
|
+
}}
|
|
467
|
+
/>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### 方向更新 (iOS)
|
|
471
|
+
|
|
472
|
+
```tsx
|
|
473
|
+
import { startUpdatingHeading, stopUpdatingHeading } from 'expo-gaode-map';
|
|
474
|
+
|
|
475
|
+
// 开始方向更新
|
|
476
|
+
startUpdatingHeading();
|
|
477
|
+
|
|
478
|
+
// 停止方向更新
|
|
479
|
+
stopUpdatingHeading();
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
class ColorParser {
|
|
5
|
+
/**
|
|
6
|
+
* 将颜色值转换为 UIColor
|
|
7
|
+
* 支持格式:
|
|
8
|
+
* - 数字:0xFF0000
|
|
9
|
+
* - 十六进制字符串:"#FF0000" 或 "FF0000"
|
|
10
|
+
* - 颜色名称:"red", "blue", "green" 等
|
|
11
|
+
*/
|
|
12
|
+
static func parseColor(_ colorValue: Any?) -> UIColor? {
|
|
13
|
+
guard let colorValue = colorValue else { return nil }
|
|
14
|
+
|
|
15
|
+
// 如果是数字类型
|
|
16
|
+
if let number = colorValue as? Int {
|
|
17
|
+
return UIColor(hex: number)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 如果是字符串类型
|
|
21
|
+
if let string = colorValue as? String {
|
|
22
|
+
return parseColorString(string)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 解析字符串颜色值
|
|
30
|
+
*/
|
|
31
|
+
private static func parseColorString(_ colorString: String) -> UIColor? {
|
|
32
|
+
let trimmedString = colorString.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
33
|
+
|
|
34
|
+
// 处理十六进制格式
|
|
35
|
+
if trimmedString.hasPrefix("#") {
|
|
36
|
+
return parseHexColor(trimmedString)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 处理颜色名称
|
|
40
|
+
if let namedColor = parseNamedColor(trimmedString) {
|
|
41
|
+
return namedColor
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 处理不带 # 的十六进制
|
|
45
|
+
if trimmedString.count == 6 || trimmedString.count == 8 {
|
|
46
|
+
return parseHexColor("#" + trimmedString)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return nil
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 解析十六进制颜色
|
|
54
|
+
*/
|
|
55
|
+
private static func parseHexColor(_ hexString: String) -> UIColor? {
|
|
56
|
+
var hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
|
|
57
|
+
var alpha: CGFloat = 1.0
|
|
58
|
+
|
|
59
|
+
// 处理 #RGB 格式
|
|
60
|
+
if hex.count == 3 {
|
|
61
|
+
let r = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 0)], count: 2)
|
|
62
|
+
let g = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 1)], count: 2)
|
|
63
|
+
let b = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 2)], count: 2)
|
|
64
|
+
hex = r + g + b
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 处理 #RGBA 格式
|
|
68
|
+
if hex.count == 4 {
|
|
69
|
+
let r = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 0)], count: 2)
|
|
70
|
+
let g = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 1)], count: 2)
|
|
71
|
+
let b = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 2)], count: 2)
|
|
72
|
+
let a = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 3)], count: 2)
|
|
73
|
+
hex = r + g + b + a
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 处理 #RRGGBBAA 格式
|
|
77
|
+
if hex.count == 8 {
|
|
78
|
+
let scanner = Scanner(string: hex)
|
|
79
|
+
var hexNumber: UInt64 = 0
|
|
80
|
+
|
|
81
|
+
if scanner.scanHexInt64(&hexNumber) {
|
|
82
|
+
let red = CGFloat((hexNumber & 0xff000000) >> 24) / 255
|
|
83
|
+
let green = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255
|
|
84
|
+
let blue = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255
|
|
85
|
+
alpha = CGFloat(hexNumber & 0x000000ff) / 255
|
|
86
|
+
|
|
87
|
+
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// 处理 #RRGGBB 格式
|
|
92
|
+
if hex.count == 6 {
|
|
93
|
+
let scanner = Scanner(string: hex)
|
|
94
|
+
var hexNumber: UInt64 = 0
|
|
95
|
+
|
|
96
|
+
if scanner.scanHexInt64(&hexNumber) {
|
|
97
|
+
let red = CGFloat((hexNumber & 0xff0000) >> 16) / 255
|
|
98
|
+
let green = CGFloat((hexNumber & 0x00ff00) >> 8) / 255
|
|
99
|
+
let blue = CGFloat(hexNumber & 0x0000ff) / 255
|
|
100
|
+
|
|
101
|
+
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return nil
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 解析颜色名称
|
|
110
|
+
*/
|
|
111
|
+
private static func parseNamedColor(_ colorName: String) -> UIColor? {
|
|
112
|
+
let colorMap: [String: UIColor] = [
|
|
113
|
+
// 基础颜色
|
|
114
|
+
"black": .black,
|
|
115
|
+
"white": .white,
|
|
116
|
+
"red": .red,
|
|
117
|
+
"green": .green,
|
|
118
|
+
"blue": .blue,
|
|
119
|
+
"yellow": .yellow,
|
|
120
|
+
"cyan": .cyan,
|
|
121
|
+
"magenta": .magenta,
|
|
122
|
+
"orange": .orange,
|
|
123
|
+
"purple": .purple,
|
|
124
|
+
"brown": .brown,
|
|
125
|
+
"gray": .gray,
|
|
126
|
+
"lightgray": .lightGray,
|
|
127
|
+
"darkgray": .darkGray,
|
|
128
|
+
"clear": .clear,
|
|
129
|
+
|
|
130
|
+
// 常用颜色
|
|
131
|
+
"pink": UIColor(red: 1.0, green: 0.75, blue: 0.8, alpha: 1.0),
|
|
132
|
+
"lightblue": UIColor(red: 0.68, green: 0.85, blue: 0.9, alpha: 1.0),
|
|
133
|
+
"lightgreen": UIColor(red: 0.56, green: 0.93, blue: 0.56, alpha: 1.0),
|
|
134
|
+
"lightyellow": UIColor(red: 1.0, green: 1.0, blue: 0.88, alpha: 1.0),
|
|
135
|
+
"lightcyan": UIColor(red: 0.88, green: 1.0, blue: 1.0, alpha: 1.0),
|
|
136
|
+
"lightmagenta": UIColor(red: 1.0, green: 0.88, blue: 1.0, alpha: 1.0),
|
|
137
|
+
"darkred": UIColor(red: 0.55, green: 0.0, blue: 0.0, alpha: 1.0),
|
|
138
|
+
"darkgreen": UIColor(red: 0.0, green: 0.39, blue: 0.0, alpha: 1.0),
|
|
139
|
+
"darkblue": UIColor(red: 0.0, green: 0.0, blue: 0.55, alpha: 1.0),
|
|
140
|
+
"darkyellow": UIColor(red: 0.55, green: 0.55, blue: 0.0, alpha: 1.0),
|
|
141
|
+
"darkcyan": UIColor(red: 0.0, green: 0.55, blue: 0.55, alpha: 1.0),
|
|
142
|
+
"darkmagenta": UIColor(red: 0.55, green: 0.0, blue: 0.55, alpha: 1.0),
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
return colorMap[colorName.lowercased()]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// UIColor 扩展,支持从数字创建
|
|
150
|
+
extension UIColor {
|
|
151
|
+
convenience init(hex: Int) {
|
|
152
|
+
let alpha = CGFloat((hex >> 24) & 0xFF) / 255.0
|
|
153
|
+
let red = CGFloat((hex >> 16) & 0xFF) / 255.0
|
|
154
|
+
let green = CGFloat((hex >> 8) & 0xFF) / 255.0
|
|
155
|
+
let blue = CGFloat(hex & 0xFF) / 255.0
|
|
156
|
+
self.init(red: red, green: green, blue: blue, alpha: alpha)
|
|
157
|
+
}
|
|
158
|
+
}
|
package/ios/ExpoGaodeMap.podspec
CHANGED