@maplibre/maplibre-react-native 10.0.0-beta.12 → 10.0.0-beta.14

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 (447) hide show
  1. package/README.md +11 -13
  2. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.java +37 -48
  3. package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +16 -9
  4. package/app.plugin.js +1 -1
  5. package/ios/MLRN/MLRNCamera.m +6 -7
  6. package/lib/commonjs/MapLibreRN.js +77 -59
  7. package/lib/commonjs/MapLibreRN.js.map +1 -1
  8. package/lib/commonjs/components/Annotation.js +7 -9
  9. package/lib/commonjs/components/Annotation.js.map +1 -1
  10. package/lib/commonjs/components/BackgroundLayer.js +6 -8
  11. package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
  12. package/lib/commonjs/components/Callout.js +2 -2
  13. package/lib/commonjs/components/Callout.js.map +1 -1
  14. package/lib/commonjs/components/Camera.js +111 -63
  15. package/lib/commonjs/components/Camera.js.map +1 -1
  16. package/lib/commonjs/components/CircleLayer.js +6 -8
  17. package/lib/commonjs/components/CircleLayer.js.map +1 -1
  18. package/lib/commonjs/components/FillExtrusionLayer.js +6 -8
  19. package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
  20. package/lib/commonjs/components/FillLayer.js +6 -8
  21. package/lib/commonjs/components/FillLayer.js.map +1 -1
  22. package/lib/commonjs/components/HeadingIndicator.js +4 -4
  23. package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
  24. package/lib/commonjs/components/HeatmapLayer.js +6 -8
  25. package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
  26. package/lib/commonjs/components/ImageSource.js +4 -5
  27. package/lib/commonjs/components/ImageSource.js.map +1 -1
  28. package/lib/commonjs/components/Images.js +2 -2
  29. package/lib/commonjs/components/Images.js.map +1 -1
  30. package/lib/commonjs/components/Light.js +4 -6
  31. package/lib/commonjs/components/Light.js.map +1 -1
  32. package/lib/commonjs/components/LineLayer.js +6 -8
  33. package/lib/commonjs/components/LineLayer.js.map +1 -1
  34. package/lib/commonjs/components/MapView.js +44 -45
  35. package/lib/commonjs/components/MapView.js.map +1 -1
  36. package/lib/commonjs/components/MarkerView.js +4 -5
  37. package/lib/commonjs/components/MarkerView.js.map +1 -1
  38. package/lib/commonjs/components/NativeUserLocation.js +2 -2
  39. package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
  40. package/lib/commonjs/components/PointAnnotation.js +4 -6
  41. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  42. package/lib/commonjs/components/RasterLayer.js +6 -8
  43. package/lib/commonjs/components/RasterLayer.js.map +1 -1
  44. package/lib/commonjs/components/RasterSource.js +8 -10
  45. package/lib/commonjs/components/RasterSource.js.map +1 -1
  46. package/lib/commonjs/components/ShapeSource.js +6 -8
  47. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  48. package/lib/commonjs/components/SymbolLayer.js +6 -7
  49. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  50. package/lib/commonjs/components/UserLocation.js +20 -22
  51. package/lib/commonjs/components/UserLocation.js.map +1 -1
  52. package/lib/commonjs/components/VectorSource.js +8 -10
  53. package/lib/commonjs/components/VectorSource.js.map +1 -1
  54. package/lib/commonjs/hooks/useAbstractLayer.js +1 -1
  55. package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -1
  56. package/lib/commonjs/hooks/useAbstractSource.js +1 -1
  57. package/lib/commonjs/hooks/useAbstractSource.js.map +1 -1
  58. package/lib/commonjs/hooks/useNativeBridge.js +2 -2
  59. package/lib/commonjs/hooks/useNativeBridge.js.map +1 -1
  60. package/lib/commonjs/hooks/useOnce.js +2 -2
  61. package/lib/commonjs/hooks/useOnce.js.map +1 -1
  62. package/lib/commonjs/index.js +3 -0
  63. package/lib/commonjs/index.js.map +1 -1
  64. package/lib/commonjs/modules/location/{locationManager.js → LocationManager.js} +10 -10
  65. package/lib/commonjs/modules/location/LocationManager.js.map +1 -0
  66. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -2
  67. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  68. package/lib/commonjs/modules/offline/{offlineManager.js → OfflineManager.js} +34 -36
  69. package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -0
  70. package/lib/commonjs/modules/offline/OfflinePack.js +2 -2
  71. package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
  72. package/lib/commonjs/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +12 -14
  73. package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -0
  74. package/lib/commonjs/modules/snapshot/SnapshotOptions.js +3 -4
  75. package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
  76. package/lib/commonjs/plugin/withMapLibre.js +149 -0
  77. package/lib/commonjs/plugin/withMapLibre.js.map +1 -0
  78. package/lib/commonjs/utils/BridgeValue.js +2 -2
  79. package/lib/commonjs/utils/BridgeValue.js.map +1 -1
  80. package/lib/commonjs/utils/Logger.js +2 -2
  81. package/lib/commonjs/utils/Logger.js.map +1 -1
  82. package/lib/commonjs/utils/StyleValue.js +2 -3
  83. package/lib/commonjs/utils/StyleValue.js.map +1 -1
  84. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
  85. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
  86. package/lib/commonjs/utils/animated/Animated.js +29 -31
  87. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  88. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +4 -5
  89. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
  90. package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +2 -2
  91. package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
  92. package/lib/commonjs/utils/animated/AnimatedPoint.js +1 -2
  93. package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -1
  94. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +4 -4
  95. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
  96. package/lib/commonjs/utils/animated/AnimatedShape.js +2 -2
  97. package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -1
  98. package/lib/module/MapLibreRN.js +40 -28
  99. package/lib/module/MapLibreRN.js.map +1 -1
  100. package/lib/module/components/Annotation.js +5 -6
  101. package/lib/module/components/Annotation.js.map +1 -1
  102. package/lib/module/components/BackgroundLayer.js +4 -6
  103. package/lib/module/components/BackgroundLayer.js.map +1 -1
  104. package/lib/module/components/Callout.js +2 -3
  105. package/lib/module/components/Callout.js.map +1 -1
  106. package/lib/module/components/Camera.js +112 -64
  107. package/lib/module/components/Camera.js.map +1 -1
  108. package/lib/module/components/CircleLayer.js +4 -6
  109. package/lib/module/components/CircleLayer.js.map +1 -1
  110. package/lib/module/components/FillExtrusionLayer.js +4 -6
  111. package/lib/module/components/FillExtrusionLayer.js.map +1 -1
  112. package/lib/module/components/FillLayer.js +4 -6
  113. package/lib/module/components/FillLayer.js.map +1 -1
  114. package/lib/module/components/HeadingIndicator.js +2 -3
  115. package/lib/module/components/HeadingIndicator.js.map +1 -1
  116. package/lib/module/components/HeatmapLayer.js +4 -6
  117. package/lib/module/components/HeatmapLayer.js.map +1 -1
  118. package/lib/module/components/ImageSource.js +2 -3
  119. package/lib/module/components/ImageSource.js.map +1 -1
  120. package/lib/module/components/Images.js +2 -3
  121. package/lib/module/components/Images.js.map +1 -1
  122. package/lib/module/components/Light.js +2 -4
  123. package/lib/module/components/Light.js.map +1 -1
  124. package/lib/module/components/LineLayer.js +4 -6
  125. package/lib/module/components/LineLayer.js.map +1 -1
  126. package/lib/module/components/MapView.js +40 -41
  127. package/lib/module/components/MapView.js.map +1 -1
  128. package/lib/module/components/MarkerView.js +2 -3
  129. package/lib/module/components/MarkerView.js.map +1 -1
  130. package/lib/module/components/NativeUserLocation.js +1 -2
  131. package/lib/module/components/NativeUserLocation.js.map +1 -1
  132. package/lib/module/components/PointAnnotation.js +2 -3
  133. package/lib/module/components/PointAnnotation.js.map +1 -1
  134. package/lib/module/components/RasterLayer.js +4 -6
  135. package/lib/module/components/RasterLayer.js.map +1 -1
  136. package/lib/module/components/RasterSource.js +5 -7
  137. package/lib/module/components/RasterSource.js.map +1 -1
  138. package/lib/module/components/ShapeSource.js +4 -5
  139. package/lib/module/components/ShapeSource.js.map +1 -1
  140. package/lib/module/components/SymbolLayer.js +4 -5
  141. package/lib/module/components/SymbolLayer.js.map +1 -1
  142. package/lib/module/components/UserLocation.js +13 -14
  143. package/lib/module/components/UserLocation.js.map +1 -1
  144. package/lib/module/components/VectorSource.js +5 -6
  145. package/lib/module/components/VectorSource.js.map +1 -1
  146. package/lib/module/hooks/useAbstractLayer.js +1 -1
  147. package/lib/module/hooks/useAbstractLayer.js.map +1 -1
  148. package/lib/module/hooks/useAbstractSource.js +1 -1
  149. package/lib/module/hooks/useAbstractSource.js.map +1 -1
  150. package/lib/module/hooks/useNativeBridge.js +1 -2
  151. package/lib/module/hooks/useNativeBridge.js.map +1 -1
  152. package/lib/module/hooks/useNativeRef.js.map +1 -1
  153. package/lib/module/hooks/useOnce.js +1 -2
  154. package/lib/module/hooks/useOnce.js.map +1 -1
  155. package/lib/module/index.js +4 -0
  156. package/lib/module/index.js.map +1 -1
  157. package/lib/module/modules/location/{locationManager.js → LocationManager.js} +10 -9
  158. package/lib/module/modules/location/LocationManager.js.map +1 -0
  159. package/lib/module/modules/offline/OfflineCreatePackOptions.js +1 -2
  160. package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  161. package/lib/module/modules/offline/{offlineManager.js → OfflineManager.js} +30 -30
  162. package/lib/module/modules/offline/OfflineManager.js.map +1 -0
  163. package/lib/module/modules/offline/OfflinePack.js +1 -2
  164. package/lib/module/modules/offline/OfflinePack.js.map +1 -1
  165. package/lib/module/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +10 -10
  166. package/lib/module/modules/snapshot/{snapshotManager.js.map → SnapshotManager.js.map} +1 -1
  167. package/lib/module/modules/snapshot/SnapshotOptions.js +2 -3
  168. package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
  169. package/lib/module/plugin/withMapLibre.js +140 -0
  170. package/lib/module/plugin/withMapLibre.js.map +1 -0
  171. package/lib/module/utils/BridgeValue.js +1 -1
  172. package/lib/module/utils/BridgeValue.js.map +1 -1
  173. package/lib/module/utils/Logger.js +1 -2
  174. package/lib/module/utils/Logger.js.map +1 -1
  175. package/lib/module/utils/StyleValue.js +1 -1
  176. package/lib/module/utils/StyleValue.js.map +1 -1
  177. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +1 -2
  178. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
  179. package/lib/module/utils/animated/Animated.js +14 -15
  180. package/lib/module/utils/animated/Animated.js.map +1 -1
  181. package/lib/module/utils/animated/AnimatedCoordinatesArray.js +2 -3
  182. package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
  183. package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -1
  184. package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
  185. package/lib/module/utils/animated/AnimatedPoint.js +0 -1
  186. package/lib/module/utils/animated/AnimatedPoint.js.map +1 -1
  187. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +2 -2
  188. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
  189. package/lib/module/utils/animated/AnimatedShape.js +1 -2
  190. package/lib/module/utils/animated/AnimatedShape.js.map +1 -1
  191. package/lib/typescript/commonjs/src/MLRNModule.d.ts +1 -1
  192. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +41 -29
  194. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  195. package/lib/typescript/commonjs/src/components/Annotation.d.ts +4 -4
  196. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  197. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +1 -3
  198. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
  199. package/lib/typescript/commonjs/src/components/Callout.d.ts +3 -4
  200. package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -1
  201. package/lib/typescript/commonjs/src/components/Camera.d.ts +4 -4
  202. package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -1
  203. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +1 -3
  204. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
  205. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +1 -3
  206. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/src/components/FillLayer.d.ts +1 -3
  208. package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +2 -3
  210. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -1
  211. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +1 -3
  212. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
  213. package/lib/typescript/commonjs/src/components/ImageSource.d.ts +3 -4
  214. package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -1
  215. package/lib/typescript/commonjs/src/components/Images.d.ts +4 -4
  216. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  217. package/lib/typescript/commonjs/src/components/Light.d.ts +2 -3
  218. package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
  219. package/lib/typescript/commonjs/src/components/LineLayer.d.ts +1 -3
  220. package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/src/components/MapView.d.ts +4 -4
  222. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  223. package/lib/typescript/commonjs/src/components/MarkerView.d.ts +3 -3
  224. package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -1
  225. package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +2 -3
  226. package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -1
  227. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +4 -3
  228. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
  229. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +1 -3
  230. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/src/components/RasterSource.d.ts +4 -4
  232. package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +4 -4
  234. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +1 -2
  236. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
  237. package/lib/typescript/commonjs/src/components/UserLocation.d.ts +6 -6
  238. package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
  239. package/lib/typescript/commonjs/src/components/VectorSource.d.ts +4 -3
  240. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +3 -2
  242. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +4 -3
  244. package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +5 -5
  246. package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +2 -2
  248. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +1 -2
  250. package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  252. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +33 -0
  254. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -0
  255. package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
  256. package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
  258. package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
  259. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +2 -3
  260. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
  261. package/lib/typescript/{module/src/modules/snapshot/snapshotManager.d.ts → commonjs/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
  262. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
  263. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
  264. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
  265. package/{plugin/build → lib/typescript/commonjs/src/plugin}/withMapLibre.d.ts +1 -0
  266. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -0
  267. package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts +1 -1
  268. package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/src/utils/Logger.d.ts +2 -2
  270. package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  273. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +19 -19
  275. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
  277. package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
  279. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -1
  281. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
  283. package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +5 -5
  285. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  286. package/lib/typescript/module/src/MLRNModule.d.ts +1 -1
  287. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  288. package/lib/typescript/module/src/MapLibreRN.d.ts +41 -29
  289. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  290. package/lib/typescript/module/src/components/Annotation.d.ts +4 -4
  291. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  292. package/lib/typescript/module/src/components/BackgroundLayer.d.ts +1 -3
  293. package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
  294. package/lib/typescript/module/src/components/Callout.d.ts +3 -4
  295. package/lib/typescript/module/src/components/Callout.d.ts.map +1 -1
  296. package/lib/typescript/module/src/components/Camera.d.ts +4 -4
  297. package/lib/typescript/module/src/components/Camera.d.ts.map +1 -1
  298. package/lib/typescript/module/src/components/CircleLayer.d.ts +1 -3
  299. package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
  300. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +1 -3
  301. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
  302. package/lib/typescript/module/src/components/FillLayer.d.ts +1 -3
  303. package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
  304. package/lib/typescript/module/src/components/HeadingIndicator.d.ts +2 -3
  305. package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -1
  306. package/lib/typescript/module/src/components/HeatmapLayer.d.ts +1 -3
  307. package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
  308. package/lib/typescript/module/src/components/ImageSource.d.ts +3 -4
  309. package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -1
  310. package/lib/typescript/module/src/components/Images.d.ts +4 -4
  311. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  312. package/lib/typescript/module/src/components/Light.d.ts +2 -3
  313. package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
  314. package/lib/typescript/module/src/components/LineLayer.d.ts +1 -3
  315. package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
  316. package/lib/typescript/module/src/components/MapView.d.ts +4 -4
  317. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  318. package/lib/typescript/module/src/components/MarkerView.d.ts +3 -3
  319. package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -1
  320. package/lib/typescript/module/src/components/NativeUserLocation.d.ts +2 -3
  321. package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -1
  322. package/lib/typescript/module/src/components/PointAnnotation.d.ts +4 -3
  323. package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
  324. package/lib/typescript/module/src/components/RasterLayer.d.ts +1 -3
  325. package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
  326. package/lib/typescript/module/src/components/RasterSource.d.ts +4 -4
  327. package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -1
  328. package/lib/typescript/module/src/components/ShapeSource.d.ts +4 -4
  329. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  330. package/lib/typescript/module/src/components/SymbolLayer.d.ts +1 -2
  331. package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
  332. package/lib/typescript/module/src/components/UserLocation.d.ts +6 -6
  333. package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
  334. package/lib/typescript/module/src/components/VectorSource.d.ts +4 -3
  335. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  336. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +3 -2
  337. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
  338. package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +4 -3
  339. package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -1
  340. package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +5 -5
  341. package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -1
  342. package/lib/typescript/module/src/hooks/useNativeRef.d.ts +2 -2
  343. package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -1
  344. package/lib/typescript/module/src/hooks/useOnce.d.ts +1 -2
  345. package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -1
  346. package/lib/typescript/module/src/index.d.ts +3 -0
  347. package/lib/typescript/module/src/index.d.ts.map +1 -1
  348. package/lib/typescript/module/src/modules/location/LocationManager.d.ts +33 -0
  349. package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -0
  350. package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
  351. package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
  352. package/lib/typescript/module/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
  353. package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
  354. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +2 -3
  355. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
  356. package/lib/typescript/{commonjs/src/modules/snapshot/snapshotManager.d.ts → module/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
  357. package/lib/typescript/module/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
  358. package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
  359. package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
  360. package/lib/typescript/module/src/plugin/withMapLibre.d.ts +13 -0
  361. package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -0
  362. package/lib/typescript/module/src/utils/BridgeValue.d.ts +1 -1
  363. package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -1
  364. package/lib/typescript/module/src/utils/Logger.d.ts +2 -2
  365. package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -1
  366. package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
  367. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  368. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  369. package/lib/typescript/module/src/utils/animated/Animated.d.ts +19 -19
  370. package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
  371. package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
  372. package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
  373. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
  374. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  375. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -1
  376. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  377. package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
  378. package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
  379. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +5 -5
  380. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  381. package/package.json +8 -10
  382. package/src/MLRNModule.ts +1 -1
  383. package/src/MapLibreRN.ts +46 -30
  384. package/src/components/Annotation.tsx +9 -11
  385. package/src/components/BackgroundLayer.tsx +5 -7
  386. package/src/components/Callout.tsx +8 -10
  387. package/src/components/Camera.tsx +154 -78
  388. package/src/components/CircleLayer.tsx +5 -7
  389. package/src/components/FillExtrusionLayer.tsx +5 -7
  390. package/src/components/FillLayer.tsx +5 -7
  391. package/src/components/HeadingIndicator.tsx +2 -6
  392. package/src/components/HeatmapLayer.tsx +5 -7
  393. package/src/components/ImageSource.tsx +4 -6
  394. package/src/components/Images.tsx +6 -8
  395. package/src/components/Light.tsx +3 -5
  396. package/src/components/LineLayer.tsx +5 -7
  397. package/src/components/MapView.tsx +42 -43
  398. package/src/components/MarkerView.tsx +4 -6
  399. package/src/components/NativeUserLocation.tsx +1 -4
  400. package/src/components/PointAnnotation.tsx +7 -6
  401. package/src/components/RasterLayer.tsx +5 -7
  402. package/src/components/RasterSource.tsx +7 -9
  403. package/src/components/ShapeSource.tsx +6 -8
  404. package/src/components/SymbolLayer.tsx +5 -6
  405. package/src/components/UserLocation.tsx +18 -19
  406. package/src/components/VectorSource.tsx +7 -9
  407. package/src/hooks/useAbstractLayer.ts +5 -5
  408. package/src/hooks/useAbstractSource.ts +6 -6
  409. package/src/hooks/useNativeBridge.ts +9 -6
  410. package/src/hooks/useNativeRef.ts +2 -2
  411. package/src/hooks/useOnce.ts +3 -3
  412. package/src/index.ts +3 -0
  413. package/src/modules/location/{locationManager.ts → LocationManager.ts} +16 -15
  414. package/src/modules/offline/OfflineCreatePackOptions.ts +1 -3
  415. package/src/modules/offline/{offlineManager.ts → OfflineManager.ts} +30 -29
  416. package/src/modules/offline/OfflinePack.ts +2 -4
  417. package/src/modules/snapshot/{snapshotManager.ts → SnapshotManager.ts} +9 -9
  418. package/src/modules/snapshot/SnapshotOptions.ts +2 -4
  419. package/src/plugin/withMapLibre.ts +181 -0
  420. package/src/utils/BridgeValue.ts +1 -1
  421. package/src/utils/Logger.ts +1 -3
  422. package/src/utils/StyleValue.ts +2 -1
  423. package/src/utils/animated/AbstractAnimatedCoordinates.ts +3 -3
  424. package/src/utils/animated/Animated.ts +23 -21
  425. package/src/utils/animated/AnimatedCoordinatesArray.ts +3 -4
  426. package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +1 -1
  427. package/src/utils/animated/AnimatedPoint.ts +0 -2
  428. package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +3 -2
  429. package/src/utils/animated/AnimatedShape.ts +4 -6
  430. package/lib/commonjs/modules/location/locationManager.js.map +0 -1
  431. package/lib/commonjs/modules/offline/offlineManager.js.map +0 -1
  432. package/lib/commonjs/modules/snapshot/snapshotManager.js.map +0 -1
  433. package/lib/module/modules/location/locationManager.js.map +0 -1
  434. package/lib/module/modules/offline/offlineManager.js.map +0 -1
  435. package/lib/typescript/commonjs/jest.config.d.ts +0 -2
  436. package/lib/typescript/commonjs/jest.config.d.ts.map +0 -1
  437. package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts +0 -64
  438. package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +0 -1
  439. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +0 -1
  440. package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
  441. package/lib/typescript/module/jest.config.d.ts +0 -2
  442. package/lib/typescript/module/jest.config.d.ts.map +0 -1
  443. package/lib/typescript/module/src/modules/location/locationManager.d.ts +0 -64
  444. package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +0 -1
  445. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +0 -1
  446. package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
  447. package/plugin/build/withMapLibre.js +0 -148
@@ -1,12 +1,19 @@
1
1
  import { point } from "@turf/helpers";
2
- import { forwardRef, memo, useImperativeHandle, useMemo } from "react";
3
- import { requireNativeComponent, type ViewProps } from "react-native";
2
+ import {
3
+ forwardRef,
4
+ memo,
5
+ useEffect,
6
+ useImperativeHandle,
7
+ useMemo,
8
+ useState,
9
+ } from "react";
10
+ import { Platform, requireNativeComponent, type ViewProps } from "react-native";
4
11
 
5
12
  import { CameraModes } from "../MLRNModule";
6
13
  import { useNativeRef } from "../hooks/useNativeRef";
7
14
  import { type BaseProps } from "../types/BaseProps";
8
15
  import { CameraMode } from "../types/CameraMode";
9
- import type { MapLibreRNEvent } from "../types/MapLibreRNEvent";
16
+ import { type MapLibreRNEvent } from "../types/MapLibreRNEvent";
10
17
  import { makeNativeBounds } from "../utils/makeNativeBounds";
11
18
 
12
19
  export const NATIVE_MODULE_NAME = "MLRNCamera";
@@ -47,54 +54,62 @@ function makeNativeCameraStop(stop?: CameraStop): NativeCameraStop | undefined {
47
54
  return undefined;
48
55
  }
49
56
 
50
- const nativeStop: NativeCameraStop = {};
57
+ const newNativeStop: NativeCameraStop = {};
51
58
 
52
59
  if (stop.animationDuration !== undefined) {
53
- nativeStop.duration = stop.animationDuration;
60
+ newNativeStop.duration = stop.animationDuration;
54
61
  }
55
62
  if (stop.animationMode !== undefined) {
56
- nativeStop.mode = getNativeCameraMode(stop.animationMode);
63
+ newNativeStop.mode = getNativeCameraMode(stop.animationMode);
57
64
  }
58
65
  if (stop.centerCoordinate) {
59
- nativeStop.centerCoordinate = JSON.stringify(point(stop.centerCoordinate));
66
+ newNativeStop.centerCoordinate = JSON.stringify(
67
+ point(stop.centerCoordinate),
68
+ );
60
69
  }
61
70
  if (stop.heading !== undefined) {
62
- nativeStop.heading = stop.heading;
71
+ newNativeStop.heading = stop.heading;
63
72
  }
64
73
  if (stop.pitch !== undefined) {
65
- nativeStop.pitch = stop.pitch;
74
+ newNativeStop.pitch = stop.pitch;
66
75
  }
67
76
  if (stop.zoomLevel !== undefined) {
68
- nativeStop.zoom = stop.zoomLevel;
77
+ newNativeStop.zoom = stop.zoomLevel;
69
78
  }
70
79
 
71
80
  if (stop.bounds && stop.bounds.ne && stop.bounds.sw) {
72
81
  const { ne, sw } = stop.bounds;
73
- nativeStop.bounds = makeNativeBounds(ne, sw);
82
+ newNativeStop.bounds = makeNativeBounds(ne, sw);
74
83
  }
75
84
 
76
85
  const paddingTop = stop.padding?.paddingTop ?? stop.bounds?.paddingTop;
77
86
  if (paddingTop !== undefined) {
78
- nativeStop.paddingTop = paddingTop;
87
+ newNativeStop.paddingTop = paddingTop;
79
88
  }
80
89
 
81
90
  const paddingRight = stop.padding?.paddingRight ?? stop.bounds?.paddingRight;
82
91
  if (paddingRight !== undefined) {
83
- nativeStop.paddingRight = paddingRight;
92
+ newNativeStop.paddingRight = paddingRight;
84
93
  }
85
94
 
86
95
  const paddingBottom =
87
96
  stop.padding?.paddingBottom ?? stop.bounds?.paddingBottom;
88
97
  if (paddingBottom !== undefined) {
89
- nativeStop.paddingBottom = paddingBottom;
98
+ newNativeStop.paddingBottom = paddingBottom;
90
99
  }
91
100
 
92
101
  const paddingLeft = stop.padding?.paddingLeft ?? stop.bounds?.paddingLeft;
93
102
  if (paddingLeft !== undefined) {
94
- nativeStop.paddingLeft = paddingLeft;
103
+ newNativeStop.paddingLeft = paddingLeft;
95
104
  }
96
105
 
97
- return nativeStop;
106
+ if (newNativeStop.centerCoordinate && newNativeStop.bounds) {
107
+ throw new Error(
108
+ "Create a camera stop with bounds and centerCoordinate – this is not possible.",
109
+ );
110
+ }
111
+
112
+ return newNativeStop;
98
113
  }
99
114
 
100
115
  export interface CameraRef {
@@ -211,7 +226,7 @@ export interface CameraProps extends BaseProps, CameraStop {
211
226
  followUserLocation?: boolean;
212
227
 
213
228
  /**
214
- * The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the `MapLibreGL.UserTrackingMode` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](/packages/examples/src/examples/Camera/SetUserTrackingMode.js)
229
+ * The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the `UserTrackingMode` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](/packages/examples/src/examples/Camera/SetUserTrackingMode.js)
215
230
  */
216
231
  followUserMode?: UserTrackingMode;
217
232
 
@@ -244,7 +259,7 @@ export interface NativeCameraProps
244
259
  defaultStop?: NativeCameraStop;
245
260
  }
246
261
 
247
- const Camera = memo(
262
+ export const Camera = memo(
248
263
  forwardRef<CameraRef, CameraProps>(
249
264
  (
250
265
  {
@@ -269,44 +284,11 @@ const Camera = memo(
269
284
  }: CameraProps,
270
285
  ref,
271
286
  ) => {
272
- const nativeCamera = useNativeRef<NativeCameraProps>();
273
-
274
- const nativeStop = useMemo(() => {
275
- return makeNativeCameraStop({
276
- animationDuration,
277
- animationMode,
278
- bounds,
279
- centerCoordinate,
280
- heading,
281
- padding,
282
- pitch,
283
- zoomLevel,
284
- });
285
- }, [
286
- animationDuration,
287
- animationMode,
288
- bounds,
289
- centerCoordinate,
290
- heading,
291
- padding,
292
- pitch,
293
- zoomLevel,
294
- ]);
295
-
296
- const nativeDefaultStop = useMemo(() => {
297
- return makeNativeCameraStop(defaultSettings);
298
- }, [defaultSettings]);
299
-
300
- const nativeMaxBounds = useMemo(() => {
301
- if (!maxBounds?.ne || !maxBounds?.sw) {
302
- return undefined;
303
- }
304
- return makeNativeBounds(maxBounds.ne, maxBounds.sw);
305
- }, [maxBounds]);
287
+ const nativeCameraRef = useNativeRef<NativeCameraProps>();
306
288
 
307
289
  const setCamera = (config: CameraStop | CameraStops = {}): void => {
308
290
  if ("stops" in config) {
309
- nativeCamera.current?.setNativeProps({
291
+ nativeCameraRef.current?.setNativeProps({
310
292
  stop: {
311
293
  stops: config.stops
312
294
  .map((stopItem) => makeNativeCameraStop(stopItem))
@@ -314,10 +296,10 @@ const Camera = memo(
314
296
  },
315
297
  });
316
298
  } else {
317
- const nativeStop = makeNativeCameraStop(config);
299
+ const stop = makeNativeCameraStop(config);
318
300
 
319
- if (nativeStop) {
320
- nativeCamera.current?.setNativeProps({ stop: nativeStop });
301
+ if (stop) {
302
+ nativeCameraRef.current?.setNativeProps({ stop });
321
303
  }
322
304
  }
323
305
  };
@@ -399,10 +381,10 @@ const Camera = memo(
399
381
  * cameraRef.current?.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)
400
382
  * cameraRef.current?.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)
401
383
  *
402
- * @param {Array<Number>} ne - North east coordinate of bound
403
- * @param {Array<Number>} sw - South west coordinate of bound
404
- * @param {Number|Array<Number>|undefined} padding - Padding for the bounds
405
- * @param {Number=} animationDuration - Duration of camera animation
384
+ * @param {Array<number>} ne - North east coordinate of bound
385
+ * @param {Array<number>} sw - South west coordinate of bound
386
+ * @param {number|Array<number>|undefined} padding - Padding for the bounds
387
+ * @param {number=} animationDuration - Duration of camera animation
406
388
  * @return {void}
407
389
  */
408
390
  fitBounds,
@@ -413,8 +395,8 @@ const Camera = memo(
413
395
  * cameraRef.current?.flyTo([lng, lat])
414
396
  * cameraRef.current?.flyTo([lng, lat], 12000)
415
397
  *
416
- * @param {Array<Number>} coordinates - Coordinates that map camera will jump to
417
- * @param {Number=} animationDuration - Duration of camera animation
398
+ * @param {Array<number>} coordinates - Coordinates that map camera will jump to
399
+ * @param {number=} animationDuration - Duration of camera animation
418
400
  * @return {void}
419
401
  */
420
402
  flyTo,
@@ -425,8 +407,8 @@ const Camera = memo(
425
407
  * cameraRef.current?.moveTo([lng, lat], 200) // eases camera to new location based on duration
426
408
  * cameraRef.current?.moveTo([lng, lat]) // snaps camera to new location without any easing
427
409
  *
428
- * @param {Array<Number>} coordinates - Coordinates that map camera will move too
429
- * @param {Number=} animationDuration - Duration of camera animation
410
+ * @param {Array<number>} coordinates - Coordinates that map camera will move too
411
+ * @param {number=} animationDuration - Duration of camera animation
430
412
  * @return {void}
431
413
  */
432
414
  moveTo,
@@ -437,8 +419,8 @@ const Camera = memo(
437
419
  * cameraRef.current?.zoomTo(16)
438
420
  * cameraRef.current?.zoomTo(16, 100)
439
421
  *
440
- * @param {Number} zoomLevel - Zoom level that the map camera will animate too
441
- * @param {Number=} animationDuration - Duration of camera animation
422
+ * @param {number} zoomLevel - Zoom level that the map camera will animate too
423
+ * @param {number=} animationDuration - Duration of camera animation
442
424
  * @return {void}
443
425
  */
444
426
  zoomTo,
@@ -465,20 +447,116 @@ const Camera = memo(
465
447
  }),
466
448
  );
467
449
 
450
+ const followProps = useMemo(() => {
451
+ return {
452
+ followUserMode,
453
+ followPitch: followPitch ?? pitch,
454
+ followHeading: followHeading ?? heading,
455
+ followZoomLevel: followZoomLevel ?? zoomLevel,
456
+ };
457
+ }, [
458
+ followUserMode,
459
+ followPitch,
460
+ pitch,
461
+ followHeading,
462
+ heading,
463
+ followZoomLevel,
464
+ zoomLevel,
465
+ ]);
466
+
467
+ useEffect(() => {
468
+ if (followUserLocation) {
469
+ if (Platform.OS === "android") {
470
+ nativeCameraRef.current?.setNativeProps({
471
+ ...followProps,
472
+ followUserLocation,
473
+ });
474
+ } else {
475
+ nativeCameraRef.current?.setNativeProps({
476
+ ...followProps,
477
+ });
478
+ nativeCameraRef.current?.setNativeProps({
479
+ followUserLocation,
480
+ });
481
+ }
482
+ } else {
483
+ nativeCameraRef.current?.setNativeProps({
484
+ followUserLocation,
485
+ });
486
+ }
487
+ }, [followUserLocation, followProps]);
488
+
489
+ const nativeMaxBounds = useMemo(() => {
490
+ if (!maxBounds?.ne || !maxBounds?.sw) {
491
+ return undefined;
492
+ }
493
+
494
+ return makeNativeBounds(maxBounds.ne, maxBounds.sw);
495
+ }, [maxBounds]);
496
+
497
+ useEffect(() => {
498
+ if (!followUserLocation) {
499
+ nativeCameraRef.current?.setNativeProps({
500
+ maxBounds: nativeMaxBounds,
501
+ });
502
+ }
503
+ }, [followUserLocation, nativeMaxBounds]);
504
+
505
+ useEffect(() => {
506
+ if (!followUserLocation) {
507
+ nativeCameraRef.current?.setNativeProps({
508
+ minZoomLevel,
509
+ });
510
+ }
511
+ }, [followUserLocation, minZoomLevel]);
512
+
513
+ useEffect(() => {
514
+ if (!followUserLocation) {
515
+ nativeCameraRef.current?.setNativeProps({
516
+ maxZoomLevel,
517
+ });
518
+ }
519
+ }, [followUserLocation, maxZoomLevel]);
520
+
521
+ const nativeStop = useMemo(() => {
522
+ return makeNativeCameraStop({
523
+ animationDuration,
524
+ animationMode,
525
+ bounds,
526
+ centerCoordinate,
527
+ heading,
528
+ padding,
529
+ pitch,
530
+ zoomLevel,
531
+ });
532
+ }, [
533
+ animationDuration,
534
+ animationMode,
535
+ bounds,
536
+ centerCoordinate,
537
+ heading,
538
+ padding,
539
+ pitch,
540
+ zoomLevel,
541
+ ]);
542
+
543
+ useEffect(() => {
544
+ if (!followUserLocation) {
545
+ nativeCameraRef.current?.setNativeProps({
546
+ stop: nativeStop,
547
+ });
548
+ }
549
+ }, [followUserLocation, nativeStop]);
550
+
551
+ const [nativeDefaultStop] = useState(
552
+ makeNativeCameraStop(defaultSettings),
553
+ );
554
+
468
555
  return (
469
556
  <MLRNCamera
470
557
  testID="Camera"
471
- ref={nativeCamera}
472
- stop={nativeStop}
558
+ ref={nativeCameraRef}
473
559
  defaultStop={nativeDefaultStop}
474
- maxBounds={nativeMaxBounds}
475
- followUserLocation={followUserLocation}
476
- followHeading={followHeading}
477
- followPitch={followPitch}
478
- followUserMode={followUserMode}
479
- followZoomLevel={followZoomLevel}
480
- maxZoomLevel={maxZoomLevel}
481
- minZoomLevel={minZoomLevel}
482
560
  onUserTrackingModeChange={onUserTrackingModeChange}
483
561
  />
484
562
  );
@@ -488,5 +566,3 @@ const Camera = memo(
488
566
 
489
567
  const MLRNCamera =
490
568
  requireNativeComponent<NativeCameraProps>(NATIVE_MODULE_NAME);
491
-
492
- export default Camera;
@@ -1,14 +1,14 @@
1
- import React from "react";
2
1
  import { NativeModules, requireNativeComponent } from "react-native";
3
2
 
4
- import useAbstractLayer, {
3
+ import {
4
+ useAbstractLayer,
5
5
  type BaseLayerProps,
6
6
  type NativeBaseProps,
7
7
  } from "../hooks/useAbstractLayer";
8
8
  import { type BaseProps } from "../types/BaseProps";
9
9
  import { type CircleLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNCircleLayer";
14
14
 
@@ -28,8 +28,8 @@ const MLRNCircleLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
28
28
  /**
29
29
  * CircleLayer is a style layer that renders one or more filled circles on the map.
30
30
  */
31
- const CircleLayer: React.FC<CircleLayerProps> = ({
32
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
31
+ export const CircleLayer = ({
32
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
33
33
  ...props
34
34
  }: CircleLayerProps) => {
35
35
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -48,5 +48,3 @@ const CircleLayer: React.FC<CircleLayerProps> = ({
48
48
  />
49
49
  );
50
50
  };
51
-
52
- export default CircleLayer;
@@ -1,14 +1,14 @@
1
- import React from "react";
2
1
  import { NativeModules, requireNativeComponent } from "react-native";
3
2
 
4
- import useAbstractLayer, {
3
+ import {
4
+ useAbstractLayer,
5
5
  type BaseLayerProps,
6
6
  type NativeBaseProps,
7
7
  } from "../hooks/useAbstractLayer";
8
8
  import { type BaseProps } from "../types/BaseProps";
9
9
  import { type FillExtrusionLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNFillExtrusionLayer";
14
14
 
@@ -29,8 +29,8 @@ const MLRNFillExtrusionLayer =
29
29
  /**
30
30
  * FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map.
31
31
  */
32
- const FillExtrusionLayer: React.FC<FillExtrusionLayerProps> = ({
33
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
32
+ export const FillExtrusionLayer = ({
33
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
34
34
  ...props
35
35
  }: FillExtrusionLayerProps) => {
36
36
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -43,5 +43,3 @@ const FillExtrusionLayer: React.FC<FillExtrusionLayerProps> = ({
43
43
 
44
44
  return <MLRNFillExtrusionLayer ref={setNativeLayer} {...baseProps} />;
45
45
  };
46
-
47
- export default FillExtrusionLayer;
@@ -1,14 +1,14 @@
1
- import React from "react";
2
1
  import { NativeModules, requireNativeComponent } from "react-native";
3
2
 
4
- import useAbstractLayer, {
3
+ import {
4
+ useAbstractLayer,
5
5
  type BaseLayerProps,
6
6
  type NativeBaseProps,
7
7
  } from "../hooks/useAbstractLayer";
8
8
  import { type BaseProps } from "../types/BaseProps";
9
9
  import { type FillLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNFillLayer";
14
14
 
@@ -26,8 +26,8 @@ const MLRNFillLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
26
26
  /**
27
27
  * FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map.
28
28
  */
29
- const FillLayer: React.FC<FillLayerProps> = ({
30
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
29
+ export const FillLayer = ({
30
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
31
31
  ...props
32
32
  }: FillLayerProps) => {
33
33
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -40,5 +40,3 @@ const FillLayer: React.FC<FillLayerProps> = ({
40
40
 
41
41
  return <MLRNFillLayer ref={setNativeLayer} {...baseProps} />;
42
42
  };
43
-
44
- export default FillLayer;
@@ -1,6 +1,4 @@
1
- import { type ReactElement } from "react";
2
-
3
- import SymbolLayer from "./SymbolLayer";
1
+ import { SymbolLayer } from "./SymbolLayer";
4
2
  import headingIcon from "../assets/heading.png";
5
3
  import { type BaseProps } from "../types/BaseProps";
6
4
 
@@ -15,7 +13,7 @@ interface HeadingIndicatorProps extends BaseProps {
15
13
  heading?: number;
16
14
  }
17
15
 
18
- const HeadingIndicator = ({ heading }: HeadingIndicatorProps): ReactElement => (
16
+ export const HeadingIndicator = ({ heading }: HeadingIndicatorProps) => (
19
17
  <SymbolLayer
20
18
  key="mapboxUserLocationHeadingIndicator"
21
19
  id="mapboxUserLocationHeadingIndicator"
@@ -26,5 +24,3 @@ const HeadingIndicator = ({ heading }: HeadingIndicatorProps): ReactElement => (
26
24
  }}
27
25
  />
28
26
  );
29
-
30
- export default HeadingIndicator;
@@ -1,14 +1,14 @@
1
- import React from "react";
2
1
  import { NativeModules, requireNativeComponent } from "react-native";
3
2
 
4
- import useAbstractLayer, {
3
+ import {
5
4
  type BaseLayerProps,
6
5
  type NativeBaseProps,
6
+ useAbstractLayer,
7
7
  } from "../hooks/useAbstractLayer";
8
8
  import { type BaseProps } from "../types/BaseProps";
9
9
  import { type HeatmapLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNHeatmapLayer";
14
14
 
@@ -28,8 +28,8 @@ const MLRNHeatmapLayer =
28
28
  /**
29
29
  * HeatmapLayer is a style layer that renders one or more filled circles on the map.
30
30
  */
31
- const HeatmapLayer: React.FC<HeatmapLayerProps> = ({
32
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
31
+ export const HeatmapLayer = ({
32
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
33
33
  ...props
34
34
  }: HeatmapLayerProps) => {
35
35
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -42,5 +42,3 @@ const HeatmapLayer: React.FC<HeatmapLayerProps> = ({
42
42
 
43
43
  return <MLRNHeatmapLayer ref={setNativeLayer} {...baseProps} />;
44
44
  };
45
-
46
- export default HeatmapLayer;
@@ -1,7 +1,7 @@
1
- import { type ReactElement } from "react";
1
+ import { type ReactNode } from "react";
2
2
  import { requireNativeComponent } from "react-native";
3
3
 
4
- import useAbstractSource from "../hooks/useAbstractSource";
4
+ import { useAbstractSource } from "../hooks/useAbstractSource";
5
5
  import { type BaseProps } from "../types/BaseProps";
6
6
  import {
7
7
  cloneReactChildrenWithProps,
@@ -31,7 +31,7 @@ export interface ImageSourceProps extends BaseProps {
31
31
  GeoJSON.Position,
32
32
  ];
33
33
 
34
- children?: ReactElement | ReactElement[];
34
+ children?: ReactNode;
35
35
  }
36
36
 
37
37
  type NativeProps = ImageSourceProps;
@@ -42,7 +42,7 @@ const MLRNImageSource = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
42
42
  * ImageSource is a content source that is used for a georeferenced raster image to be shown on the map.
43
43
  * The georeferenced image scales and rotates as the user zooms and rotates the map
44
44
  */
45
- const ImageSource: React.FC<ImageSourceProps> = (props: ImageSourceProps) => {
45
+ export const ImageSource = (props: ImageSourceProps) => {
46
46
  const { setNativeRef } = useAbstractSource<NativeProps>();
47
47
 
48
48
  const _getURL = (): string | undefined => {
@@ -66,5 +66,3 @@ const ImageSource: React.FC<ImageSourceProps> = (props: ImageSourceProps) => {
66
66
  </MLRNImageSource>
67
67
  );
68
68
  };
69
-
70
- export default ImageSource;
@@ -1,10 +1,10 @@
1
- import { type ReactElement } from "react";
1
+ import { type ReactNode } from "react";
2
2
  import {
3
- requireNativeComponent,
4
3
  Image,
5
- type NativeSyntheticEvent,
6
4
  type ImageSourcePropType,
7
5
  type ImageURISource,
6
+ type NativeSyntheticEvent,
7
+ requireNativeComponent,
8
8
  } from "react-native";
9
9
 
10
10
  import { type BaseProps } from "../types/BaseProps";
@@ -55,19 +55,19 @@ interface ImagesProps extends BaseProps {
55
55
 
56
56
  id?: string;
57
57
 
58
- children?: ReactElement;
58
+ children?: ReactNode;
59
59
  }
60
60
 
61
61
  /**
62
62
  * Images defines the images used in Symbol etc layers
63
63
  */
64
- const Images = ({
64
+ export const Images = ({
65
65
  images,
66
66
  nativeAssetImages,
67
67
  onImageMissing,
68
68
  id,
69
69
  children,
70
- }: ImagesProps): ReactElement => {
70
+ }: ImagesProps) => {
71
71
  const _getImages = (): {
72
72
  images?: { [key: string]: ImageEntry };
73
73
  nativeImages?: ImageEntry[];
@@ -123,5 +123,3 @@ const Images = ({
123
123
  };
124
124
 
125
125
  const MLRNImages = requireNativeComponent(NATIVE_MODULE_NAME);
126
-
127
- export default Images;
@@ -1,7 +1,7 @@
1
- import React from "react";
2
1
  import { requireNativeComponent } from "react-native";
3
2
 
4
- import useAbstractLayer, {
3
+ import {
4
+ useAbstractLayer,
5
5
  type BaseLayerProps,
6
6
  } from "../hooks/useAbstractLayer";
7
7
  import { type BaseProps } from "../types/BaseProps";
@@ -26,7 +26,7 @@ const MLRNLight = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
26
26
  /**
27
27
  * Light represents the light source for extruded geometries
28
28
  */
29
- const Light: React.FC<LightProps> = (props: LightProps) => {
29
+ export const Light = (props: LightProps) => {
30
30
  const { baseProps, setNativeLayer } = useAbstractLayer<
31
31
  LightProps,
32
32
  NativeProps
@@ -36,5 +36,3 @@ const Light: React.FC<LightProps> = (props: LightProps) => {
36
36
 
37
37
  return <MLRNLight ref={setNativeLayer} testID="mlrnLight" {...baseProps} />;
38
38
  };
39
-
40
- export default Light;
@@ -1,14 +1,14 @@
1
- import React from "react";
2
1
  import { NativeModules, requireNativeComponent } from "react-native";
3
2
 
4
- import useAbstractLayer, {
3
+ import {
4
+ useAbstractLayer,
5
5
  type BaseLayerProps,
6
6
  type NativeBaseProps,
7
7
  } from "../hooks/useAbstractLayer";
8
8
  import { type BaseProps } from "../types/BaseProps";
9
9
  import { type LineLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNLineLayer";
14
14
 
@@ -27,8 +27,8 @@ const MLRNLineLayer =
27
27
  /**
28
28
  * LineLayer is a style layer that renders one or more stroked polylines on the map.
29
29
  */
30
- const LineLayer: React.FC<LineLayerProps> = ({
31
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
30
+ export const LineLayer = ({
31
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
32
32
  ...props
33
33
  }: LineLayerProps) => {
34
34
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -41,5 +41,3 @@ const LineLayer: React.FC<LineLayerProps> = ({
41
41
 
42
42
  return <MLRNLineLayer ref={setNativeLayer} {...baseProps} />;
43
43
  };
44
-
45
- export default LineLayer;