expo-gaode-map 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/ExpoSmartrefreshlayoutModule.swift +119 -0
  2. package/README.md +43 -484
  3. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapModule.kt +7 -8
  4. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +9 -1
  5. package/android/src/main/java/expo/modules/gaodemap/managers/CameraManager.kt +14 -0
  6. package/android/src/main/java/expo/modules/gaodemap/managers/OverlayManager.kt +11 -45
  7. package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +111 -9
  8. package/android/src/main/java/expo/modules/gaodemap/utils/ColorParser.kt +48 -0
  9. package/build/components/overlays/Polyline.d.ts.map +1 -1
  10. package/build/components/overlays/Polyline.js +10 -17
  11. package/build/components/overlays/Polyline.js.map +1 -1
  12. package/build/index.d.ts +1 -1
  13. package/build/index.d.ts.map +1 -1
  14. package/build/index.js +2 -2
  15. package/build/index.js.map +1 -1
  16. package/build/modules/AMapSDK.d.ts +0 -6
  17. package/build/modules/AMapSDK.d.ts.map +1 -1
  18. package/build/modules/AMapSDK.js +2 -11
  19. package/build/modules/AMapSDK.js.map +1 -1
  20. package/build/types/map-view.types.d.ts +27 -5
  21. package/build/types/map-view.types.d.ts.map +1 -1
  22. package/build/types/map-view.types.js.map +1 -1
  23. package/docs/API.md +264 -0
  24. package/docs/EXAMPLES.md +479 -0
  25. package/ios/ColorParser.swift +158 -0
  26. package/ios/ExpoGaodeMap.podspec +1 -0
  27. package/ios/ExpoGaodeMapModule.swift +445 -42
  28. package/ios/ExpoGaodeMapView.swift +278 -32
  29. package/ios/UIColorExtension.swift +11 -0
  30. package/ios/managers/CameraManager.swift +107 -0
  31. package/ios/managers/OverlayManager.swift +210 -0
  32. package/ios/managers/UIManager.swift +163 -0
  33. package/ios/modules/LocationManager.swift +144 -0
  34. package/ios/overlays/CircleView.swift +76 -0
  35. package/ios/overlays/ClusterView.swift +56 -0
  36. package/ios/overlays/HeatMapView.swift +98 -0
  37. package/ios/overlays/MarkerView.swift +81 -0
  38. package/ios/overlays/MultiPointView.swift +50 -0
  39. package/ios/overlays/PolygonView.swift +70 -0
  40. package/ios/overlays/PolylineView.swift +62 -0
  41. package/lib/android/.gradle/8.9/checksums/checksums.lock +0 -0
  42. package/lib/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  43. package/lib/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  44. package/lib/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  45. package/lib/android/.gradle/8.9/gc.properties +0 -0
  46. package/lib/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  47. package/lib/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  48. package/lib/android/.gradle/vcs-1/gc.properties +0 -0
  49. package/lib/android/build/.transforms/7df4812a1bb640a0eb92904b45f433ca/results.bin +1 -0
  50. package/lib/android/build/.transforms/7df4812a1bb640a0eb92904b45f433ca/transformed/classes/classes_dex/classes.dex +0 -0
  51. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/results.bin +1 -0
  52. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/AMap3DPackage.dex +0 -0
  53. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/BuildConfig.dex +0 -0
  54. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/UtilsKt$fetchImage$request$1$1.dex +0 -0
  55. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/UtilsKt.dex +0 -0
  56. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Circle.dex +0 -0
  57. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/CircleManager.dex +0 -0
  58. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/HeatMap.dex +0 -0
  59. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/HeatMapManager.dex +0 -0
  60. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView$7.dex +0 -0
  61. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView$8.dex +0 -0
  62. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView$animateCallback$1.dex +0 -0
  63. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapView.dex +0 -0
  64. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapViewManager$commands$1.dex +0 -0
  65. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapViewManager$commands$2.dex +0 -0
  66. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MapViewManager.dex +0 -0
  67. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Marker$setIcon$1.dex +0 -0
  68. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Marker.dex +0 -0
  69. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MarkerManager$Companion.dex +0 -0
  70. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MarkerManager.dex +0 -0
  71. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MultiPoint$setIcon$1.dex +0 -0
  72. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MultiPoint.dex +0 -0
  73. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/MultiPointManager.dex +0 -0
  74. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Overlay.dex +0 -0
  75. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Polygon.dex +0 -0
  76. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/PolygonManager.dex +0 -0
  77. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/Polyline.dex +0 -0
  78. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/map_view/PolylineManager.dex +0 -0
  79. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/debug_dex/qiuxiang/amap3d/modules/SdkModule.dex +0 -0
  80. package/lib/android/build/.transforms/d6c91342f3c8bae4ed26783459def84b/transformed/debug/desugar_graph.bin +0 -0
  81. package/lib/android/build/generated/source/buildConfig/debug/qiuxiang/amap3d/BuildConfig.java +10 -0
  82. package/lib/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +14 -0
  83. package/lib/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
  84. package/lib/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
  85. package/lib/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  86. package/lib/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  87. package/lib/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  88. package/lib/android/build/intermediates/compile_symbol_list/debug/R.txt +1 -0
  89. package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-hdpi-v4_positio_icon.png.flat +0 -0
  90. package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-mdpi-v4_positio_icon.png.flat +0 -0
  91. package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-xhdpi-v4_positio_icon.png.flat +0 -0
  92. package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-xxhdpi-v4_positio_icon.png.flat +0 -0
  93. package/lib/android/build/intermediates/compiled_local_resources/debug/out/drawable-xxxhdpi-v4_positio_icon.png.flat +0 -0
  94. package/lib/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +6 -0
  95. package/lib/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  96. package/lib/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  97. package/lib/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  98. package/lib/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  99. package/lib/android/build/intermediates/java_res/debug/out/META-INF/react-native-amap3d_debug.kotlin_module +0 -0
  100. package/lib/android/build/intermediates/javac/debug/classes/qiuxiang/amap3d/BuildConfig.class +0 -0
  101. package/lib/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +3 -0
  102. package/lib/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +26 -0
  103. package/lib/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +14 -0
  104. package/lib/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  105. package/lib/android/build/intermediates/packaged_res/debug/drawable-hdpi-v4/positio_icon.png +0 -0
  106. package/lib/android/build/intermediates/packaged_res/debug/drawable-mdpi-v4/positio_icon.png +0 -0
  107. package/lib/android/build/intermediates/packaged_res/debug/drawable-xhdpi-v4/positio_icon.png +0 -0
  108. package/lib/android/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/positio_icon.png +0 -0
  109. package/lib/android/build/intermediates/packaged_res/debug/drawable-xxxhdpi-v4/positio_icon.png +0 -0
  110. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-amap3d_debug.kotlin_module +0 -0
  111. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/AMap3DPackage.class +0 -0
  112. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/BuildConfig.class +0 -0
  113. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/UtilsKt$fetchImage$request$1$1.class +0 -0
  114. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/UtilsKt.class +0 -0
  115. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Circle.class +0 -0
  116. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/CircleManager.class +0 -0
  117. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/HeatMap.class +0 -0
  118. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/HeatMapManager.class +0 -0
  119. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView$7.class +0 -0
  120. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView$8.class +0 -0
  121. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView$animateCallback$1.class +0 -0
  122. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapView.class +0 -0
  123. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$1.class +0 -0
  124. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$2.class +0 -0
  125. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MapViewManager.class +0 -0
  126. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Marker$setIcon$1.class +0 -0
  127. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Marker.class +0 -0
  128. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MarkerManager$Companion.class +0 -0
  129. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MarkerManager.class +0 -0
  130. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MultiPoint$setIcon$1.class +0 -0
  131. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MultiPoint.class +0 -0
  132. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/MultiPointManager.class +0 -0
  133. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Overlay.class +0 -0
  134. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Polygon.class +0 -0
  135. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/PolygonManager.class +0 -0
  136. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/Polyline.class +0 -0
  137. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/map_view/PolylineManager.class +0 -0
  138. package/lib/android/build/intermediates/runtime_library_classes_dir/debug/qiuxiang/amap3d/modules/SdkModule.class +0 -0
  139. package/lib/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  140. package/lib/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +2 -0
  141. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  142. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  143. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  144. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  145. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  146. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  147. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  148. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  149. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  150. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  151. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  152. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  153. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  154. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  155. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  156. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  157. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  158. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  159. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  160. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  161. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  162. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  163. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  164. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  165. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  166. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  167. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  168. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  169. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  170. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  171. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  172. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  173. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  174. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  175. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  176. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  177. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  178. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  179. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  180. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  181. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  182. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  183. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  184. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  185. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  186. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  187. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  188. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  189. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  190. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  191. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  192. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  193. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  194. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  195. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  196. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  197. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  198. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  199. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  200. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  201. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  202. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  203. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  204. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  205. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  206. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  207. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  208. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  209. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  210. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  211. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  212. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  213. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  214. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  215. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  216. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  217. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  218. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  219. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  220. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  221. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  222. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  223. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  224. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  225. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  226. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  227. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  228. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  229. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  230. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
  231. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  232. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -0
  233. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  234. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  235. package/lib/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  236. package/lib/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  237. package/lib/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  238. package/lib/android/build/outputs/logs/manifest-merger-debug-report.txt +41 -0
  239. package/lib/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  240. package/lib/android/build/tmp/kotlin-classes/debug/META-INF/react-native-amap3d_debug.kotlin_module +0 -0
  241. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/AMap3DPackage.class +0 -0
  242. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/UtilsKt$fetchImage$request$1$1.class +0 -0
  243. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/UtilsKt.class +0 -0
  244. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Circle.class +0 -0
  245. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/CircleManager.class +0 -0
  246. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/HeatMap.class +0 -0
  247. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/HeatMapManager.class +0 -0
  248. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView$7.class +0 -0
  249. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView$8.class +0 -0
  250. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView$animateCallback$1.class +0 -0
  251. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapView.class +0 -0
  252. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$1.class +0 -0
  253. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapViewManager$commands$2.class +0 -0
  254. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MapViewManager.class +0 -0
  255. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Marker$setIcon$1.class +0 -0
  256. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Marker.class +0 -0
  257. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MarkerManager$Companion.class +0 -0
  258. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MarkerManager.class +0 -0
  259. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MultiPoint$setIcon$1.class +0 -0
  260. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MultiPoint.class +0 -0
  261. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/MultiPointManager.class +0 -0
  262. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Overlay.class +0 -0
  263. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Polygon.class +0 -0
  264. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/PolygonManager.class +0 -0
  265. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/Polyline.class +0 -0
  266. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/map_view/PolylineManager.class +0 -0
  267. package/lib/android/build/tmp/kotlin-classes/debug/qiuxiang/amap3d/modules/SdkModule.class +0 -0
  268. package/lib/android/build.gradle +34 -0
  269. package/lib/android/drawable/rn_edit_text_material.xml +37 -0
  270. package/lib/android/drawable-hdpi/positio_icon.png +0 -0
  271. package/lib/android/drawable-hdpi/splashscreen_image.png +0 -0
  272. package/lib/android/drawable-mdpi/splashscreen_image.png +0 -0
  273. package/lib/android/drawable-xhdpi/splashscreen_image.png +0 -0
  274. package/lib/android/drawable-xxhdpi/splashscreen_image.png +0 -0
  275. package/lib/android/drawable-xxxhdpi/splashscreen_image.png +0 -0
  276. package/lib/android/src/main/AndroidManifest.xml +10 -0
  277. package/lib/android/src/main/java/qiuxiang/amap3d/AMap3DPackage.kt +30 -0
  278. package/lib/android/src/main/java/qiuxiang/amap3d/Utils.kt +114 -0
  279. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Circle.kt +65 -0
  280. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/CircleManager.kt +49 -0
  281. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/HeatMap.kt +32 -0
  282. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/HeatMapManager.kt +33 -0
  283. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MapView.kt +190 -0
  284. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MapViewManager.kt +181 -0
  285. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Marker.kt +102 -0
  286. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MarkerManager.kt +78 -0
  287. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MultiPoint.kt +53 -0
  288. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/MultiPointManager.kt +33 -0
  289. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Overlay.kt +8 -0
  290. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Polygon.kt +58 -0
  291. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/PolygonManager.kt +44 -0
  292. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/Polyline.kt +69 -0
  293. package/lib/android/src/main/java/qiuxiang/amap3d/map_view/PolylineManager.kt +64 -0
  294. package/lib/android/src/main/java/qiuxiang/amap3d/modules/AMapGeolocationModule.kt +468 -0
  295. package/lib/android/src/main/java/qiuxiang/amap3d/modules/SdkModule.kt +31 -0
  296. package/lib/android/src/main/res/drawable-hdpi/positio_icon.png +0 -0
  297. package/lib/android/src/main/res/drawable-mdpi/positio_icon.png +0 -0
  298. package/lib/android/src/main/res/drawable-xhdpi/positio_icon.png +0 -0
  299. package/lib/android/src/main/res/drawable-xxhdpi/positio_icon.png +0 -0
  300. package/lib/android/src/main/res/drawable-xxxhdpi/positio_icon.png +0 -0
  301. package/lib/ios/.swiftformat +2 -0
  302. package/lib/ios/Bridging-Header.h +4 -0
  303. package/lib/ios/MapView/CircleManager.m +11 -0
  304. package/lib/ios/MapView/CircleManager.swift +30 -0
  305. package/lib/ios/MapView/HeatMapManager.m +9 -0
  306. package/lib/ios/MapView/HeatMapManager.swift +29 -0
  307. package/lib/ios/MapView/MapViewManager.m +35 -0
  308. package/lib/ios/MapView/MapViewManager.swift +188 -0
  309. package/lib/ios/MapView/MarkerManager.m +18 -0
  310. package/lib/ios/MapView/MarkerManager.swift +100 -0
  311. package/lib/ios/MapView/MultiPointManager.m +9 -0
  312. package/lib/ios/MapView/MultiPointManager.swift +47 -0
  313. package/lib/ios/MapView/Overlay.swift +4 -0
  314. package/lib/ios/MapView/PolygonManager.m +10 -0
  315. package/lib/ios/MapView/PolygonManager.swift +30 -0
  316. package/lib/ios/MapView/PolylineManager.m +12 -0
  317. package/lib/ios/MapView/PolylineManager.swift +41 -0
  318. package/lib/ios/Modules/SdkModule.m +8 -0
  319. package/lib/ios/Modules/SdkModule.swift +16 -0
  320. package/lib/ios/RNAMapGeolocation.h +8 -0
  321. package/lib/ios/RNAMapGeolocation.m +302 -0
  322. package/lib/ios/Utils.swift +104 -0
  323. package/lib/ios/react-native-amap3d.podspec +21 -0
  324. package/lib/src/circle.tsx +36 -0
  325. package/lib/src/cluster/cluster-view.tsx +58 -0
  326. package/lib/src/cluster/index.tsx +159 -0
  327. package/lib/src/component.ts +31 -0
  328. package/lib/src/geolocation/index.d.ts +287 -0
  329. package/lib/src/geolocation/index.js +344 -0
  330. package/lib/src/heat-map.tsx +21 -0
  331. package/lib/src/index.ts +13 -0
  332. package/lib/src/location/index.d.ts +287 -0
  333. package/lib/src/location/index.js +344 -0
  334. package/lib/src/map-view.tsx +230 -0
  335. package/lib/src/marker.tsx +128 -0
  336. package/lib/src/multi-point.tsx +28 -0
  337. package/lib/src/polygon.tsx +31 -0
  338. package/lib/src/polyline.tsx +65 -0
  339. package/lib/src/sdk.ts +11 -0
  340. package/lib/src/types.ts +137 -0
  341. package/package.json +3 -2
  342. package/src/components/overlays/Polyline.tsx +11 -19
  343. package/src/index.ts +2 -2
  344. package/src/modules/AMapSDK.ts +2 -12
  345. package/src/types/map-view.types.ts +27 -5
  346. package/docs/followUserLocation.md +0 -186
  347. package/src/types/README.md +0 -186
@@ -1,38 +1,284 @@
1
1
  import ExpoModulesCore
2
- import WebKit
2
+ import MAMapKit
3
3
 
4
- // This view will be used as a native component. Make sure to inherit from `ExpoView`
5
- // to apply the proper styling (e.g. border radius and shadows).
6
- class ExpoGaodeMapView: ExpoView {
7
- let webView = WKWebView()
8
- let onLoad = EventDispatcher()
9
- var delegate: WebViewDelegate?
10
-
11
- required init(appContext: AppContext? = nil) {
12
- super.init(appContext: appContext)
13
- clipsToBounds = true
14
- delegate = WebViewDelegate { url in
15
- self.onLoad(["url": url])
16
- }
17
- webView.navigationDelegate = delegate
18
- addSubview(webView)
19
- }
20
-
21
- override func layoutSubviews() {
22
- webView.frame = bounds
23
- }
4
+ class ExpoGaodeMapView: ExpoView, MAMapViewDelegate {
5
+ var mapType: Int = 0
6
+ var initialCameraPosition: [String: Any]?
7
+ var showsZoomControls: Bool = true
8
+ var showsCompass: Bool = true
9
+ var showsScale: Bool = true
10
+ var isZoomEnabled: Bool = true
11
+ var isScrollEnabled: Bool = true
12
+ var isRotateEnabled: Bool = true
13
+ var isTiltEnabled: Bool = true
14
+ var showsUserLocation: Bool = false
15
+ var followUserLocation: Bool = false {
16
+ didSet {
17
+ if showsUserLocation {
18
+ uiManager?.setShowsUserLocation(true, followUser: followUserLocation)
19
+ }
20
+ }
21
+ }
22
+ var userLocationRepresentation: [String: Any]?
23
+ var showsTraffic: Bool = false
24
+ var showsBuildings: Bool = false
25
+ var showsIndoorMap: Bool = false
26
+ var maxZoomLevel: CGFloat = 20
27
+ var minZoomLevel: CGFloat = 3
28
+
29
+ let onMapPress = EventDispatcher()
30
+ let onLongPress = EventDispatcher()
31
+ let onLoad = EventDispatcher()
32
+
33
+ private var mapView: MAMapView!
34
+ private var cameraManager: CameraManager!
35
+ private var uiManager: UIManager!
36
+ private var overlayManager: OverlayManager!
37
+ private var isMapLoaded = false
38
+
39
+ required init(appContext: AppContext? = nil) {
40
+ super.init(appContext: appContext)
41
+
42
+ // 确保隐私合规已设置
43
+ MAMapView.updatePrivacyAgree(.didAgree)
44
+ MAMapView.updatePrivacyShow(.didShow, privacyInfo: .didContain)
45
+
46
+ mapView = MAMapView(frame: bounds)
47
+ mapView.delegate = self
48
+ mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
49
+ addSubview(mapView)
50
+
51
+ cameraManager = CameraManager(mapView: mapView)
52
+ uiManager = UIManager(mapView: mapView)
53
+ overlayManager = OverlayManager(mapView: mapView)
54
+
55
+ setupDefaultConfig()
56
+ }
57
+
58
+ override func layoutSubviews() {
59
+ super.layoutSubviews()
60
+ mapView.frame = bounds
61
+ }
62
+
63
+ override func addSubview(_ view: UIView) {
64
+ super.addSubview(view)
65
+
66
+ // 自动将地图实例传递给覆盖物子视图
67
+ if let markerView = view as? MarkerView {
68
+ markerView.setMap(mapView)
69
+ } else if let circleView = view as? CircleView {
70
+ circleView.setMap(mapView)
71
+ } else if let polylineView = view as? PolylineView {
72
+ polylineView.setMap(mapView)
73
+ } else if let polygonView = view as? PolygonView {
74
+ polygonView.setMap(mapView)
75
+ } else if let heatMapView = view as? HeatMapView {
76
+ heatMapView.setMap(mapView)
77
+ } else if let multiPointView = view as? MultiPointView {
78
+ multiPointView.setMap(mapView)
79
+ } else if let clusterView = view as? ClusterView {
80
+ clusterView.setMap(mapView)
81
+ }
82
+ }
83
+
84
+ private func setupDefaultConfig() {
85
+ uiManager.setMapType(0)
86
+ uiManager.setShowsScale(showsScale)
87
+ uiManager.setShowsCompass(showsCompass)
88
+ uiManager.setZoomEnabled(isZoomEnabled)
89
+ uiManager.setScrollEnabled(isScrollEnabled)
90
+ uiManager.setRotateEnabled(isRotateEnabled)
91
+ uiManager.setTiltEnabled(isTiltEnabled)
92
+ uiManager.setShowsUserLocation(showsUserLocation, followUser: followUserLocation)
93
+ }
94
+
95
+ func applyProps() {
96
+ uiManager.setMapType(mapType)
97
+
98
+ if let position = initialCameraPosition, isMapLoaded {
99
+ cameraManager.setInitialCameraPosition(position)
100
+ }
101
+
102
+ uiManager.setShowsScale(showsScale)
103
+ uiManager.setShowsCompass(showsCompass)
104
+ uiManager.setZoomEnabled(isZoomEnabled)
105
+ uiManager.setScrollEnabled(isScrollEnabled)
106
+ uiManager.setRotateEnabled(isRotateEnabled)
107
+ uiManager.setTiltEnabled(isTiltEnabled)
108
+ uiManager.setShowsUserLocation(showsUserLocation, followUser: followUserLocation)
109
+ uiManager.setShowsTraffic(showsTraffic)
110
+ uiManager.setShowsBuildings(showsBuildings)
111
+ uiManager.setShowsIndoorMap(showsIndoorMap)
112
+ }
113
+
114
+ func setMaxZoom(_ maxZoom: Double) {
115
+ cameraManager.setMaxZoomLevel(CGFloat(maxZoom))
116
+ }
117
+
118
+ func setMinZoom(_ minZoom: Double) {
119
+ cameraManager.setMinZoomLevel(CGFloat(minZoom))
120
+ }
121
+
122
+ func moveCamera(position: [String: Any], duration: Int) {
123
+ cameraManager.moveCamera(position: position, duration: duration)
124
+ }
125
+
126
+ func getLatLng(point: [String: Double]) -> [String: Double] {
127
+ return cameraManager.getLatLng(point: point)
128
+ }
129
+
130
+ func setCenter(center: [String: Double], animated: Bool) {
131
+ cameraManager.setCenter(center: center, animated: animated)
132
+ }
133
+
134
+ func setZoom(zoom: Double, animated: Bool) {
135
+ cameraManager.setZoomLevel(zoom: CGFloat(zoom), animated: animated)
136
+ }
137
+
138
+ func getCameraPosition() -> [String: Any] {
139
+ return cameraManager.getCameraPosition()
140
+ }
141
+
142
+ func addCircle(id: String, props: [String: Any]) {
143
+ overlayManager.addCircle(id: id, props: props)
144
+ }
145
+
146
+ func removeCircle(id: String) {
147
+ overlayManager.removeCircle(id: id)
148
+ }
149
+
150
+ func updateCircle(id: String, props: [String: Any]) {
151
+ overlayManager.updateCircle(id: id, props: props)
152
+ }
153
+
154
+ func addMarker(id: String, props: [String: Any]) {
155
+ overlayManager.addMarker(id: id, props: props)
156
+ }
157
+
158
+ func removeMarker(id: String) {
159
+ overlayManager.removeMarker(id: id)
160
+ }
161
+
162
+ func updateMarker(id: String, props: [String: Any]) {
163
+ overlayManager.updateMarker(id: id, props: props)
164
+ }
165
+
166
+ func addPolyline(id: String, props: [String: Any]) {
167
+ overlayManager.addPolyline(id: id, props: props)
168
+ }
169
+
170
+ func removePolyline(id: String) {
171
+ overlayManager.removePolyline(id: id)
172
+ }
173
+
174
+ func updatePolyline(id: String, props: [String: Any]) {
175
+ overlayManager.updatePolyline(id: id, props: props)
176
+ }
177
+
178
+ func addPolygon(id: String, props: [String: Any]) {
179
+ overlayManager.addPolygon(id: id, props: props)
180
+ }
181
+
182
+ func removePolygon(id: String) {
183
+ overlayManager.removePolygon(id: id)
184
+ }
185
+
186
+ func updatePolygon(id: String, props: [String: Any]) {
187
+ overlayManager.updatePolygon(id: id, props: props)
188
+ }
189
+
190
+ func setShowsTraffic(_ show: Bool) {
191
+ showsTraffic = show
192
+ uiManager.setShowsTraffic(show)
193
+ }
194
+
195
+ func setShowsBuildings(_ show: Bool) {
196
+ showsBuildings = show
197
+ uiManager.setShowsBuildings(show)
198
+ }
199
+
200
+ func setShowsIndoorMap(_ show: Bool) {
201
+ showsIndoorMap = show
202
+ uiManager.setShowsIndoorMap(show)
203
+ }
204
+
205
+ func setFollowUserLocation(_ follow: Bool) {
206
+ followUserLocation = follow
207
+ // 如果定位已开启,立即应用新设置
208
+ uiManager.setShowsUserLocation(showsUserLocation, followUser: follow)
209
+ }
210
+
211
+ func setShowsUserLocation(_ show: Bool) {
212
+ showsUserLocation = show
213
+ uiManager.setShowsUserLocation(show, followUser: followUserLocation)
214
+ if show {
215
+ applyUserLocationStyle()
216
+ }
217
+ }
218
+
219
+ func setUserLocationRepresentation(_ config: [String: Any]) {
220
+ userLocationRepresentation = config
221
+ if showsUserLocation {
222
+ uiManager.setUserLocationRepresentation(config)
223
+ }
224
+ }
225
+
226
+ private func applyUserLocationStyle() {
227
+ guard let config = userLocationRepresentation else { return }
228
+ uiManager.setUserLocationRepresentation(config)
229
+ }
24
230
  }
25
231
 
26
- class WebViewDelegate: NSObject, WKNavigationDelegate {
27
- let onUrlChange: (String) -> Void
28
-
29
- init(onUrlChange: @escaping (String) -> Void) {
30
- self.onUrlChange = onUrlChange
31
- }
32
-
33
- func webView(_ webView: WKWebView, didFinish navigation: WKNavigation) {
34
- if let url = webView.url {
35
- onUrlChange(url.absoluteString)
232
+ extension ExpoGaodeMapView {
233
+ public func mapViewDidFinishLoadingMap(_ mapView: MAMapView) {
234
+ guard !isMapLoaded else { return }
235
+ isMapLoaded = true
236
+ if let position = initialCameraPosition {
237
+ cameraManager.setInitialCameraPosition(position)
238
+ }
239
+ onLoad(["loaded": true])
240
+ }
241
+
242
+ public func mapView(_ mapView: MAMapView, didSingleTappedAt coordinate: CLLocationCoordinate2D) {
243
+ onMapPress(["latitude": coordinate.latitude, "longitude": coordinate.longitude])
244
+ }
245
+
246
+ public func mapView(_ mapView: MAMapView, didLongPressedAt coordinate: CLLocationCoordinate2D) {
247
+ onLongPress(["latitude": coordinate.latitude, "longitude": coordinate.longitude])
248
+ }
249
+
250
+ public func mapView(_ mapView: MAMapView, viewFor annotation: MAAnnotation) -> MAAnnotationView? {
251
+ // 定位蓝点返回 nil,使用系统默认样式
252
+ if annotation.isKind(of: MAUserLocation.self) {
253
+ return nil
254
+ }
255
+
256
+ if annotation.isKind(of: MAPointAnnotation.self) {
257
+ let identifier = "marker"
258
+ var view = mapView.dequeueReusableAnnotationView(withIdentifier: identifier)
259
+ if view == nil {
260
+ view = MAPinAnnotationView(annotation: annotation, reuseIdentifier: identifier)
261
+ }
262
+ view?.canShowCallout = true
263
+ return view
264
+ }
265
+ return nil
266
+ }
267
+
268
+ public func mapView(_ mapView: MAMapView, rendererFor overlay: MAOverlay) -> MAOverlayRenderer {
269
+ // 首先检查是否是通过子视图添加的覆盖物
270
+ for subview in subviews {
271
+ if let circleView = subview as? CircleView, circleView.circle === overlay {
272
+ return circleView.getRenderer()
273
+ } else if let polylineView = subview as? PolylineView, polylineView.polyline === overlay {
274
+ return polylineView.getRenderer()
275
+ } else if let polygonView = subview as? PolygonView, polygonView.polygon === overlay {
276
+ return polygonView.getRenderer()
277
+ }
278
+ }
279
+
280
+ // 否则使用 OverlayManager 的渲染器
281
+ return overlayManager.getRenderer(for: overlay) ?? MAOverlayRenderer(overlay: overlay)
36
282
  }
37
- }
38
283
  }
284
+
@@ -0,0 +1,11 @@
1
+ import UIKit
2
+
3
+ extension UIColor {
4
+ convenience init(argb: Int) {
5
+ let alpha = CGFloat((argb >> 24) & 0xFF) / 255.0
6
+ let red = CGFloat((argb >> 16) & 0xFF) / 255.0
7
+ let green = CGFloat((argb >> 8) & 0xFF) / 255.0
8
+ let blue = CGFloat(argb & 0xFF) / 255.0
9
+ self.init(red: red, green: green, blue: blue, alpha: alpha)
10
+ }
11
+ }
@@ -0,0 +1,107 @@
1
+ import ExpoModulesCore
2
+ import MAMapKit
3
+
4
+ class CameraManager {
5
+ private weak var mapView: MAMapView?
6
+
7
+ init(mapView: MAMapView) {
8
+ self.mapView = mapView
9
+ }
10
+
11
+ func setMaxZoomLevel(_ maxZoom: CGFloat) {
12
+ mapView?.maxZoomLevel = maxZoom
13
+ }
14
+
15
+ func setMinZoomLevel(_ minZoom: CGFloat) {
16
+ mapView?.minZoomLevel = minZoom
17
+ }
18
+
19
+ func setInitialCameraPosition(_ position: [String: Any]) {
20
+ guard let mapView = mapView else { return }
21
+ let status = MAMapStatus()
22
+
23
+ if let target = position["target"] as? [String: Double],
24
+ let latitude = target["latitude"],
25
+ let longitude = target["longitude"] {
26
+ status.centerCoordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
27
+ }
28
+
29
+ if let zoom = position["zoom"] as? Double {
30
+ status.zoomLevel = CGFloat(zoom)
31
+ }
32
+
33
+ if let bearing = position["bearing"] as? Double {
34
+ status.rotationDegree = CGFloat(bearing)
35
+ }
36
+
37
+ if let tilt = position["tilt"] as? Double {
38
+ status.cameraDegree = CGFloat(tilt)
39
+ }
40
+
41
+ mapView.setMapStatus(status, animated: false, duration: 0)
42
+ }
43
+
44
+ func moveCamera(position: [String: Any], duration: Int) {
45
+ guard let mapView = mapView else { return }
46
+ let status = MAMapStatus()
47
+
48
+ if let target = position["target"] as? [String: Double],
49
+ let latitude = target["latitude"],
50
+ let longitude = target["longitude"] {
51
+ status.centerCoordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
52
+ } else {
53
+ status.centerCoordinate = mapView.centerCoordinate
54
+ }
55
+
56
+ if let zoom = position["zoom"] as? Double {
57
+ status.zoomLevel = CGFloat(zoom)
58
+ } else {
59
+ status.zoomLevel = mapView.zoomLevel
60
+ }
61
+
62
+ if let bearing = position["bearing"] as? Double {
63
+ status.rotationDegree = CGFloat(bearing)
64
+ } else {
65
+ status.rotationDegree = mapView.rotationDegree
66
+ }
67
+
68
+ if let tilt = position["tilt"] as? Double {
69
+ status.cameraDegree = CGFloat(tilt)
70
+ } else {
71
+ status.cameraDegree = mapView.cameraDegree
72
+ }
73
+
74
+ mapView.setMapStatus(status, animated: duration > 0, duration: TimeInterval(duration) / 1000.0)
75
+ }
76
+
77
+ func setCenter(center: [String: Double], animated: Bool) {
78
+ guard let mapView = mapView,
79
+ let latitude = center["latitude"],
80
+ let longitude = center["longitude"] else { return }
81
+ mapView.setCenter(CLLocationCoordinate2D(latitude: latitude, longitude: longitude), animated: animated)
82
+ }
83
+
84
+ func setZoomLevel(zoom: CGFloat, animated: Bool) {
85
+ mapView?.setZoomLevel(zoom, animated: animated)
86
+ }
87
+
88
+ func getCameraPosition() -> [String: Any] {
89
+ guard let mapView = mapView else { return [:] }
90
+ let center = mapView.centerCoordinate
91
+ return [
92
+ "target": ["latitude": center.latitude, "longitude": center.longitude],
93
+ "zoom": Double(mapView.zoomLevel),
94
+ "bearing": Double(mapView.rotationDegree),
95
+ "tilt": Double(mapView.cameraDegree)
96
+ ]
97
+ }
98
+
99
+ func getLatLng(point: [String: Double]) -> [String: Double] {
100
+ guard let mapView = mapView,
101
+ let x = point["x"],
102
+ let y = point["y"] else { return [:] }
103
+ let screenPoint = CGPoint(x: x, y: y)
104
+ let coordinate = mapView.convert(screenPoint, toCoordinateFrom: mapView)
105
+ return ["latitude": coordinate.latitude, "longitude": coordinate.longitude]
106
+ }
107
+ }
@@ -0,0 +1,210 @@
1
+ import MAMapKit
2
+
3
+ class OverlayManager {
4
+ private weak var mapView: MAMapView?
5
+ private var overlays: [String: MAOverlay] = [:]
6
+ private var overlayStyles: [String: [String: Any]] = [:]
7
+ private var annotations: [String: MAPointAnnotation] = [:]
8
+
9
+ init(mapView: MAMapView) {
10
+ self.mapView = mapView
11
+ }
12
+
13
+ // MARK: - Circle
14
+
15
+ func addCircle(id: String, props: [String: Any]) {
16
+ guard let mapView = mapView,
17
+ let center = props["center"] as? [String: Double],
18
+ let latitude = center["latitude"],
19
+ let longitude = center["longitude"],
20
+ let radius = props["radius"] as? Double else { return }
21
+
22
+ let circle = MACircle(center: CLLocationCoordinate2D(latitude: latitude, longitude: longitude), radius: radius)
23
+ overlayStyles[id] = props
24
+ mapView.add(circle!)
25
+ overlays[id] = circle
26
+ }
27
+
28
+ func removeCircle(id: String) {
29
+ guard let mapView = mapView, let circle = overlays[id] else { return }
30
+ mapView.remove(circle)
31
+ overlays.removeValue(forKey: id)
32
+ overlayStyles.removeValue(forKey: id)
33
+ }
34
+
35
+ func updateCircle(id: String, props: [String: Any]) {
36
+ removeCircle(id: id)
37
+ addCircle(id: id, props: props)
38
+ }
39
+
40
+ // MARK: - Marker
41
+
42
+ func addMarker(id: String, props: [String: Any]) {
43
+ guard let mapView = mapView,
44
+ let position = props["position"] as? [String: Double],
45
+ let latitude = position["latitude"],
46
+ let longitude = position["longitude"] else { return }
47
+
48
+ let annotation = MAPointAnnotation()
49
+ annotation.coordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
50
+ annotation.title = props["title"] as? String
51
+ annotation.subtitle = props["description"] as? String
52
+ mapView.addAnnotation(annotation)
53
+ annotations[id] = annotation
54
+ }
55
+
56
+ func removeMarker(id: String) {
57
+ guard let mapView = mapView, let annotation = annotations[id] else { return }
58
+ mapView.removeAnnotation(annotation)
59
+ annotations.removeValue(forKey: id)
60
+ }
61
+
62
+ func updateMarker(id: String, props: [String: Any]) {
63
+ removeMarker(id: id)
64
+ addMarker(id: id, props: props)
65
+ }
66
+
67
+ // MARK: - Polyline
68
+
69
+ func addPolyline(id: String, props: [String: Any]) {
70
+ guard let mapView = mapView,
71
+ let points = props["points"] as? [[String: Double]] else { return }
72
+ var coordinates: [CLLocationCoordinate2D] = []
73
+ for point in points {
74
+ guard let lat = point["latitude"], let lng = point["longitude"] else { continue }
75
+ coordinates.append(CLLocationCoordinate2D(latitude: lat, longitude: lng))
76
+ }
77
+ guard !coordinates.isEmpty else { return }
78
+
79
+ let polyline = MAMultiPolyline()
80
+ polyline.setPolylineWithCoordinates(&coordinates, count: coordinates.count)
81
+
82
+ overlayStyles[id] = props
83
+ overlays[id] = polyline
84
+ mapView.add(polyline)
85
+
86
+ // 强制刷新地图渲染
87
+ DispatchQueue.main.async {
88
+ mapView.setNeedsDisplay()
89
+ }
90
+ }
91
+
92
+ func removePolyline(id: String) {
93
+ guard let mapView = mapView, let polyline = overlays[id] else { return }
94
+ mapView.remove(polyline)
95
+ overlays.removeValue(forKey: id)
96
+ overlayStyles.removeValue(forKey: id)
97
+ }
98
+
99
+ func updatePolyline(id: String, props: [String: Any]) {
100
+ removePolyline(id: id)
101
+ addPolyline(id: id, props: props)
102
+ }
103
+
104
+ // MARK: - Polygon
105
+
106
+ func addPolygon(id: String, props: [String: Any]) {
107
+ guard let mapView = mapView,
108
+ let points = props["points"] as? [[String: Double]] else { return }
109
+ var coordinates: [CLLocationCoordinate2D] = []
110
+ for point in points {
111
+ guard let lat = point["latitude"], let lng = point["longitude"] else { continue }
112
+ coordinates.append(CLLocationCoordinate2D(latitude: lat, longitude: lng))
113
+ }
114
+ guard !coordinates.isEmpty else { return }
115
+ let polygon = MAPolygon(coordinates: &coordinates, count: UInt(coordinates.count))
116
+ overlayStyles[id] = props
117
+ mapView.add(polygon!)
118
+ overlays[id] = polygon
119
+ }
120
+
121
+ func removePolygon(id: String) {
122
+ guard let mapView = mapView, let polygon = overlays[id] else { return }
123
+ mapView.remove(polygon)
124
+ overlays.removeValue(forKey: id)
125
+ overlayStyles.removeValue(forKey: id)
126
+ }
127
+
128
+ func updatePolygon(id: String, props: [String: Any]) {
129
+ removePolygon(id: id)
130
+ addPolygon(id: id, props: props)
131
+ }
132
+
133
+ // MARK: - Renderer
134
+
135
+ func getRenderer(for overlay: MAOverlay) -> MAOverlayRenderer? {
136
+ let id = overlays.first(where: { $0.value === overlay })?.key
137
+ let style = id != nil ? overlayStyles[id!] : nil
138
+
139
+ print("🎨 OverlayManager.getRenderer - overlay类型: \(type(of: overlay)), id: \(id ?? "nil"), style: \(style ?? [:])")
140
+
141
+ if let circle = overlay as? MACircle {
142
+ guard let renderer = MACircleRenderer(circle: circle) else {
143
+ return nil
144
+ }
145
+
146
+ if let fillColor = style?["fillColor"] {
147
+ renderer.fillColor = ColorParser.parseColor(fillColor)
148
+ }
149
+ if let strokeColor = style?["strokeColor"] {
150
+ renderer.strokeColor = ColorParser.parseColor(strokeColor)
151
+ }
152
+ if let strokeWidth = style?["strokeWidth"] as? Double {
153
+ renderer.lineWidth = CGFloat(strokeWidth)
154
+ }
155
+
156
+ return renderer
157
+ } else if let polyline = overlay as? MAMultiPolyline {
158
+ let renderer = MAMultiColoredPolylineRenderer(multiPolyline: polyline)
159
+
160
+ if let color = style?["color"] {
161
+ renderer?.strokeColor = ColorParser.parseColor(color) ?? .red
162
+ } else if let strokeColor = style?["strokeColor"] {
163
+ renderer?.strokeColor = ColorParser.parseColor(strokeColor) ?? .red
164
+ } else {
165
+ renderer?.strokeColor = .red
166
+ }
167
+
168
+ if let width = style?["width"] as? Double {
169
+ renderer?.lineWidth = CGFloat(width)
170
+ } else if let strokeWidth = style?["strokeWidth"] as? Double {
171
+ renderer?.lineWidth = CGFloat(strokeWidth)
172
+ } else {
173
+ renderer?.lineWidth = 5
174
+ }
175
+
176
+ return renderer!
177
+ } else if let polygon = overlay as? MAPolygon {
178
+ guard let renderer = MAPolygonRenderer(polygon: polygon) else {
179
+ return nil
180
+ }
181
+
182
+ if let fillColor = style?["fillColor"] {
183
+ renderer.fillColor = ColorParser.parseColor(fillColor)
184
+ }
185
+ if let strokeColor = style?["strokeColor"] {
186
+ renderer.strokeColor = ColorParser.parseColor(strokeColor)
187
+ }
188
+ if let strokeWidth = style?["strokeWidth"] as? Double {
189
+ renderer.lineWidth = CGFloat(strokeWidth)
190
+ }
191
+
192
+ return renderer
193
+ }
194
+
195
+ return nil
196
+ }
197
+
198
+ func clear() {
199
+ guard let mapView = mapView else { return }
200
+ for overlay in overlays.values {
201
+ mapView.remove(overlay)
202
+ }
203
+ for annotation in annotations.values {
204
+ mapView.removeAnnotation(annotation)
205
+ }
206
+ overlays.removeAll()
207
+ overlayStyles.removeAll()
208
+ annotations.removeAll()
209
+ }
210
+ }