@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/src/MapLibreRN.ts CHANGED
@@ -1,70 +1,87 @@
1
- import { UserTrackingMode } from "./components/Camera";
2
-
3
1
  export * from "./MLRNModule";
4
2
  export {
5
- default as Camera,
3
+ Camera,
6
4
  UserTrackingMode,
7
5
  type CameraPadding,
8
6
  type CameraAnimationMode,
9
7
  type CameraBounds,
10
8
  type CameraRef,
11
9
  } from "./components/Camera";
12
- export { default as MapView, type MapViewRef } from "./components/MapView";
13
- export { default as Light } from "./components/Light";
14
- export { default as PointAnnotation } from "./components/PointAnnotation";
10
+ export {
11
+ MapView,
12
+ type MapViewRef,
13
+ type RegionPayload,
14
+ } from "./components/MapView";
15
+ export { Light } from "./components/Light";
16
+ export { PointAnnotation } from "./components/PointAnnotation";
15
17
  export type { PointAnnotationRef } from "./components/PointAnnotation";
16
- export { default as Annotation } from "./components/Annotation";
17
- export { default as Callout } from "./components/Callout";
18
+ export { Annotation } from "./components/Annotation";
19
+ export { Callout } from "./components/Callout";
18
20
  export { requestAndroidLocationPermissions } from "./requestAndroidLocationPermissions";
19
21
  export {
20
- default as UserLocation,
22
+ UserLocation,
21
23
  UserLocationRenderMode,
22
24
  } from "./components/UserLocation";
23
25
  export type { UserLocationRef } from "./components/UserLocation";
24
- export { default as VectorSource } from "./components/VectorSource";
25
- export { default as ShapeSource } from "./components/ShapeSource";
26
+ export { VectorSource } from "./components/VectorSource";
27
+ export { ShapeSource } from "./components/ShapeSource";
26
28
  export type { ShapeSourceRef } from "./components/ShapeSource";
27
- export { default as RasterSource } from "./components/RasterSource";
28
- export { default as ImageSource } from "./components/ImageSource";
29
- export { default as Images } from "./components/Images";
30
- export { default as FillLayer } from "./components/FillLayer";
31
- export { default as FillExtrusionLayer } from "./components/FillExtrusionLayer";
32
- export { default as HeatmapLayer } from "./components/HeatmapLayer";
33
- export { default as LineLayer } from "./components/LineLayer";
34
- export { default as CircleLayer } from "./components/CircleLayer";
35
- export { default as SymbolLayer } from "./components/SymbolLayer";
36
- export { default as RasterLayer } from "./components/RasterLayer";
37
- export { default as BackgroundLayer } from "./components/BackgroundLayer";
29
+ export { RasterSource } from "./components/RasterSource";
30
+ export { ImageSource } from "./components/ImageSource";
31
+ export { Images } from "./components/Images";
32
+ export { FillLayer } from "./components/FillLayer";
33
+ export { FillExtrusionLayer } from "./components/FillExtrusionLayer";
34
+ export { HeatmapLayer } from "./components/HeatmapLayer";
35
+ export { LineLayer } from "./components/LineLayer";
36
+ export { CircleLayer } from "./components/CircleLayer";
37
+ export { SymbolLayer } from "./components/SymbolLayer";
38
+ export { RasterLayer } from "./components/RasterLayer";
39
+ export { BackgroundLayer } from "./components/BackgroundLayer";
40
+ export { MarkerView } from "./components/MarkerView";
41
+
38
42
  export {
39
- default as locationManager,
43
+ LocationManager,
44
+ /**
45
+ * @deprecated Use LocationManager instead
46
+ */
47
+ LocationManager as locationManager,
40
48
  type Location,
41
- } from "./modules/location/locationManager";
42
- export { default as offlineManager } from "./modules/offline/offlineManager";
43
- export type {
44
- OfflineProgressStatus,
45
- OfflinePackError,
46
- } from "./modules/offline/offlineManager";
49
+ } from "./modules/location/LocationManager";
50
+ export {
51
+ OfflineManager,
52
+ /**
53
+ * @deprecated Use OfflineManager instead
54
+ */
55
+ OfflineManager as offlineManager,
56
+ } from "./modules/offline/OfflineManager";
57
+ export type { OfflinePackError } from "./modules/offline/OfflineManager";
47
58
  export type { OfflinePackStatus } from "./modules/offline/OfflinePack";
48
- export { default as OfflinePack } from "./modules/offline/OfflinePack";
49
- export { default as OfflineCreatePackOptions } from "./modules/offline/OfflineCreatePackOptions";
50
- export { default as snapshotManager } from "./modules/snapshot/snapshotManager";
59
+ export { OfflinePack } from "./modules/offline/OfflinePack";
60
+ export { OfflineCreatePackOptions } from "./modules/offline/OfflineCreatePackOptions";
61
+ export {
62
+ SnapshotManager,
63
+ /**
64
+ * @deprecated Use SnapshotManager instead
65
+ */
66
+ SnapshotManager as snapshotManager,
67
+ } from "./modules/snapshot/SnapshotManager";
51
68
  export type { SnapshotInputOptions } from "./modules/snapshot/SnapshotOptions";
52
- export { default as MarkerView } from "./components/MarkerView";
53
- export { default as Animated } from "./utils/animated/Animated";
54
- export { default as Style } from "./components/Style";
55
- export { default as Logger, type LogLevel } from "./utils/Logger";
69
+
70
+ export type { MapLibreRNEvent } from "./types/MapLibreRNEvent";
71
+
72
+ export { Animated } from "./utils/animated/Animated";
73
+ export { Logger, type LogLevel } from "./utils/Logger";
56
74
  export type {
57
- FillLayerStyleProps as FillLayerStyle,
58
- LineLayerStyleProps as LineLayerStyle,
59
- SymbolLayerStyleProps as SymbolLayerStyle,
60
- CircleLayerStyleProps as CircleLayerStyle,
61
- HeatmapLayerStyleProps as HeatmapLayerStyle,
62
- FillExtrusionLayerStyleProps as FillExtrusionLayerStyle,
63
- RasterLayerStyleProps as RasterLayerStyle,
64
- HillshadeLayerStyleProps as HillshadeLayerStyle,
65
- BackgroundLayerStyleProps as BackgroundLayerStyle,
66
- LightLayerStyleProps as LightLayerStyle,
67
- } from "./utils/MapLibreRNStyles";
75
+ FillLayerStyle,
76
+ LineLayerStyle,
77
+ SymbolLayerStyle,
78
+ CircleLayerStyle,
79
+ HeatmapLayerStyle,
80
+ FillExtrusionLayerStyle,
81
+ RasterLayerStyle,
82
+ HillshadeLayerStyle,
83
+ BackgroundLayerStyle,
84
+ LightLayerStyle,
85
+ } from "./types/MapLibreRNStyles";
68
86
 
69
- /** @deprecated UserTrackingModes is deprecated use UserTrackingMode */
70
- export const UserTrackingModes = UserTrackingMode;
87
+ export type { MapLibrePluginProps } from "./plugin/MapLibrePluginProps";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  forwardRef,
3
- type ReactElement,
3
+ type ReactNode,
4
4
  useCallback,
5
5
  useEffect,
6
6
  useImperativeHandle,
@@ -8,11 +8,11 @@ import {
8
8
  } from "react";
9
9
  import { Animated as RNAnimated, Easing } from "react-native";
10
10
 
11
- import SymbolLayer from "./SymbolLayer";
11
+ import { SymbolLayer } from "./SymbolLayer";
12
+ import { type SymbolLayerStyle } from "../types/MapLibreRNStyles";
12
13
  import { type OnPressEvent } from "../types/OnPressEvent";
13
- import { type SymbolLayerStyleProps } from "../utils/MapLibreRNStyles";
14
14
  import { AnimatedShapeSource } from "../utils/animated/Animated";
15
- import AnimatedMapPoint from "../utils/animated/AnimatedPoint";
15
+ import { AnimatedPoint } from "../utils/animated/AnimatedPoint";
16
16
 
17
17
  interface AnnotationProps {
18
18
  id: string;
@@ -21,12 +21,12 @@ interface AnnotationProps {
21
21
  animationEasingFunction?(x: number): number;
22
22
  coordinates?: number[];
23
23
  onPress?(event: OnPressEvent): void;
24
- children?: ReactElement | ReactElement[];
24
+ children?: ReactNode;
25
25
  style?: object;
26
26
  icon?: string | number | object;
27
27
  }
28
28
 
29
- type Shape = AnimatedMapPoint | GeoJSON.Point;
29
+ type Shape = AnimatedPoint | GeoJSON.Point;
30
30
 
31
31
  function getShapeFromProps(props: Partial<AnnotationProps> = {}): Shape {
32
32
  const lng = props.coordinates?.[0] || 0;
@@ -34,22 +34,22 @@ function getShapeFromProps(props: Partial<AnnotationProps> = {}): Shape {
34
34
  const point: GeoJSON.Point = { type: "Point", coordinates: [lng, lat] };
35
35
 
36
36
  if (props.animated) {
37
- return new AnimatedMapPoint(point);
37
+ return new AnimatedPoint(point);
38
38
  }
39
39
 
40
40
  return point;
41
41
  }
42
42
 
43
- function isShapeAnimated(shape: Shape): shape is AnimatedMapPoint {
44
- return shape instanceof AnimatedMapPoint;
43
+ function isShapeAnimated(shape: Shape): shape is AnimatedPoint {
44
+ return shape instanceof AnimatedPoint;
45
45
  }
46
46
 
47
47
  interface AnnotationRef {
48
48
  onPress(event: OnPressEvent): void;
49
- symbolStyle: SymbolLayerStyleProps | undefined;
49
+ symbolStyle: SymbolLayerStyle | undefined;
50
50
  }
51
51
 
52
- const Annotation = forwardRef<AnnotationRef, AnnotationProps>(
52
+ export const Annotation = forwardRef<AnnotationRef, AnnotationProps>(
53
53
  (
54
54
  {
55
55
  animated = false,
@@ -126,7 +126,7 @@ const Annotation = forwardRef<AnnotationRef, AnnotationProps>(
126
126
  }
127
127
 
128
128
  const children = [];
129
- const symbolStyle: SymbolLayerStyleProps | undefined = props.icon
129
+ const symbolStyle: SymbolLayerStyle | undefined = props.icon
130
130
  ? {
131
131
  ...props.style,
132
132
  iconImage: typeof props.icon === "string" ? props.icon : undefined,
@@ -160,5 +160,3 @@ const Annotation = forwardRef<AnnotationRef, AnnotationProps>(
160
160
  );
161
161
 
162
162
  Annotation.displayName = "Annotation";
163
-
164
- export default Annotation;
@@ -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
- import { type BackgroundLayerStyleProps } from "../utils/MapLibreRNStyles";
9
+ import { type BackgroundLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNBackgroundLayer";
14
14
 
@@ -16,7 +16,7 @@ export interface BackgroundLayerProps extends BaseProps, BaseLayerProps {
16
16
  /**
17
17
  * Customizable style attributes
18
18
  */
19
- style?: BackgroundLayerStyleProps;
19
+ style?: BackgroundLayerStyle;
20
20
  }
21
21
 
22
22
  interface NativeProps
@@ -26,8 +26,8 @@ interface NativeProps
26
26
  const MLRNBackgroundLayer =
27
27
  requireNativeComponent<BackgroundLayerProps>(NATIVE_MODULE_NAME);
28
28
 
29
- const BackgroundLayer: React.FC<BackgroundLayerProps> = ({
30
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
29
+ export const BackgroundLayer = ({
30
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
31
31
  ...props
32
32
  }: BackgroundLayerProps) => {
33
33
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -46,5 +46,3 @@ const BackgroundLayer: React.FC<BackgroundLayerProps> = ({
46
46
  />
47
47
  );
48
48
  };
49
-
50
- export default BackgroundLayer;
@@ -1,13 +1,13 @@
1
- import { Children, type ReactElement } from "react";
1
+ import { Children } from "react";
2
2
  import {
3
- View,
4
- Text,
5
3
  Animated,
6
4
  requireNativeComponent,
5
+ type StyleProp,
7
6
  StyleSheet,
8
- type ViewStyle,
7
+ Text,
8
+ View,
9
9
  type ViewProps,
10
- type StyleProp,
10
+ type ViewStyle,
11
11
  } from "react-native";
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNCallout";
@@ -82,7 +82,7 @@ interface NativeProps extends Omit<CalloutProps, "style"> {
82
82
  /**
83
83
  * Callout that displays information about a selected annotation near the annotation.
84
84
  */
85
- const Callout = (props: CalloutProps): ReactElement => {
85
+ export const Callout = (props: CalloutProps) => {
86
86
  const {
87
87
  title,
88
88
  style,
@@ -104,7 +104,7 @@ const Callout = (props: CalloutProps): ReactElement => {
104
104
 
105
105
  const _hasChildren = Children.count(children) > 0;
106
106
 
107
- const _renderDefaultCallout = (): ReactElement => {
107
+ const _renderDefaultCallout = () => {
108
108
  return (
109
109
  <Animated.View testID="container" style={[styles.container, style]}>
110
110
  <View testID="wrapper" style={[styles.content, contentStyle]}>
@@ -117,7 +117,7 @@ const Callout = (props: CalloutProps): ReactElement => {
117
117
  );
118
118
  };
119
119
 
120
- const _renderCustomCallout = (): ReactElement => {
120
+ const _renderCustomCallout = () => {
121
121
  return (
122
122
  <Animated.View testID="container" {...props} style={style}>
123
123
  {children}
@@ -137,5 +137,3 @@ const Callout = (props: CalloutProps): ReactElement => {
137
137
  };
138
138
 
139
139
  const MLRNCallout = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
140
-
141
- export default Callout;
@@ -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.UserTrackingModes` 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/SetUserTrackingModes.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.
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 {number[]} ne - North east coordinate of bound
385
+ * @param {number[]} sw - South west coordinate of bound
386
+ * @param {number|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 {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 {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;