@maplibre/maplibre-react-native 10.0.0-beta.1 → 10.0.0-beta.10

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 (244) hide show
  1. package/README.md +34 -35
  2. package/android/build.gradle +98 -51
  3. package/android/gradle.properties +7 -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/styles/MLRNStyle.java +1 -4
  8. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
  9. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +0 -66
  10. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
  11. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +0 -145
  12. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +80 -0
  13. package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
  14. package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
  15. package/ios/MLRN/MLRNFillLayer.h +0 -1
  16. package/ios/MLRN/MLRNFillLayer.m +1 -0
  17. package/ios/MLRN/MLRNLineLayer.h +0 -1
  18. package/ios/MLRN/MLRNModule.m +0 -135
  19. package/ios/MLRN/MLRNRasterLayer.h +0 -1
  20. package/ios/MLRN/MLRNShapeSource.h +0 -11
  21. package/ios/MLRN/MLRNShapeSource.m +0 -38
  22. package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
  23. package/ios/MLRN/MLRNSymbolLayer.h +1 -7
  24. package/ios/MLRN/MLRNSymbolLayer.m +1 -89
  25. package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
  26. package/lib/commonjs/MLRNModule.js +7 -5
  27. package/lib/commonjs/MLRNModule.js.map +1 -1
  28. package/lib/commonjs/MapLibreRN.js +3 -15
  29. package/lib/commonjs/MapLibreRN.js.map +1 -1
  30. package/lib/commonjs/components/Annotation.js.map +1 -1
  31. package/lib/commonjs/components/Images.js +1 -5
  32. package/lib/commonjs/components/Images.js.map +1 -1
  33. package/lib/commonjs/components/MapView.js +0 -7
  34. package/lib/commonjs/components/MapView.js.map +1 -1
  35. package/lib/commonjs/components/ShapeSource.js +6 -38
  36. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  37. package/lib/commonjs/components/SymbolLayer.js +2 -17
  38. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  39. package/lib/commonjs/components/UserLocation.js.map +1 -1
  40. package/lib/commonjs/components/VectorSource.js +1 -11
  41. package/lib/commonjs/components/VectorSource.js.map +1 -1
  42. package/lib/commonjs/modules/offline/offlineManager.js +1 -1
  43. package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
  44. package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
  45. package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
  46. package/lib/commonjs/utils/StyleValue.js +2 -2
  47. package/lib/commonjs/utils/StyleValue.js.map +1 -1
  48. package/lib/commonjs/utils/getStylePropertyType.js +252 -0
  49. package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
  50. package/lib/module/MLRNModule.js +3 -2
  51. package/lib/module/MLRNModule.js.map +1 -1
  52. package/lib/module/MapLibreRN.js +1 -5
  53. package/lib/module/MapLibreRN.js.map +1 -1
  54. package/lib/module/components/Annotation.js.map +1 -1
  55. package/lib/module/components/Images.js +1 -5
  56. package/lib/module/components/Images.js.map +1 -1
  57. package/lib/module/components/MapView.js +0 -7
  58. package/lib/module/components/MapView.js.map +1 -1
  59. package/lib/module/components/ShapeSource.js +5 -37
  60. package/lib/module/components/ShapeSource.js.map +1 -1
  61. package/lib/module/components/SymbolLayer.js +3 -18
  62. package/lib/module/components/SymbolLayer.js.map +1 -1
  63. package/lib/module/components/UserLocation.js.map +1 -1
  64. package/lib/module/components/VectorSource.js +1 -11
  65. package/lib/module/components/VectorSource.js.map +1 -1
  66. package/lib/module/modules/offline/offlineManager.js +1 -1
  67. package/lib/module/modules/offline/offlineManager.js.map +1 -1
  68. package/lib/module/types/MapLibreRNStyles.js +4 -0
  69. package/lib/module/types/MapLibreRNStyles.js.map +1 -0
  70. package/lib/module/utils/StyleValue.js +2 -2
  71. package/lib/module/utils/StyleValue.js.map +1 -1
  72. package/lib/module/utils/getStylePropertyType.js +248 -0
  73. package/lib/module/utils/getStylePropertyType.js.map +1 -0
  74. package/lib/typescript/commonjs/jest.config.d.ts +2 -0
  75. package/lib/typescript/commonjs/jest.config.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/src/MLRNModule.d.ts +3 -7
  77. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +5 -8
  79. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/components/Annotation.d.ts +2 -2
  81. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +2 -2
  83. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/components/Camera.d.ts +1 -1
  85. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +2 -2
  86. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +2 -2
  88. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/components/FillLayer.d.ts +2 -2
  90. package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +2 -2
  92. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/src/components/Light.d.ts +2 -2
  95. package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/src/components/LineLayer.d.ts +2 -2
  97. package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/components/MapView.d.ts +1 -2
  99. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +2 -2
  101. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -2
  103. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +2 -8
  105. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +2 -2
  108. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +1 -1
  110. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +4 -14
  112. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
  114. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
  116. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
  118. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
  120. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -0
  122. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +1 -0
  124. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
  126. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
  128. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
  129. package/lib/typescript/module/jest.config.d.ts +2 -0
  130. package/lib/typescript/module/jest.config.d.ts.map +1 -0
  131. package/lib/typescript/module/src/MLRNModule.d.ts +3 -7
  132. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  133. package/lib/typescript/module/src/MapLibreRN.d.ts +5 -8
  134. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  135. package/lib/typescript/module/src/components/Annotation.d.ts +2 -2
  136. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  137. package/lib/typescript/module/src/components/BackgroundLayer.d.ts +2 -2
  138. package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
  139. package/lib/typescript/module/src/components/Camera.d.ts +1 -1
  140. package/lib/typescript/module/src/components/CircleLayer.d.ts +2 -2
  141. package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
  142. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +2 -2
  143. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
  144. package/lib/typescript/module/src/components/FillLayer.d.ts +2 -2
  145. package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
  146. package/lib/typescript/module/src/components/HeatmapLayer.d.ts +2 -2
  147. package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
  148. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  149. package/lib/typescript/module/src/components/Light.d.ts +2 -2
  150. package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
  151. package/lib/typescript/module/src/components/LineLayer.d.ts +2 -2
  152. package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
  153. package/lib/typescript/module/src/components/MapView.d.ts +1 -2
  154. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  155. package/lib/typescript/module/src/components/RasterLayer.d.ts +2 -2
  156. package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
  157. package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -2
  158. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  159. package/lib/typescript/module/src/components/SymbolLayer.d.ts +2 -8
  160. package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
  161. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  162. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +2 -2
  163. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
  164. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +1 -1
  165. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
  166. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +4 -14
  167. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -1
  168. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
  169. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
  170. package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
  171. package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
  172. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
  173. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  174. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
  175. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  176. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -0
  177. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  178. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +1 -0
  179. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  180. package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
  181. package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
  182. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
  183. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
  184. package/package.json +31 -38
  185. package/plugin/build/withMapLibre.js +6 -6
  186. package/src/MLRNModule.ts +15 -9
  187. package/src/MapLibreRN.ts +22 -23
  188. package/src/components/Annotation.tsx +3 -3
  189. package/src/components/BackgroundLayer.tsx +2 -2
  190. package/src/components/Camera.tsx +1 -1
  191. package/src/components/CircleLayer.tsx +2 -2
  192. package/src/components/FillExtrusionLayer.tsx +2 -2
  193. package/src/components/FillLayer.tsx +2 -2
  194. package/src/components/HeatmapLayer.tsx +2 -2
  195. package/src/components/Images.tsx +1 -10
  196. package/src/components/Light.tsx +2 -2
  197. package/src/components/LineLayer.tsx +2 -2
  198. package/src/components/MapView.tsx +1 -12
  199. package/src/components/RasterLayer.tsx +2 -2
  200. package/src/components/ShapeSource.tsx +9 -77
  201. package/src/components/SymbolLayer.tsx +7 -35
  202. package/src/components/UserLocation.tsx +2 -2
  203. package/src/components/VectorSource.tsx +5 -21
  204. package/src/hooks/useAbstractLayer.ts +3 -3
  205. package/src/modules/offline/OfflinePack.ts +1 -1
  206. package/src/modules/offline/offlineManager.ts +4 -18
  207. package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +85 -405
  208. package/src/utils/StyleValue.ts +4 -4
  209. package/src/utils/filterUtils.ts +1 -1
  210. package/src/utils/getStylePropertyType.ts +265 -0
  211. package/android/install.md +0 -32
  212. package/android/src/main/res/values/strings.xml +0 -3
  213. package/ios/install.md +0 -49
  214. package/lib/commonjs/components/Style.js +0 -266
  215. package/lib/commonjs/components/Style.js.map +0 -1
  216. package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
  217. package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
  218. package/lib/commonjs/utils/deprecation.js +0 -31
  219. package/lib/commonjs/utils/deprecation.js.map +0 -1
  220. package/lib/commonjs/utils/styleMap.js +0 -255
  221. package/lib/commonjs/utils/styleMap.js.map +0 -1
  222. package/lib/module/components/Style.js +0 -261
  223. package/lib/module/components/Style.js.map +0 -1
  224. package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
  225. package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
  226. package/lib/module/utils/deprecation.js +0 -27
  227. package/lib/module/utils/deprecation.js.map +0 -1
  228. package/lib/module/utils/styleMap.js +0 -249
  229. package/lib/module/utils/styleMap.js.map +0 -1
  230. package/lib/typescript/commonjs/src/components/Style.d.ts +0 -81
  231. package/lib/typescript/commonjs/src/components/Style.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/src/utils/deprecation.d.ts +0 -6
  233. package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
  235. package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
  236. package/lib/typescript/module/src/components/Style.d.ts +0 -81
  237. package/lib/typescript/module/src/components/Style.d.ts.map +0 -1
  238. package/lib/typescript/module/src/utils/deprecation.d.ts +0 -6
  239. package/lib/typescript/module/src/utils/deprecation.d.ts.map +0 -1
  240. package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
  241. package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
  242. package/src/components/Style.tsx +0 -371
  243. package/src/utils/deprecation.ts +0 -31
  244. package/src/utils/styleMap.ts +0 -265
package/README.md CHANGED
@@ -15,66 +15,65 @@ supported both Mapbox and MapLibre for some time, but as the MapLibre and Mapbox
15
15
  diverged, it has become necessary to separate the projects into specific wrappers by underlying renderer.
16
16
 
17
17
  <p align="center">
18
- <img src="/docs/assets/indoor-building-map-android.png"
18
+ <img src="/docs/assets/device-android.png"
19
19
  alt="Indoor Building Map Android"
20
- height="300"
20
+ height="320"
21
21
  />
22
- <img src="/docs/assets/indoor-building-map-ios.png"
22
+ <img src="/docs/assets/device-ios.png"
23
23
  alt="Indoor Building Map iOS"
24
- height="300"
24
+ height="320"
25
25
  />
26
26
  </p>
27
27
 
28
28
  ## Documentation
29
29
 
30
- - [Getting Started](/docs/GettingStarted.md)
30
+ - [Getting Started](/docs/guides/setup/GettingStarted.md)
31
31
  - Installation
32
32
  - React Native
33
- - [Android](/android/install.md)
34
- - [iOS](/ios/install.md)
35
- - [Expo](/plugin/install.md)
33
+ - [Android](/docs/guides/setup/Android.md)
34
+ - [iOS](/docs/guides/setup/iOS.md)
35
+ - [Expo](/docs/guides/setup/Expo.md)
36
36
 
37
37
  ### Components
38
38
 
39
- - [MapView](/docs/MapView.md)
40
- - [Light](/docs/Light.md)
41
- - [StyleSheet](/docs/StyleSheet.md)
42
- - [PointAnnotation](/docs/PointAnnotation.md)
43
- - [MarkerView](/docs/MarkerView.md)
44
- - [Callout](/docs/Callout.md)
45
- - [Camera](docs/Camera.md)
46
- - [UserLocation](docs/UserLocation.md)
47
- - [Images](docs/Images.md)
39
+ - [MapView](/docs/components/MapView.md)
40
+ - [Light](/docs/components/Light.md)
41
+ - [PointAnnotation](/docs/components/PointAnnotation.md)
42
+ - [MarkerView](/docs/components/MarkerView.md)
43
+ - [Callout](/docs/components/Callout.md)
44
+ - [Camera](docs/components/Camera.md)
45
+ - [UserLocation](docs/components/UserLocation.md)
46
+ - [Images](docs/components/Images.md)
48
47
 
49
48
  ### Sources
50
49
 
51
- - [VectorSource](/docs/VectorSource.md)
52
- - [ShapeSource](/docs/ShapeSource.md)
53
- - [RasterSource](/docs/RasterSource.md)
50
+ - [VectorSource](/docs/components/VectorSource.md)
51
+ - [ShapeSource](/docs/components/ShapeSource.md)
52
+ - [RasterSource](/docs/components/RasterSource.md)
54
53
 
55
54
  ### Layers
56
55
 
57
- - [BackgroundLayer](/docs/BackgroundLayer.md)
58
- - [CircleLayer](/docs/CircleLayer.md)
59
- - [FillExtrusionLayer](/docs/FillExtrusionLayer.md)
60
- - [FillLayer](/docs/FillLayer.md)
61
- - [LineLayer](/docs/LineLayer.md)
62
- - [RasterLayer](/docs/RasterLayer.md)
63
- - [SymbolLayer](/docs/SymbolLayer.md)
64
- - [HeatmapLayer](/docs/HeatmapLayer.md)
56
+ - [BackgroundLayer](/docs/components/BackgroundLayer.md)
57
+ - [CircleLayer](/docs/components/CircleLayer.md)
58
+ - [FillExtrusionLayer](/docs/components/FillExtrusionLayer.md)
59
+ - [FillLayer](/docs/components/FillLayer.md)
60
+ - [LineLayer](/docs/components/LineLayer.md)
61
+ - [RasterLayer](/docs/components/RasterLayer.md)
62
+ - [SymbolLayer](/docs/components/SymbolLayer.md)
63
+ - [HeatmapLayer](/docs/components/HeatmapLayer.md)
65
64
 
66
- ### Offline
65
+ ### Modules
67
66
 
68
- - [OfflineManager](/docs/OfflineManager.md)
69
- - [SnapshotManager](/docs/snapshotManager.md)
67
+ - [OfflineManager](/docs/modules/offlineManager.md)
68
+ - [SnapshotManager](/docs/modules/snapshotManager.md)
70
69
 
71
70
  ### Misc
72
71
 
73
- - [MapLibreGL](/docs/MapLibreGL.md)
74
- - [CustomHttpHeaders](/docs/CustomHttpHeaders.md)
75
- - [Logger](/docs/Logger.md)
72
+ - [MapLibreGL](/docs/guides/MapLibreGL.md)
73
+ - [Custom HTTP Headers](/docs/guides/CustomHTTPHeaders.md)
74
+ - [Logger](/docs/guides/Logger.md)
76
75
 
77
- ## Contributing / local development
76
+ ## Contributing & Development
78
77
 
79
78
  Read the [CONTRIBUTING.md](CONTRIBUTING.md) guide in order to get familiar with how we do things around here and
80
79
  set up your local development environment.
@@ -1,69 +1,116 @@
1
- apply plugin: 'com.android.library'
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["MapLibreReactNative_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
2
16
 
3
- def safeExtGet(prop, fallback) {
4
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
17
+ def reactNativeArchitectures() {
18
+ def value = rootProject.getProperties().get("reactNativeArchitectures")
19
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
5
20
  }
6
21
 
7
22
  def isNewArchitectureEnabled() {
8
- return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
23
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
9
24
  }
10
25
 
11
- buildscript {
12
- ext {
13
- buildToolsVersion = "33.0.0"
14
- minSdkVersion = 16
15
- compileSdkVersion = 34
16
- targetSdkVersion = 33
17
- supportLibVersion = "28.0.0"
18
- }
26
+ apply plugin: "com.android.library"
27
+ apply plugin: "kotlin-android"
19
28
 
20
- repositories {
21
- google()
22
- mavenCentral()
23
- }
29
+ // TODO: Currently breaks new arch support, but works without
30
+ // if (isNewArchitectureEnabled()) {
31
+ // apply plugin: "com.facebook.react"
32
+ // }
33
+
34
+ def getExtOrDefault(name) {
35
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["MapLibreReactNative_" + name]
36
+ }
37
+
38
+ def getExtOrIntegerDefault(name) {
39
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["MapLibreReactNative_" + name]).toInteger()
40
+ }
41
+
42
+ def supportsNamespace() {
43
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
44
+ def major = parsed[0].toInteger()
45
+ def minor = parsed[1].toInteger()
46
+
47
+ // Namespace support was added in 7.3.0
48
+ return (major == 7 && minor >= 3) || major >= 8
24
49
  }
25
50
 
26
51
  android {
27
- compileSdkVersion safeExtGet("compileSdkVersion", 33)
28
- buildToolsVersion safeExtGet("buildToolsVersion", '33.0.1')
29
-
30
- defaultConfig {
31
- minSdkVersion safeExtGet('minSdkVersion', 16)
32
- targetSdkVersion safeExtGet('targetSdkVersion', 26)
33
- versionCode 1
34
- versionName "1.0"
35
- buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
36
- }
52
+ if (supportsNamespace()) {
53
+ namespace "org.maplibre.reactnative"
37
54
 
38
- compileOptions {
39
- sourceCompatibility JavaVersion.VERSION_1_8
40
- targetCompatibility JavaVersion.VERSION_1_8
55
+ sourceSets {
56
+ main {
57
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
58
+ }
41
59
  }
60
+ }
61
+
62
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
63
+
64
+ defaultConfig {
65
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
66
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
42
67
 
43
- buildTypes {
44
- release {
45
- minifyEnabled false
46
- }
68
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
69
+ }
70
+
71
+ buildTypes {
72
+ release {
73
+ minifyEnabled false
47
74
  }
75
+ }
76
+
77
+ lintOptions {
78
+ disable "GradleCompatible"
79
+ }
80
+
81
+ compileOptions {
82
+ sourceCompatibility JavaVersion.VERSION_1_8
83
+ targetCompatibility JavaVersion.VERSION_1_8
84
+ }
48
85
  }
49
86
 
87
+ repositories {
88
+ mavenCentral()
89
+ google()
90
+ }
91
+
92
+ def kotlin_version = getExtOrDefault("kotlinVersion")
93
+
50
94
  dependencies {
51
- // The version of react-native is set by the React Native Gradle Plugin
52
- implementation("com.facebook.react:react-android")
53
-
54
- // MapLibre SDK
55
- implementation "org.maplibre.gl:android-sdk:11.5.0"
56
- implementation "org.maplibre.gl:android-sdk-turf:6.0.1"
57
-
58
- // Dependencies
59
- implementation "androidx.vectordrawable:vectordrawable:1.1.0"
60
- implementation "androidx.annotation:annotation:1.7.0"
61
- implementation "androidx.appcompat:appcompat:1.6.1"
62
- implementation "com.squareup.okhttp3:okhttp:${safeExtGet('okhttpVersion', '4.9.0')}"
63
- implementation "com.squareup.okhttp3:okhttp-urlconnection:${safeExtGet('okhttpVersion', '4.9.0')}"
64
-
65
- // MapLibre plugins
66
- implementation ("org.maplibre.gl:android-plugin-localization-v9:3.0.1")
67
- implementation ("org.maplibre.gl:android-plugin-annotation-v9:3.0.1")
68
- implementation ("org.maplibre.gl:android-plugin-markerview-v9:3.0.1")
95
+ // For < 0.71, this will be from the local maven repo
96
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
97
+ //noinspection GradleDynamicVersion
98
+ implementation "com.facebook.react:react-native:+"
99
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
100
+
101
+ // MapLibre SDK
102
+ implementation "org.maplibre.gl:android-sdk:11.5.0"
103
+ implementation "org.maplibre.gl:android-sdk-turf:6.0.1"
104
+
105
+ // Dependencies
106
+ implementation "androidx.vectordrawable:vectordrawable:1.1.0"
107
+ implementation "androidx.annotation:annotation:1.7.0"
108
+ implementation "androidx.appcompat:appcompat:1.6.1"
109
+ implementation "com.squareup.okhttp3:okhttp:${getExtOrDefault('okhttpVersion')}"
110
+ implementation "com.squareup.okhttp3:okhttp-urlconnection:${getExtOrDefault('okhttpVersion')}"
111
+
112
+ // MapLibre plugins
113
+ implementation ("org.maplibre.gl:android-plugin-localization-v9:3.0.1")
114
+ implementation ("org.maplibre.gl:android-plugin-annotation-v9:3.0.1")
115
+ implementation ("org.maplibre.gl:android-plugin-markerview-v9:3.0.1")
69
116
  }
@@ -0,0 +1,7 @@
1
+ MapLibreReactNative_kotlinVersion=1.7.0
2
+ MapLibreReactNative_minSdkVersion=21
3
+ MapLibreReactNative_targetSdkVersion=31
4
+ MapLibreReactNative_compileSdkVersion=31
5
+ MapLibreReactNative_ndkversion=21.4.7075529
6
+
7
+ MapLibreReactNative_okhttpVersion=4.9.0
@@ -1,4 +1,6 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.maplibre.reactnative">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="org.maplibre.reactnative">
3
+
2
4
  <uses-permission android:name="android.permission.INTERNET" />
3
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
5
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
4
6
  </manifest>
@@ -0,0 +1,5 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5
+ </manifest>
@@ -52,11 +52,6 @@ public class MLRNPackage implements ReactPackage {
52
52
  return modules;
53
53
  }
54
54
 
55
- @Deprecated
56
- public List<Class<? extends JavaScriptModule>> createJSModules() {
57
- return Collections.emptyList();
58
- }
59
-
60
55
  @Override
61
56
  public List<ViewManager> createViewManagers(ReactApplicationContext reactApplicationContext) {
62
57
  List<ViewManager> managers = new ArrayList<>();
@@ -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
  }