@maplibre/maplibre-react-native 10.0.0-beta.2 → 10.0.0-beta.21

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 (584) hide show
  1. package/README.md +12 -56
  2. package/android/build.gradle +120 -50
  3. package/android/gradle.properties +15 -0
  4. package/android/src/main/AndroidManifest.xml +4 -2
  5. package/android/src/main/AndroidManifestNew.xml +5 -0
  6. package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.java +0 -5
  7. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.java +37 -48
  8. package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +16 -9
  9. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.java +11 -13
  10. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +4 -11
  11. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
  12. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
  13. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +0 -66
  14. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
  15. package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.java +7 -11
  16. package/android/src/main/java/org/maplibre/reactnative/location/engine/DefaultLocationEngineProvider.java +18 -0
  17. package/android/src/main/java/org/maplibre/reactnative/location/engine/LocationEngineProvidable.java +9 -0
  18. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +27 -148
  19. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
  20. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +123 -18
  21. package/android/src/main/location-engine-default/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
  22. package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineImpl.java +151 -0
  23. package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineProvider.java +24 -0
  24. package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
  25. package/app.plugin.js +1 -1
  26. package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
  27. package/ios/MLRN/MLRNCamera.m +6 -7
  28. package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
  29. package/ios/MLRN/MLRNFillLayer.h +0 -1
  30. package/ios/MLRN/MLRNFillLayer.m +1 -0
  31. package/ios/MLRN/MLRNLineLayer.h +0 -1
  32. package/ios/MLRN/MLRNMapView.h +1 -1
  33. package/ios/MLRN/MLRNMapView.m +7 -7
  34. package/ios/MLRN/MLRNMapViewManager.m +1 -1
  35. package/ios/MLRN/MLRNModule.m +8 -139
  36. package/ios/MLRN/MLRNRasterLayer.h +0 -1
  37. package/ios/MLRN/MLRNShapeSource.h +0 -11
  38. package/ios/MLRN/MLRNShapeSource.m +0 -38
  39. package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
  40. package/ios/MLRN/MLRNStyle.m +0 -40
  41. package/ios/MLRN/MLRNSymbolLayer.h +1 -7
  42. package/ios/MLRN/MLRNSymbolLayer.m +1 -89
  43. package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
  44. package/lib/commonjs/MLRNModule.js +7 -5
  45. package/lib/commonjs/MLRNModule.js.map +1 -1
  46. package/lib/commonjs/MapLibreRN.js +74 -68
  47. package/lib/commonjs/MapLibreRN.js.map +1 -1
  48. package/lib/commonjs/components/Annotation.js +7 -9
  49. package/lib/commonjs/components/Annotation.js.map +1 -1
  50. package/lib/commonjs/components/BackgroundLayer.js +6 -8
  51. package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
  52. package/lib/commonjs/components/Callout.js +2 -2
  53. package/lib/commonjs/components/Callout.js.map +1 -1
  54. package/lib/commonjs/components/Camera.js +111 -63
  55. package/lib/commonjs/components/Camera.js.map +1 -1
  56. package/lib/commonjs/components/CircleLayer.js +6 -8
  57. package/lib/commonjs/components/CircleLayer.js.map +1 -1
  58. package/lib/commonjs/components/FillExtrusionLayer.js +6 -8
  59. package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
  60. package/lib/commonjs/components/FillLayer.js +6 -8
  61. package/lib/commonjs/components/FillLayer.js.map +1 -1
  62. package/lib/commonjs/components/HeadingIndicator.js +4 -4
  63. package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
  64. package/lib/commonjs/components/HeatmapLayer.js +6 -8
  65. package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
  66. package/lib/commonjs/components/ImageSource.js +4 -5
  67. package/lib/commonjs/components/ImageSource.js.map +1 -1
  68. package/lib/commonjs/components/Images.js +3 -7
  69. package/lib/commonjs/components/Images.js.map +1 -1
  70. package/lib/commonjs/components/Light.js +4 -6
  71. package/lib/commonjs/components/Light.js.map +1 -1
  72. package/lib/commonjs/components/LineLayer.js +6 -8
  73. package/lib/commonjs/components/LineLayer.js.map +1 -1
  74. package/lib/commonjs/components/MapView.js +69 -83
  75. package/lib/commonjs/components/MapView.js.map +1 -1
  76. package/lib/commonjs/components/MarkerView.js +4 -5
  77. package/lib/commonjs/components/MarkerView.js.map +1 -1
  78. package/lib/commonjs/components/NativeUserLocation.js +2 -2
  79. package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
  80. package/lib/commonjs/components/PointAnnotation.js +7 -10
  81. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  82. package/lib/commonjs/components/RasterLayer.js +6 -8
  83. package/lib/commonjs/components/RasterLayer.js.map +1 -1
  84. package/lib/commonjs/components/RasterSource.js +8 -10
  85. package/lib/commonjs/components/RasterSource.js.map +1 -1
  86. package/lib/commonjs/components/ShapeSource.js +11 -45
  87. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  88. package/lib/commonjs/components/SymbolLayer.js +8 -24
  89. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  90. package/lib/commonjs/components/UserLocation.js +21 -23
  91. package/lib/commonjs/components/UserLocation.js.map +1 -1
  92. package/lib/commonjs/components/VectorSource.js +9 -21
  93. package/lib/commonjs/components/VectorSource.js.map +1 -1
  94. package/lib/commonjs/hooks/useAbstractLayer.js +1 -1
  95. package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -1
  96. package/lib/commonjs/hooks/useAbstractSource.js +1 -1
  97. package/lib/commonjs/hooks/useAbstractSource.js.map +1 -1
  98. package/lib/commonjs/hooks/useNativeBridge.js +2 -2
  99. package/lib/commonjs/hooks/useNativeBridge.js.map +1 -1
  100. package/lib/commonjs/hooks/useOnce.js +2 -2
  101. package/lib/commonjs/hooks/useOnce.js.map +1 -1
  102. package/lib/commonjs/index.js +3 -0
  103. package/lib/commonjs/index.js.map +1 -1
  104. package/lib/commonjs/modules/location/{locationManager.js → LocationManager.js} +10 -10
  105. package/lib/commonjs/modules/location/LocationManager.js.map +1 -0
  106. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -2
  107. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  108. package/lib/commonjs/modules/offline/{offlineManager.js → OfflineManager.js} +34 -36
  109. package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -0
  110. package/lib/commonjs/modules/offline/OfflinePack.js +2 -2
  111. package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
  112. package/lib/commonjs/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +12 -14
  113. package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -0
  114. package/lib/commonjs/modules/snapshot/SnapshotOptions.js +3 -4
  115. package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
  116. package/lib/commonjs/plugin/MapLibrePluginProps.js +2 -0
  117. package/lib/commonjs/plugin/MapLibrePluginProps.js.map +1 -0
  118. package/lib/commonjs/plugin/android.js +41 -0
  119. package/lib/commonjs/plugin/android.js.map +1 -0
  120. package/lib/commonjs/plugin/ios.js +131 -0
  121. package/lib/commonjs/plugin/ios.js.map +1 -0
  122. package/lib/commonjs/plugin/withMapLibre.js +31 -0
  123. package/lib/commonjs/plugin/withMapLibre.js.map +1 -0
  124. package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
  125. package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
  126. package/lib/commonjs/utils/BridgeValue.js +2 -2
  127. package/lib/commonjs/utils/BridgeValue.js.map +1 -1
  128. package/lib/commonjs/utils/Logger.js +2 -2
  129. package/lib/commonjs/utils/Logger.js.map +1 -1
  130. package/lib/commonjs/utils/StyleValue.js +4 -5
  131. package/lib/commonjs/utils/StyleValue.js.map +1 -1
  132. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
  133. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
  134. package/lib/commonjs/utils/animated/Animated.js +29 -31
  135. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  136. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +4 -5
  137. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
  138. package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +2 -2
  139. package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
  140. package/lib/commonjs/utils/animated/AnimatedPoint.js +1 -2
  141. package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -1
  142. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +4 -4
  143. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
  144. package/lib/commonjs/utils/animated/AnimatedShape.js +2 -2
  145. package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -1
  146. package/lib/commonjs/utils/getStylePropertyType.js +252 -0
  147. package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
  148. package/lib/module/MLRNModule.js +3 -2
  149. package/lib/module/MLRNModule.js.map +1 -1
  150. package/lib/module/MapLibreRN.js +40 -32
  151. package/lib/module/MapLibreRN.js.map +1 -1
  152. package/lib/module/components/Annotation.js +5 -6
  153. package/lib/module/components/Annotation.js.map +1 -1
  154. package/lib/module/components/BackgroundLayer.js +4 -6
  155. package/lib/module/components/BackgroundLayer.js.map +1 -1
  156. package/lib/module/components/Callout.js +2 -3
  157. package/lib/module/components/Callout.js.map +1 -1
  158. package/lib/module/components/Camera.js +112 -64
  159. package/lib/module/components/Camera.js.map +1 -1
  160. package/lib/module/components/CircleLayer.js +4 -6
  161. package/lib/module/components/CircleLayer.js.map +1 -1
  162. package/lib/module/components/FillExtrusionLayer.js +4 -6
  163. package/lib/module/components/FillExtrusionLayer.js.map +1 -1
  164. package/lib/module/components/FillLayer.js +4 -6
  165. package/lib/module/components/FillLayer.js.map +1 -1
  166. package/lib/module/components/HeadingIndicator.js +2 -3
  167. package/lib/module/components/HeadingIndicator.js.map +1 -1
  168. package/lib/module/components/HeatmapLayer.js +4 -6
  169. package/lib/module/components/HeatmapLayer.js.map +1 -1
  170. package/lib/module/components/ImageSource.js +2 -3
  171. package/lib/module/components/ImageSource.js.map +1 -1
  172. package/lib/module/components/Images.js +3 -8
  173. package/lib/module/components/Images.js.map +1 -1
  174. package/lib/module/components/Light.js +2 -4
  175. package/lib/module/components/Light.js.map +1 -1
  176. package/lib/module/components/LineLayer.js +4 -6
  177. package/lib/module/components/LineLayer.js.map +1 -1
  178. package/lib/module/components/MapView.js +65 -79
  179. package/lib/module/components/MapView.js.map +1 -1
  180. package/lib/module/components/MarkerView.js +2 -3
  181. package/lib/module/components/MarkerView.js.map +1 -1
  182. package/lib/module/components/NativeUserLocation.js +1 -2
  183. package/lib/module/components/NativeUserLocation.js.map +1 -1
  184. package/lib/module/components/PointAnnotation.js +5 -7
  185. package/lib/module/components/PointAnnotation.js.map +1 -1
  186. package/lib/module/components/RasterLayer.js +4 -6
  187. package/lib/module/components/RasterLayer.js.map +1 -1
  188. package/lib/module/components/RasterSource.js +5 -7
  189. package/lib/module/components/RasterSource.js.map +1 -1
  190. package/lib/module/components/ShapeSource.js +9 -42
  191. package/lib/module/components/ShapeSource.js.map +1 -1
  192. package/lib/module/components/SymbolLayer.js +7 -23
  193. package/lib/module/components/SymbolLayer.js.map +1 -1
  194. package/lib/module/components/UserLocation.js +14 -15
  195. package/lib/module/components/UserLocation.js.map +1 -1
  196. package/lib/module/components/VectorSource.js +6 -17
  197. package/lib/module/components/VectorSource.js.map +1 -1
  198. package/lib/module/hooks/useAbstractLayer.js +1 -1
  199. package/lib/module/hooks/useAbstractLayer.js.map +1 -1
  200. package/lib/module/hooks/useAbstractSource.js +1 -1
  201. package/lib/module/hooks/useAbstractSource.js.map +1 -1
  202. package/lib/module/hooks/useNativeBridge.js +1 -2
  203. package/lib/module/hooks/useNativeBridge.js.map +1 -1
  204. package/lib/module/hooks/useNativeRef.js.map +1 -1
  205. package/lib/module/hooks/useOnce.js +1 -2
  206. package/lib/module/hooks/useOnce.js.map +1 -1
  207. package/lib/module/index.js +4 -0
  208. package/lib/module/index.js.map +1 -1
  209. package/lib/module/modules/location/{locationManager.js → LocationManager.js} +10 -9
  210. package/lib/module/modules/location/LocationManager.js.map +1 -0
  211. package/lib/module/modules/offline/OfflineCreatePackOptions.js +1 -2
  212. package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  213. package/lib/module/modules/offline/{offlineManager.js → OfflineManager.js} +30 -30
  214. package/lib/module/modules/offline/OfflineManager.js.map +1 -0
  215. package/lib/module/modules/offline/OfflinePack.js +1 -2
  216. package/lib/module/modules/offline/OfflinePack.js.map +1 -1
  217. package/lib/module/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +10 -10
  218. package/lib/module/modules/snapshot/{snapshotManager.js.map → SnapshotManager.js.map} +1 -1
  219. package/lib/module/modules/snapshot/SnapshotOptions.js +2 -3
  220. package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
  221. package/lib/module/plugin/MapLibrePluginProps.js +2 -0
  222. package/lib/module/plugin/MapLibrePluginProps.js.map +1 -0
  223. package/lib/module/plugin/android.js +34 -0
  224. package/lib/module/plugin/android.js.map +1 -0
  225. package/lib/module/plugin/ios.js +123 -0
  226. package/lib/module/plugin/ios.js.map +1 -0
  227. package/lib/module/plugin/withMapLibre.js +27 -0
  228. package/lib/module/plugin/withMapLibre.js.map +1 -0
  229. package/lib/module/types/MapLibreRNStyles.js +4 -0
  230. package/lib/module/types/MapLibreRNStyles.js.map +1 -0
  231. package/lib/module/utils/BridgeValue.js +1 -1
  232. package/lib/module/utils/BridgeValue.js.map +1 -1
  233. package/lib/module/utils/Logger.js +1 -2
  234. package/lib/module/utils/Logger.js.map +1 -1
  235. package/lib/module/utils/StyleValue.js +3 -3
  236. package/lib/module/utils/StyleValue.js.map +1 -1
  237. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +1 -2
  238. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
  239. package/lib/module/utils/animated/Animated.js +14 -15
  240. package/lib/module/utils/animated/Animated.js.map +1 -1
  241. package/lib/module/utils/animated/AnimatedCoordinatesArray.js +2 -3
  242. package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
  243. package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -1
  244. package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
  245. package/lib/module/utils/animated/AnimatedPoint.js +0 -1
  246. package/lib/module/utils/animated/AnimatedPoint.js.map +1 -1
  247. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +2 -2
  248. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
  249. package/lib/module/utils/animated/AnimatedShape.js +1 -2
  250. package/lib/module/utils/animated/AnimatedShape.js.map +1 -1
  251. package/lib/module/utils/getStylePropertyType.js +248 -0
  252. package/lib/module/utils/getStylePropertyType.js.map +1 -0
  253. package/lib/typescript/commonjs/src/MLRNModule.d.ts +3 -7
  254. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +44 -34
  256. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/src/components/Annotation.d.ts +6 -6
  258. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +3 -5
  260. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/src/components/Callout.d.ts +3 -4
  262. package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/src/components/Camera.d.ts +4 -4
  264. package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +3 -5
  266. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +3 -5
  268. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/src/components/FillLayer.d.ts +3 -5
  270. package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +2 -3
  272. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +3 -5
  274. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
  275. package/lib/typescript/commonjs/src/components/ImageSource.d.ts +3 -4
  276. package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/src/components/Images.d.ts +5 -5
  278. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/src/components/Light.d.ts +4 -5
  280. package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/src/components/LineLayer.d.ts +3 -5
  282. package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
  283. package/lib/typescript/commonjs/src/components/MapView.d.ts +12 -16
  284. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/src/components/MarkerView.d.ts +3 -3
  286. package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +2 -3
  288. package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -1
  289. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +7 -8
  290. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
  291. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +3 -5
  292. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/src/components/RasterSource.d.ts +4 -4
  294. package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -1
  295. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +8 -16
  296. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  297. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +3 -10
  298. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/src/components/UserLocation.d.ts +6 -6
  300. package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
  301. package/lib/typescript/commonjs/src/components/VectorSource.d.ts +4 -8
  302. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +5 -4
  304. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
  305. package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +4 -3
  306. package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -1
  307. package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +5 -5
  308. package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -1
  309. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +2 -2
  310. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -1
  311. package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +1 -2
  312. package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -1
  313. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  314. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  315. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +33 -0
  316. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -0
  317. package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
  318. package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
  319. package/lib/typescript/{module/src/modules/offline/offlineManager.d.ts → commonjs/src/modules/offline/OfflineManager.d.ts} +27 -37
  320. package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
  321. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +3 -4
  322. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
  323. package/lib/typescript/{module/src/modules/snapshot/snapshotManager.d.ts → commonjs/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
  324. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
  326. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts +77 -0
  328. package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/src/plugin/android.d.ts +16 -0
  330. package/lib/typescript/commonjs/src/plugin/android.d.ts.map +1 -0
  331. package/lib/typescript/commonjs/src/plugin/ios.d.ts +17 -0
  332. package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +1 -0
  333. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts +5 -0
  334. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -0
  335. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
  336. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
  337. package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts +1 -1
  338. package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/src/utils/Logger.d.ts +2 -2
  340. package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
  342. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  344. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +19 -19
  346. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
  348. package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
  350. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -1
  352. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
  354. package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +5 -5
  356. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
  358. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
  360. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
  361. package/lib/typescript/module/src/MLRNModule.d.ts +3 -7
  362. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  363. package/lib/typescript/module/src/MapLibreRN.d.ts +44 -34
  364. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  365. package/lib/typescript/module/src/components/Annotation.d.ts +6 -6
  366. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  367. package/lib/typescript/module/src/components/BackgroundLayer.d.ts +3 -5
  368. package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
  369. package/lib/typescript/module/src/components/Callout.d.ts +3 -4
  370. package/lib/typescript/module/src/components/Callout.d.ts.map +1 -1
  371. package/lib/typescript/module/src/components/Camera.d.ts +4 -4
  372. package/lib/typescript/module/src/components/Camera.d.ts.map +1 -1
  373. package/lib/typescript/module/src/components/CircleLayer.d.ts +3 -5
  374. package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
  375. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +3 -5
  376. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
  377. package/lib/typescript/module/src/components/FillLayer.d.ts +3 -5
  378. package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
  379. package/lib/typescript/module/src/components/HeadingIndicator.d.ts +2 -3
  380. package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -1
  381. package/lib/typescript/module/src/components/HeatmapLayer.d.ts +3 -5
  382. package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
  383. package/lib/typescript/module/src/components/ImageSource.d.ts +3 -4
  384. package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -1
  385. package/lib/typescript/module/src/components/Images.d.ts +5 -5
  386. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  387. package/lib/typescript/module/src/components/Light.d.ts +4 -5
  388. package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
  389. package/lib/typescript/module/src/components/LineLayer.d.ts +3 -5
  390. package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
  391. package/lib/typescript/module/src/components/MapView.d.ts +12 -16
  392. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  393. package/lib/typescript/module/src/components/MarkerView.d.ts +3 -3
  394. package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -1
  395. package/lib/typescript/module/src/components/NativeUserLocation.d.ts +2 -3
  396. package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -1
  397. package/lib/typescript/module/src/components/PointAnnotation.d.ts +7 -8
  398. package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
  399. package/lib/typescript/module/src/components/RasterLayer.d.ts +3 -5
  400. package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
  401. package/lib/typescript/module/src/components/RasterSource.d.ts +4 -4
  402. package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -1
  403. package/lib/typescript/module/src/components/ShapeSource.d.ts +8 -16
  404. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  405. package/lib/typescript/module/src/components/SymbolLayer.d.ts +3 -10
  406. package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
  407. package/lib/typescript/module/src/components/UserLocation.d.ts +6 -6
  408. package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
  409. package/lib/typescript/module/src/components/VectorSource.d.ts +4 -8
  410. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  411. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +5 -4
  412. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
  413. package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +4 -3
  414. package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -1
  415. package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +5 -5
  416. package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -1
  417. package/lib/typescript/module/src/hooks/useNativeRef.d.ts +2 -2
  418. package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -1
  419. package/lib/typescript/module/src/hooks/useOnce.d.ts +1 -2
  420. package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -1
  421. package/lib/typescript/module/src/index.d.ts +3 -0
  422. package/lib/typescript/module/src/index.d.ts.map +1 -1
  423. package/lib/typescript/module/src/modules/location/LocationManager.d.ts +33 -0
  424. package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -0
  425. package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
  426. package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
  427. package/lib/typescript/{commonjs/src/modules/offline/offlineManager.d.ts → module/src/modules/offline/OfflineManager.d.ts} +27 -37
  428. package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
  429. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +3 -4
  430. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
  431. package/lib/typescript/{commonjs/src/modules/snapshot/snapshotManager.d.ts → module/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
  432. package/lib/typescript/module/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
  433. package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
  434. package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
  435. package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts +77 -0
  436. package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
  437. package/lib/typescript/module/src/plugin/android.d.ts +16 -0
  438. package/lib/typescript/module/src/plugin/android.d.ts.map +1 -0
  439. package/lib/typescript/module/src/plugin/ios.d.ts +17 -0
  440. package/lib/typescript/module/src/plugin/ios.d.ts.map +1 -0
  441. package/lib/typescript/module/src/plugin/withMapLibre.d.ts +5 -0
  442. package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -0
  443. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
  444. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
  445. package/lib/typescript/module/src/utils/BridgeValue.d.ts +1 -1
  446. package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -1
  447. package/lib/typescript/module/src/utils/Logger.d.ts +2 -2
  448. package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -1
  449. package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
  450. package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
  451. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  452. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  453. package/lib/typescript/module/src/utils/animated/Animated.d.ts +19 -19
  454. package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
  455. package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
  456. package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
  457. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
  458. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  459. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -1
  460. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  461. package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
  462. package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
  463. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +5 -5
  464. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  465. package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
  466. package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
  467. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
  468. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
  469. package/maplibre-react-native.podspec +15 -14
  470. package/package.json +17 -14
  471. package/src/MLRNModule.ts +24 -10
  472. package/src/MapLibreRN.ts +66 -49
  473. package/src/components/Annotation.tsx +12 -14
  474. package/src/components/BackgroundLayer.tsx +7 -9
  475. package/src/components/Callout.tsx +8 -10
  476. package/src/components/Camera.tsx +154 -78
  477. package/src/components/CircleLayer.tsx +7 -9
  478. package/src/components/FillExtrusionLayer.tsx +7 -9
  479. package/src/components/FillLayer.tsx +7 -9
  480. package/src/components/HeadingIndicator.tsx +2 -6
  481. package/src/components/HeatmapLayer.tsx +7 -9
  482. package/src/components/ImageSource.tsx +4 -6
  483. package/src/components/Images.tsx +8 -19
  484. package/src/components/Light.tsx +5 -7
  485. package/src/components/LineLayer.tsx +7 -9
  486. package/src/components/MapView.tsx +85 -105
  487. package/src/components/MarkerView.tsx +4 -6
  488. package/src/components/NativeUserLocation.tsx +1 -4
  489. package/src/components/PointAnnotation.tsx +10 -11
  490. package/src/components/RasterLayer.tsx +7 -9
  491. package/src/components/RasterSource.tsx +7 -9
  492. package/src/components/ShapeSource.tsx +22 -95
  493. package/src/components/SymbolLayer.tsx +12 -41
  494. package/src/components/UserLocation.tsx +21 -22
  495. package/src/components/VectorSource.tsx +12 -35
  496. package/src/hooks/useAbstractLayer.ts +8 -8
  497. package/src/hooks/useAbstractSource.ts +6 -6
  498. package/src/hooks/useNativeBridge.ts +9 -6
  499. package/src/hooks/useNativeRef.ts +2 -2
  500. package/src/hooks/useOnce.ts +3 -3
  501. package/src/index.ts +3 -0
  502. package/src/modules/location/{locationManager.ts → LocationManager.ts} +16 -15
  503. package/src/modules/offline/OfflineCreatePackOptions.ts +1 -3
  504. package/src/modules/offline/{offlineManager.ts → OfflineManager.ts} +32 -45
  505. package/src/modules/offline/OfflinePack.ts +3 -5
  506. package/src/modules/snapshot/{snapshotManager.ts → SnapshotManager.ts} +9 -9
  507. package/src/modules/snapshot/SnapshotOptions.ts +2 -4
  508. package/src/plugin/MapLibrePluginProps.ts +83 -0
  509. package/src/plugin/android.ts +64 -0
  510. package/src/plugin/ios.ts +166 -0
  511. package/src/plugin/withMapLibre.ts +30 -0
  512. package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +86 -406
  513. package/src/utils/BridgeValue.ts +1 -1
  514. package/src/utils/Logger.ts +1 -3
  515. package/src/utils/StyleValue.ts +6 -5
  516. package/src/utils/animated/AbstractAnimatedCoordinates.ts +3 -3
  517. package/src/utils/animated/Animated.ts +23 -21
  518. package/src/utils/animated/AnimatedCoordinatesArray.ts +3 -4
  519. package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +1 -1
  520. package/src/utils/animated/AnimatedPoint.ts +0 -2
  521. package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +3 -2
  522. package/src/utils/animated/AnimatedShape.ts +4 -6
  523. package/src/utils/filterUtils.ts +1 -1
  524. package/src/utils/getStylePropertyType.ts +265 -0
  525. package/android/src/main/res/values/strings.xml +0 -3
  526. package/lib/commonjs/components/Style.js +0 -266
  527. package/lib/commonjs/components/Style.js.map +0 -1
  528. package/lib/commonjs/modules/location/locationManager.js.map +0 -1
  529. package/lib/commonjs/modules/offline/offlineManager.js.map +0 -1
  530. package/lib/commonjs/modules/snapshot/snapshotManager.js.map +0 -1
  531. package/lib/commonjs/types/StyleURL.js +0 -11
  532. package/lib/commonjs/types/StyleURL.js.map +0 -1
  533. package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
  534. package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
  535. package/lib/commonjs/utils/deprecation.js +0 -31
  536. package/lib/commonjs/utils/deprecation.js.map +0 -1
  537. package/lib/commonjs/utils/styleMap.js +0 -255
  538. package/lib/commonjs/utils/styleMap.js.map +0 -1
  539. package/lib/module/components/Style.js +0 -261
  540. package/lib/module/components/Style.js.map +0 -1
  541. package/lib/module/modules/location/locationManager.js.map +0 -1
  542. package/lib/module/modules/offline/offlineManager.js.map +0 -1
  543. package/lib/module/types/StyleURL.js +0 -7
  544. package/lib/module/types/StyleURL.js.map +0 -1
  545. package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
  546. package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
  547. package/lib/module/utils/deprecation.js +0 -27
  548. package/lib/module/utils/deprecation.js.map +0 -1
  549. package/lib/module/utils/styleMap.js +0 -249
  550. package/lib/module/utils/styleMap.js.map +0 -1
  551. package/lib/typescript/commonjs/jest.config.d.ts +0 -2
  552. package/lib/typescript/commonjs/jest.config.d.ts.map +0 -1
  553. package/lib/typescript/commonjs/src/components/Style.d.ts +0 -81
  554. package/lib/typescript/commonjs/src/components/Style.d.ts.map +0 -1
  555. package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts +0 -64
  556. package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +0 -1
  557. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +0 -1
  558. package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
  559. package/lib/typescript/commonjs/src/types/StyleURL.d.ts +0 -4
  560. package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +0 -1
  561. package/lib/typescript/commonjs/src/utils/deprecation.d.ts +0 -6
  562. package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +0 -1
  563. package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
  564. package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
  565. package/lib/typescript/module/jest.config.d.ts +0 -2
  566. package/lib/typescript/module/jest.config.d.ts.map +0 -1
  567. package/lib/typescript/module/src/components/Style.d.ts +0 -81
  568. package/lib/typescript/module/src/components/Style.d.ts.map +0 -1
  569. package/lib/typescript/module/src/modules/location/locationManager.d.ts +0 -64
  570. package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +0 -1
  571. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +0 -1
  572. package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
  573. package/lib/typescript/module/src/types/StyleURL.d.ts +0 -4
  574. package/lib/typescript/module/src/types/StyleURL.d.ts.map +0 -1
  575. package/lib/typescript/module/src/utils/deprecation.d.ts +0 -6
  576. package/lib/typescript/module/src/utils/deprecation.d.ts.map +0 -1
  577. package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
  578. package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
  579. package/plugin/build/withMapLibre.d.ts +0 -12
  580. package/plugin/build/withMapLibre.js +0 -148
  581. package/src/components/Style.tsx +0 -371
  582. package/src/types/StyleURL.ts +0 -3
  583. package/src/utils/deprecation.ts +0 -31
  584. package/src/utils/styleMap.ts +0 -265
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  [![MapLibre Logo](https://maplibre.org/img/maplibre-logo-big.svg)](https://maplibre.org)
2
2
 
3
3
  # MapLibre React Native
4
- [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md)
5
- [![Version](https://img.shields.io/npm/v/@maplibre/maplibre-react-native)](https://www.npmjs.com/package/@maplibre/maplibre-react-native)
6
- [![Actions](https://img.shields.io/github/actions/workflow/status/maplibre/maplibre-react-native/review.yml?label=Actions
7
- )](https://github.com/maplibre/maplibre-react-native/actions/workflows/review.yml)
8
4
 
5
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](/LICENSE.md)
6
+ [![Version](https://img.shields.io/npm/v/@maplibre/maplibre-react-native)](https://www.npmjs.com/package/@maplibre/maplibre-react-native)
7
+ [![Actions](https://img.shields.io/github/actions/workflow/status/maplibre/maplibre-react-native/review.yml?label=Actions)](https://github.com/maplibre/maplibre-react-native/actions/workflows/review.yml)
9
8
 
10
- _React Native library for creating maps with [MapLibre Native for Android & iOS](https://github.com/maplibre/maplibre-gl-native)_.
9
+ _React Native library for creating maps
10
+ with [MapLibre Native for Android & iOS](https://github.com/maplibre/maplibre-gl-native)._
11
11
 
12
12
  This project originated as a fork of [rnmapbox](https://github.com/rnmapbox/maps), a community-maintained
13
13
  React Native library for building maps with the Mapbox iOS and Android mobile SDKs. The original product
@@ -15,69 +15,25 @@ supported both Mapbox and MapLibre for some time, but as the MapLibre and Mapbox
15
15
  diverged, it has become necessary to separate the projects into specific wrappers by underlying renderer.
16
16
 
17
17
  <p align="center">
18
- <img src="/docs/assets/device-android.png"
18
+ <img src="/docs/static/screenshots/index/device-android.png"
19
19
  alt="Indoor Building Map Android"
20
- height="480"
20
+ height="320"
21
21
  />
22
- <img src="/docs/assets/device-ios.png"
22
+ <img src="/docs/static/screenshots/index/device-ios.png"
23
23
  alt="Indoor Building Map iOS"
24
- height="480"
24
+ height="320"
25
25
  />
26
26
  </p>
27
27
 
28
28
  ## Documentation
29
29
 
30
- - [Getting Started](/docs/guides/setup/GettingStarted.md)
31
- - Installation
32
- - React Native
33
- - [Android](/docs/guides/setup/Android.md)
34
- - [iOS](/docs/guides/setup/iOS.md)
35
- - [Expo](/docs/guides/setup/Expo.md)
36
-
37
- ### Components
38
-
39
- - [MapView](/docs/components/MapView.md)
40
- - [Light](/docs/components/Light.md)
41
- - [PointAnnotation](/docs/components/PointAnnotation.md)
42
- - [MarkerView](/docs/components/MarkerView.md)
43
- - [Callout](/docs/components/Callout.md)
44
- - [Camera](docs/components/Camera.md)
45
- - [UserLocation](docs/components/UserLocation.md)
46
- - [Images](docs/components/Images.md)
47
-
48
- ### Sources
49
-
50
- - [VectorSource](/docs/components/VectorSource.md)
51
- - [ShapeSource](/docs/components/ShapeSource.md)
52
- - [RasterSource](/docs/components/RasterSource.md)
53
-
54
- ### Layers
55
-
56
- - [BackgroundLayer](/docs/components/BackgroundLayer.md)
57
- - [CircleLayer](/docs/components/CircleLayer.md)
58
- - [FillExtrusionLayer](/docs/components/FillExtrusionLayer.md)
59
- - [FillLayer](/docs/components/FillLayer.md)
60
- - [LineLayer](/docs/components/LineLayer.md)
61
- - [RasterLayer](/docs/components/RasterLayer.md)
62
- - [SymbolLayer](/docs/components/SymbolLayer.md)
63
- - [HeatmapLayer](/docs/components/HeatmapLayer.md)
64
-
65
- ### Modules
66
-
67
- - [OfflineManager](/docs/modules/offlineManager.md)
68
- - [SnapshotManager](/docs/modules/snapshotManager.md)
69
-
70
- ### Misc
71
-
72
- - [MapLibreGL](/docs/guides/MapLibreGL.md)
73
- - [Custom HTTP Headers](/docs/guides/CustomHTTPHeaders.md)
74
- - [Logger](/docs/guides/Logger.md)
30
+ https://maplibre.org/maplibre-react-native/
75
31
 
76
32
  ## Contributing & Development
77
33
 
78
- Read the [CONTRIBUTING.md](CONTRIBUTING.md) guide in order to get familiar with how we do things around here and
34
+ Read the [CONTRIBUTING](/CONTRIBUTING.md) guide in order to get familiar with how we do things around here and
79
35
  set up your local development environment.
80
36
 
81
37
  ## Community
82
38
 
83
- Join the `#maplibre-react-native` or `#maplibre` [Slack channels at OSMUS](https://slack.openstreetmap.us/).
39
+ Join the [`#maplibre-react-native`](https://osmus.slack.com/archives/C065DB4T2UB) or [`#maplibre`](https://osmus.slack.com/archives/C01G3D28DAB) [on the Open Street Map Slack](https://slack.openstreetmap.us/).
@@ -1,69 +1,139 @@
1
- apply plugin: 'com.android.library'
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["org.maplibre.reactnative.kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
2
16
 
3
- def safeExtGet(prop, fallback) {
4
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
17
+ def reactNativeArchitectures() {
18
+ def value = rootProject.getProperties().get("reactNativeArchitectures")
19
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
5
20
  }
6
21
 
7
22
  def isNewArchitectureEnabled() {
8
- return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
23
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
9
24
  }
10
25
 
11
- buildscript {
12
- ext {
13
- buildToolsVersion = "33.0.0"
14
- minSdkVersion = 16
15
- compileSdkVersion = 34
16
- targetSdkVersion = 33
17
- supportLibVersion = "28.0.0"
18
- }
26
+ apply plugin: "com.android.library"
27
+ apply plugin: "kotlin-android"
19
28
 
20
- repositories {
21
- google()
22
- mavenCentral()
23
- }
29
+ // TODO: Currently breaks new arch support, but works without
30
+ // if (isNewArchitectureEnabled()) {
31
+ // apply plugin: "com.facebook.react"
32
+ // }
33
+
34
+ def getExtOrDefault(name) {
35
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["org.maplibre.reactnative." + name]
36
+ }
37
+
38
+ def getConfigurableExtOrDefault(name) {
39
+ return rootProject.ext.has("org.maplibre.reactnative." + name) ? rootProject.ext.get("org.maplibre.reactnative." + name) : project.properties["org.maplibre.reactnative." + name]
40
+ }
41
+
42
+ def getExtOrIntegerDefault(name) {
43
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["org.maplibre.reactnative." + name]).toInteger()
44
+ }
45
+
46
+ def supportsNamespace() {
47
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
48
+ def major = parsed[0].toInteger()
49
+ def minor = parsed[1].toInteger()
50
+
51
+ // Namespace support was added in 7.3.0
52
+ return (major == 7 && minor >= 3) || major >= 8
24
53
  }
25
54
 
26
55
  android {
27
- compileSdkVersion safeExtGet("compileSdkVersion", 33)
28
- buildToolsVersion safeExtGet("buildToolsVersion", '33.0.1')
29
-
30
- defaultConfig {
31
- minSdkVersion safeExtGet('minSdkVersion', 16)
32
- targetSdkVersion safeExtGet('targetSdkVersion', 26)
33
- versionCode 1
34
- versionName "1.0"
35
- buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
56
+ if (supportsNamespace()) {
57
+ namespace "org.maplibre.reactnative"
58
+
59
+ sourceSets {
60
+ main {
61
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
62
+ }
36
63
  }
64
+ }
65
+
66
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
67
+
68
+ defaultConfig {
69
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
70
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
71
+
72
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
73
+ }
37
74
 
38
- compileOptions {
39
- sourceCompatibility JavaVersion.VERSION_1_8
40
- targetCompatibility JavaVersion.VERSION_1_8
75
+ sourceSets {
76
+ main {
77
+ java.srcDirs = ['src/main/java']
78
+
79
+ if (getConfigurableExtOrDefault("locationEngine") == "default") {
80
+ java.srcDirs += 'src/main/location-engine-default'
81
+ } else if (getConfigurableExtOrDefault("locationEngine") == "google") {
82
+ java.srcDirs += 'src/main/location-engine-google'
83
+ } else {
84
+ throw new GradleException("org.maplibre.reactnative.locationEngine.locationEngine should be one of [\"default\", \"google\"]`. \"${getConfigurableExtOrDefault("locationEngine")}\" was provided.")
85
+ }
41
86
  }
87
+ }
42
88
 
43
- buildTypes {
44
- release {
45
- minifyEnabled false
46
- }
89
+ buildTypes {
90
+ release {
91
+ minifyEnabled false
47
92
  }
93
+ }
94
+
95
+ lintOptions {
96
+ disable "GradleCompatible"
97
+ }
98
+
99
+ compileOptions {
100
+ sourceCompatibility JavaVersion.VERSION_1_8
101
+ targetCompatibility JavaVersion.VERSION_1_8
102
+ }
48
103
  }
49
104
 
105
+ repositories {
106
+ mavenCentral()
107
+ google()
108
+ }
109
+
110
+ def kotlin_version = getExtOrDefault("kotlinVersion")
111
+
50
112
  dependencies {
51
- // The version of react-native is set by the React Native Gradle Plugin
52
- implementation("com.facebook.react:react-android")
53
-
54
- // MapLibre SDK
55
- implementation "org.maplibre.gl:android-sdk:11.5.0"
56
- implementation "org.maplibre.gl:android-sdk-turf:6.0.1"
57
-
58
- // Dependencies
59
- implementation "androidx.vectordrawable:vectordrawable:1.1.0"
60
- implementation "androidx.annotation:annotation:1.7.0"
61
- implementation "androidx.appcompat:appcompat:1.6.1"
62
- implementation "com.squareup.okhttp3:okhttp:${safeExtGet('okhttpVersion', '4.9.0')}"
63
- implementation "com.squareup.okhttp3:okhttp-urlconnection:${safeExtGet('okhttpVersion', '4.9.0')}"
64
-
65
- // MapLibre plugins
66
- implementation ("org.maplibre.gl:android-plugin-localization-v9:3.0.1")
67
- implementation ("org.maplibre.gl:android-plugin-annotation-v9:3.0.1")
68
- implementation ("org.maplibre.gl:android-plugin-markerview-v9:3.0.1")
113
+ // For < 0.71, this will be from the local maven repo
114
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
115
+ //noinspection GradleDynamicVersion
116
+ implementation "com.facebook.react:react-native:+"
117
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
118
+
119
+ // MapLibre Native
120
+ implementation "org.maplibre.gl:android-sdk:${getConfigurableExtOrDefault('nativeVersion')}"
121
+
122
+ // MapLibre Plugins
123
+ implementation "org.maplibre.gl:android-plugin-localization-v9:${getConfigurableExtOrDefault('pluginVersion')}"
124
+ implementation "org.maplibre.gl:android-plugin-annotation-v9:${getConfigurableExtOrDefault('pluginVersion')}"
125
+ implementation "org.maplibre.gl:android-plugin-markerview-v9:${getConfigurableExtOrDefault('pluginVersion')}"
126
+
127
+ // Dependencies
128
+ implementation "org.maplibre.gl:android-sdk-turf:${getConfigurableExtOrDefault('turfVersion')}"
129
+ implementation "com.squareup.okhttp3:okhttp:${getConfigurableExtOrDefault('okhttpVersion')}"
130
+ implementation "com.squareup.okhttp3:okhttp-urlconnection:${getConfigurableExtOrDefault('okhttpVersion')}"
131
+ implementation "androidx.vectordrawable:vectordrawable:1.1.0"
132
+ implementation "androidx.annotation:annotation:1.7.0"
133
+ implementation "androidx.appcompat:appcompat:1.6.1"
134
+
135
+ // Dependencies for Google Location Engine
136
+ if (getConfigurableExtOrDefault("locationEngine") == "google") {
137
+ implementation "com.google.android.gms:play-services-location:${getConfigurableExtOrDefault('googlePlayServicesLocationVersion')}"
138
+ }
69
139
  }
@@ -0,0 +1,15 @@
1
+ org.maplibre.reactnative.kotlinVersion=1.7.0
2
+ org.maplibre.reactnative.minSdkVersion=21
3
+ org.maplibre.reactnative.targetSdkVersion=31
4
+ org.maplibre.reactnative.compileSdkVersion=31
5
+ org.maplibre.reactnative.ndkVersion=21.4.7075529
6
+
7
+ # MapLibre React Native
8
+ org.maplibre.reactnative.nativeVersion=11.8.0
9
+ org.maplibre.reactnative.pluginVersion=3.0.2
10
+ org.maplibre.reactnative.turfVersion=6.0.1
11
+ org.maplibre.reactnative.okhttpVersion=4.9.0
12
+ # Available values: default, google
13
+ org.maplibre.reactnative.locationEngine=default
14
+ # Only applied if locationEngine=google
15
+ org.maplibre.reactnative.googlePlayServicesLocationVersion=21.3.0
@@ -1,4 +1,6 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.maplibre.reactnative">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="org.maplibre.reactnative">
3
+
2
4
  <uses-permission android:name="android.permission.INTERNET" />
3
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
5
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
4
6
  </manifest>
@@ -0,0 +1,5 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5
+ </manifest>
@@ -52,11 +52,6 @@ public class MLRNPackage implements ReactPackage {
52
52
  return modules;
53
53
  }
54
54
 
55
- @Deprecated
56
- public List<Class<? extends JavaScriptModule>> createJSModules() {
57
- return Collections.emptyList();
58
- }
59
-
60
55
  @Override
61
56
  public List<ViewManager> createViewManagers(ReactApplicationContext reactApplicationContext) {
62
57
  List<ViewManager> managers = new ArrayList<>();
@@ -2,6 +2,7 @@ package org.maplibre.reactnative.components.camera;
2
2
 
3
3
  import android.content.Context;
4
4
  import android.location.Location;
5
+ import android.util.Log;
5
6
 
6
7
  import org.maplibre.android.camera.CameraPosition;
7
8
  import org.maplibre.android.camera.CameraUpdate;
@@ -11,13 +12,9 @@ import org.maplibre.android.geometry.LatLngBounds;
11
12
  import org.maplibre.android.geometry.VisibleRegion;
12
13
  import org.maplibre.android.location.OnCameraTrackingChangedListener;
13
14
  import org.maplibre.android.location.modes.CameraMode;
14
- import org.maplibre.android.location.modes.RenderMode;
15
15
  import org.maplibre.android.maps.MapLibreMap;
16
16
  import org.maplibre.android.maps.Style;
17
- import org.maplibre.android.location.LocationComponent;
18
- import org.maplibre.android.location.LocationComponentOptions;
19
- import org.maplibre.android.location.LocationComponentActivationOptions;
20
- // import org.maplibre.android.plugins.locationlayer.LocationLayerPlugin;
17
+
21
18
  import org.maplibre.reactnative.components.AbstractMapFeature;
22
19
  import org.maplibre.reactnative.components.location.LocationComponentManager;
23
20
  import org.maplibre.reactnative.components.mapview.MLRNMapView;
@@ -31,8 +28,6 @@ import org.maplibre.reactnative.location.UserTrackingMode;
31
28
  import org.maplibre.reactnative.location.UserTrackingState;
32
29
  import org.maplibre.reactnative.utils.GeoJSONUtils;
33
30
 
34
- import org.maplibre.reactnative.R;
35
-
36
31
  import org.maplibre.reactnative.events.constants.EventTypes;
37
32
 
38
33
  import com.facebook.react.bridge.WritableMap;
@@ -87,12 +82,12 @@ public class MLRNCamera extends AbstractMapFeature {
87
82
  private LocationManager.OnUserLocationChange mLocationChangeListener = new LocationManager.OnUserLocationChange() {
88
83
  @Override
89
84
  public void onLocationChange(Location nextLocation) {
90
- if (getMapboxMap() == null || mLocationComponentManager == null || !mLocationComponentManager.hasLocationComponent() || (!mFollowUserLocation)) {
91
- return;
92
- }
85
+ if (getMapboxMap() == null || mLocationComponentManager == null || !mLocationComponentManager.hasLocationComponent() || (!mFollowUserLocation)) {
86
+ return;
87
+ }
93
88
 
94
- mUserLocation.setCurrentLocation(nextLocation);
95
- sendUserLocationUpdateEvent(nextLocation);
89
+ mUserLocation.setCurrentLocation(nextLocation);
90
+ sendUserLocationUpdateEvent(nextLocation);
96
91
  }
97
92
  };
98
93
 
@@ -236,12 +231,7 @@ public class MLRNCamera extends AbstractMapFeature {
236
231
  }
237
232
  }
238
233
 
239
- return new CameraPosition.Builder()
240
- .target(center)
241
- .bearing(getDirectionForUserLocationUpdate())
242
- .tilt(mPitch)
243
- .zoom(zoomLevel)
244
- .build();
234
+ return new CameraPosition.Builder().target(center).bearing(getDirectionForUserLocationUpdate()).tilt(mPitch).zoom(zoomLevel).build();
245
235
  }
246
236
 
247
237
  private double getDirectionForUserLocationUpdate() {
@@ -260,7 +250,7 @@ public class MLRNCamera extends AbstractMapFeature {
260
250
  }
261
251
 
262
252
  private void sendUserLocationUpdateEvent(Location location) {
263
- if(location == null){
253
+ if (location == null) {
264
254
  return;
265
255
  }
266
256
  IEvent event = new MapChangeEvent(this, EventTypes.USER_LOCATION_UPDATED, makeLocationChangePayload(location));
@@ -376,37 +366,38 @@ public class MLRNCamera extends AbstractMapFeature {
376
366
  }
377
367
 
378
368
  mLocationComponentManager.update(style);
379
-
380
- if (mFollowUserLocation) {
381
- mLocationComponentManager.setCameraMode(UserTrackingMode.getCameraMode(mUserTrackingMode));
382
- }
383
369
  mLocationComponentManager.setFollowUserLocation(mFollowUserLocation);
384
370
 
385
371
  if (mFollowUserLocation) {
386
372
  mLocationComponentManager.setCameraMode(UserTrackingMode.getCameraMode(mUserTrackingMode));
387
373
  mLocationComponentManager.addOnCameraTrackingChangedListener(new OnCameraTrackingChangedListener() {
388
- @Override public void onCameraTrackingChanged(int currentMode) {
389
- int userTrackingMode = UserTrackingMode.NONE;
390
- switch (currentMode) {
391
- case CameraMode.NONE:
392
- userTrackingMode = UserTrackingMode.NONE;
393
- break;
394
- case CameraMode.TRACKING:
395
- userTrackingMode = UserTrackingMode.FOLLOW;
396
- break;
397
- case CameraMode.TRACKING_COMPASS:
398
- userTrackingMode = UserTrackingMode.FollowWithHeading;
399
- break;
400
- case CameraMode.TRACKING_GPS:
401
- userTrackingMode = UserTrackingMode.FollowWithCourse;
402
- break;
403
- default:
404
- userTrackingMode = UserTrackingMode.NONE;
405
- }
406
- updateUserTrackingMode(userTrackingMode);
407
- }
408
- @Override public void onCameraTrackingDismissed() {
374
+ @Override
375
+ public void onCameraTrackingChanged(int currentMode) {
376
+ int userTrackingMode;
377
+
378
+ switch (currentMode) {
379
+ case CameraMode.NONE:
380
+ userTrackingMode = UserTrackingMode.NONE;
381
+ break;
382
+ case CameraMode.TRACKING:
383
+ userTrackingMode = UserTrackingMode.FOLLOW;
384
+ break;
385
+ case CameraMode.TRACKING_COMPASS:
386
+ userTrackingMode = UserTrackingMode.FollowWithHeading;
387
+ break;
388
+ case CameraMode.TRACKING_GPS:
389
+ userTrackingMode = UserTrackingMode.FollowWithCourse;
390
+ break;
391
+ default:
392
+ userTrackingMode = UserTrackingMode.NONE;
409
393
  }
394
+
395
+ updateUserTrackingMode(userTrackingMode);
396
+ }
397
+
398
+ @Override
399
+ public void onCameraTrackingDismissed() {
400
+ }
410
401
  });
411
402
  } else {
412
403
  mLocationComponentManager.setCameraMode(CameraMode.NONE);
@@ -429,10 +420,7 @@ public class MLRNCamera extends AbstractMapFeature {
429
420
  }
430
421
 
431
422
  private CameraPosition buildCamera(CameraPosition previousPosition, boolean shouldUpdateTarget) {
432
- CameraPosition.Builder builder = new CameraPosition.Builder(previousPosition)
433
- .bearing(mHeading)
434
- .tilt(mPitch)
435
- .zoom(mZoomLevel);
423
+ CameraPosition.Builder builder = new CameraPosition.Builder(previousPosition).bearing(mHeading).tilt(mPitch).zoom(mZoomLevel);
436
424
 
437
425
  if (shouldUpdateTarget) {
438
426
  builder.target(GeoJSONUtils.toLatLng(mCenterCoordinate));
@@ -507,6 +495,7 @@ public class MLRNCamera extends AbstractMapFeature {
507
495
  /**
508
496
  * Create a payload of the location data per the web api geolocation spec
509
497
  * https://dev.w3.org/geo/api/spec-source.html#position
498
+ *
510
499
  * @return
511
500
  */
512
501
  private WritableMap makeLocationChangePayload(Location location) {
@@ -46,6 +46,8 @@ public class LocationComponentManager {
46
46
 
47
47
  private boolean mShowingUserLocation = false;
48
48
 
49
+ private OnCameraTrackingChangedListener mOnCameraTrackingChangedListener = null;
50
+
49
51
  public void showUserLocation(boolean showUserLocation) {
50
52
  mShowUserLocation = showUserLocation;
51
53
  stateChanged();
@@ -68,16 +70,21 @@ public class LocationComponentManager {
68
70
  }
69
71
 
70
72
  public void setPreferredFramesPerSecond(int preferredFramesPerSecond) {
71
- if(mLocationComponent == null || preferredFramesPerSecond <= 0) {
73
+ if (mLocationComponent == null || preferredFramesPerSecond <= 0) {
72
74
  return;
73
- }
75
+ }
74
76
 
75
77
  mLocationComponent.setMaxAnimationFps(preferredFramesPerSecond);
76
78
  }
77
79
 
78
-
79
80
  public void addOnCameraTrackingChangedListener(OnCameraTrackingChangedListener onCameraTrackingChangedListener) {
80
- mLocationComponent.addOnCameraTrackingChangedListener(onCameraTrackingChangedListener);
81
+ if (mOnCameraTrackingChangedListener != null) {
82
+ mLocationComponent.removeOnCameraTrackingChangedListener(mOnCameraTrackingChangedListener);
83
+ }
84
+
85
+ mOnCameraTrackingChangedListener = onCameraTrackingChangedListener;
86
+
87
+ mLocationComponent.addOnCameraTrackingChangedListener(mOnCameraTrackingChangedListener);
81
88
  }
82
89
 
83
90
  @SuppressLint("MissingPermission")
@@ -111,7 +118,7 @@ public class LocationComponentManager {
111
118
  public void update(boolean displayUserLocation, @NonNull Style style) {
112
119
  Integer tintColor = mMapView.getTintColor();
113
120
 
114
- if (mLocationComponent == null || tintColor != null ) {
121
+ if (mLocationComponent == null || tintColor != null) {
115
122
  mLocationComponent = mMap.getLocationComponent();
116
123
 
117
124
  LocationComponentActivationOptions locationComponentActivationOptions = LocationComponentActivationOptions
@@ -148,10 +155,10 @@ public class LocationComponentManager {
148
155
  .accuracyAlpha(0.0f);
149
156
  } else if (tintColor != null) {
150
157
  builder = builder
151
- .enableStaleState(false)
152
- .bearingTintColor(tintColor)
153
- .foregroundTintColor(tintColor)
154
- .accuracyColor(tintColor);
158
+ .enableStaleState(false)
159
+ .bearingTintColor(tintColor)
160
+ .foregroundTintColor(tintColor)
161
+ .accuracyColor(tintColor);
155
162
  }
156
163
  return builder.build();
157
164
  }
@@ -8,7 +8,6 @@ import android.graphics.RectF;
8
8
  import android.location.Location;
9
9
  import android.os.Handler;
10
10
  import androidx.annotation.NonNull;
11
- import androidx.annotation.UiThread;
12
11
 
13
12
  import android.util.DisplayMetrics;
14
13
  import android.util.Pair;
@@ -53,7 +52,6 @@ import org.maplibre.reactnative.R;
53
52
  import org.maplibre.reactnative.components.AbstractMapFeature;
54
53
  import org.maplibre.reactnative.components.annotation.MLRNPointAnnotation;
55
54
  import org.maplibre.reactnative.components.annotation.MLRNMarkerView;
56
- import org.maplibre.reactnative.components.annotation.MarkerView;
57
55
  import org.maplibre.reactnative.components.annotation.MarkerViewManager;
58
56
  import org.maplibre.reactnative.components.camera.MLRNCamera;
59
57
  import org.maplibre.reactnative.components.images.MLRNImages;
@@ -69,6 +67,7 @@ import org.maplibre.reactnative.events.IEvent;
69
67
  import org.maplibre.reactnative.events.MapChangeEvent;
70
68
  import org.maplibre.reactnative.events.MapClickEvent;
71
69
  import org.maplibre.reactnative.events.constants.EventTypes;
70
+ import org.maplibre.reactnative.modules.MLRNModule;
72
71
  import org.maplibre.reactnative.utils.BitmapUtils;
73
72
  import org.maplibre.reactnative.utils.GeoJSONUtils;
74
73
  import org.maplibre.reactnative.utils.GeoViewport;
@@ -85,7 +84,6 @@ import org.json.*;
85
84
  import javax.annotation.Nullable;
86
85
 
87
86
  import static org.maplibre.android.style.layers.PropertyFactory.visibility;
88
- import static org.maplibre.reactnative.modules.MLRNOfflineModule.DEFAULT_STYLE_URL;
89
87
 
90
88
  @SuppressWarnings({ "MissingPermission" })
91
89
  public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibreMap.OnMapClickListener,
@@ -117,7 +115,7 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
117
115
 
118
116
  private LocalizationPlugin mLocalizationPlugin;
119
117
 
120
- private String mStyleURL;
118
+ private String mMapStyle;
121
119
 
122
120
  private Integer mPreferredFramesPerSecond;
123
121
  private boolean mLocalizeLabels;
@@ -171,7 +169,7 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
171
169
 
172
170
  mHandler = new Handler();
173
171
 
174
- mStyleURL = DEFAULT_STYLE_URL;
172
+ mMapStyle = MLRNModule.DEFAULT_STYLE_URL;
175
173
 
176
174
  setLifecycleListeners();
177
175
 
@@ -436,10 +434,10 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
436
434
  public void onMapReady(final MapLibreMap mapboxMap) {
437
435
  mMap = mapboxMap;
438
436
 
439
- if (isJSONValid(mStyleURL)) {
440
- mMap.setStyle(new Style.Builder().fromJson(mStyleURL));
437
+ if (isJSONValid(mMapStyle)) {
438
+ mMap.setStyle(new Style.Builder().fromJson(mMapStyle));
441
439
  } else {
442
- mMap.setStyle(new Style.Builder().fromUri(mStyleURL));
440
+ mMap.setStyle(new Style.Builder().fromUri(mMapStyle));
443
441
  }
444
442
 
445
443
  reflow();
@@ -776,21 +774,21 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
776
774
  return mContext.getResources().getDisplayMetrics().density;
777
775
  }
778
776
 
779
- public void setReactStyleURL(String styleURL) {
780
- mStyleURL = styleURL;
777
+ public void setReactMapStyle(String mapStyle) {
778
+ mMapStyle = mapStyle;
781
779
 
782
780
  if (mMap != null) {
783
781
  removeAllSourcesFromMap();
784
782
 
785
- if (isJSONValid(mStyleURL)) {
786
- mMap.setStyle(new Style.Builder().fromJson(mStyleURL), new Style.OnStyleLoaded() {
783
+ if (isJSONValid(mMapStyle)) {
784
+ mMap.setStyle(new Style.Builder().fromJson(mMapStyle), new Style.OnStyleLoaded() {
787
785
  @Override
788
786
  public void onStyleLoaded(@NonNull Style style) {
789
787
  addAllSourcesToMap();
790
788
  }
791
789
  });
792
790
  } else {
793
- mMap.setStyle(styleURL, new Style.OnStyleLoaded() {
791
+ mMap.setStyle(mapStyle, new Style.OnStyleLoaded() {
794
792
  @Override
795
793
  public void onStyleLoaded(@NonNull Style style) {
796
794
  addAllSourcesToMap();