@maplibre/maplibre-react-native 10.0.0-beta.8 → 10.0.0

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 (548) hide show
  1. package/README.md +10 -54
  2. package/android/build.gradle +35 -12
  3. package/android/gradle.properties +14 -6
  4. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.java +37 -48
  5. package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +16 -9
  6. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.java +11 -13
  7. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +4 -11
  8. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
  9. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
  10. package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.java +7 -11
  11. package/android/src/main/java/org/maplibre/reactnative/location/engine/DefaultLocationEngineProvider.java +18 -0
  12. package/android/src/main/java/org/maplibre/reactnative/location/engine/LocationEngineProvidable.java +9 -0
  13. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +27 -148
  14. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
  15. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +123 -18
  16. package/android/src/main/location-engine-default/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
  17. package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineImpl.java +151 -0
  18. package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineProvider.java +24 -0
  19. package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
  20. package/app.plugin.js +1 -1
  21. package/ios/MLRN/MLRNCamera.m +6 -7
  22. package/ios/MLRN/MLRNMapView.h +1 -1
  23. package/ios/MLRN/MLRNMapView.m +7 -7
  24. package/ios/MLRN/MLRNMapViewManager.m +1 -1
  25. package/ios/MLRN/MLRNModule.m +8 -139
  26. package/ios/MLRN/MLRNStyle.m +0 -40
  27. package/lib/commonjs/MLRNModule.js +3 -5
  28. package/lib/commonjs/MLRNModule.js.map +1 -1
  29. package/lib/commonjs/MapLibreRN.js +77 -59
  30. package/lib/commonjs/MapLibreRN.js.map +1 -1
  31. package/lib/commonjs/components/Annotation.js +7 -9
  32. package/lib/commonjs/components/Annotation.js.map +1 -1
  33. package/lib/commonjs/components/BackgroundLayer.js +6 -8
  34. package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
  35. package/lib/commonjs/components/Callout.js +2 -2
  36. package/lib/commonjs/components/Callout.js.map +1 -1
  37. package/lib/commonjs/components/Camera.js +111 -63
  38. package/lib/commonjs/components/Camera.js.map +1 -1
  39. package/lib/commonjs/components/CircleLayer.js +6 -8
  40. package/lib/commonjs/components/CircleLayer.js.map +1 -1
  41. package/lib/commonjs/components/FillExtrusionLayer.js +6 -8
  42. package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
  43. package/lib/commonjs/components/FillLayer.js +6 -8
  44. package/lib/commonjs/components/FillLayer.js.map +1 -1
  45. package/lib/commonjs/components/HeadingIndicator.js +4 -4
  46. package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
  47. package/lib/commonjs/components/HeatmapLayer.js +6 -8
  48. package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
  49. package/lib/commonjs/components/ImageSource.js +4 -5
  50. package/lib/commonjs/components/ImageSource.js.map +1 -1
  51. package/lib/commonjs/components/Images.js +2 -2
  52. package/lib/commonjs/components/Images.js.map +1 -1
  53. package/lib/commonjs/components/Light.js +4 -6
  54. package/lib/commonjs/components/Light.js.map +1 -1
  55. package/lib/commonjs/components/LineLayer.js +6 -8
  56. package/lib/commonjs/components/LineLayer.js.map +1 -1
  57. package/lib/commonjs/components/MapView.js +69 -76
  58. package/lib/commonjs/components/MapView.js.map +1 -1
  59. package/lib/commonjs/components/MarkerView.js +4 -5
  60. package/lib/commonjs/components/MarkerView.js.map +1 -1
  61. package/lib/commonjs/components/NativeUserLocation.js +2 -2
  62. package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
  63. package/lib/commonjs/components/PointAnnotation.js +7 -10
  64. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  65. package/lib/commonjs/components/RasterLayer.js +6 -8
  66. package/lib/commonjs/components/RasterLayer.js.map +1 -1
  67. package/lib/commonjs/components/RasterSource.js +8 -10
  68. package/lib/commonjs/components/RasterSource.js.map +1 -1
  69. package/lib/commonjs/components/ShapeSource.js +6 -8
  70. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  71. package/lib/commonjs/components/SymbolLayer.js +6 -7
  72. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  73. package/lib/commonjs/components/UserLocation.js +21 -23
  74. package/lib/commonjs/components/UserLocation.js.map +1 -1
  75. package/lib/commonjs/components/VectorSource.js +8 -10
  76. package/lib/commonjs/components/VectorSource.js.map +1 -1
  77. package/lib/commonjs/hooks/useAbstractLayer.js +1 -1
  78. package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -1
  79. package/lib/commonjs/hooks/useAbstractSource.js +1 -1
  80. package/lib/commonjs/hooks/useAbstractSource.js.map +1 -1
  81. package/lib/commonjs/hooks/useNativeBridge.js +2 -2
  82. package/lib/commonjs/hooks/useNativeBridge.js.map +1 -1
  83. package/lib/commonjs/hooks/useOnce.js +2 -2
  84. package/lib/commonjs/hooks/useOnce.js.map +1 -1
  85. package/lib/commonjs/index.js +3 -0
  86. package/lib/commonjs/index.js.map +1 -1
  87. package/lib/commonjs/modules/location/{locationManager.js → LocationManager.js} +10 -10
  88. package/lib/commonjs/modules/location/LocationManager.js.map +1 -0
  89. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -2
  90. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  91. package/lib/commonjs/modules/offline/{offlineManager.js → OfflineManager.js} +34 -36
  92. package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -0
  93. package/lib/commonjs/modules/offline/OfflinePack.js +2 -2
  94. package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
  95. package/lib/commonjs/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +12 -14
  96. package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -0
  97. package/lib/commonjs/modules/snapshot/SnapshotOptions.js +3 -4
  98. package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
  99. package/lib/commonjs/plugin/MapLibrePluginProps.js +2 -0
  100. package/lib/commonjs/plugin/MapLibrePluginProps.js.map +1 -0
  101. package/lib/commonjs/plugin/android.js +41 -0
  102. package/lib/commonjs/plugin/android.js.map +1 -0
  103. package/lib/commonjs/plugin/ios.js +131 -0
  104. package/lib/commonjs/plugin/ios.js.map +1 -0
  105. package/lib/commonjs/plugin/withMapLibre.js +31 -0
  106. package/lib/commonjs/plugin/withMapLibre.js.map +1 -0
  107. package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
  108. package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
  109. package/lib/commonjs/utils/BridgeValue.js +2 -2
  110. package/lib/commonjs/utils/BridgeValue.js.map +1 -1
  111. package/lib/commonjs/utils/Logger.js +2 -2
  112. package/lib/commonjs/utils/Logger.js.map +1 -1
  113. package/lib/commonjs/utils/StyleValue.js +4 -5
  114. package/lib/commonjs/utils/StyleValue.js.map +1 -1
  115. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
  116. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
  117. package/lib/commonjs/utils/animated/Animated.js +29 -31
  118. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  119. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +4 -5
  120. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
  121. package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +2 -2
  122. package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
  123. package/lib/commonjs/utils/animated/AnimatedPoint.js +1 -2
  124. package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -1
  125. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +4 -4
  126. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
  127. package/lib/commonjs/utils/animated/AnimatedShape.js +2 -2
  128. package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -1
  129. package/lib/commonjs/utils/getStylePropertyType.js +252 -0
  130. package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
  131. package/lib/module/MLRNModule.js +1 -2
  132. package/lib/module/MLRNModule.js.map +1 -1
  133. package/lib/module/MapLibreRN.js +40 -28
  134. package/lib/module/MapLibreRN.js.map +1 -1
  135. package/lib/module/components/Annotation.js +5 -6
  136. package/lib/module/components/Annotation.js.map +1 -1
  137. package/lib/module/components/BackgroundLayer.js +4 -6
  138. package/lib/module/components/BackgroundLayer.js.map +1 -1
  139. package/lib/module/components/Callout.js +2 -3
  140. package/lib/module/components/Callout.js.map +1 -1
  141. package/lib/module/components/Camera.js +112 -64
  142. package/lib/module/components/Camera.js.map +1 -1
  143. package/lib/module/components/CircleLayer.js +4 -6
  144. package/lib/module/components/CircleLayer.js.map +1 -1
  145. package/lib/module/components/FillExtrusionLayer.js +4 -6
  146. package/lib/module/components/FillExtrusionLayer.js.map +1 -1
  147. package/lib/module/components/FillLayer.js +4 -6
  148. package/lib/module/components/FillLayer.js.map +1 -1
  149. package/lib/module/components/HeadingIndicator.js +2 -3
  150. package/lib/module/components/HeadingIndicator.js.map +1 -1
  151. package/lib/module/components/HeatmapLayer.js +4 -6
  152. package/lib/module/components/HeatmapLayer.js.map +1 -1
  153. package/lib/module/components/ImageSource.js +2 -3
  154. package/lib/module/components/ImageSource.js.map +1 -1
  155. package/lib/module/components/Images.js +2 -3
  156. package/lib/module/components/Images.js.map +1 -1
  157. package/lib/module/components/Light.js +2 -4
  158. package/lib/module/components/Light.js.map +1 -1
  159. package/lib/module/components/LineLayer.js +4 -6
  160. package/lib/module/components/LineLayer.js.map +1 -1
  161. package/lib/module/components/MapView.js +65 -72
  162. package/lib/module/components/MapView.js.map +1 -1
  163. package/lib/module/components/MarkerView.js +2 -3
  164. package/lib/module/components/MarkerView.js.map +1 -1
  165. package/lib/module/components/NativeUserLocation.js +1 -2
  166. package/lib/module/components/NativeUserLocation.js.map +1 -1
  167. package/lib/module/components/PointAnnotation.js +5 -7
  168. package/lib/module/components/PointAnnotation.js.map +1 -1
  169. package/lib/module/components/RasterLayer.js +4 -6
  170. package/lib/module/components/RasterLayer.js.map +1 -1
  171. package/lib/module/components/RasterSource.js +5 -7
  172. package/lib/module/components/RasterSource.js.map +1 -1
  173. package/lib/module/components/ShapeSource.js +4 -5
  174. package/lib/module/components/ShapeSource.js.map +1 -1
  175. package/lib/module/components/SymbolLayer.js +4 -5
  176. package/lib/module/components/SymbolLayer.js.map +1 -1
  177. package/lib/module/components/UserLocation.js +14 -15
  178. package/lib/module/components/UserLocation.js.map +1 -1
  179. package/lib/module/components/VectorSource.js +5 -6
  180. package/lib/module/components/VectorSource.js.map +1 -1
  181. package/lib/module/hooks/useAbstractLayer.js +1 -1
  182. package/lib/module/hooks/useAbstractLayer.js.map +1 -1
  183. package/lib/module/hooks/useAbstractSource.js +1 -1
  184. package/lib/module/hooks/useAbstractSource.js.map +1 -1
  185. package/lib/module/hooks/useNativeBridge.js +1 -2
  186. package/lib/module/hooks/useNativeBridge.js.map +1 -1
  187. package/lib/module/hooks/useNativeRef.js.map +1 -1
  188. package/lib/module/hooks/useOnce.js +1 -2
  189. package/lib/module/hooks/useOnce.js.map +1 -1
  190. package/lib/module/index.js +4 -0
  191. package/lib/module/index.js.map +1 -1
  192. package/lib/module/modules/location/{locationManager.js → LocationManager.js} +10 -9
  193. package/lib/module/modules/location/LocationManager.js.map +1 -0
  194. package/lib/module/modules/offline/OfflineCreatePackOptions.js +1 -2
  195. package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
  196. package/lib/module/modules/offline/{offlineManager.js → OfflineManager.js} +30 -30
  197. package/lib/module/modules/offline/OfflineManager.js.map +1 -0
  198. package/lib/module/modules/offline/OfflinePack.js +1 -2
  199. package/lib/module/modules/offline/OfflinePack.js.map +1 -1
  200. package/lib/module/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +10 -10
  201. package/lib/module/modules/snapshot/{snapshotManager.js.map → SnapshotManager.js.map} +1 -1
  202. package/lib/module/modules/snapshot/SnapshotOptions.js +2 -3
  203. package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
  204. package/lib/module/plugin/MapLibrePluginProps.js +2 -0
  205. package/lib/module/plugin/MapLibrePluginProps.js.map +1 -0
  206. package/lib/module/plugin/android.js +34 -0
  207. package/lib/module/plugin/android.js.map +1 -0
  208. package/lib/module/plugin/ios.js +123 -0
  209. package/lib/module/plugin/ios.js.map +1 -0
  210. package/lib/module/plugin/withMapLibre.js +27 -0
  211. package/lib/module/plugin/withMapLibre.js.map +1 -0
  212. package/lib/module/types/MapLibreRNStyles.js +4 -0
  213. package/lib/module/types/MapLibreRNStyles.js.map +1 -0
  214. package/lib/module/utils/BridgeValue.js +1 -1
  215. package/lib/module/utils/BridgeValue.js.map +1 -1
  216. package/lib/module/utils/Logger.js +1 -2
  217. package/lib/module/utils/Logger.js.map +1 -1
  218. package/lib/module/utils/StyleValue.js +3 -3
  219. package/lib/module/utils/StyleValue.js.map +1 -1
  220. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +1 -2
  221. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
  222. package/lib/module/utils/animated/Animated.js +14 -15
  223. package/lib/module/utils/animated/Animated.js.map +1 -1
  224. package/lib/module/utils/animated/AnimatedCoordinatesArray.js +2 -3
  225. package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
  226. package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -1
  227. package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
  228. package/lib/module/utils/animated/AnimatedPoint.js +0 -1
  229. package/lib/module/utils/animated/AnimatedPoint.js.map +1 -1
  230. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +2 -2
  231. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
  232. package/lib/module/utils/animated/AnimatedShape.js +1 -2
  233. package/lib/module/utils/animated/AnimatedShape.js.map +1 -1
  234. package/lib/module/utils/getStylePropertyType.js +248 -0
  235. package/lib/module/utils/getStylePropertyType.js.map +1 -0
  236. package/lib/typescript/commonjs/src/MLRNModule.d.ts +2 -6
  237. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +43 -30
  239. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  240. package/lib/typescript/commonjs/src/components/Annotation.d.ts +6 -6
  241. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  242. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +3 -5
  243. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/src/components/Callout.d.ts +3 -4
  245. package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/src/components/Camera.d.ts +4 -4
  247. package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +3 -5
  249. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +3 -5
  251. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/src/components/FillLayer.d.ts +3 -5
  253. package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +2 -3
  255. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +3 -5
  257. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/src/components/ImageSource.d.ts +3 -4
  259. package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/src/components/Images.d.ts +5 -5
  261. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/src/components/Light.d.ts +4 -5
  263. package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/src/components/LineLayer.d.ts +3 -5
  265. package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/src/components/MapView.d.ts +12 -15
  267. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/src/components/MarkerView.d.ts +3 -3
  269. package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +2 -3
  271. package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +7 -8
  273. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +3 -5
  275. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/src/components/RasterSource.d.ts +4 -4
  277. package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +8 -15
  279. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +3 -4
  281. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/src/components/UserLocation.d.ts +6 -6
  283. package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/src/components/VectorSource.d.ts +4 -8
  285. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  286. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +5 -4
  287. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +4 -3
  289. package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +5 -5
  291. package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +2 -2
  293. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +1 -2
  295. package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  297. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  298. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +33 -0
  299. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
  301. package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
  303. package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +2 -3
  305. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
  306. package/lib/typescript/{module/src/modules/snapshot/snapshotManager.d.ts → commonjs/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
  307. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
  308. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
  309. package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts +77 -0
  311. package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/src/plugin/android.d.ts +16 -0
  313. package/lib/typescript/commonjs/src/plugin/android.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/src/plugin/ios.d.ts +17 -0
  315. package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts +5 -0
  317. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
  319. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
  320. package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts +1 -1
  321. package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -1
  322. package/lib/typescript/commonjs/src/utils/Logger.d.ts +2 -2
  323. package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -1
  324. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
  325. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
  326. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  327. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  328. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +19 -19
  329. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
  331. package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
  333. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -1
  335. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  336. package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
  337. package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +5 -5
  339. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  340. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
  341. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
  342. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
  343. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
  344. package/lib/typescript/module/src/MLRNModule.d.ts +2 -6
  345. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  346. package/lib/typescript/module/src/MapLibreRN.d.ts +43 -30
  347. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  348. package/lib/typescript/module/src/components/Annotation.d.ts +6 -6
  349. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  350. package/lib/typescript/module/src/components/BackgroundLayer.d.ts +3 -5
  351. package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
  352. package/lib/typescript/module/src/components/Callout.d.ts +3 -4
  353. package/lib/typescript/module/src/components/Callout.d.ts.map +1 -1
  354. package/lib/typescript/module/src/components/Camera.d.ts +4 -4
  355. package/lib/typescript/module/src/components/Camera.d.ts.map +1 -1
  356. package/lib/typescript/module/src/components/CircleLayer.d.ts +3 -5
  357. package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
  358. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +3 -5
  359. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
  360. package/lib/typescript/module/src/components/FillLayer.d.ts +3 -5
  361. package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
  362. package/lib/typescript/module/src/components/HeadingIndicator.d.ts +2 -3
  363. package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -1
  364. package/lib/typescript/module/src/components/HeatmapLayer.d.ts +3 -5
  365. package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
  366. package/lib/typescript/module/src/components/ImageSource.d.ts +3 -4
  367. package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -1
  368. package/lib/typescript/module/src/components/Images.d.ts +5 -5
  369. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  370. package/lib/typescript/module/src/components/Light.d.ts +4 -5
  371. package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
  372. package/lib/typescript/module/src/components/LineLayer.d.ts +3 -5
  373. package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
  374. package/lib/typescript/module/src/components/MapView.d.ts +12 -15
  375. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  376. package/lib/typescript/module/src/components/MarkerView.d.ts +3 -3
  377. package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -1
  378. package/lib/typescript/module/src/components/NativeUserLocation.d.ts +2 -3
  379. package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -1
  380. package/lib/typescript/module/src/components/PointAnnotation.d.ts +7 -8
  381. package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
  382. package/lib/typescript/module/src/components/RasterLayer.d.ts +3 -5
  383. package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
  384. package/lib/typescript/module/src/components/RasterSource.d.ts +4 -4
  385. package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -1
  386. package/lib/typescript/module/src/components/ShapeSource.d.ts +8 -15
  387. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  388. package/lib/typescript/module/src/components/SymbolLayer.d.ts +3 -4
  389. package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
  390. package/lib/typescript/module/src/components/UserLocation.d.ts +6 -6
  391. package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
  392. package/lib/typescript/module/src/components/VectorSource.d.ts +4 -8
  393. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  394. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +5 -4
  395. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
  396. package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +4 -3
  397. package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -1
  398. package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +5 -5
  399. package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -1
  400. package/lib/typescript/module/src/hooks/useNativeRef.d.ts +2 -2
  401. package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -1
  402. package/lib/typescript/module/src/hooks/useOnce.d.ts +1 -2
  403. package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -1
  404. package/lib/typescript/module/src/index.d.ts +3 -0
  405. package/lib/typescript/module/src/index.d.ts.map +1 -1
  406. package/lib/typescript/module/src/modules/location/LocationManager.d.ts +33 -0
  407. package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -0
  408. package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
  409. package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
  410. package/lib/typescript/module/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
  411. package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
  412. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +2 -3
  413. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
  414. package/lib/typescript/{commonjs/src/modules/snapshot/snapshotManager.d.ts → module/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
  415. package/lib/typescript/module/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
  416. package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
  417. package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
  418. package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts +77 -0
  419. package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
  420. package/lib/typescript/module/src/plugin/android.d.ts +16 -0
  421. package/lib/typescript/module/src/plugin/android.d.ts.map +1 -0
  422. package/lib/typescript/module/src/plugin/ios.d.ts +17 -0
  423. package/lib/typescript/module/src/plugin/ios.d.ts.map +1 -0
  424. package/lib/typescript/module/src/plugin/withMapLibre.d.ts +5 -0
  425. package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -0
  426. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
  427. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
  428. package/lib/typescript/module/src/utils/BridgeValue.d.ts +1 -1
  429. package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -1
  430. package/lib/typescript/module/src/utils/Logger.d.ts +2 -2
  431. package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -1
  432. package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
  433. package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
  434. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  435. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  436. package/lib/typescript/module/src/utils/animated/Animated.d.ts +19 -19
  437. package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
  438. package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
  439. package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
  440. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
  441. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  442. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -1
  443. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  444. package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
  445. package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
  446. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +5 -5
  447. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  448. package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
  449. package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
  450. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
  451. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
  452. package/maplibre-react-native.podspec +15 -14
  453. package/package.json +17 -14
  454. package/src/MLRNModule.ts +15 -10
  455. package/src/MapLibreRN.ts +59 -41
  456. package/src/components/Annotation.tsx +12 -14
  457. package/src/components/BackgroundLayer.tsx +7 -9
  458. package/src/components/Callout.tsx +8 -10
  459. package/src/components/Camera.tsx +154 -78
  460. package/src/components/CircleLayer.tsx +7 -9
  461. package/src/components/FillExtrusionLayer.tsx +7 -9
  462. package/src/components/FillLayer.tsx +7 -9
  463. package/src/components/HeadingIndicator.tsx +2 -6
  464. package/src/components/HeatmapLayer.tsx +7 -9
  465. package/src/components/ImageSource.tsx +4 -6
  466. package/src/components/Images.tsx +7 -9
  467. package/src/components/Light.tsx +5 -7
  468. package/src/components/LineLayer.tsx +7 -9
  469. package/src/components/MapView.tsx +85 -94
  470. package/src/components/MarkerView.tsx +4 -6
  471. package/src/components/NativeUserLocation.tsx +1 -4
  472. package/src/components/PointAnnotation.tsx +10 -11
  473. package/src/components/RasterLayer.tsx +7 -9
  474. package/src/components/RasterSource.tsx +7 -9
  475. package/src/components/ShapeSource.tsx +17 -22
  476. package/src/components/SymbolLayer.tsx +7 -8
  477. package/src/components/UserLocation.tsx +21 -22
  478. package/src/components/VectorSource.tsx +8 -15
  479. package/src/hooks/useAbstractLayer.ts +8 -8
  480. package/src/hooks/useAbstractSource.ts +6 -6
  481. package/src/hooks/useNativeBridge.ts +9 -6
  482. package/src/hooks/useNativeRef.ts +2 -2
  483. package/src/hooks/useOnce.ts +3 -3
  484. package/src/index.ts +3 -0
  485. package/src/modules/location/{locationManager.ts → LocationManager.ts} +16 -15
  486. package/src/modules/offline/OfflineCreatePackOptions.ts +1 -3
  487. package/src/modules/offline/{offlineManager.ts → OfflineManager.ts} +30 -29
  488. package/src/modules/offline/OfflinePack.ts +2 -4
  489. package/src/modules/snapshot/{snapshotManager.ts → SnapshotManager.ts} +9 -9
  490. package/src/modules/snapshot/SnapshotOptions.ts +2 -4
  491. package/src/plugin/MapLibrePluginProps.ts +83 -0
  492. package/src/plugin/android.ts +64 -0
  493. package/src/plugin/ios.ts +166 -0
  494. package/src/plugin/withMapLibre.ts +30 -0
  495. package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +86 -406
  496. package/src/utils/BridgeValue.ts +1 -1
  497. package/src/utils/Logger.ts +1 -3
  498. package/src/utils/StyleValue.ts +6 -5
  499. package/src/utils/animated/AbstractAnimatedCoordinates.ts +3 -3
  500. package/src/utils/animated/Animated.ts +23 -21
  501. package/src/utils/animated/AnimatedCoordinatesArray.ts +3 -4
  502. package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +1 -1
  503. package/src/utils/animated/AnimatedPoint.ts +0 -2
  504. package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +3 -2
  505. package/src/utils/animated/AnimatedShape.ts +4 -6
  506. package/src/utils/filterUtils.ts +1 -1
  507. package/src/utils/getStylePropertyType.ts +265 -0
  508. package/lib/commonjs/modules/location/locationManager.js.map +0 -1
  509. package/lib/commonjs/modules/offline/offlineManager.js.map +0 -1
  510. package/lib/commonjs/modules/snapshot/snapshotManager.js.map +0 -1
  511. package/lib/commonjs/types/StyleURL.js +0 -11
  512. package/lib/commonjs/types/StyleURL.js.map +0 -1
  513. package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
  514. package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
  515. package/lib/commonjs/utils/styleMap.js +0 -255
  516. package/lib/commonjs/utils/styleMap.js.map +0 -1
  517. package/lib/module/modules/location/locationManager.js.map +0 -1
  518. package/lib/module/modules/offline/offlineManager.js.map +0 -1
  519. package/lib/module/types/StyleURL.js +0 -7
  520. package/lib/module/types/StyleURL.js.map +0 -1
  521. package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
  522. package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
  523. package/lib/module/utils/styleMap.js +0 -249
  524. package/lib/module/utils/styleMap.js.map +0 -1
  525. package/lib/typescript/commonjs/jest.config.d.ts +0 -2
  526. package/lib/typescript/commonjs/jest.config.d.ts.map +0 -1
  527. package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts +0 -64
  528. package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +0 -1
  529. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +0 -1
  530. package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
  531. package/lib/typescript/commonjs/src/types/StyleURL.d.ts +0 -4
  532. package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +0 -1
  533. package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
  534. package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
  535. package/lib/typescript/module/jest.config.d.ts +0 -2
  536. package/lib/typescript/module/jest.config.d.ts.map +0 -1
  537. package/lib/typescript/module/src/modules/location/locationManager.d.ts +0 -64
  538. package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +0 -1
  539. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +0 -1
  540. package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
  541. package/lib/typescript/module/src/types/StyleURL.d.ts +0 -4
  542. package/lib/typescript/module/src/types/StyleURL.d.ts.map +0 -1
  543. package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
  544. package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
  545. package/plugin/build/withMapLibre.d.ts +0 -12
  546. package/plugin/build/withMapLibre.js +0 -148
  547. package/src/types/StyleURL.ts +0 -3
  548. package/src/utils/styleMap.ts +0 -265
@@ -22,17 +22,17 @@ import {
22
22
  type NativeSyntheticEvent,
23
23
  } from "react-native";
24
24
 
25
- import useNativeBridge from "../hooks/useNativeBridge";
26
- import useOnce from "../hooks/useOnce";
27
- import { type Location } from "../modules/location/locationManager";
25
+ import { useNativeBridge } from "../hooks/useNativeBridge";
26
+ import { useOnce } from "../hooks/useOnce";
27
+ import { type Location } from "../modules/location/LocationManager";
28
28
  import { type BaseProps } from "../types/BaseProps";
29
+ import { type FilterExpression } from "../types/MapLibreRNStyles";
29
30
  import { isFunction, isAndroid } from "../utils";
30
- import Logger from "../utils/Logger";
31
- import { type FilterExpression } from "../utils/MapLibreRNStyles";
31
+ import { Logger } from "../utils/Logger";
32
32
  import { getFilter } from "../utils/filterUtils";
33
33
 
34
- const MapLibreRN = NativeModules.MLRNModule;
35
- if (MapLibreRN == null) {
34
+ const MLRNModule = NativeModules.MLRNModule;
35
+ if (MLRNModule == null) {
36
36
  console.error(
37
37
  "Native module of @maplibre/maplibre-react-native library was not registered properly, please consult the docs: https://github.com/maplibre/maplibre-react-native",
38
38
  );
@@ -46,8 +46,6 @@ const styles = StyleSheet.create({
46
46
  matchParent: { flex: 1 },
47
47
  });
48
48
 
49
- const defaultStyleURL = MapLibreRN.StyleURL.Street;
50
-
51
49
  export interface RegionPayload {
52
50
  zoomLevel: number;
53
51
  heading: number;
@@ -69,13 +67,9 @@ interface MapViewProps extends BaseProps {
69
67
  */
70
68
  style?: ViewProps["style"];
71
69
  /**
72
- * Style URL for map - notice, if non is set it _will_ default to `MapLibreGL.StyleURL.Default`
73
- */
74
- styleURL?: string;
75
- /**
76
- * StyleJSON for map - according to TileJSON specs: https://github.com/mapbox/tilejson-spec
70
+ * Style for map - either a URL or a Style JSON (https://maplibre.org/maplibre-style-spec/). Default: `StyleURL.Default`
77
71
  */
78
- styleJSON?: string;
72
+ mapStyle?: string | object;
79
73
  /**
80
74
  * iOS: The preferred frame rate at which the map view is rendered.
81
75
  * The default value for this property is MLNMapViewPreferredFramesPerSecondDefault,
@@ -165,7 +159,7 @@ interface MapViewProps extends BaseProps {
165
159
  /**
166
160
  * This event is triggered whenever the currently displayed map region is about to change.
167
161
  *
168
- * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
162
+ * @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
169
163
  */
170
164
  onRegionWillChange?(
171
165
  feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
@@ -173,7 +167,7 @@ interface MapViewProps extends BaseProps {
173
167
  /**
174
168
  * This event is triggered whenever the currently displayed map region is changing.
175
169
  *
176
- * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
170
+ * @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
177
171
  */
178
172
  onRegionIsChanging?(
179
173
  feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
@@ -181,7 +175,7 @@ interface MapViewProps extends BaseProps {
181
175
  /**
182
176
  * This event is triggered whenever the currently displayed map region finished changing
183
177
  *
184
- * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
178
+ * @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
185
179
  */
186
180
  onRegionDidChange?(
187
181
  feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
@@ -250,13 +244,18 @@ type CallableProps = {
250
244
  }[keyof MapViewProps];
251
245
 
252
246
  interface NativeProps extends Omit<MapViewProps, "onPress" | "onLongPress"> {
247
+ mapStyle?: string;
253
248
  onPress(event: NativeSyntheticEvent<{ payload: GeoJSON.Feature }>): void;
254
249
  onLongPress(event: NativeSyntheticEvent<{ payload: GeoJSON.Feature }>): void;
255
250
  }
256
251
 
257
252
  export interface MapViewRef {
258
- getPointInView: (coordinate: GeoJSON.Position) => Promise<GeoJSON.Point>;
259
- getCoordinateFromView: (point: number[]) => Promise<GeoJSON.Position>;
253
+ getPointInView: (
254
+ coordinate: GeoJSON.Position,
255
+ ) => Promise<[x: number, y: number]>;
256
+ getCoordinateFromView: (
257
+ point: [x: number, y: number],
258
+ ) => Promise<GeoJSON.Position>;
260
259
  getVisibleBounds: () => Promise<VisibleBounds>;
261
260
  queryRenderedFeaturesAtPoint: (
262
261
  point: [screenPointX: number, screenPointY: number],
@@ -283,7 +282,7 @@ export interface MapViewRef {
283
282
  /**
284
283
  * MapView backed by MapLibre Native
285
284
  */
286
- const MapView = memo(
285
+ export const MapView = memo(
287
286
  forwardRef<MapViewRef, MapViewProps>(
288
287
  (
289
288
  {
@@ -305,23 +304,23 @@ const MapView = memo(
305
304
  ref,
306
305
  (): MapViewRef => ({
307
306
  /**
308
- * Converts a geographic coordinate to a point in the given view’s coordinate system.
307
+ * Converts a geographic coordinate to a pixel point of the view.
309
308
  *
310
309
  * @example
311
- * const pointInView = await this._map.getPointInView([-37.817070, 144.949901]);
310
+ * const pointInView = await mapViewRef.current?.getPointInView([-37.817070, 144.949901]);
312
311
  *
313
- * @param {Array<Number>} coordinate - A point expressed in the map view's coordinate system.
314
- * @return {Array}
312
+ * @param {GeoJSON.Position} coordinate Geographic coordinate
313
+ * @return {[x: number, y: number]} Pixel point
315
314
  */
316
315
  getPointInView,
317
316
  /**
318
- * Converts a point in the given view’s coordinate system to a geographic coordinate.
317
+ * Converts a pixel point of the view to a geographic coordinate.
319
318
  *
320
319
  * @example
321
- * const coordinate = await this._map.getCoordinateFromView([100, 100]);
320
+ * const coordinate = await mapViewRef.current?.getCoordinateFromView([100, 100]);
322
321
  *
323
- * @param {Array<Number>} point - A point expressed in the given view’s coordinate system.
324
- * @return {Array}
322
+ * @param {[x: number, y: number]} point Pixel point
323
+ * @return {GeoJSON.Position} Geographic coordinate
325
324
  */
326
325
  getCoordinateFromView,
327
326
  /**
@@ -339,7 +338,7 @@ const MapView = memo(
339
338
  * @example
340
339
  * this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])
341
340
  *
342
- * @param {Array<Number>} coordinate - A point expressed in the map view’s coordinate system.
341
+ * @param {number[]} coordinate - A point expressed in the map view’s coordinate system.
343
342
  * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
344
343
  * @param {Array=} layerIDs - A array of layer id's to filter the features by
345
344
  * @return {GeoJSON.FeatureCollection}
@@ -352,7 +351,7 @@ const MapView = memo(
352
351
  * @example
353
352
  * this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])
354
353
  *
355
- * @param {Array<Number>} bbox - A rectangle expressed in the map view’s coordinate system.
354
+ * @param {number[]} bbox - A rectangle expressed in the map view’s coordinate system.
356
355
  * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
357
356
  * @param {Array=} layerIDs - A array of layer id's to filter the features by
358
357
  * @return {GeoJSON.FeatureCollection}
@@ -360,8 +359,8 @@ const MapView = memo(
360
359
  queryRenderedFeaturesInRect,
361
360
  /**
362
361
  * Takes snapshot of map with current tiles and returns a URI to the image
363
- * @param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64
364
- * @return {String}
362
+ * @param {boolean} writeToDisk If true will create a temp file, otherwise it is in base64
363
+ * @return {string}
365
364
  */
366
365
  takeSnap,
367
366
  /**
@@ -370,7 +369,7 @@ const MapView = memo(
370
369
  * @example
371
370
  * const zoom = await this._map.getZoom();
372
371
  *
373
- * @return {Number}
372
+ * @return {number}
374
373
  */
375
374
  getZoom,
376
375
  /**
@@ -379,7 +378,7 @@ const MapView = memo(
379
378
  * @example
380
379
  * const center = await this._map.getCenter();
381
380
  *
382
- * @return {Array<Number>} Coordinates
381
+ * @return {number[]} Coordinates
383
382
  */
384
383
  getCenter,
385
384
  /**
@@ -389,8 +388,8 @@ const MapView = memo(
389
388
  * await this._map.setSourceVisibility(false, 'composite', 'building')
390
389
  *
391
390
  * @param {boolean} visible - Visibility of the layers
392
- * @param {String} sourceId - Identifier of the target source (e.g. 'composite')
393
- * @param {String=} sourceLayerId - Identifier of the target source-layer (e.g. 'building')
391
+ * @param {string} sourceId - Identifier of the target source (e.g. 'composite')
392
+ * @param {string=} sourceLayerId - Identifier of the target source-layer (e.g. 'building')
394
393
  */
395
394
  setSourceVisibility,
396
395
  /**
@@ -438,46 +437,46 @@ const MapView = memo(
438
437
  const events = [];
439
438
 
440
439
  if (props.onRegionWillChange) {
441
- events.push(MapLibreRN.EventTypes.RegionWillChange);
440
+ events.push(MLRNModule.EventTypes.RegionWillChange);
442
441
  }
443
442
  if (props.onRegionIsChanging) {
444
- events.push(MapLibreRN.EventTypes.RegionIsChanging);
443
+ events.push(MLRNModule.EventTypes.RegionIsChanging);
445
444
  }
446
445
  if (props.onRegionDidChange) {
447
- events.push(MapLibreRN.EventTypes.RegionDidChange);
446
+ events.push(MLRNModule.EventTypes.RegionDidChange);
448
447
  }
449
448
  if (props.onUserLocationUpdate) {
450
- events.push(MapLibreRN.EventTypes.UserLocationUpdated);
449
+ events.push(MLRNModule.EventTypes.UserLocationUpdated);
451
450
  }
452
451
  if (props.onWillStartLoadingMap) {
453
- events.push(MapLibreRN.EventTypes.WillStartLoadingMap);
452
+ events.push(MLRNModule.EventTypes.WillStartLoadingMap);
454
453
  }
455
454
  if (props.onDidFinishLoadingMap) {
456
- events.push(MapLibreRN.EventTypes.DidFinishLoadingMap);
455
+ events.push(MLRNModule.EventTypes.DidFinishLoadingMap);
457
456
  }
458
457
  if (props.onDidFailLoadingMap) {
459
- events.push(MapLibreRN.EventTypes.DidFailLoadingMap);
458
+ events.push(MLRNModule.EventTypes.DidFailLoadingMap);
460
459
  }
461
460
  if (props.onWillStartRenderingFrame) {
462
- events.push(MapLibreRN.EventTypes.WillStartRenderingFrame);
461
+ events.push(MLRNModule.EventTypes.WillStartRenderingFrame);
463
462
  }
464
463
  if (props.onDidFinishRenderingFrame) {
465
- events.push(MapLibreRN.EventTypes.DidFinishRenderingFrame);
464
+ events.push(MLRNModule.EventTypes.DidFinishRenderingFrame);
466
465
  }
467
466
  if (props.onDidFinishRenderingFrameFully) {
468
- events.push(MapLibreRN.EventTypes.DidFinishRenderingFrameFully);
467
+ events.push(MLRNModule.EventTypes.DidFinishRenderingFrameFully);
469
468
  }
470
469
  if (props.onWillStartRenderingMap) {
471
- events.push(MapLibreRN.EventTypes.WillStartRenderingMap);
470
+ events.push(MLRNModule.EventTypes.WillStartRenderingMap);
472
471
  }
473
472
  if (props.onDidFinishRenderingMap) {
474
- events.push(MapLibreRN.EventTypes.DidFinishRenderingMap);
473
+ events.push(MLRNModule.EventTypes.DidFinishRenderingMap);
475
474
  }
476
475
  if (props.onDidFinishRenderingMapFully) {
477
- events.push(MapLibreRN.EventTypes.DidFinishRenderingMapFully);
476
+ events.push(MLRNModule.EventTypes.DidFinishRenderingMapFully);
478
477
  }
479
478
  if (props.onDidFinishLoadingStyle) {
480
- events.push(MapLibreRN.EventTypes.DidFinishLoadingStyle);
479
+ events.push(MLRNModule.EventTypes.DidFinishLoadingStyle);
481
480
  }
482
481
 
483
482
  _runNativeCommand(
@@ -490,22 +489,23 @@ const MapView = memo(
490
489
 
491
490
  const getPointInView = async (
492
491
  coordinate: GeoJSON.Position,
493
- ): Promise<GeoJSON.Point> => {
494
- const res: { pointInView: GeoJSON.Point } = await _runNativeCommand(
495
- "getPointInView",
496
- _nativeRef.current,
497
- [coordinate],
498
- );
492
+ ): Promise<[x: number, y: number]> => {
493
+ const res: { pointInView: [x: number, y: number] } =
494
+ await _runNativeCommand("getPointInView", _nativeRef.current, [
495
+ coordinate,
496
+ ]);
497
+
499
498
  return res.pointInView;
500
499
  };
501
500
 
502
501
  const getCoordinateFromView = async (
503
- point: number[],
502
+ point: [x: number, y: number],
504
503
  ): Promise<GeoJSON.Position> => {
505
504
  const res: { coordinateFromView: GeoJSON.Position } =
506
505
  await _runNativeCommand("getCoordinateFromView", _nativeRef.current, [
507
506
  point,
508
507
  ]);
508
+
509
509
  return res.coordinateFromView;
510
510
  };
511
511
 
@@ -661,7 +661,7 @@ const MapView = memo(
661
661
  let propName: CallableProps | undefined;
662
662
 
663
663
  switch (type) {
664
- case MapLibreRN.EventTypes.RegionWillChange:
664
+ case MLRNModule.EventTypes.RegionWillChange:
665
665
  if (
666
666
  regionWillChangeDebounceTime &&
667
667
  regionWillChangeDebounceTime > 0
@@ -675,10 +675,10 @@ const MapView = memo(
675
675
  propName = "onRegionWillChange";
676
676
  }
677
677
  break;
678
- case MapLibreRN.EventTypes.RegionIsChanging:
678
+ case MLRNModule.EventTypes.RegionIsChanging:
679
679
  propName = "onRegionIsChanging";
680
680
  break;
681
- case MapLibreRN.EventTypes.RegionDidChange:
681
+ case MLRNModule.EventTypes.RegionDidChange:
682
682
  if (
683
683
  regionDidChangeDebounceTime &&
684
684
  regionDidChangeDebounceTime > 0
@@ -692,37 +692,37 @@ const MapView = memo(
692
692
  propName = "onRegionDidChange";
693
693
  }
694
694
  break;
695
- case MapLibreRN.EventTypes.UserLocationUpdated:
695
+ case MLRNModule.EventTypes.UserLocationUpdated:
696
696
  propName = "onUserLocationUpdate";
697
697
  break;
698
- case MapLibreRN.EventTypes.WillStartLoadingMap:
698
+ case MLRNModule.EventTypes.WillStartLoadingMap:
699
699
  propName = "onWillStartLoadingMap";
700
700
  break;
701
- case MapLibreRN.EventTypes.DidFinishLoadingMap:
701
+ case MLRNModule.EventTypes.DidFinishLoadingMap:
702
702
  propName = "onDidFinishLoadingMap";
703
703
  break;
704
- case MapLibreRN.EventTypes.DidFailLoadingMap:
704
+ case MLRNModule.EventTypes.DidFailLoadingMap:
705
705
  propName = "onDidFailLoadingMap";
706
706
  break;
707
- case MapLibreRN.EventTypes.WillStartRenderingFrame:
707
+ case MLRNModule.EventTypes.WillStartRenderingFrame:
708
708
  propName = "onWillStartRenderingFrame";
709
709
  break;
710
- case MapLibreRN.EventTypes.DidFinishRenderingFrame:
710
+ case MLRNModule.EventTypes.DidFinishRenderingFrame:
711
711
  propName = "onDidFinishRenderingFrame";
712
712
  break;
713
- case MapLibreRN.EventTypes.DidFinishRenderingFrameFully:
713
+ case MLRNModule.EventTypes.DidFinishRenderingFrameFully:
714
714
  propName = "onDidFinishRenderingFrameFully";
715
715
  break;
716
- case MapLibreRN.EventTypes.WillStartRenderingMap:
716
+ case MLRNModule.EventTypes.WillStartRenderingMap:
717
717
  propName = "onWillStartRenderingMap";
718
718
  break;
719
- case MapLibreRN.EventTypes.DidFinishRenderingMap:
719
+ case MLRNModule.EventTypes.DidFinishRenderingMap:
720
720
  propName = "onDidFinishRenderingMap";
721
721
  break;
722
- case MapLibreRN.EventTypes.DidFinishRenderingMapFully:
722
+ case MLRNModule.EventTypes.DidFinishRenderingMapFully:
723
723
  propName = "onDidFinishRenderingMapFully";
724
724
  break;
725
- case MapLibreRN.EventTypes.DidFinishLoadingStyle:
725
+ case MLRNModule.EventTypes.DidFinishLoadingStyle:
726
726
  propName = "onDidFinishLoadingStyle";
727
727
  break;
728
728
  default:
@@ -771,27 +771,20 @@ const MapView = memo(
771
771
  }
772
772
  };
773
773
 
774
- const _setStyleURL = (props: MapViewProps): void => {
775
- // user set a styleURL, no need to alter props
776
- if (props.styleURL) {
777
- return;
778
- }
779
-
780
- // user set styleJSON pass it to styleURL
781
- if (props.styleJSON && !props.styleURL) {
782
- props.styleURL = props.styleJSON;
783
- }
784
-
785
- // user neither set styleJSON nor styleURL
786
- // set defaultStyleUrl
787
- if (!props.styleJSON || !props.styleURL) {
788
- props.styleURL = defaultStyleURL;
774
+ const nativeProps = useMemo(() => {
775
+ const { mapStyle, ...otherProps } = props;
776
+
777
+ let nativeMapStyle = undefined;
778
+ if (mapStyle) {
779
+ if (typeof mapStyle === "string") {
780
+ nativeMapStyle = mapStyle;
781
+ } else if (typeof mapStyle === "object") {
782
+ nativeMapStyle = JSON.stringify(mapStyle);
783
+ }
789
784
  }
790
- };
791
785
 
792
- const nativeProps = useMemo(() => {
793
786
  return {
794
- ...props,
787
+ ...otherProps,
795
788
  localizeLabels,
796
789
  scrollEnabled,
797
790
  pitchEnabled,
@@ -801,10 +794,12 @@ const MapView = memo(
801
794
  surfaceView,
802
795
  regionWillChangeDebounceTime,
803
796
  regionDidChangeDebounceTime,
797
+ mapStyle: nativeMapStyle,
804
798
  contentInset: contentInsetValue,
805
799
  style: styles.matchParent,
806
800
  };
807
801
  }, [
802
+ props,
808
803
  localizeLabels,
809
804
  scrollEnabled,
810
805
  pitchEnabled,
@@ -814,12 +809,9 @@ const MapView = memo(
814
809
  surfaceView,
815
810
  regionWillChangeDebounceTime,
816
811
  regionDidChangeDebounceTime,
817
- props,
818
812
  contentInsetValue,
819
813
  ]);
820
814
 
821
- _setStyleURL(nativeProps);
822
-
823
815
  const callbacks = {
824
816
  ref: (ref: MLRNMapViewRefType): void => _setNativeRef(ref),
825
817
  onPress: _onPress,
@@ -865,4 +857,3 @@ if (isAndroid()) {
865
857
  ANDROID_TEXTURE_NATIVE_MODULE_NAME,
866
858
  );
867
859
  }
868
- export default MapView;
@@ -2,7 +2,7 @@ import { point } from "@turf/helpers";
2
2
  import { type ReactElement, useMemo } from "react";
3
3
  import { Platform, requireNativeComponent, type ViewProps } from "react-native";
4
4
 
5
- import PointAnnotation from "./PointAnnotation";
5
+ import { PointAnnotation } from "./PointAnnotation";
6
6
  import { toJSONString } from "../utils";
7
7
 
8
8
  export const NATIVE_MODULE_NAME = "MLRNMarkerView";
@@ -35,7 +35,7 @@ interface MarkerViewProps extends ViewProps {
35
35
  /**
36
36
  * Expects one child - can be container with multiple elements
37
37
  */
38
- children: React.ReactElement;
38
+ children: ReactElement;
39
39
  }
40
40
 
41
41
  interface NativeProps extends ViewProps {
@@ -53,12 +53,12 @@ interface NativeProps extends ViewProps {
53
53
  * This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android
54
54
  * and PointAnnotation on iOS.
55
55
  */
56
- const MarkerView = ({
56
+ export const MarkerView = ({
57
57
  anchor = { x: 0.5, y: 0.5 },
58
58
  allowOverlap = false,
59
59
  isSelected = false,
60
60
  ...rest
61
- }: MarkerViewProps): ReactElement => {
61
+ }: MarkerViewProps) => {
62
62
  const props = { anchor, allowOverlap, isSelected, ...rest };
63
63
  const coordinate = props.coordinate
64
64
  ? toJSONString(point(props.coordinate))
@@ -84,5 +84,3 @@ const MarkerView = ({
84
84
  let lastId = 0;
85
85
 
86
86
  const MLRNMarkerView = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
87
-
88
- export default MarkerView;
@@ -1,4 +1,3 @@
1
- import { type ReactElement } from "react";
2
1
  import { requireNativeComponent } from "react-native";
3
2
 
4
3
  const NATIVE_MODULE_NAME = "MLRNNativeUserLocation";
@@ -26,10 +25,8 @@ interface NativeUserLocationProps {
26
25
  androidPreferredFramesPerSecond?: number;
27
26
  }
28
27
 
29
- const NativeUserLocation = (props: NativeUserLocationProps): ReactElement => {
28
+ export const NativeUserLocation = (props: NativeUserLocationProps) => {
30
29
  return <MLRNNativeUserLocation {...props} />;
31
30
  };
32
31
 
33
32
  const MLRNNativeUserLocation = requireNativeComponent(NATIVE_MODULE_NAME);
34
-
35
- export default NativeUserLocation;
@@ -14,7 +14,7 @@ import {
14
14
  requireNativeComponent,
15
15
  } from "react-native";
16
16
 
17
- import useNativeBridge, { type RNMLEvent } from "../hooks/useNativeBridge";
17
+ import { useNativeBridge, type RNMLEvent } from "../hooks/useNativeBridge";
18
18
  import { isFunction, toJSONString } from "../utils";
19
19
 
20
20
  export const NATIVE_MODULE_NAME = "MLRNPointAnnotation";
@@ -50,7 +50,6 @@ export interface PointAnnotationProps {
50
50
  snippet?: string;
51
51
  /**
52
52
  * Manually selects/deselects annotation
53
- * @type {[type]}
54
53
  */
55
54
  selected?: boolean;
56
55
  /**
@@ -102,7 +101,7 @@ export interface PointAnnotationProps {
102
101
  /**
103
102
  * Expects one child, and an optional callout can be added as well
104
103
  */
105
- children: React.ReactElement | [React.ReactElement, React.ReactElement];
104
+ children: ReactElement | [ReactElement, ReactElement];
106
105
 
107
106
  style?: ViewProps["style"];
108
107
  }
@@ -118,14 +117,16 @@ export interface PointAnnotationRef {
118
117
  /**
119
118
  * PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.
120
119
  *
121
- * Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,
122
- * they'll offer much better performance
120
+ * Consider using ShapeSource and SymbolLayer instead, if you have many points, and you have static images,
121
+ * they'll offer much better performance.
123
122
  *
124
- * .
125
- * If you need interctive views please use MarkerView,
123
+ * If you need interactive views please use MarkerView,
126
124
  * as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
127
125
  */
128
- const PointAnnotation = forwardRef<PointAnnotationRef, PointAnnotationProps>(
126
+ export const PointAnnotation = forwardRef<
127
+ PointAnnotationRef,
128
+ PointAnnotationProps
129
+ >(
129
130
  (
130
131
  {
131
132
  anchor = { x: 0.5, y: 0.5 },
@@ -133,7 +134,7 @@ const PointAnnotation = forwardRef<PointAnnotationRef, PointAnnotationProps>(
133
134
  ...props
134
135
  }: PointAnnotationProps,
135
136
  ref,
136
- ): ReactElement => {
137
+ ) => {
137
138
  useImperativeHandle(
138
139
  ref,
139
140
  (): PointAnnotationRef => ({
@@ -241,5 +242,3 @@ PointAnnotation.displayName = "PointAnnotation";
241
242
 
242
243
  const MLRNPointAnnotation =
243
244
  requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
244
-
245
- export default PointAnnotation;
@@ -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 RasterLayerStyleProps } from "../utils/MapLibreRNStyles";
9
+ import { type RasterLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
- const MapLibreRN = NativeModules.MLRNModule;
11
+ const MLRNModule = NativeModules.MLRNModule;
12
12
 
13
13
  export const NATIVE_MODULE_NAME = "MLRNRasterLayer";
14
14
 
@@ -16,7 +16,7 @@ export interface RasterLayerProps extends BaseProps, BaseLayerProps {
16
16
  /**
17
17
  * Customizable style attributes
18
18
  */
19
- style?: RasterLayerStyleProps;
19
+ style?: RasterLayerStyle;
20
20
  }
21
21
 
22
22
  interface NativeProps
@@ -25,8 +25,8 @@ interface NativeProps
25
25
 
26
26
  const MLRNRasterLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
27
27
 
28
- const RasterLayer: React.FC<RasterLayerProps> = ({
29
- sourceID = MapLibreRN.StyleSource.DefaultSourceID,
28
+ export const RasterLayer = ({
29
+ sourceID = MLRNModule.StyleSource.DefaultSourceID,
30
30
  ...props
31
31
  }: RasterLayerProps) => {
32
32
  const { baseProps, setNativeLayer } = useAbstractLayer<
@@ -39,5 +39,3 @@ const RasterLayer: React.FC<RasterLayerProps> = ({
39
39
 
40
40
  return <MLRNRasterLayer ref={setNativeLayer} {...baseProps} />;
41
41
  };
42
-
43
- export default RasterLayer;
@@ -1,12 +1,12 @@
1
- import React from "react";
1
+ import { type ReactNode } from "react";
2
2
  import { NativeModules, requireNativeComponent } from "react-native";
3
3
 
4
- import useAbstractSource from "../hooks/useAbstractSource";
5
- import useOnce from "../hooks/useOnce";
4
+ import { useAbstractSource } from "../hooks/useAbstractSource";
5
+ import { useOnce } from "../hooks/useOnce";
6
6
  import { type BaseProps } from "../types/BaseProps";
7
7
  import { cloneReactChildrenWithProps } from "../utils";
8
8
 
9
- const MapLibreRN = NativeModules.MLRNModule;
9
+ const MLRNModule = NativeModules.MLRNModule;
10
10
 
11
11
  export const NATIVE_MODULE_NAME = "MLRNRasterSource";
12
12
 
@@ -55,7 +55,7 @@ interface RasterSourceProps extends BaseProps {
55
55
  */
56
56
  attribution?: string;
57
57
 
58
- children?: React.ReactElement | React.ReactElement[];
58
+ children?: ReactNode;
59
59
  }
60
60
 
61
61
  type NativeProps = RasterSourceProps;
@@ -68,8 +68,8 @@ const MLRNRasterSource =
68
68
  * The location of and metadata about the tiles are defined either by an option dictionary
69
69
  * or by an external file that conforms to the TileJSON specification.
70
70
  */
71
- const RasterSource: React.FC<RasterSourceProps> = ({
72
- id = MapLibreRN.StyleSource.DefaultSourceID,
71
+ export const RasterSource = ({
72
+ id = MLRNModule.StyleSource.DefaultSourceID,
73
73
  ...props
74
74
  }: RasterSourceProps) => {
75
75
  useOnce(() => {
@@ -110,5 +110,3 @@ const RasterSource: React.FC<RasterSourceProps> = ({
110
110
  </MLRNRasterSource>
111
111
  );
112
112
  };
113
-
114
- export default RasterSource;