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
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
@objc(AMapViewManager)
|
|
2
|
+
class AMapViewManager: RCTViewManager {
|
|
3
|
+
override class func requiresMainQueueSetup() -> Bool { false }
|
|
4
|
+
|
|
5
|
+
override func view() -> UIView {
|
|
6
|
+
let view = MapView()
|
|
7
|
+
view.delegate = view
|
|
8
|
+
return view
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@objc func moveCamera(_ reactTag: NSNumber, position: NSDictionary, duration: Int) {
|
|
12
|
+
getView(reactTag: reactTag) { view in
|
|
13
|
+
view.moveCamera(position: position, duration: duration)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@objc func call(_ reactTag: NSNumber, callerId: Double, name: String, args: NSDictionary) {
|
|
18
|
+
getView(reactTag: reactTag) { view in
|
|
19
|
+
view.call(id: callerId, name: name, args: args)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@objc func moveToCurrentLocation(_ reactTag: NSNumber) {
|
|
24
|
+
getView(reactTag: reactTag) { view in
|
|
25
|
+
view.moveToCurrentLocation()
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
func getView(reactTag: NSNumber, callback: @escaping (MapView) -> Void) {
|
|
31
|
+
bridge.uiManager.addUIBlock { _, viewRegistry in
|
|
32
|
+
callback(viewRegistry![reactTag] as! MapView)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class MapView: MAMapView, MAMapViewDelegate {
|
|
38
|
+
var initialized = false
|
|
39
|
+
var overlayMap: [MABaseOverlay: Overlay] = [:]
|
|
40
|
+
var markerMap: [MAPointAnnotation: Marker] = [:]
|
|
41
|
+
|
|
42
|
+
@objc var onLoad: RCTBubblingEventBlock = { _ in }
|
|
43
|
+
@objc var onCameraMove: RCTBubblingEventBlock = { _ in }
|
|
44
|
+
@objc var onCameraIdle: RCTBubblingEventBlock = { _ in }
|
|
45
|
+
@objc var onPress: RCTBubblingEventBlock = { _ in }
|
|
46
|
+
@objc var onPressPoi: RCTBubblingEventBlock = { _ in }
|
|
47
|
+
@objc var onLongPress: RCTBubblingEventBlock = { _ in }
|
|
48
|
+
@objc var onLocation: RCTBubblingEventBlock = { _ in }
|
|
49
|
+
@objc var onCallback: RCTBubblingEventBlock = { _ in }
|
|
50
|
+
|
|
51
|
+
// 私有变量来存储用户位置
|
|
52
|
+
private var currentLocation: CLLocation?
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@objc func setInitialCameraPosition(_ json: NSDictionary) {
|
|
56
|
+
if !initialized {
|
|
57
|
+
initialized = true
|
|
58
|
+
moveCamera(position: json)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
func moveCamera(position: NSDictionary, duration: Int = 0) {
|
|
63
|
+
let status = MAMapStatus()
|
|
64
|
+
status.zoomLevel = (position["zoom"] as? Double)?.cgFloat ?? zoomLevel
|
|
65
|
+
status.cameraDegree = (position["tilt"] as? Double)?.cgFloat ?? cameraDegree
|
|
66
|
+
status.rotationDegree = (position["bearing"] as? Double)?.cgFloat ?? rotationDegree
|
|
67
|
+
status.centerCoordinate = (position["target"] as? NSDictionary)?.coordinate ?? centerCoordinate
|
|
68
|
+
setMapStatus(status, animated: true, duration: Double(duration) / 1000)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
func call(id: Double, name: String, args: NSDictionary) {
|
|
72
|
+
switch name {
|
|
73
|
+
case "getLatLng":
|
|
74
|
+
callback(id: id, data: convert(args.point, toCoordinateFrom: self).json)
|
|
75
|
+
default:
|
|
76
|
+
break
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
func callback(id: Double, data: [String: Any]) {
|
|
81
|
+
onCallback(["id": id, "data": data])
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
override func didAddSubview(_ subview: UIView) {
|
|
85
|
+
if let overlay = (subview as? Overlay)?.getOverlay() {
|
|
86
|
+
overlayMap[overlay] = subview as? Overlay
|
|
87
|
+
add(overlay)
|
|
88
|
+
}
|
|
89
|
+
if let annotation = (subview as? Marker)?.annotation {
|
|
90
|
+
markerMap[annotation] = subview as? Marker
|
|
91
|
+
addAnnotation(annotation)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
override func removeReactSubview(_ subview: UIView!) {
|
|
96
|
+
super.removeReactSubview(subview)
|
|
97
|
+
if let overlay = (subview as? Overlay)?.getOverlay() {
|
|
98
|
+
overlayMap.removeValue(forKey: overlay)
|
|
99
|
+
remove(overlay)
|
|
100
|
+
}
|
|
101
|
+
if let annotation = (subview as? Marker)?.annotation {
|
|
102
|
+
markerMap.removeValue(forKey: annotation)
|
|
103
|
+
removeAnnotation(annotation)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
func mapView(_: MAMapView, rendererFor overlay: MAOverlay) -> MAOverlayRenderer? {
|
|
108
|
+
if let key = overlay as? MABaseOverlay {
|
|
109
|
+
return overlayMap[key]?.getRenderer()
|
|
110
|
+
}
|
|
111
|
+
return nil
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
func mapView(_: MAMapView!, viewFor annotation: MAAnnotation) -> MAAnnotationView? {
|
|
115
|
+
if let key = annotation as? MAPointAnnotation {
|
|
116
|
+
return markerMap[key]?.getView()
|
|
117
|
+
}
|
|
118
|
+
return nil
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
func mapView(_: MAMapView!, annotationView view: MAAnnotationView!, didChange newState: MAAnnotationViewDragState, fromOldState _: MAAnnotationViewDragState) {
|
|
122
|
+
if let key = view.annotation as? MAPointAnnotation {
|
|
123
|
+
let market = markerMap[key]!
|
|
124
|
+
if newState == MAAnnotationViewDragState.starting {
|
|
125
|
+
market.onDragStart(nil)
|
|
126
|
+
}
|
|
127
|
+
if newState == MAAnnotationViewDragState.dragging {
|
|
128
|
+
market.onDrag(nil)
|
|
129
|
+
}
|
|
130
|
+
if newState == MAAnnotationViewDragState.ending {
|
|
131
|
+
market.onDragEnd(view.annotation.coordinate.json)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
func mapView(_: MAMapView!, didAnnotationViewTapped view: MAAnnotationView!) {
|
|
137
|
+
if let key = view.annotation as? MAPointAnnotation {
|
|
138
|
+
markerMap[key]?.onPress(nil)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
func mapInitComplete(_: MAMapView!) {
|
|
143
|
+
onLoad(nil)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
func mapView(_: MAMapView!, didSingleTappedAt coordinate: CLLocationCoordinate2D) {
|
|
147
|
+
onPress(coordinate.json)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
func mapView(_: MAMapView!, didTouchPois pois: [Any]!) {
|
|
151
|
+
let poi = pois[0] as! MATouchPoi
|
|
152
|
+
onPressPoi(["name": poi.name!, "id": poi.uid!, "position": poi.coordinate.json])
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
func mapView(_: MAMapView!, didLongPressedAt coordinate: CLLocationCoordinate2D) {
|
|
156
|
+
onLongPress(coordinate.json)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
func mapViewRegionChanged(_: MAMapView!) {
|
|
160
|
+
onCameraMove(cameraEvent)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
func mapView(_: MAMapView!, regionDidChangeAnimated _: Bool) {
|
|
164
|
+
onCameraIdle(cameraEvent)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
func mapView(_: MAMapView!, didUpdate userLocation: MAUserLocation!, updatingLocation _: Bool) {
|
|
168
|
+
self.currentLocation = userLocation.location
|
|
169
|
+
onLocation(userLocation.json)
|
|
170
|
+
setCustomUserLocationRepresentation()
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
func setCustomUserLocationRepresentation() {
|
|
174
|
+
let r = MAUserLocationRepresentation()
|
|
175
|
+
r.fillColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0)
|
|
176
|
+
r.strokeColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0)
|
|
177
|
+
r.lineWidth = 0
|
|
178
|
+
r.image = UIImage(named: "custom_location_image")
|
|
179
|
+
self.update(r)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@objc func moveToCurrentLocation() {
|
|
183
|
+
if let location = self.currentLocation {
|
|
184
|
+
setCenter(location.coordinate, animated: true)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#import <React/RCTUIManager.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(AMapMarkerManager, RCTViewManager)
|
|
4
|
+
|
|
5
|
+
RCT_EXPORT_VIEW_PROPERTY(latLng, CLLocationCoordinate2D)
|
|
6
|
+
RCT_EXPORT_VIEW_PROPERTY(centerOffset, CGPoint)
|
|
7
|
+
RCT_EXPORT_VIEW_PROPERTY(draggable, BOOL)
|
|
8
|
+
RCT_EXPORT_VIEW_PROPERTY(zIndex, int)
|
|
9
|
+
RCT_EXPORT_VIEW_PROPERTY(icon, NSDictionary)
|
|
10
|
+
|
|
11
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
12
|
+
RCT_EXPORT_VIEW_PROPERTY(onDragStart, RCTBubblingEventBlock)
|
|
13
|
+
RCT_EXPORT_VIEW_PROPERTY(onDrag, RCTBubblingEventBlock)
|
|
14
|
+
RCT_EXPORT_VIEW_PROPERTY(onDragEnd, RCTBubblingEventBlock)
|
|
15
|
+
|
|
16
|
+
RCT_EXTERN_METHOD(update:(nonnull NSNumber *)reactTag)
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@objc(AMapMarkerManager)
|
|
2
|
+
class AMapMarkerManager: RCTViewManager {
|
|
3
|
+
override class func requiresMainQueueSetup() -> Bool { false }
|
|
4
|
+
|
|
5
|
+
override func view() -> UIView {
|
|
6
|
+
let view = Marker()
|
|
7
|
+
view.imageLoader = bridge.module(forName: "ImageLoader") as? RCTImageLoader
|
|
8
|
+
return view
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@objc func update(_ reactTag: NSNumber) {
|
|
12
|
+
getView(reactTag: reactTag) { view in view.update() }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
func getView(reactTag: NSNumber, callback: @escaping (Marker) -> Void) {
|
|
16
|
+
bridge.uiManager.addUIBlock { _, viewRegistry in
|
|
17
|
+
callback(viewRegistry![reactTag] as! Marker)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class Marker: UIView {
|
|
23
|
+
var imageLoader: RCTImageLoader?
|
|
24
|
+
var view: MAAnnotationView?
|
|
25
|
+
var annotation = MAPointAnnotation()
|
|
26
|
+
var icon: UIImage?
|
|
27
|
+
var iconView: UIView?
|
|
28
|
+
var centerOffset: CGPoint?
|
|
29
|
+
|
|
30
|
+
@objc var draggable = false { didSet { view?.isDraggable = draggable } }
|
|
31
|
+
@objc var zIndex = 1 { didSet { view?.zIndex = zIndex } }
|
|
32
|
+
|
|
33
|
+
@objc var onPress: RCTDirectEventBlock = { _ in }
|
|
34
|
+
@objc var onDragStart: RCTDirectEventBlock = { _ in }
|
|
35
|
+
@objc var onDrag: RCTDirectEventBlock = { _ in }
|
|
36
|
+
@objc var onDragEnd: RCTDirectEventBlock = { _ in }
|
|
37
|
+
|
|
38
|
+
@objc func setIcon(_ icon: NSDictionary?) {
|
|
39
|
+
imageLoader?.loadImage(icon) { image in
|
|
40
|
+
self.icon = image
|
|
41
|
+
self.view?.image = image
|
|
42
|
+
self.updateCenterOffset()
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@objc func setLatLng(_ coordinate: CLLocationCoordinate2D) {
|
|
47
|
+
annotation.coordinate = coordinate
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@objc func setCenterOffset(_ centerOffset: CGPoint) {
|
|
51
|
+
self.centerOffset = centerOffset
|
|
52
|
+
view?.centerOffset = centerOffset
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override func didAddSubview(_ subview: UIView) {
|
|
56
|
+
subview.layer.opacity = 0
|
|
57
|
+
iconView = subview
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* subview 不能直接用作 marker 的 icon,因为在实现点聚合的时候发现,subview 一定概率无法正常 layout,会堆在右上角。
|
|
62
|
+
* 于是索性把 subview 渲染成 image,原来用 subview 带来的 offset、点击问题也都不用处理了。
|
|
63
|
+
* 正常情况下就把 subview 的 opacity 设成 0,需要渲染的时候才设成 1,渲染然后马上设回 0。
|
|
64
|
+
*/
|
|
65
|
+
func update() {
|
|
66
|
+
if centerOffset == nil, view != nil {
|
|
67
|
+
iconView?.layer.opacity = 1
|
|
68
|
+
let renderer = UIGraphicsImageRenderer(bounds: iconView!.bounds)
|
|
69
|
+
view?.image = renderer.image { context in layer.render(in: context.cgContext) }
|
|
70
|
+
iconView?.layer.opacity = 0
|
|
71
|
+
updateCenterOffset()
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
func updateCenterOffset() {
|
|
76
|
+
if centerOffset == nil, view != nil {
|
|
77
|
+
let size: CGSize = (view?.image.size)!
|
|
78
|
+
view?.centerOffset = CGPoint(x: 0, y: -size.height / 2)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
func getView() -> MAAnnotationView {
|
|
83
|
+
if view == nil {
|
|
84
|
+
view = MAAnnotationView(annotation: annotation, reuseIdentifier: nil)
|
|
85
|
+
if icon == nil, iconView == nil {
|
|
86
|
+
view?.image = MAPinAnnotationView(annotation: annotation, reuseIdentifier: nil).image
|
|
87
|
+
}
|
|
88
|
+
view?.isDraggable = draggable
|
|
89
|
+
view?.zIndex = zIndex
|
|
90
|
+
if centerOffset != nil {
|
|
91
|
+
view?.centerOffset = centerOffset!
|
|
92
|
+
}
|
|
93
|
+
if icon != nil {
|
|
94
|
+
view?.image = icon
|
|
95
|
+
updateCenterOffset()
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return view!
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@objc(AMapMultiPointManager)
|
|
2
|
+
class AMapMultiPointManager: RCTViewManager {
|
|
3
|
+
override class func requiresMainQueueSetup() -> Bool { false }
|
|
4
|
+
|
|
5
|
+
override func view() -> UIView {
|
|
6
|
+
let view = MultiPoint()
|
|
7
|
+
view.imageLoader = bridge.module(forName: "ImageLoader") as? RCTImageLoader
|
|
8
|
+
return view
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class MultiPoint: UIView, Overlay, MAMultiPointOverlayRendererDelegate {
|
|
13
|
+
var imageLoader: RCTImageLoader?
|
|
14
|
+
var overlay: MAMultiPointOverlay?
|
|
15
|
+
var renderer: MAMultiPointOverlayRenderer?
|
|
16
|
+
var icon: UIImage?
|
|
17
|
+
|
|
18
|
+
@objc var onPress: RCTDirectEventBlock = { _ in }
|
|
19
|
+
|
|
20
|
+
@objc func setIcon(_ icon: NSDictionary) {
|
|
21
|
+
imageLoader?.loadImage(icon) { image in
|
|
22
|
+
self.renderer?.icon = image
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@objc func setItems(_ items: NSArray) {
|
|
27
|
+
overlay = MAMultiPointOverlay(multiPointItems: items.map { it -> MAMultiPointItem in
|
|
28
|
+
let item = MAMultiPointItem()
|
|
29
|
+
item.coordinate = (it as! NSDictionary).coordinate
|
|
30
|
+
return item
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
func getOverlay() -> MABaseOverlay { overlay! }
|
|
35
|
+
func getRenderer() -> MAOverlayRenderer {
|
|
36
|
+
if renderer == nil {
|
|
37
|
+
renderer = MAMultiPointOverlayRenderer(multiPointOverlay: overlay)
|
|
38
|
+
renderer?.icon = icon
|
|
39
|
+
renderer?.delegate = self
|
|
40
|
+
}
|
|
41
|
+
return renderer!
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
func multiPointOverlayRenderer(_: MAMultiPointOverlayRenderer!, didItemTapped item: MAMultiPointItem!) {
|
|
45
|
+
onPress(["index": (overlay?.items.firstIndex(of: item))!])
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <React/RCTUIManager.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(AMapPolygonManager, RCTViewManager)
|
|
4
|
+
|
|
5
|
+
RCT_EXPORT_VIEW_PROPERTY(points, NSArray)
|
|
6
|
+
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, double)
|
|
7
|
+
RCT_EXPORT_VIEW_PROPERTY(strokeColor, UIColor)
|
|
8
|
+
RCT_EXPORT_VIEW_PROPERTY(fillColor, UIColor)
|
|
9
|
+
|
|
10
|
+
@end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@objc(AMapPolygonManager)
|
|
2
|
+
class AMapPolygonManager: RCTViewManager {
|
|
3
|
+
override class func requiresMainQueueSetup() -> Bool { false }
|
|
4
|
+
override func view() -> UIView { Polygon() }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
class Polygon: UIView, Overlay {
|
|
8
|
+
var overlay = MAPolygon()
|
|
9
|
+
var renderer: MAPolygonRenderer?
|
|
10
|
+
|
|
11
|
+
@objc var strokeWidth = 1.0 { didSet { renderer?.lineWidth = strokeWidth } }
|
|
12
|
+
@objc var strokeColor = UIColor.black { didSet { renderer?.strokeColor = strokeColor } }
|
|
13
|
+
@objc var fillColor = UIColor.white { didSet { renderer?.fillColor = fillColor } }
|
|
14
|
+
|
|
15
|
+
@objc func setPoints(_ points: NSArray) {
|
|
16
|
+
var coordinates = points.map { it -> CLLocationCoordinate2D in (it as! NSDictionary).coordinate }
|
|
17
|
+
overlay.setPolygonWithCoordinates(&coordinates, count: points.count)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
func getOverlay() -> MABaseOverlay { overlay }
|
|
21
|
+
func getRenderer() -> MAOverlayRenderer {
|
|
22
|
+
if renderer == nil {
|
|
23
|
+
renderer = MAPolygonRenderer(polygon: overlay)
|
|
24
|
+
renderer?.fillColor = fillColor
|
|
25
|
+
renderer?.strokeColor = strokeColor
|
|
26
|
+
renderer?.lineWidth = strokeWidth
|
|
27
|
+
}
|
|
28
|
+
return renderer!
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#import <React/RCTUIManager.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(AMapPolylineManager, RCTViewManager)
|
|
4
|
+
|
|
5
|
+
RCT_EXPORT_VIEW_PROPERTY(points, NSArray)
|
|
6
|
+
RCT_EXPORT_VIEW_PROPERTY(width, double)
|
|
7
|
+
RCT_EXPORT_VIEW_PROPERTY(color, UIColor)
|
|
8
|
+
RCT_EXPORT_VIEW_PROPERTY(dotted, BOOL)
|
|
9
|
+
RCT_EXPORT_VIEW_PROPERTY(gradient, BOOL)
|
|
10
|
+
RCT_EXPORT_VIEW_PROPERTY(colors, UIColorArray)
|
|
11
|
+
|
|
12
|
+
@end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@objc(AMapPolylineManager)
|
|
2
|
+
class AMapPolylineManager: RCTViewManager {
|
|
3
|
+
override class func requiresMainQueueSetup() -> Bool { false }
|
|
4
|
+
override func view() -> UIView { Polyline() }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
class Polyline: UIView, Overlay {
|
|
8
|
+
var overlay = MAMultiPolyline()
|
|
9
|
+
var renderer: MAMultiColoredPolylineRenderer?
|
|
10
|
+
|
|
11
|
+
@objc var width = 1.0 { didSet { renderer?.lineWidth = width } }
|
|
12
|
+
@objc var color = UIColor.black { didSet { renderer?.strokeColor = color } }
|
|
13
|
+
@objc var gradient = false { didSet { renderer?.isGradient = gradient } }
|
|
14
|
+
@objc var dotted = false { didSet { setDotted() } }
|
|
15
|
+
@objc var colors: [UIColor] = [] { didSet {
|
|
16
|
+
renderer?.strokeColors = colors
|
|
17
|
+
overlay.drawStyleIndexes = (0 ..< colors.count).map { it in NSNumber(value: it) }
|
|
18
|
+
} }
|
|
19
|
+
|
|
20
|
+
@objc func setPoints(_ points: NSArray) {
|
|
21
|
+
var coordinates = points.map { it -> CLLocationCoordinate2D in (it as! NSDictionary).coordinate }
|
|
22
|
+
overlay.setPolylineWithCoordinates(&coordinates, count: points.count)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
func setDotted() {
|
|
26
|
+
renderer?.lineDashType = dotted ? kMALineDashTypeDot : kMALineDashTypeNone
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
func getOverlay() -> MABaseOverlay { overlay }
|
|
30
|
+
func getRenderer() -> MAOverlayRenderer {
|
|
31
|
+
if renderer == nil {
|
|
32
|
+
renderer = MAMultiColoredPolylineRenderer(multiPolyline: overlay)
|
|
33
|
+
renderer?.strokeColor = color
|
|
34
|
+
renderer?.lineWidth = width
|
|
35
|
+
renderer?.isGradient = gradient
|
|
36
|
+
renderer?.strokeColors = colors
|
|
37
|
+
setDotted()
|
|
38
|
+
}
|
|
39
|
+
return renderer!
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@objc(AMapSdk)
|
|
2
|
+
class AMapSdk: NSObject {
|
|
3
|
+
@objc static func requiresMainQueueSetup() -> Bool {
|
|
4
|
+
false
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@objc func initSDK(_ apiKey: String) {
|
|
8
|
+
AMapServices.shared().apiKey = apiKey
|
|
9
|
+
MAMapView.updatePrivacyAgree(AMapPrivacyAgreeStatus.didAgree)
|
|
10
|
+
MAMapView.updatePrivacyShow(AMapPrivacyShowStatus.didShow, privacyInfo: AMapPrivacyInfoStatus.didContain)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@objc func getVersion(_ resolve: RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
14
|
+
resolve("8.0.1")
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTEventEmitter.h>
|
|
3
|
+
#import <AMapFoundationKit/AMapFoundationKit.h>
|
|
4
|
+
#import <AMapLocationKit/AMapLocationKit.h>
|
|
5
|
+
|
|
6
|
+
@interface RNAMapGeolocation : RCTEventEmitter <RCTBridgeModule, AMapLocationManagerDelegate>
|
|
7
|
+
|
|
8
|
+
@end
|