@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.
- package/README.md +34 -35
- package/android/build.gradle +98 -51
- package/android/gradle.properties +7 -0
- package/android/src/main/AndroidManifest.xml +4 -2
- package/android/src/main/AndroidManifestNew.xml +5 -0
- package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.java +0 -5
- package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
- package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +0 -66
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +0 -145
- package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +80 -0
- package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
- package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
- package/ios/MLRN/MLRNFillLayer.h +0 -1
- package/ios/MLRN/MLRNFillLayer.m +1 -0
- package/ios/MLRN/MLRNLineLayer.h +0 -1
- package/ios/MLRN/MLRNModule.m +0 -135
- package/ios/MLRN/MLRNRasterLayer.h +0 -1
- package/ios/MLRN/MLRNShapeSource.h +0 -11
- package/ios/MLRN/MLRNShapeSource.m +0 -38
- package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
- package/ios/MLRN/MLRNSymbolLayer.h +1 -7
- package/ios/MLRN/MLRNSymbolLayer.m +1 -89
- package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
- package/lib/commonjs/MLRNModule.js +7 -5
- package/lib/commonjs/MLRNModule.js.map +1 -1
- package/lib/commonjs/MapLibreRN.js +3 -15
- package/lib/commonjs/MapLibreRN.js.map +1 -1
- package/lib/commonjs/components/Annotation.js.map +1 -1
- package/lib/commonjs/components/Images.js +1 -5
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/MapView.js +0 -7
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +6 -38
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +2 -17
- package/lib/commonjs/components/SymbolLayer.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +1 -11
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/modules/offline/offlineManager.js +1 -1
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
- package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
- package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
- package/lib/commonjs/utils/StyleValue.js +2 -2
- package/lib/commonjs/utils/StyleValue.js.map +1 -1
- package/lib/commonjs/utils/getStylePropertyType.js +252 -0
- package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
- package/lib/module/MLRNModule.js +3 -2
- package/lib/module/MLRNModule.js.map +1 -1
- package/lib/module/MapLibreRN.js +1 -5
- package/lib/module/MapLibreRN.js.map +1 -1
- package/lib/module/components/Annotation.js.map +1 -1
- package/lib/module/components/Images.js +1 -5
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/MapView.js +0 -7
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/ShapeSource.js +5 -37
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +3 -18
- package/lib/module/components/SymbolLayer.js.map +1 -1
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/VectorSource.js +1 -11
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/modules/offline/offlineManager.js +1 -1
- package/lib/module/modules/offline/offlineManager.js.map +1 -1
- package/lib/module/types/MapLibreRNStyles.js +4 -0
- package/lib/module/types/MapLibreRNStyles.js.map +1 -0
- package/lib/module/utils/StyleValue.js +2 -2
- package/lib/module/utils/StyleValue.js.map +1 -1
- package/lib/module/utils/getStylePropertyType.js +248 -0
- package/lib/module/utils/getStylePropertyType.js.map +1 -0
- package/lib/typescript/commonjs/jest.config.d.ts +2 -0
- package/lib/typescript/commonjs/jest.config.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MLRNModule.d.ts +3 -7
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +5 -8
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Camera.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Light.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MapView.d.ts +1 -2
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -2
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +2 -8
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +2 -2
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +4 -14
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
- package/lib/typescript/module/jest.config.d.ts +2 -0
- package/lib/typescript/module/jest.config.d.ts.map +1 -0
- package/lib/typescript/module/src/MLRNModule.d.ts +3 -7
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +5 -8
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Annotation.d.ts +2 -2
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Camera.d.ts +1 -1
- package/lib/typescript/module/src/components/CircleLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Light.d.ts +2 -2
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/module/src/components/LineLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MapView.d.ts +1 -2
- package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterLayer.d.ts +2 -2
- package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -2
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +2 -8
- package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +2 -2
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +1 -1
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +4 -14
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -1
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
- package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
- package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
- package/package.json +31 -38
- package/plugin/build/withMapLibre.js +6 -6
- package/src/MLRNModule.ts +15 -9
- package/src/MapLibreRN.ts +22 -23
- package/src/components/Annotation.tsx +3 -3
- package/src/components/BackgroundLayer.tsx +2 -2
- package/src/components/Camera.tsx +1 -1
- package/src/components/CircleLayer.tsx +2 -2
- package/src/components/FillExtrusionLayer.tsx +2 -2
- package/src/components/FillLayer.tsx +2 -2
- package/src/components/HeatmapLayer.tsx +2 -2
- package/src/components/Images.tsx +1 -10
- package/src/components/Light.tsx +2 -2
- package/src/components/LineLayer.tsx +2 -2
- package/src/components/MapView.tsx +1 -12
- package/src/components/RasterLayer.tsx +2 -2
- package/src/components/ShapeSource.tsx +9 -77
- package/src/components/SymbolLayer.tsx +7 -35
- package/src/components/UserLocation.tsx +2 -2
- package/src/components/VectorSource.tsx +5 -21
- package/src/hooks/useAbstractLayer.ts +3 -3
- package/src/modules/offline/OfflinePack.ts +1 -1
- package/src/modules/offline/offlineManager.ts +4 -18
- package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +85 -405
- package/src/utils/StyleValue.ts +4 -4
- package/src/utils/filterUtils.ts +1 -1
- package/src/utils/getStylePropertyType.ts +265 -0
- package/android/install.md +0 -32
- package/android/src/main/res/values/strings.xml +0 -3
- package/ios/install.md +0 -49
- package/lib/commonjs/components/Style.js +0 -266
- package/lib/commonjs/components/Style.js.map +0 -1
- package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
- package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
- package/lib/commonjs/utils/deprecation.js +0 -31
- package/lib/commonjs/utils/deprecation.js.map +0 -1
- package/lib/commonjs/utils/styleMap.js +0 -255
- package/lib/commonjs/utils/styleMap.js.map +0 -1
- package/lib/module/components/Style.js +0 -261
- package/lib/module/components/Style.js.map +0 -1
- package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
- package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
- package/lib/module/utils/deprecation.js +0 -27
- package/lib/module/utils/deprecation.js.map +0 -1
- package/lib/module/utils/styleMap.js +0 -249
- package/lib/module/utils/styleMap.js.map +0 -1
- package/lib/typescript/commonjs/src/components/Style.d.ts +0 -81
- package/lib/typescript/commonjs/src/components/Style.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts +0 -6
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Style.d.ts +0 -81
- package/lib/typescript/module/src/components/Style.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/deprecation.d.ts +0 -6
- package/lib/typescript/module/src/utils/deprecation.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
- package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
- package/src/components/Style.tsx +0 -371
- package/src/utils/deprecation.ts +0 -31
- 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/
|
|
18
|
+
<img src="/docs/assets/device-android.png"
|
|
19
19
|
alt="Indoor Building Map Android"
|
|
20
|
-
height="
|
|
20
|
+
height="320"
|
|
21
21
|
/>
|
|
22
|
-
<img src="/docs/assets/
|
|
22
|
+
<img src="/docs/assets/device-ios.png"
|
|
23
23
|
alt="Indoor Building Map iOS"
|
|
24
|
-
height="
|
|
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](/
|
|
34
|
-
- [iOS](/
|
|
35
|
-
- [Expo](/
|
|
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
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
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
|
-
###
|
|
65
|
+
### Modules
|
|
67
66
|
|
|
68
|
-
- [OfflineManager](/docs/
|
|
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
|
-
- [
|
|
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
|
|
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.
|
package/android/build.gradle
CHANGED
|
@@ -1,69 +1,116 @@
|
|
|
1
|
-
|
|
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
|
|
4
|
-
|
|
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
|
-
|
|
23
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
9
24
|
}
|
|
10
25
|
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
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>
|
|
@@ -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<>();
|
package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
}
|