@maplibre/maplibre-react-native 10.0.0-beta.2 → 10.0.0-beta.20
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 +12 -56
- package/android/build.gradle +120 -50
- package/android/gradle.properties +15 -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/camera/MLRNCamera.java +37 -48
- package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +16 -9
- 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/location/LocationManager.java +7 -11
- package/android/src/main/java/org/maplibre/reactnative/location/engine/DefaultLocationEngineProvider.java +18 -0
- package/android/src/main/java/org/maplibre/reactnative/location/engine/LocationEngineProvidable.java +9 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +27 -148
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
- package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +123 -18
- package/android/src/main/location-engine-default/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineImpl.java +151 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineProvider.java +24 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
- package/app.plugin.js +1 -1
- package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
- package/ios/MLRN/MLRNCamera.m +6 -7
- 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 +8 -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/MLRNStyle.m +0 -40
- 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 +74 -68
- package/lib/commonjs/MapLibreRN.js.map +1 -1
- package/lib/commonjs/components/Annotation.js +7 -9
- package/lib/commonjs/components/Annotation.js.map +1 -1
- package/lib/commonjs/components/BackgroundLayer.js +6 -8
- package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
- package/lib/commonjs/components/Callout.js +2 -2
- package/lib/commonjs/components/Callout.js.map +1 -1
- package/lib/commonjs/components/Camera.js +111 -63
- package/lib/commonjs/components/Camera.js.map +1 -1
- package/lib/commonjs/components/CircleLayer.js +6 -8
- package/lib/commonjs/components/CircleLayer.js.map +1 -1
- package/lib/commonjs/components/FillExtrusionLayer.js +6 -8
- package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
- package/lib/commonjs/components/FillLayer.js +6 -8
- package/lib/commonjs/components/FillLayer.js.map +1 -1
- package/lib/commonjs/components/HeadingIndicator.js +4 -4
- package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
- package/lib/commonjs/components/HeatmapLayer.js +6 -8
- package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
- package/lib/commonjs/components/ImageSource.js +4 -5
- package/lib/commonjs/components/ImageSource.js.map +1 -1
- package/lib/commonjs/components/Images.js +3 -7
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/Light.js +4 -6
- package/lib/commonjs/components/Light.js.map +1 -1
- package/lib/commonjs/components/LineLayer.js +6 -8
- package/lib/commonjs/components/LineLayer.js.map +1 -1
- package/lib/commonjs/components/MapView.js +69 -83
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/MarkerView.js +4 -5
- package/lib/commonjs/components/MarkerView.js.map +1 -1
- package/lib/commonjs/components/NativeUserLocation.js +2 -2
- package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
- package/lib/commonjs/components/PointAnnotation.js +7 -10
- package/lib/commonjs/components/PointAnnotation.js.map +1 -1
- package/lib/commonjs/components/RasterLayer.js +6 -8
- package/lib/commonjs/components/RasterLayer.js.map +1 -1
- package/lib/commonjs/components/RasterSource.js +8 -10
- package/lib/commonjs/components/RasterSource.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +11 -45
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +8 -24
- package/lib/commonjs/components/SymbolLayer.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +21 -23
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +9 -21
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/hooks/useAbstractLayer.js +1 -1
- package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -1
- package/lib/commonjs/hooks/useAbstractSource.js +1 -1
- package/lib/commonjs/hooks/useAbstractSource.js.map +1 -1
- package/lib/commonjs/hooks/useNativeBridge.js +2 -2
- package/lib/commonjs/hooks/useNativeBridge.js.map +1 -1
- package/lib/commonjs/hooks/useOnce.js +2 -2
- package/lib/commonjs/hooks/useOnce.js.map +1 -1
- package/lib/commonjs/index.js +3 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/location/{locationManager.js → LocationManager.js} +10 -10
- package/lib/commonjs/modules/location/LocationManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -2
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
- package/lib/commonjs/modules/offline/{offlineManager.js → OfflineManager.js} +34 -36
- package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflinePack.js +2 -2
- package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
- package/lib/commonjs/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +12 -14
- package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js +3 -4
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
- package/lib/commonjs/plugin/MapLibrePluginProps.js +2 -0
- package/lib/commonjs/plugin/MapLibrePluginProps.js.map +1 -0
- package/lib/commonjs/plugin/android.js +41 -0
- package/lib/commonjs/plugin/android.js.map +1 -0
- package/lib/commonjs/plugin/ios.js +131 -0
- package/lib/commonjs/plugin/ios.js.map +1 -0
- package/lib/commonjs/plugin/withMapLibre.js +31 -0
- package/lib/commonjs/plugin/withMapLibre.js.map +1 -0
- package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
- package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
- package/lib/commonjs/utils/BridgeValue.js +2 -2
- package/lib/commonjs/utils/BridgeValue.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +2 -2
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/StyleValue.js +4 -5
- package/lib/commonjs/utils/StyleValue.js.map +1 -1
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/commonjs/utils/animated/Animated.js +29 -31
- package/lib/commonjs/utils/animated/Animated.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +4 -5
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +2 -2
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedPoint.js +1 -2
- package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +4 -4
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedShape.js +2 -2
- package/lib/commonjs/utils/animated/AnimatedShape.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 +40 -32
- package/lib/module/MapLibreRN.js.map +1 -1
- package/lib/module/components/Annotation.js +5 -6
- package/lib/module/components/Annotation.js.map +1 -1
- package/lib/module/components/BackgroundLayer.js +4 -6
- package/lib/module/components/BackgroundLayer.js.map +1 -1
- package/lib/module/components/Callout.js +2 -3
- package/lib/module/components/Callout.js.map +1 -1
- package/lib/module/components/Camera.js +112 -64
- package/lib/module/components/Camera.js.map +1 -1
- package/lib/module/components/CircleLayer.js +4 -6
- package/lib/module/components/CircleLayer.js.map +1 -1
- package/lib/module/components/FillExtrusionLayer.js +4 -6
- package/lib/module/components/FillExtrusionLayer.js.map +1 -1
- package/lib/module/components/FillLayer.js +4 -6
- package/lib/module/components/FillLayer.js.map +1 -1
- package/lib/module/components/HeadingIndicator.js +2 -3
- package/lib/module/components/HeadingIndicator.js.map +1 -1
- package/lib/module/components/HeatmapLayer.js +4 -6
- package/lib/module/components/HeatmapLayer.js.map +1 -1
- package/lib/module/components/ImageSource.js +2 -3
- package/lib/module/components/ImageSource.js.map +1 -1
- package/lib/module/components/Images.js +3 -8
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/Light.js +2 -4
- package/lib/module/components/Light.js.map +1 -1
- package/lib/module/components/LineLayer.js +4 -6
- package/lib/module/components/LineLayer.js.map +1 -1
- package/lib/module/components/MapView.js +65 -79
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/MarkerView.js +2 -3
- package/lib/module/components/MarkerView.js.map +1 -1
- package/lib/module/components/NativeUserLocation.js +1 -2
- package/lib/module/components/NativeUserLocation.js.map +1 -1
- package/lib/module/components/PointAnnotation.js +5 -7
- package/lib/module/components/PointAnnotation.js.map +1 -1
- package/lib/module/components/RasterLayer.js +4 -6
- package/lib/module/components/RasterLayer.js.map +1 -1
- package/lib/module/components/RasterSource.js +5 -7
- package/lib/module/components/RasterSource.js.map +1 -1
- package/lib/module/components/ShapeSource.js +9 -42
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +7 -23
- package/lib/module/components/SymbolLayer.js.map +1 -1
- package/lib/module/components/UserLocation.js +14 -15
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/VectorSource.js +6 -17
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/hooks/useAbstractLayer.js +1 -1
- package/lib/module/hooks/useAbstractLayer.js.map +1 -1
- package/lib/module/hooks/useAbstractSource.js +1 -1
- package/lib/module/hooks/useAbstractSource.js.map +1 -1
- package/lib/module/hooks/useNativeBridge.js +1 -2
- package/lib/module/hooks/useNativeBridge.js.map +1 -1
- package/lib/module/hooks/useNativeRef.js.map +1 -1
- package/lib/module/hooks/useOnce.js +1 -2
- package/lib/module/hooks/useOnce.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/location/{locationManager.js → LocationManager.js} +10 -9
- package/lib/module/modules/location/LocationManager.js.map +1 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js +1 -2
- package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
- package/lib/module/modules/offline/{offlineManager.js → OfflineManager.js} +30 -30
- package/lib/module/modules/offline/OfflineManager.js.map +1 -0
- package/lib/module/modules/offline/OfflinePack.js +1 -2
- package/lib/module/modules/offline/OfflinePack.js.map +1 -1
- package/lib/module/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +10 -10
- package/lib/module/modules/snapshot/{snapshotManager.js.map → SnapshotManager.js.map} +1 -1
- package/lib/module/modules/snapshot/SnapshotOptions.js +2 -3
- package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
- package/lib/module/plugin/MapLibrePluginProps.js +2 -0
- package/lib/module/plugin/MapLibrePluginProps.js.map +1 -0
- package/lib/module/plugin/android.js +34 -0
- package/lib/module/plugin/android.js.map +1 -0
- package/lib/module/plugin/ios.js +123 -0
- package/lib/module/plugin/ios.js.map +1 -0
- package/lib/module/plugin/withMapLibre.js +27 -0
- package/lib/module/plugin/withMapLibre.js.map +1 -0
- package/lib/module/types/MapLibreRNStyles.js +4 -0
- package/lib/module/types/MapLibreRNStyles.js.map +1 -0
- package/lib/module/utils/BridgeValue.js +1 -1
- package/lib/module/utils/BridgeValue.js.map +1 -1
- package/lib/module/utils/Logger.js +1 -2
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/StyleValue.js +3 -3
- package/lib/module/utils/StyleValue.js.map +1 -1
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +1 -2
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/module/utils/animated/Animated.js +14 -15
- package/lib/module/utils/animated/Animated.js.map +1 -1
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js +2 -3
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -1
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedPoint.js +0 -1
- package/lib/module/utils/animated/AnimatedPoint.js.map +1 -1
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +2 -2
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedShape.js +1 -2
- package/lib/module/utils/animated/AnimatedShape.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/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 +44 -34
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +6 -6
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Callout.d.ts +3 -4
- package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Camera.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +2 -3
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts +3 -4
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Images.d.ts +5 -5
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Light.d.ts +4 -5
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MapView.d.ts +12 -16
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts +3 -3
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +2 -3
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +7 -8
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +8 -16
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +3 -10
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts +6 -6
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts +4 -8
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +5 -4
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +4 -3
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +5 -5
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +2 -2
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +1 -2
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
- package/lib/typescript/{module/src/modules/offline/offlineManager.d.ts → commonjs/src/modules/offline/OfflineManager.d.ts} +27 -37
- package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +3 -4
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/{module/src/modules/snapshot/snapshotManager.d.ts → commonjs/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts +77 -0
- package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin/android.d.ts +16 -0
- package/lib/typescript/commonjs/src/plugin/android.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin/ios.d.ts +17 -0
- package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts +5 -0
- package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -0
- 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/BridgeValue.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/Logger.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -1
- 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 +2 -2
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +19 -19
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +5 -5
- 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/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 +44 -34
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Annotation.d.ts +6 -6
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Callout.d.ts +3 -4
- package/lib/typescript/module/src/components/Callout.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Camera.d.ts +4 -4
- package/lib/typescript/module/src/components/Camera.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CircleLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts +2 -3
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -1
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ImageSource.d.ts +3 -4
- package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Images.d.ts +5 -5
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Light.d.ts +4 -5
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/module/src/components/LineLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MapView.d.ts +12 -16
- package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MarkerView.d.ts +3 -3
- package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts +2 -3
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/PointAnnotation.d.ts +7 -8
- package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterSource.d.ts +4 -4
- package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +8 -16
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +3 -10
- package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserLocation.d.ts +6 -6
- package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/VectorSource.d.ts +4 -8
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +5 -4
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +4 -3
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +5 -5
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts +2 -2
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useOnce.d.ts +1 -2
- package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +3 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts +33 -0
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
- package/lib/typescript/{commonjs/src/modules/offline/offlineManager.d.ts → module/src/modules/offline/OfflineManager.d.ts} +27 -37
- package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +3 -4
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/{commonjs/src/modules/snapshot/snapshotManager.d.ts → module/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
- package/lib/typescript/module/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
- package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts +77 -0
- package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin/android.d.ts +16 -0
- package/lib/typescript/module/src/plugin/android.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin/ios.d.ts +17 -0
- package/lib/typescript/module/src/plugin/ios.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin/withMapLibre.d.ts +5 -0
- package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -0
- 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/BridgeValue.d.ts +1 -1
- package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/Logger.d.ts +2 -2
- package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -1
- 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 +2 -2
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/Animated.d.ts +19 -19
- package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +5 -5
- 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/maplibre-react-native.podspec +15 -14
- package/package.json +17 -14
- package/src/MLRNModule.ts +24 -10
- package/src/MapLibreRN.ts +66 -49
- package/src/components/Annotation.tsx +12 -14
- package/src/components/BackgroundLayer.tsx +7 -9
- package/src/components/Callout.tsx +8 -10
- package/src/components/Camera.tsx +154 -78
- package/src/components/CircleLayer.tsx +7 -9
- package/src/components/FillExtrusionLayer.tsx +7 -9
- package/src/components/FillLayer.tsx +7 -9
- package/src/components/HeadingIndicator.tsx +2 -6
- package/src/components/HeatmapLayer.tsx +7 -9
- package/src/components/ImageSource.tsx +4 -6
- package/src/components/Images.tsx +8 -19
- package/src/components/Light.tsx +5 -7
- package/src/components/LineLayer.tsx +7 -9
- package/src/components/MapView.tsx +85 -105
- package/src/components/MarkerView.tsx +4 -6
- package/src/components/NativeUserLocation.tsx +1 -4
- package/src/components/PointAnnotation.tsx +10 -11
- package/src/components/RasterLayer.tsx +7 -9
- package/src/components/RasterSource.tsx +7 -9
- package/src/components/ShapeSource.tsx +22 -95
- package/src/components/SymbolLayer.tsx +12 -41
- package/src/components/UserLocation.tsx +21 -22
- package/src/components/VectorSource.tsx +12 -35
- package/src/hooks/useAbstractLayer.ts +8 -8
- package/src/hooks/useAbstractSource.ts +6 -6
- package/src/hooks/useNativeBridge.ts +9 -6
- package/src/hooks/useNativeRef.ts +2 -2
- package/src/hooks/useOnce.ts +3 -3
- package/src/index.ts +3 -0
- package/src/modules/location/{locationManager.ts → LocationManager.ts} +16 -15
- package/src/modules/offline/OfflineCreatePackOptions.ts +1 -3
- package/src/modules/offline/{offlineManager.ts → OfflineManager.ts} +32 -45
- package/src/modules/offline/OfflinePack.ts +3 -5
- package/src/modules/snapshot/{snapshotManager.ts → SnapshotManager.ts} +9 -9
- package/src/modules/snapshot/SnapshotOptions.ts +2 -4
- package/src/plugin/MapLibrePluginProps.ts +83 -0
- package/src/plugin/android.ts +64 -0
- package/src/plugin/ios.ts +166 -0
- package/src/plugin/withMapLibre.ts +30 -0
- package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +86 -406
- package/src/utils/BridgeValue.ts +1 -1
- package/src/utils/Logger.ts +1 -3
- package/src/utils/StyleValue.ts +6 -5
- package/src/utils/animated/AbstractAnimatedCoordinates.ts +3 -3
- package/src/utils/animated/Animated.ts +23 -21
- package/src/utils/animated/AnimatedCoordinatesArray.ts +3 -4
- package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +1 -1
- package/src/utils/animated/AnimatedPoint.ts +0 -2
- package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +3 -2
- package/src/utils/animated/AnimatedShape.ts +4 -6
- package/src/utils/filterUtils.ts +1 -1
- package/src/utils/getStylePropertyType.ts +265 -0
- package/android/src/main/res/values/strings.xml +0 -3
- package/lib/commonjs/components/Style.js +0 -266
- package/lib/commonjs/components/Style.js.map +0 -1
- package/lib/commonjs/modules/location/locationManager.js.map +0 -1
- package/lib/commonjs/modules/offline/offlineManager.js.map +0 -1
- package/lib/commonjs/modules/snapshot/snapshotManager.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/modules/location/locationManager.js.map +0 -1
- package/lib/module/modules/offline/offlineManager.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/jest.config.d.ts +0 -2
- package/lib/typescript/commonjs/jest.config.d.ts.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/modules/location/locationManager.d.ts +0 -64
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.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/jest.config.d.ts +0 -2
- package/lib/typescript/module/jest.config.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/modules/location/locationManager.d.ts +0 -64
- package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/snapshot/snapshotManager.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/plugin/build/withMapLibre.d.ts +0 -12
- package/plugin/build/withMapLibre.js +0 -148
- 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/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
|
}
|
|
@@ -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
|
}
|
|
@@ -7,21 +7,14 @@ import android.util.Log;
|
|
|
7
7
|
|
|
8
8
|
import org.maplibre.android.location.engine.LocationEngine;
|
|
9
9
|
import org.maplibre.android.location.engine.LocationEngineCallback;
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
import com.mapbox.android.core.location.LocationEngineListener;
|
|
13
|
-
import com.mapbox.android.core.location.LocationEnginePriority;
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import org.maplibre.android.location.engine.LocationEngineDefault;
|
|
17
10
|
import org.maplibre.android.location.engine.LocationEngineRequest;
|
|
18
11
|
import org.maplibre.android.location.engine.LocationEngineResult;
|
|
19
12
|
import org.maplibre.android.location.permissions.PermissionsManager;
|
|
13
|
+
import org.maplibre.reactnative.location.engine.LocationEngineProvider;
|
|
20
14
|
|
|
21
15
|
import java.lang.ref.WeakReference;
|
|
22
16
|
import java.util.ArrayList;
|
|
23
17
|
import java.util.List;
|
|
24
|
-
import java.util.Locale;
|
|
25
18
|
|
|
26
19
|
@SuppressWarnings({"MissingPermission"})
|
|
27
20
|
public class LocationManager implements LocationEngineCallback<LocationEngineResult> {
|
|
@@ -58,8 +51,10 @@ public class LocationManager implements LocationEngineCallback<LocationEngineRes
|
|
|
58
51
|
this.buildEngineRequest();
|
|
59
52
|
|
|
60
53
|
}
|
|
54
|
+
|
|
61
55
|
private void buildEngineRequest() {
|
|
62
|
-
locationEngine =
|
|
56
|
+
locationEngine = new LocationEngineProvider().getLocationEngine(context);
|
|
57
|
+
|
|
63
58
|
locationEngineRequest = new LocationEngineRequest.Builder(DEFAULT_INTERVAL_MILLIS)
|
|
64
59
|
.setFastestInterval(DEFAULT_FASTEST_INTERVAL_MILLIS)
|
|
65
60
|
.setPriority(LocationEngineRequest.PRIORITY_HIGH_ACCURACY)
|
|
@@ -78,9 +73,11 @@ public class LocationManager implements LocationEngineCallback<LocationEngineRes
|
|
|
78
73
|
listeners.remove(listener);
|
|
79
74
|
}
|
|
80
75
|
}
|
|
76
|
+
|
|
81
77
|
public void setMinDisplacement(float minDisplacement) {
|
|
82
78
|
mMinDisplacement = minDisplacement;
|
|
83
79
|
}
|
|
80
|
+
|
|
84
81
|
public void enable() {
|
|
85
82
|
if (!PermissionsManager.areLocationPermissionsGranted(context)) {
|
|
86
83
|
return;
|
|
@@ -134,8 +131,7 @@ public class LocationManager implements LocationEngineCallback<LocationEngineRes
|
|
|
134
131
|
|
|
135
132
|
try {
|
|
136
133
|
locationEngine.getLastLocation(callback);
|
|
137
|
-
}
|
|
138
|
-
catch(Exception exception) {
|
|
134
|
+
} catch (Exception exception) {
|
|
139
135
|
Log.w(LOG_TAG, exception);
|
|
140
136
|
callback.onFailure(exception);
|
|
141
137
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package org.maplibre.reactnative.location.engine;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.util.Log;
|
|
5
|
+
|
|
6
|
+
import org.maplibre.android.location.engine.LocationEngine;
|
|
7
|
+
import org.maplibre.android.location.engine.LocationEngineDefault;
|
|
8
|
+
|
|
9
|
+
public class DefaultLocationEngineProvider implements LocationEngineProvidable {
|
|
10
|
+
private static final String LOG_TAG = "DefaultLocationEngineProvider";
|
|
11
|
+
|
|
12
|
+
@Override
|
|
13
|
+
public LocationEngine getLocationEngine(Context context) {
|
|
14
|
+
LocationEngine locationEngine = LocationEngineDefault.INSTANCE.getDefaultLocationEngine(context.getApplicationContext());
|
|
15
|
+
Log.d(LOG_TAG, "DefaultLocationEngine will be used.");
|
|
16
|
+
return locationEngine;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -11,9 +11,7 @@ import com.facebook.react.common.MapBuilder;
|
|
|
11
11
|
import com.facebook.react.module.annotations.ReactModule;
|
|
12
12
|
import org.maplibre.android.MapLibre;
|
|
13
13
|
import org.maplibre.android.WellKnownTileServer;
|
|
14
|
-
import org.maplibre.android.style.layers.Property;
|
|
15
14
|
import org.maplibre.reactnative.components.camera.constants.CameraMode;
|
|
16
|
-
import org.maplibre.reactnative.components.styles.MLRNStyleValue;
|
|
17
15
|
import org.maplibre.reactnative.components.styles.sources.MLRNSource;
|
|
18
16
|
import org.maplibre.reactnative.events.constants.EventTypes;
|
|
19
17
|
import org.maplibre.reactnative.http.CustomHeadersInterceptor;
|
|
@@ -34,6 +32,8 @@ import javax.annotation.Nullable;
|
|
|
34
32
|
public class MLRNModule extends ReactContextBaseJavaModule {
|
|
35
33
|
public static final String REACT_CLASS = "MLRNModule";
|
|
36
34
|
|
|
35
|
+
public static final String DEFAULT_STYLE_URL = "https://demotiles.maplibre.org/style.json";
|
|
36
|
+
|
|
37
37
|
private static boolean customHeaderInterceptorAdded = false;
|
|
38
38
|
|
|
39
39
|
private Handler mUiThreadHandler;
|
|
@@ -44,6 +44,11 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
44
44
|
mReactContext = reactApplicationContext;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
@Override
|
|
48
|
+
public void initialize() {
|
|
49
|
+
initializeMapLibreInstance();
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
@Override
|
|
48
53
|
public String getName() {
|
|
49
54
|
return REACT_CLASS;
|
|
@@ -54,7 +59,7 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
54
59
|
public Map<String, Object> getConstants() {
|
|
55
60
|
// map style urls
|
|
56
61
|
Map<String, String> styleURLS = new HashMap<>();
|
|
57
|
-
styleURLS.put("Default",
|
|
62
|
+
styleURLS.put("Default", DEFAULT_STYLE_URL);
|
|
58
63
|
|
|
59
64
|
// events
|
|
60
65
|
Map<String, String> eventTypes = new HashMap<>();
|
|
@@ -99,127 +104,6 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
99
104
|
Map<String, String> styleSourceConsts = new HashMap<>();
|
|
100
105
|
styleSourceConsts.put("DefaultSourceID", MLRNSource.DEFAULT_ID);
|
|
101
106
|
|
|
102
|
-
// interpolation modes
|
|
103
|
-
Map<String, Integer> interpolationModes = new HashMap<>();
|
|
104
|
-
interpolationModes.put("Exponential", MLRNStyleValue.InterpolationModeExponential);
|
|
105
|
-
interpolationModes.put("Categorical", MLRNStyleValue.InterpolationModeCategorical);
|
|
106
|
-
interpolationModes.put("Interval", MLRNStyleValue.InterpolationModeInterval);
|
|
107
|
-
interpolationModes.put("Identity", MLRNStyleValue.InterpolationModeIdentity);
|
|
108
|
-
|
|
109
|
-
// line layer constants
|
|
110
|
-
Map<String, String> lineJoin = new HashMap<>();
|
|
111
|
-
lineJoin.put("Bevel", Property.LINE_JOIN_BEVEL);
|
|
112
|
-
lineJoin.put("Round", Property.LINE_JOIN_ROUND);
|
|
113
|
-
lineJoin.put("Miter", Property.LINE_JOIN_MITER);
|
|
114
|
-
|
|
115
|
-
Map<String, String> lineCap = new HashMap<>();
|
|
116
|
-
lineCap.put("Butt", Property.LINE_CAP_BUTT);
|
|
117
|
-
lineCap.put("Round", Property.LINE_CAP_ROUND);
|
|
118
|
-
lineCap.put("Square", Property.LINE_CAP_SQUARE);
|
|
119
|
-
|
|
120
|
-
Map<String, String> lineTranslateAnchor = new HashMap<>();
|
|
121
|
-
lineTranslateAnchor.put("Map", Property.LINE_TRANSLATE_ANCHOR_MAP);
|
|
122
|
-
lineTranslateAnchor.put("Viewport", Property.LINE_TRANSLATE_ANCHOR_VIEWPORT);
|
|
123
|
-
|
|
124
|
-
// circle layer constants
|
|
125
|
-
Map<String, String> circlePitchScale = new HashMap<>();
|
|
126
|
-
circlePitchScale.put("Map", Property.CIRCLE_PITCH_SCALE_MAP);
|
|
127
|
-
circlePitchScale.put("Viewport", Property.CIRCLE_PITCH_SCALE_VIEWPORT);
|
|
128
|
-
|
|
129
|
-
Map<String, String> circleTranslateAnchor = new HashMap<>();
|
|
130
|
-
circleTranslateAnchor.put("Map", Property.CIRCLE_TRANSLATE_ANCHOR_MAP);
|
|
131
|
-
circleTranslateAnchor.put("Viewport", Property.CIRCLE_TRANSLATE_ANCHOR_VIEWPORT);
|
|
132
|
-
|
|
133
|
-
Map<String, String> circlePitchAlignment = new HashMap<>();
|
|
134
|
-
circlePitchAlignment.put("Map", Property.CIRCLE_PITCH_ALIGNMENT_MAP);
|
|
135
|
-
circlePitchAlignment.put("Viewport", Property.CIRCLE_PITCH_ALIGNMENT_VIEWPORT);
|
|
136
|
-
|
|
137
|
-
// fill extrusion layer constants
|
|
138
|
-
Map<String, String> fillExtrusionTranslateAnchor = new HashMap<>();
|
|
139
|
-
fillExtrusionTranslateAnchor.put("Map", Property.FILL_EXTRUSION_TRANSLATE_ANCHOR_MAP);
|
|
140
|
-
fillExtrusionTranslateAnchor.put("Viewport", Property.FILL_EXTRUSION_TRANSLATE_ANCHOR_VIEWPORT);
|
|
141
|
-
|
|
142
|
-
// fill layer constants
|
|
143
|
-
Map<String, String> fillTranslateAnchor = new HashMap<>();
|
|
144
|
-
fillTranslateAnchor.put("Map", Property.FILL_TRANSLATE_ANCHOR_MAP);
|
|
145
|
-
fillTranslateAnchor.put("Viewport", Property.FILL_TRANSLATE_ANCHOR_VIEWPORT);
|
|
146
|
-
|
|
147
|
-
// symbol layer constants
|
|
148
|
-
Map<String, String> iconRotationAlignment = new HashMap<>();
|
|
149
|
-
iconRotationAlignment.put("Auto", Property.ICON_ROTATION_ALIGNMENT_AUTO);
|
|
150
|
-
iconRotationAlignment.put("Map", Property.ICON_ROTATION_ALIGNMENT_MAP);
|
|
151
|
-
iconRotationAlignment.put("Viewport", Property.ICON_ROTATION_ALIGNMENT_VIEWPORT);
|
|
152
|
-
|
|
153
|
-
Map<String, String> iconTextFit = new HashMap<>();
|
|
154
|
-
iconTextFit.put("None", Property.ICON_TEXT_FIT_NONE);
|
|
155
|
-
iconTextFit.put("Width", Property.ICON_TEXT_FIT_WIDTH);
|
|
156
|
-
iconTextFit.put("Height", Property.ICON_TEXT_FIT_HEIGHT);
|
|
157
|
-
iconTextFit.put("Both", Property.ICON_TEXT_FIT_BOTH);
|
|
158
|
-
|
|
159
|
-
Map<String, String> iconAnchor = new HashMap<>();
|
|
160
|
-
iconAnchor.put("Center", Property.ICON_ANCHOR_CENTER);
|
|
161
|
-
iconAnchor.put("Left", Property.ICON_ANCHOR_LEFT);
|
|
162
|
-
iconAnchor.put("Right", Property.ICON_ANCHOR_RIGHT);
|
|
163
|
-
iconAnchor.put("Top", Property.ICON_ANCHOR_TOP);
|
|
164
|
-
iconAnchor.put("Bottom", Property.ICON_ANCHOR_BOTTOM);
|
|
165
|
-
iconAnchor.put("TopLeft", Property.ICON_ANCHOR_TOP_LEFT);
|
|
166
|
-
iconAnchor.put("TopRight", Property.ICON_ANCHOR_TOP_RIGHT);
|
|
167
|
-
iconAnchor.put("BottomLeft", Property.ICON_ANCHOR_BOTTOM_LEFT);
|
|
168
|
-
iconAnchor.put("BottomRight", Property.ICON_ANCHOR_BOTTOM_RIGHT);
|
|
169
|
-
|
|
170
|
-
Map<String, String> iconPitchAlignment = new HashMap<>();
|
|
171
|
-
iconPitchAlignment.put("Auto", Property.ICON_PITCH_ALIGNMENT_AUTO);
|
|
172
|
-
iconPitchAlignment.put("Map", Property.ICON_PITCH_ALIGNMENT_MAP);
|
|
173
|
-
iconPitchAlignment.put("Viewport", Property.ICON_PITCH_ALIGNMENT_VIEWPORT);
|
|
174
|
-
|
|
175
|
-
Map<String, String> iconTranslateAnchor = new HashMap<>();
|
|
176
|
-
iconTranslateAnchor.put("Map", Property.ICON_TRANSLATE_ANCHOR_MAP);
|
|
177
|
-
iconTranslateAnchor.put("Viewport", Property.ICON_TRANSLATE_ANCHOR_VIEWPORT);
|
|
178
|
-
|
|
179
|
-
Map<String, String> symbolPlacement = new HashMap<>();
|
|
180
|
-
symbolPlacement.put("Line", Property.SYMBOL_PLACEMENT_LINE);
|
|
181
|
-
symbolPlacement.put("Point", Property.SYMBOL_PLACEMENT_POINT);
|
|
182
|
-
|
|
183
|
-
Map<String, String> textAnchor = new HashMap<>();
|
|
184
|
-
textAnchor.put("Center", Property.TEXT_ANCHOR_CENTER);
|
|
185
|
-
textAnchor.put("Left", Property.TEXT_ANCHOR_LEFT);
|
|
186
|
-
textAnchor.put("Right", Property.TEXT_ANCHOR_RIGHT);
|
|
187
|
-
textAnchor.put("Top", Property.TEXT_ANCHOR_TOP);
|
|
188
|
-
textAnchor.put("Bottom", Property.TEXT_ANCHOR_BOTTOM);
|
|
189
|
-
textAnchor.put("TopLeft", Property.TEXT_ANCHOR_TOP_LEFT);
|
|
190
|
-
textAnchor.put("TopRight", Property.TEXT_ANCHOR_TOP_RIGHT);
|
|
191
|
-
textAnchor.put("BottomLeft", Property.TEXT_ANCHOR_BOTTOM_LEFT);
|
|
192
|
-
textAnchor.put("BottomRight", Property.TEXT_ANCHOR_BOTTOM_RIGHT);
|
|
193
|
-
|
|
194
|
-
Map<String, String> textJustify = new HashMap<>();
|
|
195
|
-
textJustify.put("Center", Property.TEXT_JUSTIFY_CENTER);
|
|
196
|
-
textJustify.put("Left", Property.TEXT_JUSTIFY_LEFT);
|
|
197
|
-
textJustify.put("Right", Property.TEXT_JUSTIFY_RIGHT);
|
|
198
|
-
|
|
199
|
-
Map<String, String> textPitchAlignment = new HashMap<>();
|
|
200
|
-
textPitchAlignment.put("Auto", Property.TEXT_PITCH_ALIGNMENT_AUTO);
|
|
201
|
-
textPitchAlignment.put("Map", Property.TEXT_PITCH_ALIGNMENT_MAP);
|
|
202
|
-
textPitchAlignment.put("Viewport", Property.TEXT_PITCH_ALIGNMENT_VIEWPORT);
|
|
203
|
-
|
|
204
|
-
Map<String, String> textRotationAlignment = new HashMap<>();
|
|
205
|
-
textRotationAlignment.put("Auto", Property.TEXT_ROTATION_ALIGNMENT_AUTO);
|
|
206
|
-
textRotationAlignment.put("Map", Property.TEXT_ROTATION_ALIGNMENT_MAP);
|
|
207
|
-
textRotationAlignment.put("Viewport", Property.TEXT_ROTATION_ALIGNMENT_VIEWPORT);
|
|
208
|
-
|
|
209
|
-
Map<String, String> textTransform = new HashMap<>();
|
|
210
|
-
textTransform.put("None", Property.TEXT_TRANSFORM_NONE);
|
|
211
|
-
textTransform.put("Lowercase", Property.TEXT_TRANSFORM_LOWERCASE);
|
|
212
|
-
textTransform.put("Uppercase", Property.TEXT_TRANSFORM_UPPERCASE);
|
|
213
|
-
|
|
214
|
-
Map<String, String> textTranslateAnchor = new HashMap<>();
|
|
215
|
-
textTranslateAnchor.put("Map", Property.TEXT_TRANSLATE_ANCHOR_MAP);
|
|
216
|
-
textTranslateAnchor.put("Viewport", Property.TEXT_TRANSLATE_ANCHOR_VIEWPORT);
|
|
217
|
-
|
|
218
|
-
// light constants
|
|
219
|
-
Map<String, String> lightAnchor = new HashMap<>();
|
|
220
|
-
lightAnchor.put("Map", Property.ANCHOR_MAP);
|
|
221
|
-
lightAnchor.put("Viewport", Property.ANCHOR_VIEWPORT);
|
|
222
|
-
|
|
223
107
|
// offline region download states
|
|
224
108
|
Map<String, Integer> offlinePackDownloadStates = new HashMap<>();
|
|
225
109
|
offlinePackDownloadStates.put("Inactive", MLRNOfflineModule.INACTIVE_REGION_DOWNLOAD_STATE);
|
|
@@ -242,35 +126,17 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
242
126
|
.put("UserLocationVerticalAlignment", userLocationVerticalAlignment)
|
|
243
127
|
.put("CameraModes", cameraModes)
|
|
244
128
|
.put("StyleSource", styleSourceConsts)
|
|
245
|
-
.put("InterpolationMode", interpolationModes)
|
|
246
|
-
.put("LineJoin", lineJoin)
|
|
247
|
-
.put("LineCap", lineCap)
|
|
248
|
-
.put("LineTranslateAnchor", lineTranslateAnchor)
|
|
249
|
-
.put("CirclePitchScale", circlePitchScale)
|
|
250
|
-
.put("CircleTranslateAnchor", circleTranslateAnchor)
|
|
251
|
-
.put("CirclePitchAlignment", circlePitchAlignment)
|
|
252
|
-
.put("FillExtrusionTranslateAnchor", fillExtrusionTranslateAnchor)
|
|
253
|
-
.put("FillTranslateAnchor", fillTranslateAnchor)
|
|
254
|
-
.put("IconRotationAlignment", iconRotationAlignment)
|
|
255
|
-
.put("IconTextFit", iconTextFit)
|
|
256
|
-
.put("IconTranslateAnchor", iconTranslateAnchor)
|
|
257
|
-
.put("SymbolPlacement", symbolPlacement)
|
|
258
|
-
.put("IconAnchor", iconAnchor)
|
|
259
|
-
.put("TextAnchor", textAnchor)
|
|
260
|
-
.put("TextJustify", textJustify)
|
|
261
|
-
.put("IconPitchAlignment", iconPitchAlignment)
|
|
262
|
-
.put("TextPitchAlignment", textPitchAlignment)
|
|
263
|
-
.put("TextRotationAlignment", textRotationAlignment)
|
|
264
|
-
.put("TextTransform", textTransform)
|
|
265
|
-
.put("TextTranslateAnchor", textTranslateAnchor)
|
|
266
|
-
.put("LightAnchor", lightAnchor)
|
|
267
129
|
.put("OfflinePackDownloadState", offlinePackDownloadStates)
|
|
268
130
|
.put("OfflineCallbackName", offlineModuleCallbackNames)
|
|
269
131
|
.put("LocationCallbackName", locationModuleCallbackNames)
|
|
270
132
|
.build();
|
|
271
133
|
}
|
|
272
134
|
|
|
273
|
-
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated This will be removed in the next major version.
|
|
137
|
+
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
138
|
+
*/
|
|
139
|
+
@Deprecated
|
|
274
140
|
@ReactMethod
|
|
275
141
|
public void setAccessToken(final String accessToken) {
|
|
276
142
|
mReactContext.runOnUiQueueThread(new Runnable() {
|
|
@@ -313,7 +179,11 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
313
179
|
});
|
|
314
180
|
}
|
|
315
181
|
|
|
316
|
-
|
|
182
|
+
/**
|
|
183
|
+
* @deprecated This will be removed in the next major version.
|
|
184
|
+
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
185
|
+
*/
|
|
186
|
+
@Deprecated
|
|
317
187
|
@ReactMethod
|
|
318
188
|
public void getAccessToken(Promise promise) {
|
|
319
189
|
String token = MapLibre.getApiKey();
|
|
@@ -341,4 +211,13 @@ public class MLRNModule extends ReactContextBaseJavaModule {
|
|
|
341
211
|
dispatcher.setMaxRequestsPerHost(20);
|
|
342
212
|
return dispatcher;
|
|
343
213
|
}
|
|
214
|
+
|
|
215
|
+
private void initializeMapLibreInstance() {
|
|
216
|
+
mReactContext.runOnUiQueueThread(new Runnable() {
|
|
217
|
+
@Override
|
|
218
|
+
public void run() {
|
|
219
|
+
MapLibre.getInstance(getReactApplicationContext());
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
344
223
|
}
|
|
@@ -9,7 +9,6 @@ import com.facebook.react.bridge.*;
|
|
|
9
9
|
import com.facebook.react.module.annotations.ReactModule;
|
|
10
10
|
import com.facebook.react.modules.core.RCTNativeAppEventEmitter;
|
|
11
11
|
import org.maplibre.geojson.FeatureCollection;
|
|
12
|
-
// import org.maplibre.android.constants.Style;
|
|
13
12
|
import org.maplibre.android.geometry.LatLngBounds;
|
|
14
13
|
import org.maplibre.android.offline.OfflineManager;
|
|
15
14
|
import org.maplibre.android.offline.OfflineRegion;
|
|
@@ -43,7 +42,6 @@ public class MLRNOfflineModule extends ReactContextBaseJavaModule {
|
|
|
43
42
|
public static final String OFFLINE_ERROR = "MapboxOfflineRegionError";
|
|
44
43
|
public static final String OFFLINE_PROGRESS = "MapboxOfflineRegionProgress";
|
|
45
44
|
|
|
46
|
-
public static final String DEFAULT_STYLE_URL = "https://demotiles.maplibre.org/style.json";
|
|
47
45
|
public static final Double DEFAULT_MIN_ZOOM_LEVEL = 10.0;
|
|
48
46
|
public static final Double DEFAULT_MAX_ZOOM_LEVEL = 20.0;
|
|
49
47
|
|
|
@@ -426,7 +424,7 @@ public class MLRNOfflineModule extends ReactContextBaseJavaModule {
|
|
|
426
424
|
|
|
427
425
|
private OfflineRegionDefinition makeDefinition(LatLngBounds latLngBounds, ReadableMap options) {
|
|
428
426
|
return new OfflineTilePyramidRegionDefinition(
|
|
429
|
-
ConvertUtils.getString("styleURL", options, DEFAULT_STYLE_URL),
|
|
427
|
+
ConvertUtils.getString("styleURL", options, MLRNModule.DEFAULT_STYLE_URL),
|
|
430
428
|
latLngBounds,
|
|
431
429
|
ConvertUtils.getDouble("minZoom", options, DEFAULT_MIN_ZOOM_LEVEL),
|
|
432
430
|
ConvertUtils.getDouble("maxZoom", options, DEFAULT_MAX_ZOOM_LEVEL),
|