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

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 (259) hide show
  1. package/README.md +36 -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/mapview/MLRNMapView.java +11 -13
  8. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +4 -11
  9. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
  10. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
  11. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +0 -66
  12. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
  13. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +3 -146
  14. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
  15. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +80 -0
  16. package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
  17. package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
  18. package/ios/MLRN/MLRNFillLayer.h +0 -1
  19. package/ios/MLRN/MLRNFillLayer.m +1 -0
  20. package/ios/MLRN/MLRNLineLayer.h +0 -1
  21. package/ios/MLRN/MLRNMapView.h +1 -1
  22. package/ios/MLRN/MLRNMapView.m +7 -7
  23. package/ios/MLRN/MLRNMapViewManager.m +1 -1
  24. package/ios/MLRN/MLRNModule.m +0 -139
  25. package/ios/MLRN/MLRNRasterLayer.h +0 -1
  26. package/ios/MLRN/MLRNShapeSource.h +0 -11
  27. package/ios/MLRN/MLRNShapeSource.m +0 -38
  28. package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
  29. package/ios/MLRN/MLRNSymbolLayer.h +1 -7
  30. package/ios/MLRN/MLRNSymbolLayer.m +1 -89
  31. package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
  32. package/lib/commonjs/MLRNModule.js +7 -5
  33. package/lib/commonjs/MLRNModule.js.map +1 -1
  34. package/lib/commonjs/MapLibreRN.js +3 -15
  35. package/lib/commonjs/MapLibreRN.js.map +1 -1
  36. package/lib/commonjs/components/Annotation.js.map +1 -1
  37. package/lib/commonjs/components/Images.js +1 -5
  38. package/lib/commonjs/components/Images.js.map +1 -1
  39. package/lib/commonjs/components/MapView.js +15 -28
  40. package/lib/commonjs/components/MapView.js.map +1 -1
  41. package/lib/commonjs/components/ShapeSource.js +6 -38
  42. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  43. package/lib/commonjs/components/SymbolLayer.js +2 -17
  44. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  45. package/lib/commonjs/components/UserLocation.js.map +1 -1
  46. package/lib/commonjs/components/VectorSource.js +1 -11
  47. package/lib/commonjs/components/VectorSource.js.map +1 -1
  48. package/lib/commonjs/modules/offline/offlineManager.js +1 -1
  49. package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
  50. package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
  51. package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
  52. package/lib/commonjs/utils/StyleValue.js +2 -2
  53. package/lib/commonjs/utils/StyleValue.js.map +1 -1
  54. package/lib/commonjs/utils/getStylePropertyType.js +252 -0
  55. package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
  56. package/lib/module/MLRNModule.js +3 -2
  57. package/lib/module/MLRNModule.js.map +1 -1
  58. package/lib/module/MapLibreRN.js +1 -5
  59. package/lib/module/MapLibreRN.js.map +1 -1
  60. package/lib/module/components/Annotation.js.map +1 -1
  61. package/lib/module/components/Images.js +1 -5
  62. package/lib/module/components/Images.js.map +1 -1
  63. package/lib/module/components/MapView.js +15 -28
  64. package/lib/module/components/MapView.js.map +1 -1
  65. package/lib/module/components/ShapeSource.js +5 -37
  66. package/lib/module/components/ShapeSource.js.map +1 -1
  67. package/lib/module/components/SymbolLayer.js +3 -18
  68. package/lib/module/components/SymbolLayer.js.map +1 -1
  69. package/lib/module/components/UserLocation.js.map +1 -1
  70. package/lib/module/components/VectorSource.js +1 -11
  71. package/lib/module/components/VectorSource.js.map +1 -1
  72. package/lib/module/modules/offline/offlineManager.js +1 -1
  73. package/lib/module/modules/offline/offlineManager.js.map +1 -1
  74. package/lib/module/types/MapLibreRNStyles.js +4 -0
  75. package/lib/module/types/MapLibreRNStyles.js.map +1 -0
  76. package/lib/module/utils/StyleValue.js +2 -2
  77. package/lib/module/utils/StyleValue.js.map +1 -1
  78. package/lib/module/utils/getStylePropertyType.js +248 -0
  79. package/lib/module/utils/getStylePropertyType.js.map +1 -0
  80. package/lib/typescript/commonjs/jest.config.d.ts +2 -0
  81. package/lib/typescript/commonjs/jest.config.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/MLRNModule.d.ts +3 -7
  83. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +5 -8
  85. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/components/Annotation.d.ts +2 -2
  87. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +2 -2
  89. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/components/Camera.d.ts +1 -1
  91. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +2 -2
  92. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +2 -2
  94. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/components/FillLayer.d.ts +2 -2
  96. package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +2 -2
  98. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/components/Light.d.ts +2 -2
  101. package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/components/LineLayer.d.ts +2 -2
  103. package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/components/MapView.d.ts +7 -11
  105. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +2 -2
  107. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -2
  109. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +2 -8
  111. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +2 -2
  114. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +1 -1
  116. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +4 -14
  118. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
  120. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
  122. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
  124. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
  126. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -0
  128. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +1 -0
  130. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
  132. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
  134. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
  135. package/lib/typescript/module/jest.config.d.ts +2 -0
  136. package/lib/typescript/module/jest.config.d.ts.map +1 -0
  137. package/lib/typescript/module/src/MLRNModule.d.ts +3 -7
  138. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  139. package/lib/typescript/module/src/MapLibreRN.d.ts +5 -8
  140. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  141. package/lib/typescript/module/src/components/Annotation.d.ts +2 -2
  142. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  143. package/lib/typescript/module/src/components/BackgroundLayer.d.ts +2 -2
  144. package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
  145. package/lib/typescript/module/src/components/Camera.d.ts +1 -1
  146. package/lib/typescript/module/src/components/CircleLayer.d.ts +2 -2
  147. package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
  148. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +2 -2
  149. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
  150. package/lib/typescript/module/src/components/FillLayer.d.ts +2 -2
  151. package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
  152. package/lib/typescript/module/src/components/HeatmapLayer.d.ts +2 -2
  153. package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
  154. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  155. package/lib/typescript/module/src/components/Light.d.ts +2 -2
  156. package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
  157. package/lib/typescript/module/src/components/LineLayer.d.ts +2 -2
  158. package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
  159. package/lib/typescript/module/src/components/MapView.d.ts +7 -11
  160. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  161. package/lib/typescript/module/src/components/RasterLayer.d.ts +2 -2
  162. package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
  163. package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -2
  164. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  165. package/lib/typescript/module/src/components/SymbolLayer.d.ts +2 -8
  166. package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
  167. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  168. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +2 -2
  169. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
  170. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +1 -1
  171. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
  172. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +4 -14
  173. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -1
  174. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
  175. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
  176. package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
  177. package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
  178. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
  179. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  180. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
  181. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  182. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -0
  183. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  184. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +1 -0
  185. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  186. package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
  187. package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
  188. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
  189. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
  190. package/package.json +31 -38
  191. package/plugin/build/withMapLibre.js +6 -6
  192. package/src/MLRNModule.ts +16 -10
  193. package/src/MapLibreRN.ts +22 -23
  194. package/src/components/Annotation.tsx +3 -3
  195. package/src/components/BackgroundLayer.tsx +2 -2
  196. package/src/components/Camera.tsx +1 -1
  197. package/src/components/CircleLayer.tsx +2 -2
  198. package/src/components/FillExtrusionLayer.tsx +2 -2
  199. package/src/components/FillLayer.tsx +2 -2
  200. package/src/components/HeatmapLayer.tsx +2 -2
  201. package/src/components/Images.tsx +1 -10
  202. package/src/components/Light.tsx +2 -2
  203. package/src/components/LineLayer.tsx +2 -2
  204. package/src/components/MapView.tsx +20 -44
  205. package/src/components/RasterLayer.tsx +2 -2
  206. package/src/components/ShapeSource.tsx +9 -77
  207. package/src/components/SymbolLayer.tsx +7 -35
  208. package/src/components/UserLocation.tsx +2 -2
  209. package/src/components/VectorSource.tsx +5 -21
  210. package/src/hooks/useAbstractLayer.ts +3 -3
  211. package/src/modules/offline/OfflinePack.ts +1 -1
  212. package/src/modules/offline/offlineManager.ts +4 -18
  213. package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +85 -405
  214. package/src/utils/StyleValue.ts +4 -4
  215. package/src/utils/filterUtils.ts +1 -1
  216. package/src/utils/getStylePropertyType.ts +265 -0
  217. package/android/install.md +0 -32
  218. package/android/src/main/res/values/strings.xml +0 -3
  219. package/ios/install.md +0 -49
  220. package/lib/commonjs/components/Style.js +0 -266
  221. package/lib/commonjs/components/Style.js.map +0 -1
  222. package/lib/commonjs/types/StyleURL.js +0 -11
  223. package/lib/commonjs/types/StyleURL.js.map +0 -1
  224. package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
  225. package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
  226. package/lib/commonjs/utils/deprecation.js +0 -31
  227. package/lib/commonjs/utils/deprecation.js.map +0 -1
  228. package/lib/commonjs/utils/styleMap.js +0 -255
  229. package/lib/commonjs/utils/styleMap.js.map +0 -1
  230. package/lib/module/components/Style.js +0 -261
  231. package/lib/module/components/Style.js.map +0 -1
  232. package/lib/module/types/StyleURL.js +0 -7
  233. package/lib/module/types/StyleURL.js.map +0 -1
  234. package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
  235. package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
  236. package/lib/module/utils/deprecation.js +0 -27
  237. package/lib/module/utils/deprecation.js.map +0 -1
  238. package/lib/module/utils/styleMap.js +0 -249
  239. package/lib/module/utils/styleMap.js.map +0 -1
  240. package/lib/typescript/commonjs/src/components/Style.d.ts +0 -81
  241. package/lib/typescript/commonjs/src/components/Style.d.ts.map +0 -1
  242. package/lib/typescript/commonjs/src/types/StyleURL.d.ts +0 -4
  243. package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +0 -1
  244. package/lib/typescript/commonjs/src/utils/deprecation.d.ts +0 -6
  245. package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +0 -1
  246. package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
  247. package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
  248. package/lib/typescript/module/src/components/Style.d.ts +0 -81
  249. package/lib/typescript/module/src/components/Style.d.ts.map +0 -1
  250. package/lib/typescript/module/src/types/StyleURL.d.ts +0 -4
  251. package/lib/typescript/module/src/types/StyleURL.d.ts.map +0 -1
  252. package/lib/typescript/module/src/utils/deprecation.d.ts +0 -6
  253. package/lib/typescript/module/src/utils/deprecation.d.ts.map +0 -1
  254. package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
  255. package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
  256. package/src/components/Style.tsx +0 -371
  257. package/src/types/StyleURL.ts +0 -3
  258. package/src/utils/deprecation.ts +0 -31
  259. package/src/utils/styleMap.ts +0 -265
@@ -4,8 +4,8 @@ import BridgeValue, {
4
4
  type RawValueType,
5
5
  type StyleValueJSON,
6
6
  } from "./BridgeValue";
7
- import { type AllLayerStyleProps } from "./MapLibreRNStyles";
8
- import { getStyleType } from "./styleMap";
7
+ import { getStylePropertyType } from "./getStylePropertyType";
8
+ import { type AllLayerStyle } from "../types/MapLibreRNStyles";
9
9
 
10
10
  export type StyleValue = {
11
11
  styletype: string;
@@ -13,7 +13,7 @@ export type StyleValue = {
13
13
  };
14
14
 
15
15
  export function transformStyle(
16
- style: AllLayerStyleProps | undefined,
16
+ style: AllLayerStyle | undefined,
17
17
  ): undefined | { [key: string]: StyleValue } {
18
18
  if (!style) {
19
19
  return undefined;
@@ -22,7 +22,7 @@ export function transformStyle(
22
22
  const nativeStyle: { [key: string]: StyleValue } = {};
23
23
  const styleProps = Object.keys(style) as (keyof typeof style)[];
24
24
  for (const styleProp of styleProps) {
25
- const styleType = getStyleType(styleProp);
25
+ const styleType = getStylePropertyType(styleProp);
26
26
  let rawStyle: RawValueType | undefined = style[styleProp];
27
27
 
28
28
  if (styleType === "color" && typeof rawStyle === "string") {
@@ -1,4 +1,4 @@
1
- import { type FilterExpression } from "./MapLibreRNStyles";
1
+ import { type FilterExpression } from "../types/MapLibreRNStyles";
2
2
 
3
3
  export function getFilter(filter: FilterExpression | undefined): string[] {
4
4
  if (!Array.isArray(filter) || filter.length === 0) {
@@ -0,0 +1,265 @@
1
+ /* eslint-disable */
2
+ // DO NOT MODIFY
3
+ // This file is auto-generated from scripts/templates/getStylePropertyType.ts.ejs
4
+
5
+ import { isAndroid } from "./index";
6
+
7
+ const StyleType = {
8
+ Constant: "constant",
9
+ Color: "color",
10
+ Transition: "transition",
11
+ Translation: "translation",
12
+ Function: "function",
13
+ Image: "image",
14
+ Enum: "enum",
15
+ };
16
+
17
+ const STYLE_MAP = {
18
+ fillSortKey: StyleType.Constant,
19
+ fillAntialias: StyleType.Constant,
20
+ fillOpacity: StyleType.Constant,
21
+ fillOpacityTransition: StyleType.Transition,
22
+ fillColor: StyleType.Color,
23
+ fillColorTransition: StyleType.Transition,
24
+ fillOutlineColor: StyleType.Color,
25
+ fillOutlineColorTransition: StyleType.Transition,
26
+ fillTranslate: StyleType.Translation,
27
+ fillTranslateTransition: StyleType.Transition,
28
+ fillTranslateAnchor: StyleType.Enum,
29
+ fillPattern: StyleType.Image,
30
+ fillPatternTransition: StyleType.Transition,
31
+
32
+ lineCap: StyleType.Enum,
33
+ lineJoin: StyleType.Enum,
34
+ lineMiterLimit: StyleType.Constant,
35
+ lineRoundLimit: StyleType.Constant,
36
+ lineSortKey: StyleType.Constant,
37
+ lineOpacity: StyleType.Constant,
38
+ lineOpacityTransition: StyleType.Transition,
39
+ lineColor: StyleType.Color,
40
+ lineColorTransition: StyleType.Transition,
41
+ lineTranslate: StyleType.Translation,
42
+ lineTranslateTransition: StyleType.Transition,
43
+ lineTranslateAnchor: StyleType.Enum,
44
+ lineWidth: StyleType.Constant,
45
+ lineWidthTransition: StyleType.Transition,
46
+ lineGapWidth: StyleType.Constant,
47
+ lineGapWidthTransition: StyleType.Transition,
48
+ lineOffset: StyleType.Constant,
49
+ lineOffsetTransition: StyleType.Transition,
50
+ lineBlur: StyleType.Constant,
51
+ lineBlurTransition: StyleType.Transition,
52
+ lineDasharray: StyleType.Constant,
53
+ lineDasharrayTransition: StyleType.Transition,
54
+ linePattern: StyleType.Image,
55
+ linePatternTransition: StyleType.Transition,
56
+ lineGradient: StyleType.Color,
57
+
58
+ symbolPlacement: StyleType.Enum,
59
+ symbolSpacing: StyleType.Constant,
60
+ symbolAvoidEdges: StyleType.Constant,
61
+ symbolSortKey: StyleType.Constant,
62
+ symbolZOrder: StyleType.Enum,
63
+ iconAllowOverlap: StyleType.Constant,
64
+ iconIgnorePlacement: StyleType.Constant,
65
+ iconOptional: StyleType.Constant,
66
+ iconRotationAlignment: StyleType.Enum,
67
+ iconSize: StyleType.Constant,
68
+ iconTextFit: StyleType.Enum,
69
+ iconTextFitPadding: StyleType.Constant,
70
+ iconImage: StyleType.Image,
71
+ iconRotate: StyleType.Constant,
72
+ iconPadding: StyleType.Constant,
73
+ iconKeepUpright: StyleType.Constant,
74
+ iconOffset: StyleType.Constant,
75
+ iconAnchor: StyleType.Enum,
76
+ iconPitchAlignment: StyleType.Enum,
77
+ textPitchAlignment: StyleType.Enum,
78
+ textRotationAlignment: StyleType.Enum,
79
+ textField: StyleType.Constant,
80
+ textFont: StyleType.Constant,
81
+ textSize: StyleType.Constant,
82
+ textMaxWidth: StyleType.Constant,
83
+ textLineHeight: StyleType.Constant,
84
+ textLetterSpacing: StyleType.Constant,
85
+ textJustify: StyleType.Enum,
86
+ textRadialOffset: StyleType.Constant,
87
+ textVariableAnchor: StyleType.Constant,
88
+ textAnchor: StyleType.Enum,
89
+ textMaxAngle: StyleType.Constant,
90
+ textWritingMode: StyleType.Constant,
91
+ textRotate: StyleType.Constant,
92
+ textPadding: StyleType.Constant,
93
+ textKeepUpright: StyleType.Constant,
94
+ textTransform: StyleType.Enum,
95
+ textOffset: StyleType.Constant,
96
+ textAllowOverlap: StyleType.Constant,
97
+ textIgnorePlacement: StyleType.Constant,
98
+ textOptional: StyleType.Constant,
99
+ iconOpacity: StyleType.Constant,
100
+ iconOpacityTransition: StyleType.Transition,
101
+ iconColor: StyleType.Color,
102
+ iconColorTransition: StyleType.Transition,
103
+ iconHaloColor: StyleType.Color,
104
+ iconHaloColorTransition: StyleType.Transition,
105
+ iconHaloWidth: StyleType.Constant,
106
+ iconHaloWidthTransition: StyleType.Transition,
107
+ iconHaloBlur: StyleType.Constant,
108
+ iconHaloBlurTransition: StyleType.Transition,
109
+ iconTranslate: StyleType.Translation,
110
+ iconTranslateTransition: StyleType.Transition,
111
+ iconTranslateAnchor: StyleType.Enum,
112
+ textOpacity: StyleType.Constant,
113
+ textOpacityTransition: StyleType.Transition,
114
+ textColor: StyleType.Color,
115
+ textColorTransition: StyleType.Transition,
116
+ textHaloColor: StyleType.Color,
117
+ textHaloColorTransition: StyleType.Transition,
118
+ textHaloWidth: StyleType.Constant,
119
+ textHaloWidthTransition: StyleType.Transition,
120
+ textHaloBlur: StyleType.Constant,
121
+ textHaloBlurTransition: StyleType.Transition,
122
+ textTranslate: StyleType.Translation,
123
+ textTranslateTransition: StyleType.Transition,
124
+ textTranslateAnchor: StyleType.Enum,
125
+
126
+ circleSortKey: StyleType.Constant,
127
+ circleRadius: StyleType.Constant,
128
+ circleRadiusTransition: StyleType.Transition,
129
+ circleColor: StyleType.Color,
130
+ circleColorTransition: StyleType.Transition,
131
+ circleBlur: StyleType.Constant,
132
+ circleBlurTransition: StyleType.Transition,
133
+ circleOpacity: StyleType.Constant,
134
+ circleOpacityTransition: StyleType.Transition,
135
+ circleTranslate: StyleType.Translation,
136
+ circleTranslateTransition: StyleType.Transition,
137
+ circleTranslateAnchor: StyleType.Enum,
138
+ circlePitchScale: StyleType.Enum,
139
+ circlePitchAlignment: StyleType.Enum,
140
+ circleStrokeWidth: StyleType.Constant,
141
+ circleStrokeWidthTransition: StyleType.Transition,
142
+ circleStrokeColor: StyleType.Color,
143
+ circleStrokeColorTransition: StyleType.Transition,
144
+ circleStrokeOpacity: StyleType.Constant,
145
+ circleStrokeOpacityTransition: StyleType.Transition,
146
+
147
+ heatmapRadius: StyleType.Constant,
148
+ heatmapRadiusTransition: StyleType.Transition,
149
+ heatmapWeight: StyleType.Constant,
150
+ heatmapIntensity: StyleType.Constant,
151
+ heatmapIntensityTransition: StyleType.Transition,
152
+ heatmapColor: StyleType.Color,
153
+ heatmapOpacity: StyleType.Constant,
154
+ heatmapOpacityTransition: StyleType.Transition,
155
+
156
+ fillExtrusionOpacity: StyleType.Constant,
157
+ fillExtrusionOpacityTransition: StyleType.Transition,
158
+ fillExtrusionColor: StyleType.Color,
159
+ fillExtrusionColorTransition: StyleType.Transition,
160
+ fillExtrusionTranslate: StyleType.Translation,
161
+ fillExtrusionTranslateTransition: StyleType.Transition,
162
+ fillExtrusionTranslateAnchor: StyleType.Enum,
163
+ fillExtrusionPattern: StyleType.Image,
164
+ fillExtrusionPatternTransition: StyleType.Transition,
165
+ fillExtrusionHeight: StyleType.Constant,
166
+ fillExtrusionHeightTransition: StyleType.Transition,
167
+ fillExtrusionBase: StyleType.Constant,
168
+ fillExtrusionBaseTransition: StyleType.Transition,
169
+ fillExtrusionVerticalGradient: StyleType.Constant,
170
+
171
+ rasterOpacity: StyleType.Constant,
172
+ rasterOpacityTransition: StyleType.Transition,
173
+ rasterHueRotate: StyleType.Constant,
174
+ rasterHueRotateTransition: StyleType.Transition,
175
+ rasterBrightnessMin: StyleType.Constant,
176
+ rasterBrightnessMinTransition: StyleType.Transition,
177
+ rasterBrightnessMax: StyleType.Constant,
178
+ rasterBrightnessMaxTransition: StyleType.Transition,
179
+ rasterSaturation: StyleType.Constant,
180
+ rasterSaturationTransition: StyleType.Transition,
181
+ rasterContrast: StyleType.Constant,
182
+ rasterContrastTransition: StyleType.Transition,
183
+ rasterResampling: StyleType.Enum,
184
+ rasterFadeDuration: StyleType.Constant,
185
+
186
+ hillshadeIlluminationDirection: StyleType.Constant,
187
+ hillshadeIlluminationAnchor: StyleType.Enum,
188
+ hillshadeExaggeration: StyleType.Constant,
189
+ hillshadeExaggerationTransition: StyleType.Transition,
190
+ hillshadeShadowColor: StyleType.Color,
191
+ hillshadeShadowColorTransition: StyleType.Transition,
192
+ hillshadeHighlightColor: StyleType.Color,
193
+ hillshadeHighlightColorTransition: StyleType.Transition,
194
+ hillshadeAccentColor: StyleType.Color,
195
+ hillshadeAccentColorTransition: StyleType.Transition,
196
+
197
+ backgroundColor: StyleType.Color,
198
+ backgroundColorTransition: StyleType.Transition,
199
+ backgroundPattern: StyleType.Image,
200
+ backgroundPatternTransition: StyleType.Transition,
201
+ backgroundOpacity: StyleType.Constant,
202
+ backgroundOpacityTransition: StyleType.Transition,
203
+
204
+ anchor: StyleType.Enum,
205
+ position: StyleType.Constant,
206
+ positionTransition: StyleType.Transition,
207
+ color: StyleType.Color,
208
+ colorTransition: StyleType.Transition,
209
+ intensity: StyleType.Constant,
210
+ intensityTransition: StyleType.Transition,
211
+
212
+ visibility: StyleType.Constant,
213
+ };
214
+
215
+ const STYLE_OVERRIDES = {
216
+ // padding
217
+ iconTextFitPadding: {
218
+ iosType: "edgeinsets",
219
+ },
220
+
221
+ // offsets
222
+ iconOffset: {
223
+ iosType: "vector",
224
+ },
225
+ textOffset: {
226
+ iosType: "vector",
227
+ },
228
+ lineOffset: {
229
+ iosType: "vector",
230
+ },
231
+
232
+ // translates
233
+ fillTranslate: {
234
+ iosType: "vector",
235
+ },
236
+ lineTranslate: {
237
+ iosType: "vector",
238
+ },
239
+ iconTranslate: {
240
+ iosType: "vector",
241
+ },
242
+ textTranslate: {
243
+ iosType: "vector",
244
+ },
245
+ circleTranslate: {
246
+ iosType: "vector",
247
+ },
248
+ fillExtrusionTranslate: {
249
+ iosType: "vector",
250
+ },
251
+ };
252
+
253
+ export function getStylePropertyType(
254
+ styleProperty: keyof typeof STYLE_OVERRIDES,
255
+ ): string {
256
+ if (!isAndroid() && STYLE_OVERRIDES[styleProperty]) {
257
+ return STYLE_OVERRIDES[styleProperty].iosType;
258
+ }
259
+
260
+ if (STYLE_MAP[styleProperty]) {
261
+ return STYLE_MAP[styleProperty];
262
+ }
263
+
264
+ throw new Error(`${styleProperty} is not a valid MapLibre layer style`);
265
+ }
@@ -1,32 +0,0 @@
1
- # Android Installation
2
-
3
- ## Access tokens
4
-
5
- > [!NOTE]
6
- > MapLibre Native for Android is slightly peculiar in that it
7
- _requires_ setting an access token, even though it will be `null` for
8
- most users (only Mapbox authenticates this way). Even if it feels odd,
9
- you have to have a line like this in your code before using the library.
10
- You can put this near the top of your `App.js` for convenience.
11
-
12
- ```javascript
13
- MapLibreGL.setAccessToken(null);
14
- ```
15
-
16
- ## Setting connection status
17
-
18
- TODO: check if this is still an issue with MapLibre Native on Android (issue #21).
19
-
20
- If you are hosting styles and sources on localhost, you might need to set
21
- the connection status manually for the SDK to be able to use them.
22
- See [mapbox/mapbox-gl-native#12819](https://github.com/mapbox/mapbox-gl-native/issues/12819).
23
-
24
- Manually sets the connectivity state of the app, bypassing any checks to the
25
- `ConnectivityManager`. Set to `true` for connected, `false` for disconnected,
26
- and `null` for the normal `ConnectivityManager` behavior.
27
-
28
- ```js
29
- import MapLibreGL from "@maplibre/maplibre-react-native";
30
-
31
- MapLibreGL.setConnected(true);
32
- ```
@@ -1,3 +0,0 @@
1
- <resources>
2
- <string name="app_name">MLRN</string>
3
- </resources>
package/ios/install.md DELETED
@@ -1,49 +0,0 @@
1
- # iOS Installation
2
-
3
- The following assumes, that you're using autolinking and installed
4
- `@maplibre/maplibre-react-native` via `npm` or `yarn`.
5
-
6
- Add the following to your `ios/Podfile`:
7
-
8
- ```ruby
9
- post_install do |installer|
10
- ... other post install hooks
11
- $MLRN.post_install(installer)
12
- end
13
- ```
14
-
15
- Running `pod install` will add version `6.5.4` of the MapLibre SDK.
16
-
17
- ```sh
18
- # Go to the ios directory
19
- cd ios
20
-
21
- # Run Pod Install
22
- pod install
23
- ```
24
-
25
- You are good to go!
26
-
27
- ## Note on iOS Simulator issues
28
-
29
- MapLibre Native has some issues on iOS Simulators in many
30
- environments. The map either does not render at all or appears garbled when panning and zooming.
31
- It is best to test on a real device if at all possible at this time
32
- until this is fixed upstream. iOS devs can open the workspace in Xcode and run from there.
33
-
34
- ## Installing a specific version
35
-
36
- The current default MapLibre version is `6.5.4`.
37
- If you want to install a different version, you can override as follows in
38
- your `Podfile`:
39
-
40
- ```ruby
41
- $MLRN_SPM_Spec = {
42
- url: "https://github.com/maplibre/maplibre-gl-native-distribution",
43
- requirement: {
44
- kind: "upToNextMajorVersion",
45
- minimumVersion: "6.5.4"
46
- },
47
- product_name: "MapLibre"
48
- }
49
- ```
@@ -1,266 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _BackgroundLayer = _interopRequireDefault(require("./BackgroundLayer.js"));
9
- var _CircleLayer = _interopRequireDefault(require("./CircleLayer.js"));
10
- var _FillExtrusionLayer = _interopRequireDefault(require("./FillExtrusionLayer.js"));
11
- var _FillLayer = _interopRequireDefault(require("./FillLayer.js"));
12
- var _HeatmapLayer = _interopRequireDefault(require("./HeatmapLayer.js"));
13
- var _ImageSource = _interopRequireDefault(require("./ImageSource.js"));
14
- var _LineLayer = _interopRequireDefault(require("./LineLayer.js"));
15
- var _RasterLayer = _interopRequireDefault(require("./RasterLayer.js"));
16
- var _RasterSource = _interopRequireDefault(require("./RasterSource.js"));
17
- var _ShapeSource = _interopRequireDefault(require("./ShapeSource.js"));
18
- var _SymbolLayer = _interopRequireDefault(require("./SymbolLayer.js"));
19
- var _VectorSource = _interopRequireDefault(require("./VectorSource.js"));
20
- var _jsxRuntime = require("react/jsx-runtime");
21
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
- function toCamelCase(s) {
23
- return s.replace(/([-_][a-z])/gi, $1 => {
24
- return $1.toUpperCase().replace("-", "").replace("_", "");
25
- });
26
- }
27
-
28
- // Patches the Mapbox Style Specification keys into the style props attributes:
29
- // icon-allow-overlap -> iconAllowOverlap
30
- function toCamelCaseKeys(oldObj) {
31
- if (!oldObj) {
32
- return {};
33
- }
34
- const newObj = {};
35
- Object.keys(oldObj).forEach(key => {
36
- const value = oldObj[key];
37
- if (key.includes("-")) {
38
- newObj[toCamelCase(key)] = value;
39
- } else {
40
- newObj[key] = value;
41
- }
42
- });
43
- return newObj;
44
- }
45
- function getLayerComponentType(layer) {
46
- const {
47
- type
48
- } = layer;
49
- switch (type) {
50
- case "circle":
51
- return _CircleLayer.default;
52
- case "symbol":
53
- return _SymbolLayer.default;
54
- case "raster":
55
- return _RasterLayer.default;
56
- case "line":
57
- return _LineLayer.default;
58
- case "fill":
59
- return _FillLayer.default;
60
- case "fill-extrusion":
61
- return _FillExtrusionLayer.default;
62
- case "background":
63
- return _BackgroundLayer.default;
64
- case "heatmap":
65
- return _HeatmapLayer.default;
66
- }
67
- console.warn(`Mapbox layer type '${type}' is not supported/`);
68
- return null;
69
- }
70
- function asLayerComponent(layer) {
71
- const LayerComponent = getLayerComponentType(layer);
72
- if (!LayerComponent) {
73
- return null;
74
- }
75
- const style = {
76
- ...toCamelCaseKeys(layer.paint),
77
- ...toCamelCaseKeys(layer.layout)
78
- };
79
- const layerProps = {};
80
- if (layer.source) {
81
- layerProps.sourceID = layer.source;
82
- }
83
- if (layer["source-layer"]) {
84
- layerProps.sourceLayerID = layer["source-layer"];
85
- }
86
- if (layer.minzoom) {
87
- layerProps.minZoomLevel = layer.minzoom;
88
- }
89
- if (layer.maxzoom) {
90
- layerProps.maxZoomLevel = layer.maxzoom;
91
- }
92
- if (layer.filter) {
93
- layerProps.filter = layer.filter;
94
- }
95
- if (Object.keys(style).length) {
96
- layerProps.style = style;
97
- }
98
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(LayerComponent, {
99
- id: layer.id,
100
- ...layerProps
101
- }, layer.id);
102
- }
103
- function getTileSourceProps(source) {
104
- const sourceProps = {};
105
- if (source.url) {
106
- sourceProps.url = source.url;
107
- }
108
- if (source.tiles) {
109
- sourceProps.tileUrlTemplates = source.tiles;
110
- }
111
- if (source.minzoom !== undefined) {
112
- sourceProps.minZoomLevel = source.minzoom;
113
- }
114
- if (source.maxzoom !== undefined) {
115
- sourceProps.maxZoomLevel = source.maxzoom;
116
- }
117
- if (source.attribution) {
118
- sourceProps.attribution = source.attribution;
119
- }
120
- if (source.scheme && source.scheme === "tms") {
121
- sourceProps.tms = true;
122
- }
123
- return sourceProps;
124
- }
125
- function getVectorSource(id, source) {
126
- const sourceProps = {
127
- ...getTileSourceProps(source)
128
- };
129
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VectorSource.default, {
130
- id: id,
131
- ...sourceProps
132
- }, id);
133
- }
134
- function getRasterSource(id, source) {
135
- const sourceProps = {
136
- ...getTileSourceProps(source)
137
- };
138
- if (source.tileSize) {
139
- sourceProps.tileSize = source.tileSize;
140
- }
141
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RasterSource.default, {
142
- id: id,
143
- ...sourceProps
144
- }, id);
145
- }
146
- function getImageSource(id, source) {
147
- const sourceProps = {
148
- url: source.url,
149
- coordinates: source.coordinates
150
- };
151
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageSource.default, {
152
- id: id,
153
- ...sourceProps
154
- }, id);
155
- }
156
- function getShapeSource(id, source) {
157
- const sourceProps = {};
158
- if (source.data && typeof source.data === "string") {
159
- sourceProps.url = source.data;
160
- } else if (source.data && typeof source.data === "object") {
161
- sourceProps.shape = source.data;
162
- }
163
- if (source.cluster !== undefined) {
164
- sourceProps.cluster = source.cluster;
165
- }
166
- if (source.clusterRadius !== undefined) {
167
- sourceProps.clusterRadius = source.clusterRadius;
168
- }
169
- if (source.maxzoom !== undefined) {
170
- sourceProps.maxZoomLevel = source.maxzoom;
171
- }
172
- if (source.clusterMaxZoom !== undefined) {
173
- sourceProps.clusterMaxZoomLevel = source.clusterMaxZoom;
174
- }
175
- if (source.clusterProperties !== undefined) {
176
- sourceProps.clusterProperties = source.clusterProperties;
177
- }
178
- if (source.buffer !== undefined) {
179
- sourceProps.buffer = source.buffer;
180
- }
181
- if (source.tolerance !== undefined) {
182
- sourceProps.tolerance = source.tolerance;
183
- }
184
- if (source.lineMetrics !== undefined) {
185
- sourceProps.lineMetrics = source.lineMetrics;
186
- }
187
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ShapeSource.default, {
188
- id: id,
189
- ...sourceProps
190
- }, id);
191
- }
192
- function asSourceComponent(id, source) {
193
- switch (source.type) {
194
- case "vector":
195
- return getVectorSource(id, source);
196
- case "raster":
197
- return getRasterSource(id, source);
198
- case "image":
199
- return getImageSource(id, source);
200
- case "geojson":
201
- return getShapeSource(id, source);
202
- }
203
- console.warn(`MapLibre source type '${source.type}' is not supported`);
204
- return null;
205
- }
206
- /**
207
- * Style is a component that automatically adds sources / layers to the map using MapLibre Style Spec.
208
- * Only [`sources`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) & [`layers`](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/) are supported.
209
- * Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/maplibre/maplibre-react-native/tree/main/docs.
210
- *
211
- * TODO: Maintainer forking this project does not understand the above comment regarding what is supported.
212
- */
213
- const Style = props => {
214
- const [fetchedJson, setFetchedJson] = (0, _react.useState)({});
215
- const json = typeof props.json === "object" ? props.json : fetchedJson;
216
-
217
- // Fetch style when props.json is a URL
218
- (0, _react.useEffect)(() => {
219
- const abortController = new AbortController();
220
- const fetchStyleJson = async url => {
221
- try {
222
- const response = await fetch(url, {
223
- signal: abortController.signal
224
- });
225
- const responseJson = await response.json();
226
- setFetchedJson(responseJson);
227
- } catch (error) {
228
- const e = error;
229
- if (e.name === "AbortError") {
230
- return;
231
- }
232
- throw e;
233
- }
234
- };
235
- if (typeof props.json === "string") {
236
- fetchStyleJson(props.json);
237
- }
238
- return function cleanup() {
239
- abortController.abort();
240
- };
241
- }, [props.json]);
242
-
243
- // Extract layer components from json
244
- const layerComponents = (0, _react.useMemo)(() => {
245
- if (!json.layers) {
246
- return [];
247
- }
248
- return json.layers.map(asLayerComponent).filter(x => !!x);
249
- }, [json.layers]);
250
-
251
- // Extract source components from json
252
- const sourceComponents = (0, _react.useMemo)(() => {
253
- const {
254
- sources
255
- } = json;
256
- if (!sources || !Object.keys(sources)) {
257
- return [];
258
- }
259
- return Object.entries(sources).map(([id, source]) => asSourceComponent(id, source)).filter(x => !!x);
260
- }, [json]);
261
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
262
- children: [sourceComponents, layerComponents]
263
- });
264
- };
265
- var _default = exports.default = Style;
266
- //# sourceMappingURL=Style.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_BackgroundLayer","_interopRequireDefault","_CircleLayer","_FillExtrusionLayer","_FillLayer","_HeatmapLayer","_ImageSource","_LineLayer","_RasterLayer","_RasterSource","_ShapeSource","_SymbolLayer","_VectorSource","_jsxRuntime","e","__esModule","default","toCamelCase","s","replace","$1","toUpperCase","toCamelCaseKeys","oldObj","newObj","Object","keys","forEach","key","value","includes","getLayerComponentType","layer","type","CircleLayer","SymbolLayer","RasterLayer","LineLayer","FillLayer","FillExtrusionLayer","BackgroundLayer","HeatmapLayer","console","warn","asLayerComponent","LayerComponent","style","paint","layout","layerProps","source","sourceID","sourceLayerID","minzoom","minZoomLevel","maxzoom","maxZoomLevel","filter","length","jsx","id","getTileSourceProps","sourceProps","url","tiles","tileUrlTemplates","undefined","attribution","scheme","tms","getVectorSource","getRasterSource","tileSize","getImageSource","coordinates","getShapeSource","data","shape","cluster","clusterRadius","clusterMaxZoom","clusterMaxZoomLevel","clusterProperties","buffer","tolerance","lineMetrics","asSourceComponent","Style","props","fetchedJson","setFetchedJson","useState","json","useEffect","abortController","AbortController","fetchStyleJson","response","fetch","signal","responseJson","error","name","cleanup","abort","layerComponents","useMemo","layers","map","x","sourceComponents","sources","entries","jsxs","Fragment","children","_default","exports"],"sourceRoot":"../../../src","sources":["components/Style.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,mBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAGA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,YAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,UAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,YAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,aAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,YAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,YAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,aAAA,GAAAX,sBAAA,CAAAF,OAAA;AAA0C,IAAAc,WAAA,GAAAd,OAAA;AAAA,SAAAE,uBAAAa,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAM1C,SAASG,WAAWA,CAACC,CAAS,EAAU;EACtC,OAAOA,CAAC,CAACC,OAAO,CAAC,eAAe,EAAGC,EAAE,IAAK;IACxC,OAAOA,EAAE,CAACC,WAAW,CAAC,CAAC,CAACF,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAACA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CAAC,CAC3BH,GAAG,CAAC,CAAC,CAAChD,EAAE,EAAEV,MAAM,CAAC,KAAKoC,iBAAiB,CAAC1B,EAAE,EAAEV,MAAM,CAAC,CAAC,CACpDO,MAAM,CAAEoD,CAAC,IAAK,CAAC,CAACA,CAAC,CAAC;EACvB,CAAC,EAAE,CAACjB,IAAI,CAAC,CAAC;EAEV,oBACE,IAAA/E,WAAA,CAAAoG,IAAA,EAAApG,WAAA,CAAAqG,QAAA;IAAAC,QAAA,GACGL,gBAAgB,EAChBL,eAAe;EAAA,CAChB,CAAC;AAEP,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAArG,OAAA,GAEauE,KAAK","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StyleURL = void 0;
7
- let StyleURL = exports.StyleURL = /*#__PURE__*/function (StyleURL) {
8
- StyleURL["Default"] = "https://demotiles.maplibre.org/style.json";
9
- return StyleURL;
10
- }({});
11
- //# sourceMappingURL=StyleURL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleURL","exports"],"sourceRoot":"../../../src","sources":["types/StyleURL.ts"],"mappings":";;;;;;IAAYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}