@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.
- package/README.md +36 -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/mapview/MLRNMapView.java +11 -13
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +4 -11
- 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 +3 -146
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
- 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/MLRNMapView.h +1 -1
- package/ios/MLRN/MLRNMapView.m +7 -7
- package/ios/MLRN/MLRNMapViewManager.m +1 -1
- package/ios/MLRN/MLRNModule.m +0 -139
- 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 +15 -28
- 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 +15 -28
- 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 +7 -11
- 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 +7 -11
- 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 +16 -10
- 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 +20 -44
- 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/types/StyleURL.js +0 -11
- package/lib/commonjs/types/StyleURL.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/types/StyleURL.js +0 -7
- package/lib/module/types/StyleURL.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/types/StyleURL.d.ts +0 -4
- package/lib/typescript/commonjs/src/types/StyleURL.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/types/StyleURL.d.ts +0 -4
- package/lib/typescript/module/src/types/StyleURL.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/types/StyleURL.ts +0 -3
- package/src/utils/deprecation.ts +0 -31
- package/src/utils/styleMap.ts +0 -265
package/README.md
CHANGED
|
@@ -15,66 +15,67 @@ 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
|
+
- Migrations
|
|
37
|
+
- [Migrating to v10](/docs/guides/migrations/v10.md)
|
|
36
38
|
|
|
37
39
|
### Components
|
|
38
40
|
|
|
39
|
-
- [MapView](/docs/MapView.md)
|
|
40
|
-
- [Light](/docs/Light.md)
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
47
|
-
- [Images](docs/Images.md)
|
|
41
|
+
- [MapView](/docs/components/MapView.md)
|
|
42
|
+
- [Light](/docs/components/Light.md)
|
|
43
|
+
- [PointAnnotation](/docs/components/PointAnnotation.md)
|
|
44
|
+
- [MarkerView](/docs/components/MarkerView.md)
|
|
45
|
+
- [Callout](/docs/components/Callout.md)
|
|
46
|
+
- [Camera](/docs/components/Camera.md)
|
|
47
|
+
- [UserLocation](/docs/components/UserLocation.md)
|
|
48
|
+
- [Images](/docs/components/Images.md)
|
|
48
49
|
|
|
49
50
|
### Sources
|
|
50
51
|
|
|
51
|
-
- [VectorSource](/docs/VectorSource.md)
|
|
52
|
-
- [ShapeSource](/docs/ShapeSource.md)
|
|
53
|
-
- [RasterSource](/docs/RasterSource.md)
|
|
52
|
+
- [VectorSource](/docs/components/VectorSource.md)
|
|
53
|
+
- [ShapeSource](/docs/components/ShapeSource.md)
|
|
54
|
+
- [RasterSource](/docs/components/RasterSource.md)
|
|
54
55
|
|
|
55
56
|
### Layers
|
|
56
57
|
|
|
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)
|
|
58
|
+
- [BackgroundLayer](/docs/components/BackgroundLayer.md)
|
|
59
|
+
- [CircleLayer](/docs/components/CircleLayer.md)
|
|
60
|
+
- [FillExtrusionLayer](/docs/components/FillExtrusionLayer.md)
|
|
61
|
+
- [FillLayer](/docs/components/FillLayer.md)
|
|
62
|
+
- [LineLayer](/docs/components/LineLayer.md)
|
|
63
|
+
- [RasterLayer](/docs/components/RasterLayer.md)
|
|
64
|
+
- [SymbolLayer](/docs/components/SymbolLayer.md)
|
|
65
|
+
- [HeatmapLayer](/docs/components/HeatmapLayer.md)
|
|
65
66
|
|
|
66
|
-
###
|
|
67
|
+
### Modules
|
|
67
68
|
|
|
68
|
-
- [OfflineManager](/docs/
|
|
69
|
-
- [SnapshotManager](/docs/snapshotManager.md)
|
|
69
|
+
- [OfflineManager](/docs/modules/offlineManager.md)
|
|
70
|
+
- [SnapshotManager](/docs/modules/snapshotManager.md)
|
|
70
71
|
|
|
71
72
|
### Misc
|
|
72
73
|
|
|
73
|
-
- [MapLibreGL](/docs/MapLibreGL.md)
|
|
74
|
-
- [
|
|
75
|
-
- [Logger](/docs/Logger.md)
|
|
74
|
+
- [MapLibreGL](/docs/guides/MapLibreGL.md)
|
|
75
|
+
- [Custom HTTP Headers](/docs/guides/CustomHTTPHeaders.md)
|
|
76
|
+
- [Logger](/docs/guides/Logger.md)
|
|
76
77
|
|
|
77
|
-
## Contributing
|
|
78
|
+
## Contributing & Development
|
|
78
79
|
|
|
79
80
|
Read the [CONTRIBUTING.md](CONTRIBUTING.md) guide in order to get familiar with how we do things around here and
|
|
80
81
|
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<>();
|
|
@@ -8,7 +8,6 @@ import android.graphics.RectF;
|
|
|
8
8
|
import android.location.Location;
|
|
9
9
|
import android.os.Handler;
|
|
10
10
|
import androidx.annotation.NonNull;
|
|
11
|
-
import androidx.annotation.UiThread;
|
|
12
11
|
|
|
13
12
|
import android.util.DisplayMetrics;
|
|
14
13
|
import android.util.Pair;
|
|
@@ -53,7 +52,6 @@ import org.maplibre.reactnative.R;
|
|
|
53
52
|
import org.maplibre.reactnative.components.AbstractMapFeature;
|
|
54
53
|
import org.maplibre.reactnative.components.annotation.MLRNPointAnnotation;
|
|
55
54
|
import org.maplibre.reactnative.components.annotation.MLRNMarkerView;
|
|
56
|
-
import org.maplibre.reactnative.components.annotation.MarkerView;
|
|
57
55
|
import org.maplibre.reactnative.components.annotation.MarkerViewManager;
|
|
58
56
|
import org.maplibre.reactnative.components.camera.MLRNCamera;
|
|
59
57
|
import org.maplibre.reactnative.components.images.MLRNImages;
|
|
@@ -69,6 +67,7 @@ import org.maplibre.reactnative.events.IEvent;
|
|
|
69
67
|
import org.maplibre.reactnative.events.MapChangeEvent;
|
|
70
68
|
import org.maplibre.reactnative.events.MapClickEvent;
|
|
71
69
|
import org.maplibre.reactnative.events.constants.EventTypes;
|
|
70
|
+
import org.maplibre.reactnative.modules.MLRNModule;
|
|
72
71
|
import org.maplibre.reactnative.utils.BitmapUtils;
|
|
73
72
|
import org.maplibre.reactnative.utils.GeoJSONUtils;
|
|
74
73
|
import org.maplibre.reactnative.utils.GeoViewport;
|
|
@@ -85,7 +84,6 @@ import org.json.*;
|
|
|
85
84
|
import javax.annotation.Nullable;
|
|
86
85
|
|
|
87
86
|
import static org.maplibre.android.style.layers.PropertyFactory.visibility;
|
|
88
|
-
import static org.maplibre.reactnative.modules.MLRNOfflineModule.DEFAULT_STYLE_URL;
|
|
89
87
|
|
|
90
88
|
@SuppressWarnings({ "MissingPermission" })
|
|
91
89
|
public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibreMap.OnMapClickListener,
|
|
@@ -117,7 +115,7 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
|
|
|
117
115
|
|
|
118
116
|
private LocalizationPlugin mLocalizationPlugin;
|
|
119
117
|
|
|
120
|
-
private String
|
|
118
|
+
private String mMapStyle;
|
|
121
119
|
|
|
122
120
|
private Integer mPreferredFramesPerSecond;
|
|
123
121
|
private boolean mLocalizeLabels;
|
|
@@ -171,7 +169,7 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
|
|
|
171
169
|
|
|
172
170
|
mHandler = new Handler();
|
|
173
171
|
|
|
174
|
-
|
|
172
|
+
mMapStyle = MLRNModule.DEFAULT_STYLE_URL;
|
|
175
173
|
|
|
176
174
|
setLifecycleListeners();
|
|
177
175
|
|
|
@@ -436,10 +434,10 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
|
|
|
436
434
|
public void onMapReady(final MapLibreMap mapboxMap) {
|
|
437
435
|
mMap = mapboxMap;
|
|
438
436
|
|
|
439
|
-
if (isJSONValid(
|
|
440
|
-
mMap.setStyle(new Style.Builder().fromJson(
|
|
437
|
+
if (isJSONValid(mMapStyle)) {
|
|
438
|
+
mMap.setStyle(new Style.Builder().fromJson(mMapStyle));
|
|
441
439
|
} else {
|
|
442
|
-
mMap.setStyle(new Style.Builder().fromUri(
|
|
440
|
+
mMap.setStyle(new Style.Builder().fromUri(mMapStyle));
|
|
443
441
|
}
|
|
444
442
|
|
|
445
443
|
reflow();
|
|
@@ -776,21 +774,21 @@ public class MLRNMapView extends MapView implements OnMapReadyCallback, MapLibre
|
|
|
776
774
|
return mContext.getResources().getDisplayMetrics().density;
|
|
777
775
|
}
|
|
778
776
|
|
|
779
|
-
public void
|
|
780
|
-
|
|
777
|
+
public void setReactMapStyle(String mapStyle) {
|
|
778
|
+
mMapStyle = mapStyle;
|
|
781
779
|
|
|
782
780
|
if (mMap != null) {
|
|
783
781
|
removeAllSourcesFromMap();
|
|
784
782
|
|
|
785
|
-
if (isJSONValid(
|
|
786
|
-
mMap.setStyle(new Style.Builder().fromJson(
|
|
783
|
+
if (isJSONValid(mMapStyle)) {
|
|
784
|
+
mMap.setStyle(new Style.Builder().fromJson(mMapStyle), new Style.OnStyleLoaded() {
|
|
787
785
|
@Override
|
|
788
786
|
public void onStyleLoaded(@NonNull Style style) {
|
|
789
787
|
addAllSourcesToMap();
|
|
790
788
|
}
|
|
791
789
|
});
|
|
792
790
|
} else {
|
|
793
|
-
mMap.setStyle(
|
|
791
|
+
mMap.setStyle(mapStyle, new Style.OnStyleLoaded() {
|
|
794
792
|
@Override
|
|
795
793
|
public void onStyleLoaded(@NonNull Style style) {
|
|
796
794
|
addAllSourcesToMap();
|
package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package org.maplibre.reactnative.components.mapview;
|
|
2
2
|
|
|
3
3
|
import android.util.Log;
|
|
4
|
-
import android.view.Gravity;
|
|
5
4
|
import android.view.View;
|
|
6
5
|
|
|
7
6
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
@@ -11,23 +10,17 @@ import com.facebook.react.common.MapBuilder;
|
|
|
11
10
|
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
12
11
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
13
12
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
14
|
-
|
|
15
|
-
import org.maplibre.android.log.Logger;
|
|
13
|
+
|
|
16
14
|
import org.maplibre.android.maps.MapLibreMap;
|
|
17
15
|
import org.maplibre.reactnative.components.AbstractEventEmitter;
|
|
18
16
|
import org.maplibre.reactnative.events.constants.EventKeys;
|
|
19
17
|
import org.maplibre.reactnative.utils.ConvertUtils;
|
|
20
18
|
import org.maplibre.reactnative.utils.ExpressionParser;
|
|
21
19
|
import org.maplibre.reactnative.utils.GeoJSONUtils;
|
|
22
|
-
import org.maplibre.geojson.FeatureCollection;
|
|
23
|
-
import org.maplibre.geojson.Point;
|
|
24
20
|
|
|
25
21
|
import java.util.ArrayList;
|
|
26
22
|
import java.util.HashMap;
|
|
27
23
|
import java.util.Map;
|
|
28
|
-
import java.util.concurrent.ExecutionException;
|
|
29
|
-
import java.util.concurrent.FutureTask;
|
|
30
|
-
import java.util.concurrent.RunnableFuture;
|
|
31
24
|
|
|
32
25
|
import javax.annotation.Nullable;
|
|
33
26
|
|
|
@@ -111,9 +104,9 @@ public class MLRNMapViewManager extends AbstractEventEmitter<MLRNMapView> {
|
|
|
111
104
|
|
|
112
105
|
//region React Props
|
|
113
106
|
|
|
114
|
-
@ReactProp(name="
|
|
115
|
-
public void
|
|
116
|
-
mapView.
|
|
107
|
+
@ReactProp(name="mapStyle")
|
|
108
|
+
public void setMapStyle(MLRNMapView mapView, String mapStyle) {
|
|
109
|
+
mapView.setReactMapStyle(mapStyle);
|
|
117
110
|
}
|
|
118
111
|
|
|
119
112
|
@ReactProp(name="preferredFramesPerSecond")
|
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
|
}
|