expo-gaode-map 0.1.1 → 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 +26 -479
- 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
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
NativeMethods,
|
|
4
|
+
NativeSyntheticEvent,
|
|
5
|
+
requireNativeComponent,
|
|
6
|
+
ViewProps,
|
|
7
|
+
} from "react-native";
|
|
8
|
+
import Component from "./component";
|
|
9
|
+
import { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from "./types";
|
|
10
|
+
|
|
11
|
+
export interface CameraEvent {
|
|
12
|
+
cameraPosition: CameraPosition;
|
|
13
|
+
latLngBounds: LatLngBounds;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface MapViewProps extends ViewProps {
|
|
17
|
+
/**
|
|
18
|
+
* 地图类型
|
|
19
|
+
*/
|
|
20
|
+
mapType?: MapType;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 初始状态
|
|
24
|
+
*/
|
|
25
|
+
initialCameraPosition?: CameraPosition;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 是否显示当前定位
|
|
29
|
+
*/
|
|
30
|
+
myLocationEnabled?: boolean;
|
|
31
|
+
myLocationIcon?:boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 是否显示室内地图
|
|
34
|
+
*/
|
|
35
|
+
indoorViewEnabled?: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 是否显示3D建筑
|
|
39
|
+
*/
|
|
40
|
+
buildingsEnabled?: boolean;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 是否显示标注
|
|
44
|
+
*/
|
|
45
|
+
labelsEnabled?: boolean;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 是否显示指南针
|
|
49
|
+
*/
|
|
50
|
+
compassEnabled?: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 是否显示放大缩小按钮
|
|
54
|
+
*
|
|
55
|
+
* @platform android
|
|
56
|
+
*/
|
|
57
|
+
zoomControlsEnabled?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 是否显示比例尺
|
|
61
|
+
*/
|
|
62
|
+
scaleControlsEnabled?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 是否显示定位按钮
|
|
66
|
+
*
|
|
67
|
+
* @platform android
|
|
68
|
+
*/
|
|
69
|
+
myLocationButtonEnabled?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 是否显示路况
|
|
73
|
+
*/
|
|
74
|
+
trafficEnabled?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 最大缩放级别
|
|
78
|
+
*/
|
|
79
|
+
maxZoom?: number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 最小缩放级别
|
|
83
|
+
*/
|
|
84
|
+
minZoom?: number;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 是否启用缩放手势,用于放大缩小
|
|
88
|
+
*/
|
|
89
|
+
zoomGesturesEnabled?: boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 是否启用滑动手势,用于平移
|
|
93
|
+
*/
|
|
94
|
+
scrollGesturesEnabled?: boolean;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 是否启用旋转手势,用于调整方向
|
|
98
|
+
*/
|
|
99
|
+
rotateGesturesEnabled?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 是否启用倾斜手势,用于改变视角
|
|
103
|
+
*/
|
|
104
|
+
tiltGesturesEnabled?: boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 设定定位的最小更新距离
|
|
108
|
+
*
|
|
109
|
+
* @platform ios
|
|
110
|
+
*/
|
|
111
|
+
distanceFilter?: number;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 设定最小更新角度,默认为 1 度
|
|
115
|
+
*
|
|
116
|
+
* @platform ios
|
|
117
|
+
*/
|
|
118
|
+
headingFilter?: number;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 点击事件
|
|
122
|
+
*/
|
|
123
|
+
onPress?: (event: NativeSyntheticEvent<LatLng>) => void;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* 标注点击事件
|
|
127
|
+
*/
|
|
128
|
+
onPressPoi?: (event: NativeSyntheticEvent<MapPoi>) => void;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 长按事件
|
|
132
|
+
*/
|
|
133
|
+
onLongPress?: (event: NativeSyntheticEvent<LatLng>) => void;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 地图状态改变事件,随地图状态变化不停地触发
|
|
137
|
+
*/
|
|
138
|
+
onCameraMove?: (event: NativeSyntheticEvent<CameraEvent>) => void;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 地图状态改变事件,在停止变化后触发
|
|
142
|
+
*/
|
|
143
|
+
onCameraIdle?: (event: NativeSyntheticEvent<CameraEvent>) => void;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 地图初始化完成事件
|
|
147
|
+
*/
|
|
148
|
+
onLoad?: (event: NativeSyntheticEvent<void>) => void;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 地图定位更新事件
|
|
152
|
+
*/
|
|
153
|
+
onLocation?: (event: NativeSyntheticEvent<GeolocationPosition>) => void;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const name = "AMapView";
|
|
157
|
+
const NativeMapView = requireNativeComponent<MapViewProps>(name);
|
|
158
|
+
|
|
159
|
+
export default class extends Component<MapViewProps> {
|
|
160
|
+
static defaultProps = {
|
|
161
|
+
style: { flex: 1 },
|
|
162
|
+
compassEnabled: true,
|
|
163
|
+
scaleControlsEnabled: true,
|
|
164
|
+
distanceFilter: 1,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
name = name;
|
|
168
|
+
ref?: (React.Component<MapViewProps> & NativeMethods) | null;
|
|
169
|
+
state = { loaded: false };
|
|
170
|
+
callbackMap: { [key: number]: (data: any) => void } = {};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 移动视角
|
|
174
|
+
*/
|
|
175
|
+
moveCamera(cameraPosition: CameraPosition, duration = 0) {
|
|
176
|
+
this.invoke("moveCamera", [cameraPosition, duration]);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 点坐标转地理坐标,主要用于地图选点
|
|
181
|
+
*/
|
|
182
|
+
getLatLng(point: Point): Promise<LatLng> {
|
|
183
|
+
return this.call("getLatLng", point);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
callback = ({ nativeEvent }: NativeSyntheticEvent<{ id: number; data: any }>) => {
|
|
187
|
+
this.callbackMap[nativeEvent.id]?.call(this, nativeEvent.data);
|
|
188
|
+
delete this.callbackMap[nativeEvent.id];
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
call(name: string, args: any): Promise<any> {
|
|
192
|
+
const id = Math.random();
|
|
193
|
+
this.invoke("call", [id, name, args]);
|
|
194
|
+
return new Promise((resolve) => (this.callbackMap[id] = resolve));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
componentDidMount() {
|
|
198
|
+
super.componentDidMount();
|
|
199
|
+
// 无论如何也要在 1 秒后 setLoaded(true) ,防止 onLoad 事件不触发的情况下显示不正常
|
|
200
|
+
// 目前只在 iOS 上低概率出现
|
|
201
|
+
setTimeout(() => this.setState({ loaded: true }), 1000);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
render() {
|
|
205
|
+
let { style, onLoad } = this.props;
|
|
206
|
+
if (!this.state.loaded) {
|
|
207
|
+
style = [style, { width: 1, height: 1 }];
|
|
208
|
+
}
|
|
209
|
+
return (
|
|
210
|
+
<NativeMapView
|
|
211
|
+
{...this.props}
|
|
212
|
+
ref={(ref) => (this.ref = ref)}
|
|
213
|
+
style={style}
|
|
214
|
+
// @ts-ignore: 内部接口
|
|
215
|
+
onCallback={this.callback}
|
|
216
|
+
onPress={(event) => {
|
|
217
|
+
if (event.nativeEvent.latitude) {
|
|
218
|
+
this.props.onPress?.call(this, event);
|
|
219
|
+
}
|
|
220
|
+
}}
|
|
221
|
+
onLoad={(event) => {
|
|
222
|
+
// android 地图部分控件不显示的问题在重新 layout 之后会恢复正常。
|
|
223
|
+
// 同时也能修复 ios 地图偶尔出现的 layout 异常
|
|
224
|
+
this.setState({ loaded: true });
|
|
225
|
+
onLoad?.call(this, event);
|
|
226
|
+
}}
|
|
227
|
+
/>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
ImageSourcePropType,
|
|
4
|
+
NativeSyntheticEvent,
|
|
5
|
+
requireNativeComponent,
|
|
6
|
+
ViewStyle,
|
|
7
|
+
} from "react-native";
|
|
8
|
+
import { View } from "@/components/Themed";
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource";
|
|
11
|
+
import Component from "./component";
|
|
12
|
+
import { LatLng, Point } from "./types";
|
|
13
|
+
|
|
14
|
+
export interface MarkerProps {
|
|
15
|
+
/**
|
|
16
|
+
* 坐标
|
|
17
|
+
*/ position: LatLng;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 图标
|
|
21
|
+
*/
|
|
22
|
+
icon?: ImageSourcePropType;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 透明度 [0, 1]
|
|
26
|
+
*
|
|
27
|
+
* @platform android
|
|
28
|
+
*/
|
|
29
|
+
opacity?: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 是否可拖拽
|
|
33
|
+
*/
|
|
34
|
+
draggable?: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 是否平贴地图
|
|
38
|
+
*
|
|
39
|
+
* @platform android
|
|
40
|
+
*/
|
|
41
|
+
flat?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 层级
|
|
45
|
+
*/
|
|
46
|
+
zIndex?: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 覆盖物锚点比例
|
|
50
|
+
*
|
|
51
|
+
* @link http://a.amap.com/lbs/static/unzip/Android_Map_Doc/3D/com/amap/api/maps/model/Marker.html#setAnchor-float-float-
|
|
52
|
+
* @platform android
|
|
53
|
+
*/
|
|
54
|
+
anchor?: Point;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 覆盖物偏移位置
|
|
58
|
+
*
|
|
59
|
+
* @link http://a.amap.com/lbs/static/unzip/iOS_Map_Doc/AMap_iOS_API_Doc_3D/interface_m_a_annotation_view.html#a78f23c1e6a6d92faf12a00877ac278a7
|
|
60
|
+
* @platform ios
|
|
61
|
+
*/
|
|
62
|
+
centerOffset?: Point;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 自定义 View
|
|
66
|
+
*/
|
|
67
|
+
children?: React.ReactNode;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 点击事件
|
|
71
|
+
*/
|
|
72
|
+
onPress?: () => void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 拖放开始事件
|
|
76
|
+
*/
|
|
77
|
+
onDragStart?: () => void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 拖放进行事件,类似于 mousemove,在结束之前会不断调用
|
|
81
|
+
*/
|
|
82
|
+
onDrag?: () => void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 拖放结束事件
|
|
86
|
+
*/
|
|
87
|
+
onDragEnd?: (event: NativeSyntheticEvent<LatLng>) => void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export default class extends Component<MarkerProps> {
|
|
91
|
+
name = name;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 触发自定义 view 更新
|
|
95
|
+
*
|
|
96
|
+
* 通常来说,不需要主动调用该方法,对于 android,如果自定义 view 存在异步更新,
|
|
97
|
+
* 例如,包含一个引用了网络图片的 <Image />,则需要在 view 更新后主动调用该方法触发
|
|
98
|
+
* icon 更新。
|
|
99
|
+
*/
|
|
100
|
+
update = () => {
|
|
101
|
+
setTimeout(() => this.invoke("update"), 0);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
componentDidUpdate() {
|
|
105
|
+
if (this.props.children) {
|
|
106
|
+
this.update();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
render() {
|
|
111
|
+
const props = { ...this.props };
|
|
112
|
+
Reflect.set(props, "latLng", props.position);
|
|
113
|
+
// @ts-ignore android 不能用 position 作为属性,会发生冲突,也是个蛋疼的问题
|
|
114
|
+
delete props.position;
|
|
115
|
+
if (props.children) {
|
|
116
|
+
props.children = (
|
|
117
|
+
<View style={style} onLayout={this.update}>
|
|
118
|
+
{props.children}
|
|
119
|
+
</View>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
return <NativeMarker {...props} icon={resolveAssetSource(props.icon)} />;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const name = "AMapMarker";
|
|
127
|
+
const style: ViewStyle = { position: "absolute", zIndex: -1 };
|
|
128
|
+
const NativeMarker = requireNativeComponent<MarkerProps>(name);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ImageSourcePropType, NativeSyntheticEvent, requireNativeComponent } from "react-native";
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource";
|
|
5
|
+
import { LatLng } from "./types";
|
|
6
|
+
|
|
7
|
+
const NativeMultiPoint = requireNativeComponent<MultiPointProps>("AMapMultiPoint");
|
|
8
|
+
|
|
9
|
+
export interface MultiPointProps {
|
|
10
|
+
/**
|
|
11
|
+
* 坐标点集合
|
|
12
|
+
*/
|
|
13
|
+
items?: LatLng[];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 图标
|
|
17
|
+
*/
|
|
18
|
+
icon?: ImageSourcePropType;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 点击事件
|
|
22
|
+
*/
|
|
23
|
+
onPress?: (event: NativeSyntheticEvent<{ index: number }>) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default (props: MultiPointProps) => {
|
|
27
|
+
return <NativeMultiPoint {...props} icon={resolveAssetSource(props.icon)} />;
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { requireNativeComponent } from "react-native";
|
|
2
|
+
import { LatLng } from "./types";
|
|
3
|
+
|
|
4
|
+
export interface Polygon {
|
|
5
|
+
/**
|
|
6
|
+
* 节点坐标
|
|
7
|
+
*/
|
|
8
|
+
points: LatLng[];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 边线宽度
|
|
12
|
+
*/
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 边线颜色
|
|
17
|
+
*/
|
|
18
|
+
strokeColor?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 填充颜色
|
|
22
|
+
*/
|
|
23
|
+
fillColor?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 层级
|
|
27
|
+
*/
|
|
28
|
+
zIndex?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default requireNativeComponent<Polygon>("AMapPolygon");
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ColorValue, Platform, processColor, requireNativeComponent } from "react-native";
|
|
3
|
+
import { LatLng } from "./types";
|
|
4
|
+
|
|
5
|
+
export interface PolylineProps {
|
|
6
|
+
/**
|
|
7
|
+
* 节点坐标
|
|
8
|
+
*/
|
|
9
|
+
points: LatLng[];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 线段宽度
|
|
13
|
+
*/
|
|
14
|
+
width?: number;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 线段颜色
|
|
18
|
+
*/
|
|
19
|
+
color?: ColorValue;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 层级
|
|
23
|
+
*/
|
|
24
|
+
zIndex?: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 多段颜色
|
|
28
|
+
*/
|
|
29
|
+
colors: ColorValue[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 是否使用颜色渐变
|
|
33
|
+
*/
|
|
34
|
+
gradient?: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 是否绘制大地线
|
|
38
|
+
*/
|
|
39
|
+
geodesic?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 是否绘制虚线
|
|
43
|
+
*/
|
|
44
|
+
dotted?: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 点击事件
|
|
48
|
+
*/
|
|
49
|
+
onPress?: () => void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default class extends React.PureComponent<PolylineProps> {
|
|
53
|
+
static defaultProps = { colors: [] };
|
|
54
|
+
|
|
55
|
+
render() {
|
|
56
|
+
const props = {
|
|
57
|
+
...this.props,
|
|
58
|
+
...Platform.select({ android: { colors: this.props.colors.map(processColor) } }),
|
|
59
|
+
};
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
return <NativePolyline {...props} />;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const NativePolyline = requireNativeComponent<PolylineProps>("AMapPolyline");
|
package/lib/src/sdk.ts
ADDED
package/lib/src/types.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 点坐标
|
|
3
|
+
*/
|
|
4
|
+
export interface Point {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 地理坐标
|
|
11
|
+
*/
|
|
12
|
+
export interface LatLng {
|
|
13
|
+
/**
|
|
14
|
+
* 纬度
|
|
15
|
+
*/
|
|
16
|
+
latitude: number;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 经度
|
|
20
|
+
*/
|
|
21
|
+
longitude: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 地图标注点
|
|
26
|
+
*/
|
|
27
|
+
export interface MapPoi {
|
|
28
|
+
/**
|
|
29
|
+
* 标注点 ID
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 标注点名称
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 标注点坐标
|
|
40
|
+
*/
|
|
41
|
+
position: LatLng;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 矩形坐标边界
|
|
46
|
+
*/
|
|
47
|
+
export interface LatLngBounds {
|
|
48
|
+
/**
|
|
49
|
+
* 西南坐标
|
|
50
|
+
*/
|
|
51
|
+
southwest: LatLng;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 东北坐标
|
|
55
|
+
*/
|
|
56
|
+
northeast: LatLng;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 地图状态
|
|
61
|
+
*/
|
|
62
|
+
export interface CameraPosition {
|
|
63
|
+
/**
|
|
64
|
+
* 中心坐标
|
|
65
|
+
*/
|
|
66
|
+
target?: LatLng;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 缩放级别
|
|
70
|
+
*/
|
|
71
|
+
zoom?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 朝向、旋转角度
|
|
75
|
+
*/
|
|
76
|
+
bearing?: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 倾斜角度
|
|
80
|
+
*/
|
|
81
|
+
tilt?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 定位
|
|
86
|
+
*/
|
|
87
|
+
export interface Location extends LatLng {
|
|
88
|
+
/**
|
|
89
|
+
* 精度
|
|
90
|
+
*/
|
|
91
|
+
accuracy: number;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 朝向
|
|
95
|
+
*/
|
|
96
|
+
heading: number;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 海拔
|
|
100
|
+
*/
|
|
101
|
+
altitude: number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 运动速度
|
|
105
|
+
*/
|
|
106
|
+
speed: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 地图类型
|
|
111
|
+
*/
|
|
112
|
+
export enum MapType {
|
|
113
|
+
/**
|
|
114
|
+
* 标准地图
|
|
115
|
+
*/
|
|
116
|
+
Standard,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 卫星地图
|
|
120
|
+
*/
|
|
121
|
+
Satellite,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 夜间地图
|
|
125
|
+
*/
|
|
126
|
+
Night,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 导航地图
|
|
130
|
+
*/
|
|
131
|
+
Navi,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 公交地图
|
|
135
|
+
*/
|
|
136
|
+
Bus,
|
|
137
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gaode-map",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "一个功能完整的高德地图 React Native 组件库,基于 Expo Modules 开发,提供地图显示、定位、覆盖物等功能。",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
3
|
* @Date : 2025-11-13 15:01:30
|
|
4
4
|
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
-
* @LastEditTime : 2025-11-
|
|
5
|
+
* @LastEditTime : 2025-11-14 15:48:14
|
|
6
6
|
* @FilePath : /expo-gaode-map/src/components/overlays/Polyline.tsx
|
|
7
7
|
* @Description : 地图折线组件 - 使用命令式 API
|
|
8
8
|
*
|
|
@@ -33,36 +33,28 @@ import type { PolylineProps } from '../../types';
|
|
|
33
33
|
export default function Polyline(props: PolylineProps) {
|
|
34
34
|
const mapRef = React.useContext(MapContext);
|
|
35
35
|
const polylineIdRef = React.useRef<string>(`polyline_${Date.now()}_${Math.random()}`);
|
|
36
|
-
|
|
37
|
-
console.log('Polyline 组件渲染,props:', props);
|
|
36
|
+
const isInitialMount = React.useRef(true);
|
|
38
37
|
|
|
39
38
|
// 添加折线
|
|
40
39
|
React.useEffect(() => {
|
|
41
40
|
const polylineId = polylineIdRef.current;
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
mapRef?.current?.addPolyline?.(polylineId, props).then(() => {
|
|
45
|
-
console.log('✅ 折线已添加:', polylineId);
|
|
46
|
-
}).catch((error: any) => {
|
|
47
|
-
console.error('❌ 添加折线失败:', error);
|
|
48
|
-
});
|
|
42
|
+
mapRef?.current?.addPolyline?.(polylineId, props);
|
|
49
43
|
|
|
50
44
|
return () => {
|
|
51
|
-
|
|
52
|
-
mapRef?.current?.removePolyline?.(polylineId).catch((error: any) => {
|
|
53
|
-
console.error('❌ 移除折线失败:', error);
|
|
54
|
-
});
|
|
45
|
+
mapRef?.current?.removePolyline?.(polylineId);
|
|
55
46
|
};
|
|
56
47
|
}, []);
|
|
57
48
|
|
|
58
|
-
// 监听 Props
|
|
49
|
+
// 监听 Props 变化,更新折线(跳过初始渲染)
|
|
59
50
|
React.useEffect(() => {
|
|
60
|
-
|
|
51
|
+
if (isInitialMount.current) {
|
|
52
|
+
isInitialMount.current = false;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
mapRef?.current?.updatePolyline?.(polylineId, props)
|
|
64
|
-
console.error('❌ 更新折线失败:', error);
|
|
65
|
-
});
|
|
56
|
+
const polylineId = polylineIdRef.current;
|
|
57
|
+
mapRef?.current?.updatePolyline?.(polylineId, props);
|
|
66
58
|
}, [props.points, props.width, props.color]);
|
|
67
59
|
|
|
68
60
|
return null;
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
3
3
|
* @Date : 2025-11-13 14:45:15
|
|
4
4
|
* @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
|
|
5
|
-
* @LastEditTime : 2025-11-
|
|
5
|
+
* @LastEditTime : 2025-11-14 16:15:52
|
|
6
6
|
* @FilePath : /expo-gaode-map/src/index.ts
|
|
7
7
|
* @Description : 高德地图 Expo Module 主导出文件
|
|
8
8
|
*
|
|
@@ -17,7 +17,7 @@ export * from './types';
|
|
|
17
17
|
export { default as ExpoGaodeMapModule } from './ExpoGaodeMapModule';
|
|
18
18
|
|
|
19
19
|
// 导出 SDK 模块
|
|
20
|
-
export { default as AMapSDK, initSDK,
|
|
20
|
+
export { default as AMapSDK, initSDK, getVersion } from './modules/AMapSDK';
|
|
21
21
|
|
|
22
22
|
// 导出定位模块
|
|
23
23
|
export {
|