@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
@@ -26,9 +26,9 @@ import useNativeBridge from "../hooks/useNativeBridge";
26
26
  import useOnce from "../hooks/useOnce";
27
27
  import { type Location } from "../modules/location/locationManager";
28
28
  import { type BaseProps } from "../types/BaseProps";
29
+ import { type FilterExpression } from "../types/MapLibreRNStyles";
29
30
  import { isFunction, isAndroid } from "../utils";
30
31
  import Logger from "../utils/Logger";
31
- import { type FilterExpression } from "../utils/MapLibreRNStyles";
32
32
  import { getFilter } from "../utils/filterUtils";
33
33
 
34
34
  const MapLibreRN = NativeModules.MLRNModule;
@@ -268,7 +268,6 @@ export interface MapViewRef {
268
268
  filter: FilterExpression | undefined,
269
269
  layerIDs: string[],
270
270
  ) => Promise<GeoJSON.FeatureCollection>;
271
- setCamera: () => void;
272
271
  takeSnap: (writeToDisk?: boolean) => Promise<string>;
273
272
  getZoom: () => Promise<number>;
274
273
  getCenter: () => Promise<GeoJSON.Position>;
@@ -359,10 +358,6 @@ const MapView = memo(
359
358
  * @return {GeoJSON.FeatureCollection}
360
359
  */
361
360
  queryRenderedFeaturesInRect,
362
- /**
363
- * Map camera will perform updates based on provided config. Deprecated use Camera#setCamera.
364
- */
365
- setCamera,
366
361
  /**
367
362
  * Takes snapshot of map with current tiles and returns a URI to the image
368
363
  * @param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64
@@ -571,12 +566,6 @@ const MapView = memo(
571
566
  return res.data as GeoJSON.FeatureCollection;
572
567
  };
573
568
 
574
- const setCamera = (): void => {
575
- console.warn(
576
- "MapView.setCamera is deprecated - please use Camera#setCamera",
577
- );
578
- };
579
-
580
569
  const takeSnap = async (writeToDisk = false): Promise<string> => {
581
570
  const res: { uri: string } = await _runNativeCommand(
582
571
  "takeSnap",
@@ -6,7 +6,7 @@ import useAbstractLayer, {
6
6
  type NativeBaseProps,
7
7
  } from "../hooks/useAbstractLayer";
8
8
  import { type BaseProps } from "../types/BaseProps";
9
- import { type RasterLayerStyleProps } from "../utils/MapLibreRNStyles";
9
+ import { type RasterLayerStyle } from "../types/MapLibreRNStyles";
10
10
 
11
11
  const MapLibreRN = NativeModules.MLRNModule;
12
12
 
@@ -16,7 +16,7 @@ export interface RasterLayerProps extends BaseProps, BaseLayerProps {
16
16
  /**
17
17
  * Customizable style attributes
18
18
  */
19
- style?: RasterLayerStyleProps;
19
+ style?: RasterLayerStyle;
20
20
  }
21
21
 
22
22
  interface NativeProps
@@ -15,6 +15,10 @@ import {
15
15
 
16
16
  import useNativeBridge from "../hooks/useNativeBridge";
17
17
  import { type BaseProps } from "../types/BaseProps";
18
+ import {
19
+ type ExpressionField,
20
+ type FilterExpression,
21
+ } from "../types/MapLibreRNStyles";
18
22
  import { type OnPressEvent } from "../types/OnPressEvent";
19
23
  import {
20
24
  cloneReactChildrenWithProps,
@@ -22,16 +26,10 @@ import {
22
26
  isFunction,
23
27
  toJSONString,
24
28
  } from "../utils";
25
- import {
26
- type ExpressionField,
27
- type FilterExpression,
28
- } from "../utils/MapLibreRNStyles";
29
- import { copyPropertiesAsDeprecated } from "../utils/deprecation";
30
29
  import { getFilter } from "../utils/filterUtils";
31
30
 
32
31
  const MapLibreRN = NativeModules.MLRNModule;
33
32
  export const NATIVE_MODULE_NAME = "MLRNShapeSource";
34
- export const SHAPE_SOURCE_NATIVE_ASSETS_KEY = "assets";
35
33
 
36
34
  interface NativeProps {
37
35
  shape?: string;
@@ -252,18 +250,6 @@ const ShapeSource = memo(
252
250
  async function getClusterExpansionZoom(
253
251
  feature: GeoJSON.Feature,
254
252
  ): Promise<number> {
255
- if (typeof feature === "number") {
256
- console.warn(
257
- "Using cluster_id is deprecated and will be removed from the future releases. Please use cluster as an argument instead.",
258
- );
259
- const res: { data: number } = await _runNativeCommand(
260
- "getClusterExpansionZoomById",
261
- _nativeRef.current,
262
- [feature],
263
- );
264
- return res.data;
265
- }
266
-
267
253
  const res: { data: number } = await _runNativeCommand(
268
254
  "getClusterExpansionZoom",
269
255
  _nativeRef.current,
@@ -277,24 +263,6 @@ const ShapeSource = memo(
277
263
  limit: number,
278
264
  offset: number,
279
265
  ): Promise<GeoJSON.FeatureCollection> {
280
- if (typeof feature === "number") {
281
- console.warn(
282
- "Using cluster_id is deprecated and will be removed from the future releases. Please use cluster as an argument instead.",
283
- );
284
- const res: { data: string | GeoJSON.FeatureCollection } =
285
- await _runNativeCommand(
286
- "getClusterLeavesById",
287
- _nativeRef.current,
288
- [feature, limit, offset],
289
- );
290
-
291
- if (isAndroid()) {
292
- return JSON.parse(res.data as string);
293
- }
294
-
295
- return res.data as GeoJSON.FeatureCollection;
296
- }
297
-
298
266
  const res: { data: string | GeoJSON.FeatureCollection } =
299
267
  await _runNativeCommand("getClusterLeaves", _nativeRef.current, [
300
268
  JSON.stringify(feature),
@@ -312,24 +280,6 @@ const ShapeSource = memo(
312
280
  async function getClusterChildren(
313
281
  feature: GeoJSON.Feature,
314
282
  ): Promise<GeoJSON.FeatureCollection> {
315
- if (typeof feature === "number") {
316
- console.warn(
317
- "Using cluster_id is deprecated and will be removed from the future releases. Please use cluster as an argument instead.",
318
- );
319
- const res: { data: string | GeoJSON.FeatureCollection } =
320
- await _runNativeCommand(
321
- "getClusterChildrenById",
322
- _nativeRef.current,
323
- [feature],
324
- );
325
-
326
- if (isAndroid()) {
327
- return JSON.parse(res.data as string);
328
- }
329
-
330
- return res.data as GeoJSON.FeatureCollection;
331
- }
332
-
333
283
  const res: { data: string | GeoJSON.FeatureCollection } =
334
284
  await _runNativeCommand("getClusterChildren", _nativeRef.current, [
335
285
  JSON.stringify(feature),
@@ -372,31 +322,13 @@ const ShapeSource = memo(
372
322
  payload: { features, coordinates, point },
373
323
  },
374
324
  } = event;
375
- let newEvent = {
376
- features,
377
- coordinates,
378
- point,
379
- };
380
- newEvent = copyPropertiesAsDeprecated(
381
- event,
382
- newEvent,
383
- (key: string): void => {
384
- console.warn(
385
- `event.${key} is deprecated on ShapeSource#onPress, please use event.features`,
386
- );
387
- },
388
- {
389
- nativeEvent: (
390
- origNativeEvent: NativeSyntheticEvent<{ payload: OnPressEvent }>,
391
- ) => ({
392
- ...origNativeEvent,
393
- payload: features[0],
394
- }),
395
- },
396
- );
397
325
 
398
326
  if (props.onPress) {
399
- props.onPress(newEvent);
327
+ props.onPress({
328
+ features,
329
+ coordinates,
330
+ point,
331
+ });
400
332
  }
401
333
  }
402
334
 
@@ -1,12 +1,11 @@
1
- import { Children, type ReactElement } from "react";
2
- import { View, NativeModules, requireNativeComponent } from "react-native";
1
+ import { NativeModules, requireNativeComponent } from "react-native";
3
2
 
4
3
  import useAbstractLayer, {
5
4
  type BaseLayerProps,
6
5
  type NativeBaseProps,
7
6
  } from "../hooks/useAbstractLayer";
8
7
  import { type BaseProps } from "../types/BaseProps";
9
- import { type SymbolLayerStyleProps } from "../utils/MapLibreRNStyles";
8
+ import { type SymbolLayerStyle } from "../types/MapLibreRNStyles";
10
9
 
11
10
  const MapLibreRN = NativeModules.MLRNModule;
12
11
 
@@ -16,18 +15,12 @@ export interface SymbolLayerProps extends BaseProps, BaseLayerProps {
16
15
  /**
17
16
  * Customizable style attributes
18
17
  */
19
- style?: SymbolLayerStyleProps;
20
-
21
- /**
22
- * @deprecated passed children used to create an image with id of symbol in style and also set the iconImageName property accordingly.
23
- * This is now deprecated, use Image component instead.
24
- */
25
- children?: ReactElement | ReactElement[];
18
+ style?: SymbolLayerStyle;
26
19
  }
27
20
 
28
- interface NativeProps extends Omit<SymbolLayerProps, "style">, NativeBaseProps {
29
- snapshot: boolean;
30
- }
21
+ interface NativeProps
22
+ extends Omit<SymbolLayerProps, "style">,
23
+ NativeBaseProps {}
31
24
 
32
25
  const MLRNSymbolLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
33
26
 
@@ -46,32 +39,11 @@ const SymbolLayer: React.FC<SymbolLayerProps> = ({
46
39
  sourceID,
47
40
  });
48
41
 
49
- const _shouldSnapshot = (): boolean => {
50
- let isSnapshot = false;
51
-
52
- if (Children.count(props.children) <= 0) {
53
- return isSnapshot;
54
- }
55
-
56
- Children.forEach(props.children, (child) => {
57
- if (child?.type === View) {
58
- isSnapshot = true;
59
- }
60
- });
61
-
62
- return isSnapshot;
63
- };
64
-
65
42
  const updatedProps = {
66
43
  ...baseProps,
67
- snapshot: _shouldSnapshot(),
68
44
  };
69
45
 
70
- return (
71
- <MLRNSymbolLayer ref={setNativeLayer} {...updatedProps}>
72
- {props.children}
73
- </MLRNSymbolLayer>
74
- );
46
+ return <MLRNSymbolLayer ref={setNativeLayer} {...updatedProps} />;
75
47
  };
76
48
 
77
49
  export default SymbolLayer;
@@ -15,11 +15,11 @@ import NativeUserLocation from "./NativeUserLocation";
15
15
  import locationManager, {
16
16
  type Location,
17
17
  } from "../modules/location/locationManager";
18
- import { type CircleLayerStyleProps } from "../utils/MapLibreRNStyles";
18
+ import { type CircleLayerStyle } from "../types/MapLibreRNStyles";
19
19
 
20
20
  const mapboxBlue = "rgba(51, 181, 229, 100)";
21
21
 
22
- const layerStyles: Record<string, CircleLayerStyleProps> = {
22
+ const layerStyles: Record<string, CircleLayerStyle> = {
23
23
  pluse: {
24
24
  circleRadius: 15,
25
25
  circleColor: mapboxBlue,
@@ -9,10 +9,9 @@ import {
9
9
  import useAbstractSource from "../hooks/useAbstractSource";
10
10
  import useNativeBridge from "../hooks/useNativeBridge";
11
11
  import { type BaseProps } from "../types/BaseProps";
12
+ import { type FilterExpression } from "../types/MapLibreRNStyles";
12
13
  import { type OnPressEvent } from "../types/OnPressEvent";
13
14
  import { cloneReactChildrenWithProps, isFunction, isAndroid } from "../utils";
14
- import { type FilterExpression } from "../utils/MapLibreRNStyles";
15
- import { copyPropertiesAsDeprecated } from "../utils/deprecation";
16
15
  import { getFilter } from "../utils/filterUtils";
17
16
 
18
17
  const MapLibreRN = NativeModules.MLRNModule;
@@ -160,33 +159,18 @@ const VectorSource = memo(
160
159
  if (!onPress) {
161
160
  return;
162
161
  }
162
+
163
163
  const {
164
164
  nativeEvent: {
165
165
  payload: { features, coordinates, point },
166
166
  },
167
167
  } = event;
168
- let newEvent = {
168
+
169
+ onPress({
169
170
  features,
170
171
  coordinates,
171
172
  point,
172
- };
173
- newEvent = copyPropertiesAsDeprecated(
174
- event,
175
- newEvent,
176
- (key: string) => {
177
- console.warn(
178
- `event.${key} is deprecated on VectorSource#onPress, please use event.features`,
179
- );
180
- },
181
- {
182
- nativeEvent: (origNativeEvent: OnPressEvent) => ({
183
- ...origNativeEvent,
184
- payload: features[0],
185
- }),
186
- },
187
- );
188
-
189
- onPress(newEvent);
173
+ });
190
174
  };
191
175
 
192
176
  const allProps = {
@@ -3,11 +3,11 @@ import { processColor, type NativeMethods } from "react-native";
3
3
 
4
4
  import { type BaseProps } from "../types/BaseProps";
5
5
  import {
6
- type AllLayerStyleProps,
6
+ type AllLayerStyle,
7
7
  type ExpressionField,
8
8
  type ExpressionName,
9
9
  type FilterExpression,
10
- } from "../utils/MapLibreRNStyles";
10
+ } from "../types/MapLibreRNStyles";
11
11
  import { type StyleValue, transformStyle } from "../utils/StyleValue";
12
12
  import { getFilter } from "../utils/filterUtils";
13
13
 
@@ -53,7 +53,7 @@ export interface BaseLayerProps {
53
53
  /**
54
54
  * Customizable style attributes
55
55
  */
56
- style?: AllLayerStyleProps;
56
+ style?: AllLayerStyle;
57
57
  }
58
58
 
59
59
  export interface NativeBaseProps {
@@ -10,8 +10,8 @@ export type OfflinePackStatus = {
10
10
  percentage: number;
11
11
  completedResourceCount: number;
12
12
  completedResourceSize: number;
13
- completedTileSize: number;
14
13
  completedTileCount: number;
14
+ completedTileSize: number;
15
15
  requiredResourceCount: number;
16
16
  };
17
17
 
@@ -7,7 +7,7 @@ import {
7
7
  import OfflineCreatePackOptions, {
8
8
  type OfflineCreatePackInputOptions,
9
9
  } from "./OfflineCreatePackOptions";
10
- import OfflinePack from "./OfflinePack";
10
+ import OfflinePack, { type OfflinePackStatus } from "./OfflinePack";
11
11
  import { isUndefined, isFunction, isAndroid } from "../../utils";
12
12
 
13
13
  const MapLibreRN = NativeModules.MLRNModule;
@@ -16,17 +16,6 @@ export const OfflineModuleEventEmitter = new NativeEventEmitter(
16
16
  MLRNOfflineModule,
17
17
  );
18
18
 
19
- export type OfflineProgressStatus = {
20
- name: string;
21
- state: number;
22
- percentage: number;
23
- completedResourceSize: number;
24
- completedTileCount: number;
25
- completedResourceCount: number;
26
- requiredResourceCount: number;
27
- completedTileSize: number;
28
- };
29
-
30
19
  export type OfflinePackError = {
31
20
  name: string;
32
21
  message: string;
@@ -37,13 +26,10 @@ type ErrorEvent = {
37
26
  };
38
27
 
39
28
  type ProgressEvent = {
40
- payload: OfflineProgressStatus;
29
+ payload: OfflinePackStatus;
41
30
  };
42
31
 
43
- type ProgressListener = (
44
- pack: OfflinePack,
45
- status: OfflineProgressStatus,
46
- ) => void;
32
+ type ProgressListener = (pack: OfflinePack, status: OfflinePackStatus) => void;
47
33
  type ErrorListener = (pack: OfflinePack, err: OfflinePackError) => void;
48
34
 
49
35
  /**
@@ -83,7 +69,7 @@ class OfflineManager {
83
69
  *
84
70
  * await MapLibreGL.offlineManager.createPack({
85
71
  * name: 'offlinePack',
86
- * styleURL: 'mapbox://...',
72
+ * styleURL: 'https://demotiles.maplibre.org/tiles/tiles.json',
87
73
  * minZoom: 14,
88
74
  * maxZoom: 20,
89
75
  * bounds: [[neLng, neLat], [swLng, swLat]]