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