expo-gaode-map 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/ExpoSmartrefreshlayoutModule.swift +119 -0
  2. package/README.md +35 -496
  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 +248 -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 +2 -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,479 @@
1
+ # 使用示例
2
+
3
+ 完整的使用示例和最佳实践。
4
+
5
+ ## 目录
6
+
7
+ - [基础地图应用](#基础地图应用)
8
+ - [定位追踪应用](#定位追踪应用)
9
+ - [覆盖物示例](#覆盖物示例)
10
+ - [高级用法](#高级用法)
11
+
12
+ ## 基础地图应用
13
+
14
+ ```tsx
15
+ import React, { useRef, useEffect } from 'react';
16
+ import { View, StyleSheet, Button } from 'react-native';
17
+ import {
18
+ MapView,
19
+ initSDK,
20
+ Circle,
21
+ Marker,
22
+ Polyline,
23
+ Polygon,
24
+ type MapViewRef
25
+ } from 'expo-gaode-map';
26
+
27
+ export default function App() {
28
+ const mapRef = useRef<MapViewRef>(null);
29
+
30
+ useEffect(() => {
31
+ initSDK({
32
+ androidKey: 'your-android-api-key',
33
+ iosKey: 'your-ios-api-key',
34
+ });
35
+ }, []);
36
+
37
+ const handleMoveCamera = async () => {
38
+ await mapRef.current?.moveCamera(
39
+ {
40
+ target: { latitude: 40.0, longitude: 116.5 },
41
+ zoom: 15,
42
+ },
43
+ 1000
44
+ );
45
+ };
46
+
47
+ return (
48
+ <View style={styles.container}>
49
+ <MapView
50
+ ref={mapRef}
51
+ style={styles.map}
52
+ initialCameraPosition={{
53
+ target: { latitude: 39.9, longitude: 116.4 },
54
+ zoom: 10,
55
+ }}
56
+ myLocationEnabled={true}
57
+ followUserLocation={false}
58
+ trafficEnabled={true}
59
+ onPress={(e) => console.log('点击地图', e)}
60
+ onLoad={() => console.log('地图加载完成')}
61
+ >
62
+ {/* 圆形覆盖物 */}
63
+ <Circle
64
+ center={{ latitude: 39.9, longitude: 116.4 }}
65
+ radius={1000}
66
+ fillColor="#8800FF00"
67
+ strokeColor="#FFFF0000"
68
+ strokeWidth={2}
69
+ />
70
+
71
+ {/* 标记点 */}
72
+ <Marker
73
+ position={{ latitude: 39.95, longitude: 116.45 }}
74
+ title="这是一个标记"
75
+ draggable={true}
76
+ />
77
+
78
+ {/* 折线 */}
79
+ <Polyline
80
+ points={[
81
+ { latitude: 39.9, longitude: 116.4 },
82
+ { latitude: 39.95, longitude: 116.45 },
83
+ { latitude: 40.0, longitude: 116.5 },
84
+ ]}
85
+ strokeWidth={5}
86
+ strokeColor="#FF0000FF"
87
+ />
88
+
89
+ {/* 多边形 */}
90
+ <Polygon
91
+ points={[
92
+ { latitude: 39.85, longitude: 116.35 },
93
+ { latitude: 39.85, longitude: 116.45 },
94
+ { latitude: 39.75, longitude: 116.40 },
95
+ ]}
96
+ fillColor="#880000FF"
97
+ strokeColor="#FFFF0000"
98
+ strokeWidth={2}
99
+ />
100
+ </MapView>
101
+
102
+ <View style={styles.controls}>
103
+ <Button title="移动相机" onPress={handleMoveCamera} />
104
+ </View>
105
+ </View>
106
+ );
107
+ }
108
+
109
+ const styles = StyleSheet.create({
110
+ container: {
111
+ flex: 1,
112
+ },
113
+ map: {
114
+ flex: 1,
115
+ },
116
+ controls: {
117
+ position: 'absolute',
118
+ bottom: 20,
119
+ left: 20,
120
+ right: 20,
121
+ },
122
+ });
123
+ ```
124
+
125
+ ## 定位追踪应用
126
+
127
+ ```tsx
128
+ import React, { useEffect, useState } from 'react';
129
+ import { View, Text, Button, StyleSheet } from 'react-native';
130
+ import {
131
+ MapView,
132
+ initSDK,
133
+ configure,
134
+ start,
135
+ stop,
136
+ getCurrentLocation,
137
+ addLocationListener,
138
+ type Location,
139
+ } from 'expo-gaode-map';
140
+
141
+ export default function LocationApp() {
142
+ const [location, setLocation] = useState<Location | null>(null);
143
+ const [isTracking, setIsTracking] = useState(false);
144
+
145
+ useEffect(() => {
146
+ // 初始化 SDK
147
+ initSDK({
148
+ androidKey: 'your-android-api-key',
149
+ iosKey: 'your-ios-api-key',
150
+ });
151
+
152
+ // 配置定位参数
153
+ configure({
154
+ withReGeocode: true,
155
+ mode: 0,
156
+ interval: 2000,
157
+ });
158
+
159
+ // 监听位置更新
160
+ const subscription = addLocationListener((loc) => {
161
+ console.log('位置更新:', loc);
162
+ setLocation(loc);
163
+ });
164
+
165
+ return () => subscription.remove();
166
+ }, []);
167
+
168
+ const handleStartTracking = () => {
169
+ start();
170
+ setIsTracking(true);
171
+ };
172
+
173
+ const handleStopTracking = () => {
174
+ stop();
175
+ setIsTracking(false);
176
+ };
177
+
178
+ const handleGetLocation = async () => {
179
+ try {
180
+ const loc = await getCurrentLocation();
181
+ setLocation(loc);
182
+ } catch (error) {
183
+ console.error('获取位置失败:', error);
184
+ }
185
+ };
186
+
187
+ return (
188
+ <View style={styles.container}>
189
+ <MapView
190
+ style={styles.map}
191
+ myLocationEnabled={true}
192
+ followUserLocation={isTracking}
193
+ initialCameraPosition={{
194
+ target: {
195
+ latitude: location?.latitude || 39.9,
196
+ longitude: location?.longitude || 116.4
197
+ },
198
+ zoom: 15,
199
+ }}
200
+ />
201
+
202
+ {location && (
203
+ <View style={styles.info}>
204
+ <Text style={styles.infoText}>
205
+ 纬度: {location.latitude.toFixed(6)}
206
+ </Text>
207
+ <Text style={styles.infoText}>
208
+ 经度: {location.longitude.toFixed(6)}
209
+ </Text>
210
+ <Text style={styles.infoText}>
211
+ 精度: {location.accuracy.toFixed(2)} 米
212
+ </Text>
213
+ {location.address && (
214
+ <Text style={styles.infoText}>
215
+ 地址: {location.address}
216
+ </Text>
217
+ )}
218
+ </View>
219
+ )}
220
+
221
+ <View style={styles.controls}>
222
+ <Button
223
+ title="获取位置"
224
+ onPress={handleGetLocation}
225
+ />
226
+ <View style={{ height: 10 }} />
227
+ <Button
228
+ title={isTracking ? '停止追踪' : '开始追踪'}
229
+ onPress={isTracking ? handleStopTracking : handleStartTracking}
230
+ color={isTracking ? '#FF3B30' : '#007AFF'}
231
+ />
232
+ </View>
233
+ </View>
234
+ );
235
+ }
236
+
237
+ const styles = StyleSheet.create({
238
+ container: {
239
+ flex: 1,
240
+ },
241
+ map: {
242
+ flex: 1,
243
+ },
244
+ info: {
245
+ position: 'absolute',
246
+ top: 50,
247
+ left: 20,
248
+ right: 20,
249
+ backgroundColor: 'white',
250
+ padding: 15,
251
+ borderRadius: 10,
252
+ shadowColor: '#000',
253
+ shadowOffset: { width: 0, height: 2 },
254
+ shadowOpacity: 0.25,
255
+ shadowRadius: 3.84,
256
+ elevation: 5,
257
+ },
258
+ infoText: {
259
+ fontSize: 14,
260
+ marginBottom: 5,
261
+ color: '#333',
262
+ },
263
+ controls: {
264
+ position: 'absolute',
265
+ bottom: 30,
266
+ left: 20,
267
+ right: 20,
268
+ },
269
+ });
270
+ ```
271
+
272
+ ## 覆盖物示例
273
+
274
+ ### Circle (圆形)
275
+
276
+ **声明式用法:**
277
+ ```tsx
278
+ <MapView style={{ flex: 1 }}>
279
+ <Circle
280
+ center={{ latitude: 39.9, longitude: 116.4 }}
281
+ radius={1000}
282
+ fillColor="#8800FF00"
283
+ strokeColor="#FFFF0000"
284
+ strokeWidth={2}
285
+ onPress={() => console.log('点击圆形')}
286
+ />
287
+ </MapView>
288
+ ```
289
+
290
+ **命令式用法:**
291
+ ```tsx
292
+ const mapRef = useRef<MapViewRef>(null);
293
+
294
+ await mapRef.current?.addCircle('circle1', {
295
+ center: { latitude: 39.9, longitude: 116.4 },
296
+ radius: 1000,
297
+ fillColor: 0x8800FF00,
298
+ strokeColor: 0xFFFF0000,
299
+ strokeWidth: 2,
300
+ });
301
+
302
+ await mapRef.current?.updateCircle('circle1', {
303
+ radius: 2000,
304
+ });
305
+
306
+ await mapRef.current?.removeCircle('circle1');
307
+ ```
308
+
309
+ ### Marker (标记点)
310
+
311
+ **声明式用法:**
312
+ ```tsx
313
+ <MapView style={{ flex: 1 }}>
314
+ <Marker
315
+ position={{ latitude: 39.9, longitude: 116.4 }}
316
+ title="标题"
317
+ description="描述信息"
318
+ draggable={true}
319
+ onPress={() => console.log('点击标记')}
320
+ onDragEnd={(e) => console.log('拖动结束', e)}
321
+ />
322
+ </MapView>
323
+ ```
324
+
325
+ **命令式用法:**
326
+ ```tsx
327
+ await mapRef.current?.addMarker('marker1', {
328
+ position: { latitude: 39.9, longitude: 116.4 },
329
+ title: '标题',
330
+ draggable: true,
331
+ });
332
+
333
+ await mapRef.current?.updateMarker('marker1', {
334
+ position: { latitude: 40.0, longitude: 116.5 },
335
+ });
336
+
337
+ await mapRef.current?.removeMarker('marker1');
338
+ ```
339
+
340
+ ### Polyline (折线)
341
+
342
+ **声明式用法:**
343
+ ```tsx
344
+ <MapView style={{ flex: 1 }}>
345
+ <Polyline
346
+ points={[
347
+ { latitude: 39.9, longitude: 116.4 },
348
+ { latitude: 39.95, longitude: 116.45 },
349
+ { latitude: 40.0, longitude: 116.5 },
350
+ ]}
351
+ strokeWidth={5}
352
+ strokeColor="#FF0000FF"
353
+ onPress={() => console.log('点击折线')}
354
+ />
355
+ </MapView>
356
+ ```
357
+
358
+ **命令式用法:**
359
+ ```tsx
360
+ await mapRef.current?.addPolyline('polyline1', {
361
+ points: [
362
+ { latitude: 39.9, longitude: 116.4 },
363
+ { latitude: 40.0, longitude: 116.5 },
364
+ ],
365
+ strokeWidth: 5,
366
+ strokeColor: 0xFFFF0000,
367
+ });
368
+ ```
369
+
370
+ ### Polygon (多边形)
371
+
372
+ **声明式用法:**
373
+ ```tsx
374
+ <MapView style={{ flex: 1 }}>
375
+ <Polygon
376
+ points={[
377
+ { latitude: 39.9, longitude: 116.3 },
378
+ { latitude: 39.9, longitude: 116.4 },
379
+ { latitude: 39.8, longitude: 116.4 },
380
+ ]}
381
+ fillColor="#8800FF00"
382
+ strokeColor="#FFFF0000"
383
+ strokeWidth={2}
384
+ onPress={() => console.log('点击多边形')}
385
+ />
386
+ </MapView>
387
+ ```
388
+
389
+ **命令式用法:**
390
+ ```tsx
391
+ await mapRef.current?.addPolygon('polygon1', {
392
+ points: [
393
+ { latitude: 39.9, longitude: 116.3 },
394
+ { latitude: 39.9, longitude: 116.4 },
395
+ { latitude: 39.8, longitude: 116.4 },
396
+ ],
397
+ fillColor: 0x8800FF00,
398
+ strokeColor: 0xFFFF0000,
399
+ strokeWidth: 2,
400
+ });
401
+ ```
402
+
403
+ ## 高级用法
404
+
405
+ ### 自定义定位蓝点
406
+
407
+ ```tsx
408
+ import { Image } from 'react-native';
409
+
410
+ const iconUri = Image.resolveAssetSource(require('./assets/location-icon.png')).uri;
411
+
412
+ <MapView
413
+ myLocationEnabled={true}
414
+ userLocationRepresentation={{
415
+ showsAccuracyRing: true,
416
+ fillColor: '#4285F4',
417
+ strokeColor: '#1967D2',
418
+ lineWidth: 2,
419
+ image: iconUri,
420
+ imageWidth: 40,
421
+ imageHeight: 40,
422
+ }}
423
+ />
424
+ ```
425
+
426
+ ### 批量操作覆盖物
427
+
428
+ ```tsx
429
+ const mapRef = useRef<MapViewRef>(null);
430
+
431
+ const addMultipleOverlays = async () => {
432
+ await mapRef.current?.addCircle('circle1', {
433
+ center: { latitude: 39.9, longitude: 116.4 },
434
+ radius: 1000,
435
+ fillColor: 0x8800FF00,
436
+ });
437
+
438
+ await mapRef.current?.addCircle('circle2', {
439
+ center: { latitude: 40.0, longitude: 116.5 },
440
+ radius: 500,
441
+ fillColor: 0x880000FF,
442
+ });
443
+
444
+ await mapRef.current?.addMarker('marker1', {
445
+ position: { latitude: 39.95, longitude: 116.45 },
446
+ title: '北京',
447
+ });
448
+ };
449
+
450
+ const clearAll = async () => {
451
+ await mapRef.current?.removeCircle('circle1');
452
+ await mapRef.current?.removeCircle('circle2');
453
+ await mapRef.current?.removeMarker('marker1');
454
+ };
455
+ ```
456
+
457
+ ### 缩放级别限制
458
+
459
+ ```tsx
460
+ <MapView
461
+ maxZoom={18}
462
+ minZoom={5}
463
+ initialCameraPosition={{
464
+ target: { latitude: 39.9, longitude: 116.4 },
465
+ zoom: 10,
466
+ }}
467
+ />
468
+ ```
469
+
470
+ ### 方向更新 (iOS)
471
+
472
+ ```tsx
473
+ import { startUpdatingHeading, stopUpdatingHeading } from 'expo-gaode-map';
474
+
475
+ // 开始方向更新
476
+ startUpdatingHeading();
477
+
478
+ // 停止方向更新
479
+ stopUpdatingHeading();
@@ -0,0 +1,158 @@
1
+ import ExpoModulesCore
2
+ import UIKit
3
+
4
+ class ColorParser {
5
+ /**
6
+ * 将颜色值转换为 UIColor
7
+ * 支持格式:
8
+ * - 数字:0xFF0000
9
+ * - 十六进制字符串:"#FF0000" 或 "FF0000"
10
+ * - 颜色名称:"red", "blue", "green" 等
11
+ */
12
+ static func parseColor(_ colorValue: Any?) -> UIColor? {
13
+ guard let colorValue = colorValue else { return nil }
14
+
15
+ // 如果是数字类型
16
+ if let number = colorValue as? Int {
17
+ return UIColor(hex: number)
18
+ }
19
+
20
+ // 如果是字符串类型
21
+ if let string = colorValue as? String {
22
+ return parseColorString(string)
23
+ }
24
+
25
+ return nil
26
+ }
27
+
28
+ /**
29
+ * 解析字符串颜色值
30
+ */
31
+ private static func parseColorString(_ colorString: String) -> UIColor? {
32
+ let trimmedString = colorString.trimmingCharacters(in: .whitespacesAndNewlines)
33
+
34
+ // 处理十六进制格式
35
+ if trimmedString.hasPrefix("#") {
36
+ return parseHexColor(trimmedString)
37
+ }
38
+
39
+ // 处理颜色名称
40
+ if let namedColor = parseNamedColor(trimmedString) {
41
+ return namedColor
42
+ }
43
+
44
+ // 处理不带 # 的十六进制
45
+ if trimmedString.count == 6 || trimmedString.count == 8 {
46
+ return parseHexColor("#" + trimmedString)
47
+ }
48
+
49
+ return nil
50
+ }
51
+
52
+ /**
53
+ * 解析十六进制颜色
54
+ */
55
+ private static func parseHexColor(_ hexString: String) -> UIColor? {
56
+ var hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
57
+ var alpha: CGFloat = 1.0
58
+
59
+ // 处理 #RGB 格式
60
+ if hex.count == 3 {
61
+ let r = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 0)], count: 2)
62
+ let g = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 1)], count: 2)
63
+ let b = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 2)], count: 2)
64
+ hex = r + g + b
65
+ }
66
+
67
+ // 处理 #RGBA 格式
68
+ if hex.count == 4 {
69
+ let r = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 0)], count: 2)
70
+ let g = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 1)], count: 2)
71
+ let b = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 2)], count: 2)
72
+ let a = String(repeating: hex[hex.index(hex.startIndex, offsetBy: 3)], count: 2)
73
+ hex = r + g + b + a
74
+ }
75
+
76
+ // 处理 #RRGGBBAA 格式
77
+ if hex.count == 8 {
78
+ let scanner = Scanner(string: hex)
79
+ var hexNumber: UInt64 = 0
80
+
81
+ if scanner.scanHexInt64(&hexNumber) {
82
+ let red = CGFloat((hexNumber & 0xff000000) >> 24) / 255
83
+ let green = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255
84
+ let blue = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255
85
+ alpha = CGFloat(hexNumber & 0x000000ff) / 255
86
+
87
+ return UIColor(red: red, green: green, blue: blue, alpha: alpha)
88
+ }
89
+ }
90
+
91
+ // 处理 #RRGGBB 格式
92
+ if hex.count == 6 {
93
+ let scanner = Scanner(string: hex)
94
+ var hexNumber: UInt64 = 0
95
+
96
+ if scanner.scanHexInt64(&hexNumber) {
97
+ let red = CGFloat((hexNumber & 0xff0000) >> 16) / 255
98
+ let green = CGFloat((hexNumber & 0x00ff00) >> 8) / 255
99
+ let blue = CGFloat(hexNumber & 0x0000ff) / 255
100
+
101
+ return UIColor(red: red, green: green, blue: blue, alpha: alpha)
102
+ }
103
+ }
104
+
105
+ return nil
106
+ }
107
+
108
+ /**
109
+ * 解析颜色名称
110
+ */
111
+ private static func parseNamedColor(_ colorName: String) -> UIColor? {
112
+ let colorMap: [String: UIColor] = [
113
+ // 基础颜色
114
+ "black": .black,
115
+ "white": .white,
116
+ "red": .red,
117
+ "green": .green,
118
+ "blue": .blue,
119
+ "yellow": .yellow,
120
+ "cyan": .cyan,
121
+ "magenta": .magenta,
122
+ "orange": .orange,
123
+ "purple": .purple,
124
+ "brown": .brown,
125
+ "gray": .gray,
126
+ "lightgray": .lightGray,
127
+ "darkgray": .darkGray,
128
+ "clear": .clear,
129
+
130
+ // 常用颜色
131
+ "pink": UIColor(red: 1.0, green: 0.75, blue: 0.8, alpha: 1.0),
132
+ "lightblue": UIColor(red: 0.68, green: 0.85, blue: 0.9, alpha: 1.0),
133
+ "lightgreen": UIColor(red: 0.56, green: 0.93, blue: 0.56, alpha: 1.0),
134
+ "lightyellow": UIColor(red: 1.0, green: 1.0, blue: 0.88, alpha: 1.0),
135
+ "lightcyan": UIColor(red: 0.88, green: 1.0, blue: 1.0, alpha: 1.0),
136
+ "lightmagenta": UIColor(red: 1.0, green: 0.88, blue: 1.0, alpha: 1.0),
137
+ "darkred": UIColor(red: 0.55, green: 0.0, blue: 0.0, alpha: 1.0),
138
+ "darkgreen": UIColor(red: 0.0, green: 0.39, blue: 0.0, alpha: 1.0),
139
+ "darkblue": UIColor(red: 0.0, green: 0.0, blue: 0.55, alpha: 1.0),
140
+ "darkyellow": UIColor(red: 0.55, green: 0.55, blue: 0.0, alpha: 1.0),
141
+ "darkcyan": UIColor(red: 0.0, green: 0.55, blue: 0.55, alpha: 1.0),
142
+ "darkmagenta": UIColor(red: 0.55, green: 0.0, blue: 0.55, alpha: 1.0),
143
+ ]
144
+
145
+ return colorMap[colorName.lowercased()]
146
+ }
147
+ }
148
+
149
+ // UIColor 扩展,支持从数字创建
150
+ extension UIColor {
151
+ convenience init(hex: Int) {
152
+ let alpha = CGFloat((hex >> 24) & 0xFF) / 255.0
153
+ let red = CGFloat((hex >> 16) & 0xFF) / 255.0
154
+ let green = CGFloat((hex >> 8) & 0xFF) / 255.0
155
+ let blue = CGFloat(hex & 0xFF) / 255.0
156
+ self.init(red: red, green: green, blue: blue, alpha: alpha)
157
+ }
158
+ }
@@ -20,6 +20,7 @@ Pod::Spec.new do |s|
20
20
 
21
21
  s.dependency 'ExpoModulesCore'
22
22
  s.dependency 'AMap3DMap', '10.0.600'
23
+ s.dependency "AMapLocation"
23
24
  # Swift/Objective-C compatibility
24
25
  s.pod_target_xcconfig = {
25
26
  'DEFINES_MODULE' => 'YES',