@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/index.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import * as MapLibreRN from "./MapLibreRN";
2
2
  export * from "./MapLibreRN";
3
3
 
4
+ /**
5
+ * @deprecated Use named imports or `import * as MapLibreRN` instead
6
+ */
4
7
  export default MapLibreRN;
@@ -4,26 +4,26 @@ import {
4
4
  type EmitterSubscription,
5
5
  } from "react-native";
6
6
 
7
- const MapLibreRN = NativeModules.MLRNModule;
7
+ const MLRNModule = NativeModules.MLRNModule;
8
8
  const MLRNLocationModule = NativeModules.MLRNLocationModule;
9
9
 
10
10
  export const LocationModuleEventEmitter = new NativeEventEmitter(
11
11
  MLRNLocationModule,
12
12
  );
13
13
 
14
- /**
15
- * Location sent by locationManager
14
+ /*
15
+ * Location sent by LocationManager
16
16
  */
17
17
  export interface Location {
18
18
  coords: Coordinates;
19
19
  timestamp?: number;
20
20
  }
21
21
 
22
- /**
23
- * Coorinates sent by locationManager
22
+ /*
23
+ * Coordinates sent by LocationManager
24
24
  */
25
25
  interface Coordinates {
26
- /**
26
+ /*
27
27
  * The heading (measured in degrees) relative to true north.
28
28
  * Heading is used to describe the direction the device is pointing to (the value of the compass).
29
29
  * Note that on Android this is incorrectly reporting the course value as mentioned in issue https://github.com/rnmapbox/maps/issues/1213
@@ -31,33 +31,33 @@ interface Coordinates {
31
31
  */
32
32
  heading?: number;
33
33
 
34
- /**
34
+ /*
35
35
  * The direction in which the device is traveling, measured in degrees and relative to due north.
36
36
  * The course refers to the direction the device is actually moving (not the same as heading).
37
37
  */
38
38
  course?: number;
39
39
 
40
- /**
40
+ /*
41
41
  * The instantaneous speed of the device, measured in meters per second.
42
42
  */
43
43
  speed?: number;
44
44
 
45
- /**
45
+ /*
46
46
  * The latitude in degrees.
47
47
  */
48
48
  latitude: number;
49
49
 
50
- /**
50
+ /*
51
51
  * The longitude in degrees.
52
52
  */
53
53
  longitude: number;
54
54
 
55
- /**
55
+ /*
56
56
  * The radius of uncertainty for the location, measured in meters.
57
57
  */
58
58
  accuracy?: number;
59
59
 
60
- /**
60
+ /*
61
61
  * The altitude, measured in meters.
62
62
  */
63
63
  altitude?: number;
@@ -88,7 +88,7 @@ class LocationManager {
88
88
  try {
89
89
  lastKnownLocation = await MLRNLocationModule.getLastKnownLocation();
90
90
  } catch (error) {
91
- console.log("locationManager Error: ", error);
91
+ console.log("LocationManager Error: ", error);
92
92
  }
93
93
 
94
94
  if (!this._lastKnownLocation && lastKnownLocation) {
@@ -129,7 +129,7 @@ class LocationManager {
129
129
  MLRNLocationModule.start(displacement);
130
130
 
131
131
  this.subscription = LocationModuleEventEmitter.addListener(
132
- MapLibreRN.LocationCallbackName.Update,
132
+ MLRNModule.LocationCallbackName.Update,
133
133
  this.onUpdate,
134
134
  );
135
135
 
@@ -158,4 +158,5 @@ class LocationManager {
158
158
  }
159
159
  }
160
160
 
161
- export default new LocationManager();
161
+ const locationManager = new LocationManager();
162
+ export { locationManager as LocationManager };
@@ -9,7 +9,7 @@ export interface OfflineCreatePackInputOptions {
9
9
  metadata?: Record<string, any>;
10
10
  }
11
11
 
12
- class OfflineCreatePackOptions {
12
+ export class OfflineCreatePackOptions {
13
13
  name: string;
14
14
  styleURL: string;
15
15
  bounds: string;
@@ -51,5 +51,3 @@ class OfflineCreatePackOptions {
51
51
  });
52
52
  }
53
53
  }
54
-
55
- export default OfflineCreatePackOptions;
@@ -4,29 +4,19 @@ import {
4
4
  type EventSubscription,
5
5
  } from "react-native";
6
6
 
7
- import OfflineCreatePackOptions, {
7
+ import {
8
+ OfflineCreatePackOptions,
8
9
  type OfflineCreatePackInputOptions,
9
10
  } from "./OfflineCreatePackOptions";
10
- import OfflinePack from "./OfflinePack";
11
+ import { OfflinePack, type OfflinePackStatus } from "./OfflinePack";
11
12
  import { isUndefined, isFunction, isAndroid } from "../../utils";
12
13
 
13
- const MapLibreRN = NativeModules.MLRNModule;
14
+ const MLRNModule = NativeModules.MLRNModule;
14
15
  const MLRNOfflineModule = NativeModules.MLRNOfflineModule;
15
16
  export const OfflineModuleEventEmitter = new NativeEventEmitter(
16
17
  MLRNOfflineModule,
17
18
  );
18
19
 
19
- export type OfflineProgressStatus = {
20
- name: string;
21
- state: number;
22
- percentage: number;
23
- completedResourceSize: number;
24
- completedTileCount: number;
25
- completedResourceCount: number;
26
- requiredResourceCount: number;
27
- completedTileSize: number;
28
- };
29
-
30
20
  export type OfflinePackError = {
31
21
  name: string;
32
22
  message: string;
@@ -37,13 +27,10 @@ type ErrorEvent = {
37
27
  };
38
28
 
39
29
  type ProgressEvent = {
40
- payload: OfflineProgressStatus;
30
+ payload: OfflinePackStatus;
41
31
  };
42
32
 
43
- type ProgressListener = (
44
- pack: OfflinePack,
45
- status: OfflineProgressStatus,
46
- ) => void;
33
+ type ProgressListener = (pack: OfflinePack, status: OfflinePackStatus) => void;
47
34
  type ErrorListener = (pack: OfflinePack, err: OfflinePackError) => void;
48
35
 
49
36
  /**
@@ -81,7 +68,7 @@ class OfflineManager {
81
68
  * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);
82
69
  * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err);
83
70
  *
84
- * await MapLibreGL.offlineManager.createPack({
71
+ * await OfflineManager.createPack({
85
72
  * name: 'offlinePack',
86
73
  * styleURL: 'https://demotiles.maplibre.org/tiles/tiles.json',
87
74
  * minZoom: 14,
@@ -120,9 +107,9 @@ class OfflineManager {
120
107
  * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded.
121
108
  *
122
109
  * @example
123
- * await MapLibreGL.offlineManager.invalidatePack('packName')
110
+ * await OfflineManager.invalidatePack('packName')
124
111
  *
125
- * @param {String} name Name of the offline pack.
112
+ * @param {string} name Name of the offline pack.
126
113
  * @return {void}
127
114
  */
128
115
  async invalidatePack(name: string): Promise<void> {
@@ -142,9 +129,9 @@ class OfflineManager {
142
129
  * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed.
143
130
  *
144
131
  * @example
145
- * await MapLibreGL.offlineManager.deletePack('packName')
132
+ * await OfflineManager.deletePack('packName')
146
133
  *
147
- * @param {String} name Name of the offline pack.
134
+ * @param {string} name Name of the offline pack.
148
135
  * @return {void}
149
136
  */
150
137
  async deletePack(name: string): Promise<void> {
@@ -168,7 +155,7 @@ class OfflineManager {
168
155
  * It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects.
169
156
  *
170
157
  * @example
171
- * await MapLibreGL.offlineManager.invalidateAmbientCache();
158
+ * await OfflineManager.invalidateAmbientCache();
172
159
  *
173
160
  * @return {void}
174
161
  */
@@ -182,7 +169,7 @@ class OfflineManager {
182
169
  * This method clears the cache and decreases the amount of space that map resources take up on the device.
183
170
  *
184
171
  * @example
185
- * await MapLibreGL.offlineManager.clearAmbientCache();
172
+ * await OfflineManager.clearAmbientCache();
186
173
  *
187
174
  * @return {void}
188
175
  */
@@ -196,9 +183,9 @@ class OfflineManager {
196
183
  * This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased.
197
184
  *
198
185
  * @example
199
- * await MapLibreGL.offlineManager.setMaximumAmbientCacheSize(5000000);
186
+ * await OfflineManager.setMaximumAmbientCacheSize(5000000);
200
187
  *
201
- * @param {Number} size Size of ambient cache.
188
+ * @param {number} size Size of ambient cache.
202
189
  * @return {void}
203
190
  */
204
191
  async setMaximumAmbientCacheSize(size: number): Promise<void> {
@@ -210,7 +197,7 @@ class OfflineManager {
210
197
  * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it.
211
198
  *
212
199
  * @example
213
- * await MapLibreGL.offlineManager.resetDatabase();
200
+ * await OfflineManager.resetDatabase();
214
201
  *
215
202
  * @return {void}
216
203
  */
@@ -223,7 +210,7 @@ class OfflineManager {
223
210
  * Retrieves all the current offline packs that are stored in the database.
224
211
  *
225
212
  * @example
226
- * const offlinePacks = await MapLibreGL.offlineManager.getPacks();
213
+ * const offlinePacks = await OfflineManager.getPacks();
227
214
  *
228
215
  * @return {Array<OfflinePack>}
229
216
  */
@@ -239,9 +226,9 @@ class OfflineManager {
239
226
  * Retrieves an offline pack that is stored in the database by name.
240
227
  *
241
228
  * @example
242
- * const offlinePack = await MapLibreGL.offlineManager.getPack();
229
+ * const offlinePack = await OfflineManager.getPack();
243
230
  *
244
- * @param {String} name Name of the offline pack.
231
+ * @param {string} name Name of the offline pack.
245
232
  * @return {OfflinePack}
246
233
  */
247
234
  async getPack(name: string) {
@@ -253,9 +240,9 @@ class OfflineManager {
253
240
  * Sideloads offline db
254
241
  *
255
242
  * @example
256
- * await MapLibreGL.offlineManager.mergeOfflineRegions(path);
243
+ * await OfflineManager.mergeOfflineRegions(path);
257
244
  *
258
- * @param {String} path Path to offline tile db on file system.
245
+ * @param {string} path Path to offline tile db on file system.
259
246
  * @return {void}
260
247
  */
261
248
  async mergeOfflineRegions(path: string): Promise<void> {
@@ -268,9 +255,9 @@ class OfflineManager {
268
255
  * Consult the Terms of Service for your map tile host before changing this value.
269
256
  *
270
257
  * @example
271
- * MapLibreGL.offlineManager.setTileCountLimit(1000);
258
+ * OfflineManager.setTileCountLimit(1000);
272
259
  *
273
- * @param {Number} limit Map tile limit count.
260
+ * @param {number} limit Map tile limit count.
274
261
  * @return {void}
275
262
  */
276
263
  setTileCountLimit(limit: number): void {
@@ -282,9 +269,9 @@ class OfflineManager {
282
269
  * The default is 500ms.
283
270
  *
284
271
  * @example
285
- * MapLibreGL.offlineManager.setProgressEventThrottle(500);
272
+ * OfflineManager.setProgressEventThrottle(500);
286
273
  *
287
- * @param {Number} throttleValue event throttle value in ms.
274
+ * @param {number} throttleValue event throttle value in ms.
288
275
  * @return {void}
289
276
  */
290
277
  setProgressEventThrottle(throttleValue: number): void {
@@ -298,7 +285,7 @@ class OfflineManager {
298
285
  * @example
299
286
  * const progressListener = (offlinePack, status) => console.log(offlinePack, status)
300
287
  * const errorListener = (offlinePack, err) => console.log(offlinePack, err)
301
- * MapLibreGL.offlineManager.subscribe('packName', progressListener, errorListener)
288
+ * OfflineManager.subscribe('packName', progressListener, errorListener)
302
289
  *
303
290
  * @param {string} packName Name of the offline pack.
304
291
  * @param {ProgressListener} progressListener Callback that listens for status events while downloading the offline resource.
@@ -314,7 +301,7 @@ class OfflineManager {
314
301
  if (isFunction(progressListener)) {
315
302
  if (totalProgressListeners === 0) {
316
303
  this.subscriptionProgress = OfflineModuleEventEmitter.addListener(
317
- MapLibreRN.OfflineCallbackName.Progress,
304
+ MLRNModule.OfflineCallbackName.Progress,
318
305
  this._onProgress,
319
306
  );
320
307
  }
@@ -325,7 +312,7 @@ class OfflineManager {
325
312
  if (isFunction(errorListener)) {
326
313
  if (totalErrorListeners === 0) {
327
314
  this.subscriptionError = OfflineModuleEventEmitter.addListener(
328
- MapLibreRN.OfflineCallbackName.Error,
315
+ MLRNModule.OfflineCallbackName.Error,
329
316
  this._onError,
330
317
  );
331
318
  }
@@ -349,9 +336,9 @@ class OfflineManager {
349
336
  * It's a good idea to call this on componentWillUnmount.
350
337
  *
351
338
  * @example
352
- * MapLibreGL.offlineManager.unsubscribe('packName')
339
+ * OfflineManager.unsubscribe('packName')
353
340
  *
354
- * @param {String} packName Name of the offline pack.
341
+ * @param {string} packName Name of the offline pack.
355
342
  * @return {void}
356
343
  */
357
344
  unsubscribe(packName: string): void {
@@ -404,7 +391,7 @@ class OfflineManager {
404
391
  }
405
392
 
406
393
  // cleanup listeners now that they are no longer needed
407
- if (state === MapLibreRN.OfflinePackDownloadState.Complete) {
394
+ if (state === MLRNModule.OfflinePackDownloadState.Complete) {
408
395
  this.unsubscribe(name);
409
396
  }
410
397
  }
@@ -435,4 +422,4 @@ class OfflineManager {
435
422
  }
436
423
 
437
424
  const offlineManager = new OfflineManager();
438
- export default offlineManager;
425
+ export { offlineManager as OfflineManager };
@@ -1,6 +1,6 @@
1
1
  import { NativeModules } from "react-native";
2
2
 
3
- import OfflineCreatePackOptions from "./OfflineCreatePackOptions";
3
+ import { OfflineCreatePackOptions } from "./OfflineCreatePackOptions";
4
4
 
5
5
  const MLRNOfflineModule = NativeModules.MLRNOfflineModule;
6
6
 
@@ -10,12 +10,12 @@ export type OfflinePackStatus = {
10
10
  percentage: number;
11
11
  completedResourceCount: number;
12
12
  completedResourceSize: number;
13
- completedTileSize: number;
14
13
  completedTileCount: number;
14
+ completedTileSize: number;
15
15
  requiredResourceCount: number;
16
16
  };
17
17
 
18
- class OfflinePack {
18
+ export class OfflinePack {
19
19
  private pack: OfflineCreatePackOptions;
20
20
  private _metadata: Record<string, any> | null;
21
21
 
@@ -52,5 +52,3 @@ class OfflinePack {
52
52
  return MLRNOfflineModule.pausePackDownload(this.name);
53
53
  }
54
54
  }
55
-
56
- export default OfflinePack;
@@ -1,11 +1,11 @@
1
1
  import { NativeModules } from "react-native";
2
2
 
3
- import SnapshotOptions, { type SnapshotInputOptions } from "./SnapshotOptions";
3
+ import { SnapshotOptions, type SnapshotInputOptions } from "./SnapshotOptions";
4
4
 
5
5
  const MLRNSnapshotModule = NativeModules.MLRNSnapshotModule;
6
6
 
7
7
  /**
8
- * The snapshotManager generates static raster images of the map.
8
+ * The SnapshotManager generates static raster images of the map.
9
9
  * Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide.
10
10
  * The snapshotter generates the snapshot asynchronous.
11
11
  */
@@ -16,35 +16,35 @@ class SnapshotManager {
16
16
  * @example
17
17
  *
18
18
  * // creates a temp file png of base map
19
- * const uri = await MapLibreGL.snapshotManager.takeSnap({
19
+ * const uri = await SnapshotManager.takeSnap({
20
20
  * centerCoordinate: [-74.126410, 40.797968],
21
21
  * width: width,
22
22
  * height: height,
23
23
  * zoomLevel: 12,
24
24
  * pitch: 30,
25
25
  * heading: 20,
26
- * styleURL: MapLibreGL.StyleURL.Default,
26
+ * styleURL: StyleURL.Default,
27
27
  * writeToDisk: true, // Create a temporary file
28
28
  * });
29
29
  *
30
30
  * // creates base64 png of base map without logo
31
- * const uri = await MapLibreGL.snapshotManager.takeSnap({
31
+ * const uri = await SnapshotManager.takeSnap({
32
32
  * centerCoordinate: [-74.126410, 40.797968],
33
33
  * width: width,
34
34
  * height: height,
35
35
  * zoomLevel: 12,
36
36
  * pitch: 30,
37
37
  * heading: 20,
38
- * styleURL: MapLibreGL.StyleURL.Default,
38
+ * styleURL: StyleURL.Default,
39
39
  * withLogo: false, // Disable Mapbox logo (Android only)
40
40
  * });
41
41
  *
42
42
  * // creates snapshot with bounds
43
- * const uri = await MapLibreGL.snapshotManager.takeSnap({
43
+ * const uri = await SnapshotManager.takeSnap({
44
44
  * bounds: [[-74.126410, 40.797968], [-74.143727, 40.772177]],
45
45
  * width: width,
46
46
  * height: height,
47
- * styleURL: MapLibreGL.StyleURL.Default,
47
+ * styleURL: StyleURL.Default,
48
48
  * });
49
49
  *
50
50
  * @param {SnapshotOptions} options Snapshot options for create a static image of the base map
@@ -59,4 +59,4 @@ class SnapshotManager {
59
59
  }
60
60
 
61
61
  const snapshotManager = new SnapshotManager();
62
- export default snapshotManager;
62
+ export { snapshotManager as SnapshotManager };
@@ -3,7 +3,7 @@ import { NativeModules } from "react-native";
3
3
 
4
4
  import { toJSONString } from "../../utils";
5
5
 
6
- const MapLibreRN = NativeModules.MLRNModule;
6
+ const MLRNModule = NativeModules.MLRNModule;
7
7
 
8
8
  export interface SnapshotInputOptions {
9
9
  centerCoordinate?: GeoJSON.Position;
@@ -50,7 +50,7 @@ export class SnapshotOptions {
50
50
  );
51
51
  }
52
52
 
53
- this.styleURL = options.styleURL || MapLibreRN.StyleURL.Default;
53
+ this.styleURL = options.styleURL || MLRNModule.StyleURL.Default;
54
54
  this.heading = options.heading || 0.0;
55
55
  this.pitch = options.pitch || 0.0;
56
56
  this.zoomLevel = options.zoomLevel || 16.0;
@@ -99,5 +99,3 @@ export class SnapshotOptions {
99
99
  return toJSONString(featureCollection(features));
100
100
  }
101
101
  }
102
-
103
- export default SnapshotOptions;
@@ -0,0 +1,83 @@
1
+ type VersionString =
2
+ | `${number}.${number}.${number}`
3
+ | `${number}.${number}.${number}-${string}`;
4
+
5
+ export type MapLibrePluginProps =
6
+ | {
7
+ /**
8
+ * Properties relevant only for Android
9
+ *
10
+ * @platform android
11
+ */
12
+ android?: {
13
+ /**
14
+ * Version for `org.maplibre.gl:android-sdk`
15
+ */
16
+ nativeVersion?: VersionString;
17
+ /**
18
+ * Version for `org.maplibre.gl:android-plugin-*-v9`
19
+ */
20
+ pluginVersion?: VersionString;
21
+ /**
22
+ * Version for `org.maplibre.gl:android-sdk-turf`
23
+ */
24
+ turfVersion?: VersionString;
25
+ /**
26
+ * Version for `com.squareup.okhttp3:okhttp`
27
+ */
28
+ okhttpVersion?: VersionString;
29
+
30
+ /**
31
+ * Location engine to be used
32
+ *
33
+ * - `default`: Used per default from MapLibre; F-Droid compatible
34
+ * - `google`: Google Play Services Location Engine for higher precision; F-Droid incompatible
35
+ *
36
+ * @default "default"
37
+ */
38
+ locationEngine?: "default" | "google";
39
+ /**
40
+ * Version for `com.google.android.gms:play-services-location`, only used with `locationEngine: "google"`
41
+ */
42
+ googlePlayServicesLocationVersion?: VersionString;
43
+ };
44
+
45
+ /**
46
+ * Properties relevant only for iOS
47
+ *
48
+ * @platform ios
49
+ */
50
+ ios?: {
51
+ /**
52
+ * Version for `maplibre-gl-native-distribution`
53
+ */
54
+ nativeVersion?: VersionString;
55
+
56
+ /**
57
+ * Swift Package Manager spec to override the selected version range
58
+ *
59
+ * @default `{
60
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
61
+ * requirement: {
62
+ * kind: "exactVersion",
63
+ * version: $MLRN_NATIVE_VERSION
64
+ * },
65
+ * product_name: "MapLibre"
66
+ * }`
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * spmSpec: `{
71
+ * url: "https://github.com/maplibre/maplibre-gl-native-distribution",
72
+ * requirement: {
73
+ * kind: "upToNextMajorVersion",
74
+ * minimumVersion: "x.x.x"
75
+ * },
76
+ * product_name: "MapLibre"
77
+ * }`
78
+ * ```
79
+ */
80
+ spmSpec?: string;
81
+ };
82
+ }
83
+ | undefined;
@@ -0,0 +1,64 @@
1
+ import {
2
+ type ConfigPlugin,
3
+ withGradleProperties as withGradlePropertiesExpo,
4
+ } from "@expo/config-plugins";
5
+ import type { PropertiesItem } from "@expo/config-plugins/build/android/Properties";
6
+
7
+ import type { MapLibrePluginProps } from "./MapLibrePluginProps";
8
+
9
+ type PropertyItem = {
10
+ type: "property";
11
+ key: string;
12
+ value: string;
13
+ };
14
+
15
+ export const getGradleProperties = (
16
+ props: MapLibrePluginProps,
17
+ ): PropertyItem[] => {
18
+ return Object.entries(props?.android || {}).reduce(
19
+ (properties, [key, value]) => {
20
+ if (key && value) {
21
+ properties.push({
22
+ type: "property",
23
+ key: `org.maplibre.reactnative.${key}`,
24
+ value: value.toString(),
25
+ });
26
+ }
27
+
28
+ return properties;
29
+ },
30
+ [] as PropertyItem[],
31
+ );
32
+ };
33
+
34
+ export const mergeGradleProperties = (
35
+ oldProperties: PropertiesItem[],
36
+ newProperties: PropertyItem[],
37
+ ): PropertiesItem[] => {
38
+ const newPropertiesKeys = newProperties.map(({ key }) => key);
39
+ const merged = oldProperties.filter(
40
+ (item) =>
41
+ !(item.type === "property" && newPropertiesKeys.includes(item.key)),
42
+ );
43
+
44
+ merged.push(...newProperties);
45
+
46
+ return merged;
47
+ };
48
+
49
+ export const withGradleProperties: ConfigPlugin<MapLibrePluginProps> = (
50
+ config,
51
+ props,
52
+ ) => {
53
+ const gradleProperties = getGradleProperties(props);
54
+
55
+ return withGradlePropertiesExpo(config, (c) => {
56
+ c.modResults = mergeGradleProperties(c.modResults, gradleProperties);
57
+
58
+ return c;
59
+ });
60
+ };
61
+
62
+ export const android = {
63
+ withGradleProperties,
64
+ };