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