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

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
@@ -1,7 +1,6 @@
1
1
  package org.maplibre.reactnative.components.mapview;
2
2
 
3
3
  import android.util.Log;
4
- import android.view.Gravity;
5
4
  import android.view.View;
6
5
 
7
6
  import com.facebook.react.bridge.ReactApplicationContext;
@@ -11,23 +10,17 @@ import com.facebook.react.common.MapBuilder;
11
10
  import com.facebook.react.uimanager.LayoutShadowNode;
12
11
  import com.facebook.react.uimanager.ThemedReactContext;
13
12
  import com.facebook.react.uimanager.annotations.ReactProp;
14
- import org.maplibre.android.geometry.LatLngBounds;
15
- import org.maplibre.android.log.Logger;
13
+
16
14
  import org.maplibre.android.maps.MapLibreMap;
17
15
  import org.maplibre.reactnative.components.AbstractEventEmitter;
18
16
  import org.maplibre.reactnative.events.constants.EventKeys;
19
17
  import org.maplibre.reactnative.utils.ConvertUtils;
20
18
  import org.maplibre.reactnative.utils.ExpressionParser;
21
19
  import org.maplibre.reactnative.utils.GeoJSONUtils;
22
- import org.maplibre.geojson.FeatureCollection;
23
- import org.maplibre.geojson.Point;
24
20
 
25
21
  import java.util.ArrayList;
26
22
  import java.util.HashMap;
27
23
  import java.util.Map;
28
- import java.util.concurrent.ExecutionException;
29
- import java.util.concurrent.FutureTask;
30
- import java.util.concurrent.RunnableFuture;
31
24
 
32
25
  import javax.annotation.Nullable;
33
26
 
@@ -111,9 +104,9 @@ public class MLRNMapViewManager extends AbstractEventEmitter<MLRNMapView> {
111
104
 
112
105
  //region React Props
113
106
 
114
- @ReactProp(name="styleURL")
115
- public void setStyleURL(MLRNMapView mapView, String styleURL) {
116
- mapView.setReactStyleURL(styleURL);
107
+ @ReactProp(name="mapStyle")
108
+ public void setMapStyle(MLRNMapView mapView, String mapStyle) {
109
+ mapView.setReactMapStyle(mapStyle);
117
110
  }
118
111
 
119
112
  @ReactProp(name="preferredFramesPerSecond")
@@ -35,10 +35,7 @@ public class MLRNStyle {
35
35
 
36
36
  while (it.hasNextKey()) {
37
37
  String key = it.nextKey();
38
-
39
- if (!key.equals("__MAPBOX_STYLESHEET__")) {
40
- keys.add(key);
41
- }
38
+ keys.add(key);
42
39
  }
43
40
 
44
41
  return keys;
@@ -9,7 +9,6 @@ import org.maplibre.android.style.layers.FillExtrusionLayer;
9
9
  import org.maplibre.android.style.layers.FillLayer;
10
10
  import org.maplibre.android.style.layers.LineLayer;
11
11
  import org.maplibre.android.style.layers.PropertyFactory;
12
- import org.maplibre.android.style.layers.PropertyValue;
13
12
  import org.maplibre.android.style.layers.RasterLayer;
14
13
  import org.maplibre.android.style.layers.SymbolLayer;
15
14
  import org.maplibre.android.style.layers.HeatmapLayer;
@@ -28,7 +27,7 @@ public class MLRNStyleFactory {
28
27
  public static void setFillLayerStyle(final FillLayer layer, MLRNStyle style) {
29
28
  List<String> styleKeys = style.getAllStyleKeys();
30
29
 
31
- if (styleKeys.size() == 0) {
30
+ if (styleKeys.isEmpty()) {
32
31
  return;
33
32
  }
34
33
 
@@ -89,7 +88,7 @@ public class MLRNStyleFactory {
89
88
  public static void setLineLayerStyle(final LineLayer layer, MLRNStyle style) {
90
89
  List<String> styleKeys = style.getAllStyleKeys();
91
90
 
92
- if (styleKeys.size() == 0) {
91
+ if (styleKeys.isEmpty()) {
93
92
  return;
94
93
  }
95
94
 
@@ -186,7 +185,7 @@ public class MLRNStyleFactory {
186
185
  public static void setSymbolLayerStyle(final SymbolLayer layer, MLRNStyle style) {
187
186
  List<String> styleKeys = style.getAllStyleKeys();
188
187
 
189
- if (styleKeys.size() == 0) {
188
+ if (styleKeys.isEmpty()) {
190
189
  return;
191
190
  }
192
191
 
@@ -409,7 +408,7 @@ public class MLRNStyleFactory {
409
408
  public static void setCircleLayerStyle(final CircleLayer layer, MLRNStyle style) {
410
409
  List<String> styleKeys = style.getAllStyleKeys();
411
410
 
412
- if (styleKeys.size() == 0) {
411
+ if (styleKeys.isEmpty()) {
413
412
  return;
414
413
  }
415
414
 
@@ -486,7 +485,7 @@ public class MLRNStyleFactory {
486
485
  public static void setHeatmapLayerStyle(final HeatmapLayer layer, MLRNStyle style) {
487
486
  List<String> styleKeys = style.getAllStyleKeys();
488
487
 
489
- if (styleKeys.size() == 0) {
488
+ if (styleKeys.isEmpty()) {
490
489
  return;
491
490
  }
492
491
 
@@ -527,7 +526,7 @@ public class MLRNStyleFactory {
527
526
  public static void setFillExtrusionLayerStyle(final FillExtrusionLayer layer, MLRNStyle style) {
528
527
  List<String> styleKeys = style.getAllStyleKeys();
529
528
 
530
- if (styleKeys.size() == 0) {
529
+ if (styleKeys.isEmpty()) {
531
530
  return;
532
531
  }
533
532
 
@@ -591,7 +590,7 @@ public class MLRNStyleFactory {
591
590
  public static void setRasterLayerStyle(final RasterLayer layer, MLRNStyle style) {
592
591
  List<String> styleKeys = style.getAllStyleKeys();
593
592
 
594
- if (styleKeys.size() == 0) {
593
+ if (styleKeys.isEmpty()) {
595
594
  return;
596
595
  }
597
596
 
@@ -650,7 +649,7 @@ public class MLRNStyleFactory {
650
649
  public static void setHillshadeLayerStyle(final HillshadeLayer layer, MLRNStyle style) {
651
650
  List<String> styleKeys = style.getAllStyleKeys();
652
651
 
653
- if (styleKeys.size() == 0) {
652
+ if (styleKeys.isEmpty()) {
654
653
  return;
655
654
  }
656
655
 
@@ -697,7 +696,7 @@ public class MLRNStyleFactory {
697
696
  public static void setBackgroundLayerStyle(final BackgroundLayer layer, MLRNStyle style) {
698
697
  List<String> styleKeys = style.getAllStyleKeys();
699
698
 
700
- if (styleKeys.size() == 0) {
699
+ if (styleKeys.isEmpty()) {
701
700
  return;
702
701
  }
703
702
 
@@ -737,7 +736,7 @@ public class MLRNStyleFactory {
737
736
  public static void setLightLayerStyle(final Light layer, MLRNStyle style) {
738
737
  List<String> styleKeys = style.getAllStyleKeys();
739
738
 
740
- if (styleKeys.size() == 0) {
739
+ if (styleKeys.isEmpty()) {
741
740
  return;
742
741
  }
743
742
 
@@ -243,70 +243,4 @@ public class MLRNShapeSource extends MLRNSource<GeoJsonSource> {
243
243
  AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
244
244
  mManager.handleEvent(event);
245
245
  }
246
-
247
- // Deprecated. Will be removed in 9+ ver.
248
- public void getClusterExpansionZoomById(String callbackID, int clusterId) {
249
- if (mSource == null) {
250
- WritableMap payload = new WritableNativeMap();
251
- payload.putString("error", "source is not yet loaded");
252
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
253
- mManager.handleEvent(event);
254
- return;
255
- }
256
- List<Feature> features = mSource.querySourceFeatures(Expression.eq(Expression.id(), clusterId));
257
- int zoom = -1;
258
- if (features.size() > 0) {
259
- zoom = mSource.getClusterExpansionZoom(features.get(0));
260
- }
261
-
262
- if (zoom == -1) {
263
- WritableMap payload = new WritableNativeMap();
264
- payload.putString("error", "Could not get zoom for cluster id " + clusterId);
265
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
266
- mManager.handleEvent(event);
267
- return;
268
- }
269
-
270
- WritableMap payload = new WritableNativeMap();
271
- payload.putInt("data", zoom);
272
-
273
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
274
- mManager.handleEvent(event);
275
- }
276
-
277
- // Deprecated. Will be removed in 9+ ver.
278
- public void getClusterLeavesById(String callbackID, int clusterId, int number, int offset) {
279
- if (mSource == null) {
280
- WritableMap payload = new WritableNativeMap();
281
- payload.putString("error", "source is not yet loaded");
282
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
283
- mManager.handleEvent(event);
284
- return;
285
- }
286
- Feature clusterFeature = mSource.querySourceFeatures(Expression.eq(Expression.get("cluster_id"), clusterId)).get(0);
287
- FeatureCollection leaves = mSource.getClusterLeaves(clusterFeature, number, offset);
288
- WritableMap payload = new WritableNativeMap();
289
- payload.putString("data", leaves.toJson());
290
-
291
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
292
- mManager.handleEvent(event);
293
- }
294
-
295
- // Deprecated. Will be removed in 9+ ver.
296
- public void getClusterChildrenById(String callbackID, int clusterId) {
297
- if (mSource == null) {
298
- WritableMap payload = new WritableNativeMap();
299
- payload.putString("error", "source is not yet loaded");
300
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
301
- mManager.handleEvent(event);
302
- return;
303
- }
304
- Feature clusterFeature = mSource.querySourceFeatures(Expression.eq(Expression.get("cluster_id"), clusterId)).get(0);
305
- FeatureCollection leaves = mSource.getClusterChildren(clusterFeature);
306
- WritableMap payload = new WritableNativeMap();
307
- payload.putString("data", leaves.toJson());
308
-
309
- AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
310
- mManager.handleEvent(event);
311
- }
312
246
  }
@@ -179,11 +179,6 @@ public class MLRNShapeSourceManager extends AbstractEventEmitter<MLRNShapeSource
179
179
  public static final int METHOD_GET_CLUSTER_LEAVES = 105;
180
180
  public static final int METHOD_GET_CLUSTER_CHILDREN = 106;
181
181
 
182
- // Deprecated. Will be removed in 9+ ver.
183
- public static final int METHOD_GET_CLUSTER_EXPANSION_ZOOM_BY_ID = 107;
184
- public static final int METHOD_GET_CLUSTER_LEAVES_BY_ID = 108;
185
- public static final int METHOD_GET_CLUSTER_CHILDREN_BY_ID = 109;
186
-
187
182
  @Nullable
188
183
  @Override
189
184
  public Map<String, Integer> getCommandsMap() {
@@ -192,12 +187,6 @@ public class MLRNShapeSourceManager extends AbstractEventEmitter<MLRNShapeSource
192
187
  .put("getClusterExpansionZoom", METHOD_GET_CLUSTER_EXPANSION_ZOOM)
193
188
  .put("getClusterLeaves", METHOD_GET_CLUSTER_LEAVES)
194
189
  .put("getClusterChildren", METHOD_GET_CLUSTER_CHILDREN)
195
-
196
- // Deprecated. Will be removed in 9+ ver.
197
- .put("getClusterExpansionZoomById", METHOD_GET_CLUSTER_EXPANSION_ZOOM_BY_ID)
198
- .put("getClusterLeavesById", METHOD_GET_CLUSTER_LEAVES_BY_ID)
199
- .put("getClusterChildrenById", METHOD_GET_CLUSTER_CHILDREN_BY_ID)
200
-
201
190
  .build();
202
191
  }
203
192
 
@@ -227,23 +216,6 @@ public class MLRNShapeSourceManager extends AbstractEventEmitter<MLRNShapeSource
227
216
  args.getString(1)
228
217
  );
229
218
  break;
230
- case METHOD_GET_CLUSTER_EXPANSION_ZOOM_BY_ID:
231
- source.getClusterExpansionZoomById(args.getString(0), args.getInt(1));
232
- break;
233
- case METHOD_GET_CLUSTER_LEAVES_BY_ID:
234
- source.getClusterLeavesById(
235
- args.getString(0),
236
- args.getInt(1),
237
- args.getInt(2),
238
- args.getInt((3))
239
- );
240
- break;
241
- case METHOD_GET_CLUSTER_CHILDREN_BY_ID:
242
- source.getClusterChildrenById(
243
- args.getString(0),
244
- args.getInt(1)
245
- );
246
- break;
247
219
  }
248
220
  }
249
221
  }
@@ -7,21 +7,14 @@ import android.util.Log;
7
7
 
8
8
  import org.maplibre.android.location.engine.LocationEngine;
9
9
  import org.maplibre.android.location.engine.LocationEngineCallback;
10
-
11
- /*
12
- import com.mapbox.android.core.location.LocationEngineListener;
13
- import com.mapbox.android.core.location.LocationEnginePriority;
14
- */
15
-
16
- import org.maplibre.android.location.engine.LocationEngineDefault;
17
10
  import org.maplibre.android.location.engine.LocationEngineRequest;
18
11
  import org.maplibre.android.location.engine.LocationEngineResult;
19
12
  import org.maplibre.android.location.permissions.PermissionsManager;
13
+ import org.maplibre.reactnative.location.engine.LocationEngineProvider;
20
14
 
21
15
  import java.lang.ref.WeakReference;
22
16
  import java.util.ArrayList;
23
17
  import java.util.List;
24
- import java.util.Locale;
25
18
 
26
19
  @SuppressWarnings({"MissingPermission"})
27
20
  public class LocationManager implements LocationEngineCallback<LocationEngineResult> {
@@ -58,8 +51,10 @@ public class LocationManager implements LocationEngineCallback<LocationEngineRes
58
51
  this.buildEngineRequest();
59
52
 
60
53
  }
54
+
61
55
  private void buildEngineRequest() {
62
- locationEngine = LocationEngineDefault.INSTANCE.getDefaultLocationEngine(this.context.getApplicationContext());
56
+ locationEngine = new LocationEngineProvider().getLocationEngine(context);
57
+
63
58
  locationEngineRequest = new LocationEngineRequest.Builder(DEFAULT_INTERVAL_MILLIS)
64
59
  .setFastestInterval(DEFAULT_FASTEST_INTERVAL_MILLIS)
65
60
  .setPriority(LocationEngineRequest.PRIORITY_HIGH_ACCURACY)
@@ -78,9 +73,11 @@ public class LocationManager implements LocationEngineCallback<LocationEngineRes
78
73
  listeners.remove(listener);
79
74
  }
80
75
  }
76
+
81
77
  public void setMinDisplacement(float minDisplacement) {
82
78
  mMinDisplacement = minDisplacement;
83
79
  }
80
+
84
81
  public void enable() {
85
82
  if (!PermissionsManager.areLocationPermissionsGranted(context)) {
86
83
  return;
@@ -134,8 +131,7 @@ public class LocationManager implements LocationEngineCallback<LocationEngineRes
134
131
 
135
132
  try {
136
133
  locationEngine.getLastLocation(callback);
137
- }
138
- catch(Exception exception) {
134
+ } catch (Exception exception) {
139
135
  Log.w(LOG_TAG, exception);
140
136
  callback.onFailure(exception);
141
137
  }
@@ -0,0 +1,18 @@
1
+ package org.maplibre.reactnative.location.engine;
2
+
3
+ import android.content.Context;
4
+ import android.util.Log;
5
+
6
+ import org.maplibre.android.location.engine.LocationEngine;
7
+ import org.maplibre.android.location.engine.LocationEngineDefault;
8
+
9
+ public class DefaultLocationEngineProvider implements LocationEngineProvidable {
10
+ private static final String LOG_TAG = "DefaultLocationEngineProvider";
11
+
12
+ @Override
13
+ public LocationEngine getLocationEngine(Context context) {
14
+ LocationEngine locationEngine = LocationEngineDefault.INSTANCE.getDefaultLocationEngine(context.getApplicationContext());
15
+ Log.d(LOG_TAG, "DefaultLocationEngine will be used.");
16
+ return locationEngine;
17
+ }
18
+ }
@@ -0,0 +1,9 @@
1
+ package org.maplibre.reactnative.location.engine;
2
+
3
+ import android.content.Context;
4
+
5
+ import org.maplibre.android.location.engine.LocationEngine;
6
+
7
+ public interface LocationEngineProvidable {
8
+ LocationEngine getLocationEngine(Context context);
9
+ }
@@ -11,9 +11,7 @@ import com.facebook.react.common.MapBuilder;
11
11
  import com.facebook.react.module.annotations.ReactModule;
12
12
  import org.maplibre.android.MapLibre;
13
13
  import org.maplibre.android.WellKnownTileServer;
14
- import org.maplibre.android.style.layers.Property;
15
14
  import org.maplibre.reactnative.components.camera.constants.CameraMode;
16
- import org.maplibre.reactnative.components.styles.MLRNStyleValue;
17
15
  import org.maplibre.reactnative.components.styles.sources.MLRNSource;
18
16
  import org.maplibre.reactnative.events.constants.EventTypes;
19
17
  import org.maplibre.reactnative.http.CustomHeadersInterceptor;
@@ -34,6 +32,8 @@ import javax.annotation.Nullable;
34
32
  public class MLRNModule extends ReactContextBaseJavaModule {
35
33
  public static final String REACT_CLASS = "MLRNModule";
36
34
 
35
+ public static final String DEFAULT_STYLE_URL = "https://demotiles.maplibre.org/style.json";
36
+
37
37
  private static boolean customHeaderInterceptorAdded = false;
38
38
 
39
39
  private Handler mUiThreadHandler;
@@ -44,6 +44,11 @@ public class MLRNModule extends ReactContextBaseJavaModule {
44
44
  mReactContext = reactApplicationContext;
45
45
  }
46
46
 
47
+ @Override
48
+ public void initialize() {
49
+ initializeMapLibreInstance();
50
+ }
51
+
47
52
  @Override
48
53
  public String getName() {
49
54
  return REACT_CLASS;
@@ -54,7 +59,7 @@ public class MLRNModule extends ReactContextBaseJavaModule {
54
59
  public Map<String, Object> getConstants() {
55
60
  // map style urls
56
61
  Map<String, String> styleURLS = new HashMap<>();
57
- styleURLS.put("Default", "https://demotiles.maplibre.org/style.json");
62
+ styleURLS.put("Default", DEFAULT_STYLE_URL);
58
63
 
59
64
  // events
60
65
  Map<String, String> eventTypes = new HashMap<>();
@@ -99,127 +104,6 @@ public class MLRNModule extends ReactContextBaseJavaModule {
99
104
  Map<String, String> styleSourceConsts = new HashMap<>();
100
105
  styleSourceConsts.put("DefaultSourceID", MLRNSource.DEFAULT_ID);
101
106
 
102
- // interpolation modes
103
- Map<String, Integer> interpolationModes = new HashMap<>();
104
- interpolationModes.put("Exponential", MLRNStyleValue.InterpolationModeExponential);
105
- interpolationModes.put("Categorical", MLRNStyleValue.InterpolationModeCategorical);
106
- interpolationModes.put("Interval", MLRNStyleValue.InterpolationModeInterval);
107
- interpolationModes.put("Identity", MLRNStyleValue.InterpolationModeIdentity);
108
-
109
- // line layer constants
110
- Map<String, String> lineJoin = new HashMap<>();
111
- lineJoin.put("Bevel", Property.LINE_JOIN_BEVEL);
112
- lineJoin.put("Round", Property.LINE_JOIN_ROUND);
113
- lineJoin.put("Miter", Property.LINE_JOIN_MITER);
114
-
115
- Map<String, String> lineCap = new HashMap<>();
116
- lineCap.put("Butt", Property.LINE_CAP_BUTT);
117
- lineCap.put("Round", Property.LINE_CAP_ROUND);
118
- lineCap.put("Square", Property.LINE_CAP_SQUARE);
119
-
120
- Map<String, String> lineTranslateAnchor = new HashMap<>();
121
- lineTranslateAnchor.put("Map", Property.LINE_TRANSLATE_ANCHOR_MAP);
122
- lineTranslateAnchor.put("Viewport", Property.LINE_TRANSLATE_ANCHOR_VIEWPORT);
123
-
124
- // circle layer constants
125
- Map<String, String> circlePitchScale = new HashMap<>();
126
- circlePitchScale.put("Map", Property.CIRCLE_PITCH_SCALE_MAP);
127
- circlePitchScale.put("Viewport", Property.CIRCLE_PITCH_SCALE_VIEWPORT);
128
-
129
- Map<String, String> circleTranslateAnchor = new HashMap<>();
130
- circleTranslateAnchor.put("Map", Property.CIRCLE_TRANSLATE_ANCHOR_MAP);
131
- circleTranslateAnchor.put("Viewport", Property.CIRCLE_TRANSLATE_ANCHOR_VIEWPORT);
132
-
133
- Map<String, String> circlePitchAlignment = new HashMap<>();
134
- circlePitchAlignment.put("Map", Property.CIRCLE_PITCH_ALIGNMENT_MAP);
135
- circlePitchAlignment.put("Viewport", Property.CIRCLE_PITCH_ALIGNMENT_VIEWPORT);
136
-
137
- // fill extrusion layer constants
138
- Map<String, String> fillExtrusionTranslateAnchor = new HashMap<>();
139
- fillExtrusionTranslateAnchor.put("Map", Property.FILL_EXTRUSION_TRANSLATE_ANCHOR_MAP);
140
- fillExtrusionTranslateAnchor.put("Viewport", Property.FILL_EXTRUSION_TRANSLATE_ANCHOR_VIEWPORT);
141
-
142
- // fill layer constants
143
- Map<String, String> fillTranslateAnchor = new HashMap<>();
144
- fillTranslateAnchor.put("Map", Property.FILL_TRANSLATE_ANCHOR_MAP);
145
- fillTranslateAnchor.put("Viewport", Property.FILL_TRANSLATE_ANCHOR_VIEWPORT);
146
-
147
- // symbol layer constants
148
- Map<String, String> iconRotationAlignment = new HashMap<>();
149
- iconRotationAlignment.put("Auto", Property.ICON_ROTATION_ALIGNMENT_AUTO);
150
- iconRotationAlignment.put("Map", Property.ICON_ROTATION_ALIGNMENT_MAP);
151
- iconRotationAlignment.put("Viewport", Property.ICON_ROTATION_ALIGNMENT_VIEWPORT);
152
-
153
- Map<String, String> iconTextFit = new HashMap<>();
154
- iconTextFit.put("None", Property.ICON_TEXT_FIT_NONE);
155
- iconTextFit.put("Width", Property.ICON_TEXT_FIT_WIDTH);
156
- iconTextFit.put("Height", Property.ICON_TEXT_FIT_HEIGHT);
157
- iconTextFit.put("Both", Property.ICON_TEXT_FIT_BOTH);
158
-
159
- Map<String, String> iconAnchor = new HashMap<>();
160
- iconAnchor.put("Center", Property.ICON_ANCHOR_CENTER);
161
- iconAnchor.put("Left", Property.ICON_ANCHOR_LEFT);
162
- iconAnchor.put("Right", Property.ICON_ANCHOR_RIGHT);
163
- iconAnchor.put("Top", Property.ICON_ANCHOR_TOP);
164
- iconAnchor.put("Bottom", Property.ICON_ANCHOR_BOTTOM);
165
- iconAnchor.put("TopLeft", Property.ICON_ANCHOR_TOP_LEFT);
166
- iconAnchor.put("TopRight", Property.ICON_ANCHOR_TOP_RIGHT);
167
- iconAnchor.put("BottomLeft", Property.ICON_ANCHOR_BOTTOM_LEFT);
168
- iconAnchor.put("BottomRight", Property.ICON_ANCHOR_BOTTOM_RIGHT);
169
-
170
- Map<String, String> iconPitchAlignment = new HashMap<>();
171
- iconPitchAlignment.put("Auto", Property.ICON_PITCH_ALIGNMENT_AUTO);
172
- iconPitchAlignment.put("Map", Property.ICON_PITCH_ALIGNMENT_MAP);
173
- iconPitchAlignment.put("Viewport", Property.ICON_PITCH_ALIGNMENT_VIEWPORT);
174
-
175
- Map<String, String> iconTranslateAnchor = new HashMap<>();
176
- iconTranslateAnchor.put("Map", Property.ICON_TRANSLATE_ANCHOR_MAP);
177
- iconTranslateAnchor.put("Viewport", Property.ICON_TRANSLATE_ANCHOR_VIEWPORT);
178
-
179
- Map<String, String> symbolPlacement = new HashMap<>();
180
- symbolPlacement.put("Line", Property.SYMBOL_PLACEMENT_LINE);
181
- symbolPlacement.put("Point", Property.SYMBOL_PLACEMENT_POINT);
182
-
183
- Map<String, String> textAnchor = new HashMap<>();
184
- textAnchor.put("Center", Property.TEXT_ANCHOR_CENTER);
185
- textAnchor.put("Left", Property.TEXT_ANCHOR_LEFT);
186
- textAnchor.put("Right", Property.TEXT_ANCHOR_RIGHT);
187
- textAnchor.put("Top", Property.TEXT_ANCHOR_TOP);
188
- textAnchor.put("Bottom", Property.TEXT_ANCHOR_BOTTOM);
189
- textAnchor.put("TopLeft", Property.TEXT_ANCHOR_TOP_LEFT);
190
- textAnchor.put("TopRight", Property.TEXT_ANCHOR_TOP_RIGHT);
191
- textAnchor.put("BottomLeft", Property.TEXT_ANCHOR_BOTTOM_LEFT);
192
- textAnchor.put("BottomRight", Property.TEXT_ANCHOR_BOTTOM_RIGHT);
193
-
194
- Map<String, String> textJustify = new HashMap<>();
195
- textJustify.put("Center", Property.TEXT_JUSTIFY_CENTER);
196
- textJustify.put("Left", Property.TEXT_JUSTIFY_LEFT);
197
- textJustify.put("Right", Property.TEXT_JUSTIFY_RIGHT);
198
-
199
- Map<String, String> textPitchAlignment = new HashMap<>();
200
- textPitchAlignment.put("Auto", Property.TEXT_PITCH_ALIGNMENT_AUTO);
201
- textPitchAlignment.put("Map", Property.TEXT_PITCH_ALIGNMENT_MAP);
202
- textPitchAlignment.put("Viewport", Property.TEXT_PITCH_ALIGNMENT_VIEWPORT);
203
-
204
- Map<String, String> textRotationAlignment = new HashMap<>();
205
- textRotationAlignment.put("Auto", Property.TEXT_ROTATION_ALIGNMENT_AUTO);
206
- textRotationAlignment.put("Map", Property.TEXT_ROTATION_ALIGNMENT_MAP);
207
- textRotationAlignment.put("Viewport", Property.TEXT_ROTATION_ALIGNMENT_VIEWPORT);
208
-
209
- Map<String, String> textTransform = new HashMap<>();
210
- textTransform.put("None", Property.TEXT_TRANSFORM_NONE);
211
- textTransform.put("Lowercase", Property.TEXT_TRANSFORM_LOWERCASE);
212
- textTransform.put("Uppercase", Property.TEXT_TRANSFORM_UPPERCASE);
213
-
214
- Map<String, String> textTranslateAnchor = new HashMap<>();
215
- textTranslateAnchor.put("Map", Property.TEXT_TRANSLATE_ANCHOR_MAP);
216
- textTranslateAnchor.put("Viewport", Property.TEXT_TRANSLATE_ANCHOR_VIEWPORT);
217
-
218
- // light constants
219
- Map<String, String> lightAnchor = new HashMap<>();
220
- lightAnchor.put("Map", Property.ANCHOR_MAP);
221
- lightAnchor.put("Viewport", Property.ANCHOR_VIEWPORT);
222
-
223
107
  // offline region download states
224
108
  Map<String, Integer> offlinePackDownloadStates = new HashMap<>();
225
109
  offlinePackDownloadStates.put("Inactive", MLRNOfflineModule.INACTIVE_REGION_DOWNLOAD_STATE);
@@ -242,35 +126,17 @@ public class MLRNModule extends ReactContextBaseJavaModule {
242
126
  .put("UserLocationVerticalAlignment", userLocationVerticalAlignment)
243
127
  .put("CameraModes", cameraModes)
244
128
  .put("StyleSource", styleSourceConsts)
245
- .put("InterpolationMode", interpolationModes)
246
- .put("LineJoin", lineJoin)
247
- .put("LineCap", lineCap)
248
- .put("LineTranslateAnchor", lineTranslateAnchor)
249
- .put("CirclePitchScale", circlePitchScale)
250
- .put("CircleTranslateAnchor", circleTranslateAnchor)
251
- .put("CirclePitchAlignment", circlePitchAlignment)
252
- .put("FillExtrusionTranslateAnchor", fillExtrusionTranslateAnchor)
253
- .put("FillTranslateAnchor", fillTranslateAnchor)
254
- .put("IconRotationAlignment", iconRotationAlignment)
255
- .put("IconTextFit", iconTextFit)
256
- .put("IconTranslateAnchor", iconTranslateAnchor)
257
- .put("SymbolPlacement", symbolPlacement)
258
- .put("IconAnchor", iconAnchor)
259
- .put("TextAnchor", textAnchor)
260
- .put("TextJustify", textJustify)
261
- .put("IconPitchAlignment", iconPitchAlignment)
262
- .put("TextPitchAlignment", textPitchAlignment)
263
- .put("TextRotationAlignment", textRotationAlignment)
264
- .put("TextTransform", textTransform)
265
- .put("TextTranslateAnchor", textTranslateAnchor)
266
- .put("LightAnchor", lightAnchor)
267
129
  .put("OfflinePackDownloadState", offlinePackDownloadStates)
268
130
  .put("OfflineCallbackName", offlineModuleCallbackNames)
269
131
  .put("LocationCallbackName", locationModuleCallbackNames)
270
132
  .build();
271
133
  }
272
134
 
273
- // TODO: How to handle this? API has changed significantly
135
+ /**
136
+ * @deprecated This will be removed in the next major version.
137
+ * @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
138
+ */
139
+ @Deprecated
274
140
  @ReactMethod
275
141
  public void setAccessToken(final String accessToken) {
276
142
  mReactContext.runOnUiQueueThread(new Runnable() {
@@ -313,7 +179,11 @@ public class MLRNModule extends ReactContextBaseJavaModule {
313
179
  });
314
180
  }
315
181
 
316
- // TODO: How to handle this? Underlying API has changed significantly on Android
182
+ /**
183
+ * @deprecated This will be removed in the next major version.
184
+ * @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
185
+ */
186
+ @Deprecated
317
187
  @ReactMethod
318
188
  public void getAccessToken(Promise promise) {
319
189
  String token = MapLibre.getApiKey();
@@ -341,4 +211,13 @@ public class MLRNModule extends ReactContextBaseJavaModule {
341
211
  dispatcher.setMaxRequestsPerHost(20);
342
212
  return dispatcher;
343
213
  }
214
+
215
+ private void initializeMapLibreInstance() {
216
+ mReactContext.runOnUiQueueThread(new Runnable() {
217
+ @Override
218
+ public void run() {
219
+ MapLibre.getInstance(getReactApplicationContext());
220
+ }
221
+ });
222
+ }
344
223
  }
@@ -9,7 +9,6 @@ import com.facebook.react.bridge.*;
9
9
  import com.facebook.react.module.annotations.ReactModule;
10
10
  import com.facebook.react.modules.core.RCTNativeAppEventEmitter;
11
11
  import org.maplibre.geojson.FeatureCollection;
12
- // import org.maplibre.android.constants.Style;
13
12
  import org.maplibre.android.geometry.LatLngBounds;
14
13
  import org.maplibre.android.offline.OfflineManager;
15
14
  import org.maplibre.android.offline.OfflineRegion;
@@ -43,7 +42,6 @@ public class MLRNOfflineModule extends ReactContextBaseJavaModule {
43
42
  public static final String OFFLINE_ERROR = "MapboxOfflineRegionError";
44
43
  public static final String OFFLINE_PROGRESS = "MapboxOfflineRegionProgress";
45
44
 
46
- public static final String DEFAULT_STYLE_URL = "https://demotiles.maplibre.org/style.json";
47
45
  public static final Double DEFAULT_MIN_ZOOM_LEVEL = 10.0;
48
46
  public static final Double DEFAULT_MAX_ZOOM_LEVEL = 20.0;
49
47
 
@@ -426,7 +424,7 @@ public class MLRNOfflineModule extends ReactContextBaseJavaModule {
426
424
 
427
425
  private OfflineRegionDefinition makeDefinition(LatLngBounds latLngBounds, ReadableMap options) {
428
426
  return new OfflineTilePyramidRegionDefinition(
429
- ConvertUtils.getString("styleURL", options, DEFAULT_STYLE_URL),
427
+ ConvertUtils.getString("styleURL", options, MLRNModule.DEFAULT_STYLE_URL),
430
428
  latLngBounds,
431
429
  ConvertUtils.getDouble("minZoom", options, DEFAULT_MIN_ZOOM_LEVEL),
432
430
  ConvertUtils.getDouble("maxZoom", options, DEFAULT_MAX_ZOOM_LEVEL),