@maplibre/maplibre-react-native 10.0.0-beta.9 → 10.0.0
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 +10 -54
- package/android/build.gradle +35 -12
- package/android/gradle.properties +14 -6
- 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/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 +49 -24
- 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/MLRNCamera.m +6 -7
- 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/MLRNStyle.m +0 -40
- package/lib/commonjs/MLRNModule.js +3 -5
- package/lib/commonjs/MLRNModule.js.map +1 -1
- package/lib/commonjs/MapLibreRN.js +77 -59
- 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 +2 -2
- 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 -76
- 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 +6 -8
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +6 -7
- 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 +8 -10
- 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 +1 -2
- package/lib/module/MLRNModule.js.map +1 -1
- package/lib/module/MapLibreRN.js +40 -28
- 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 +2 -3
- 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 -72
- 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 +4 -5
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +4 -5
- 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 +5 -6
- 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 +2 -6
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +43 -30
- 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 -15
- 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 -15
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +3 -4
- 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/commonjs/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
- package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +2 -3
- 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 +2 -6
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +43 -30
- 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 -15
- 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 -15
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +3 -4
- 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/module/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
- package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +2 -3
- 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 +15 -10
- package/src/MapLibreRN.ts +59 -41
- 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 +7 -9
- package/src/components/Light.tsx +5 -7
- package/src/components/LineLayer.tsx +7 -9
- package/src/components/MapView.tsx +85 -94
- 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 +17 -22
- package/src/components/SymbolLayer.tsx +7 -8
- package/src/components/UserLocation.tsx +21 -22
- package/src/components/VectorSource.tsx +8 -15
- 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} +30 -29
- package/src/modules/offline/OfflinePack.ts +2 -4
- 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/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/styleMap.js +0 -255
- package/lib/commonjs/utils/styleMap.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/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/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/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/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/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/types/StyleURL.ts +0 -3
- package/src/utils/styleMap.ts +0 -265
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[](https://maplibre.org)
|
|
2
2
|
|
|
3
3
|
# MapLibre React Native
|
|
4
|
-
[](LICENSE.md)
|
|
5
|
-
[](https://www.npmjs.com/package/@maplibre/maplibre-react-native)
|
|
6
|
-
[](https://github.com/maplibre/maplibre-react-native/actions/workflows/review.yml)
|
|
8
4
|
|
|
5
|
+
[](/LICENSE.md)
|
|
6
|
+
[](https://www.npmjs.com/package/@maplibre/maplibre-react-native)
|
|
7
|
+
[](https://github.com/maplibre/maplibre-react-native/actions/workflows/review.yml)
|
|
9
8
|
|
|
10
|
-
_React Native library for creating maps
|
|
9
|
+
_React Native library for creating maps
|
|
10
|
+
with [MapLibre Native for Android & iOS](https://github.com/maplibre/maplibre-gl-native)._
|
|
11
11
|
|
|
12
12
|
This project originated as a fork of [rnmapbox](https://github.com/rnmapbox/maps), a community-maintained
|
|
13
13
|
React Native library for building maps with the Mapbox iOS and Android mobile SDKs. The original product
|
|
@@ -15,11 +15,11 @@ 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/
|
|
18
|
+
<img src="/docs/static/screenshots/index/device-android.png"
|
|
19
19
|
alt="Indoor Building Map Android"
|
|
20
20
|
height="320"
|
|
21
21
|
/>
|
|
22
|
-
<img src="/docs/
|
|
22
|
+
<img src="/docs/static/screenshots/index/device-ios.png"
|
|
23
23
|
alt="Indoor Building Map iOS"
|
|
24
24
|
height="320"
|
|
25
25
|
/>
|
|
@@ -27,57 +27,13 @@ diverged, it has become necessary to separate the projects into specific wrapper
|
|
|
27
27
|
|
|
28
28
|
## Documentation
|
|
29
29
|
|
|
30
|
-
-
|
|
31
|
-
- Installation
|
|
32
|
-
- React Native
|
|
33
|
-
- [Android](/docs/guides/setup/Android.md)
|
|
34
|
-
- [iOS](/docs/guides/setup/iOS.md)
|
|
35
|
-
- [Expo](/docs/guides/setup/Expo.md)
|
|
36
|
-
|
|
37
|
-
### Components
|
|
38
|
-
|
|
39
|
-
- [MapView](/docs/components/MapView.md)
|
|
40
|
-
- [Light](/docs/components/Light.md)
|
|
41
|
-
- [PointAnnotation](/docs/components/PointAnnotation.md)
|
|
42
|
-
- [MarkerView](/docs/components/MarkerView.md)
|
|
43
|
-
- [Callout](/docs/components/Callout.md)
|
|
44
|
-
- [Camera](docs/components/Camera.md)
|
|
45
|
-
- [UserLocation](docs/components/UserLocation.md)
|
|
46
|
-
- [Images](docs/components/Images.md)
|
|
47
|
-
|
|
48
|
-
### Sources
|
|
49
|
-
|
|
50
|
-
- [VectorSource](/docs/components/VectorSource.md)
|
|
51
|
-
- [ShapeSource](/docs/components/ShapeSource.md)
|
|
52
|
-
- [RasterSource](/docs/components/RasterSource.md)
|
|
53
|
-
|
|
54
|
-
### Layers
|
|
55
|
-
|
|
56
|
-
- [BackgroundLayer](/docs/components/BackgroundLayer.md)
|
|
57
|
-
- [CircleLayer](/docs/components/CircleLayer.md)
|
|
58
|
-
- [FillExtrusionLayer](/docs/components/FillExtrusionLayer.md)
|
|
59
|
-
- [FillLayer](/docs/components/FillLayer.md)
|
|
60
|
-
- [LineLayer](/docs/components/LineLayer.md)
|
|
61
|
-
- [RasterLayer](/docs/components/RasterLayer.md)
|
|
62
|
-
- [SymbolLayer](/docs/components/SymbolLayer.md)
|
|
63
|
-
- [HeatmapLayer](/docs/components/HeatmapLayer.md)
|
|
64
|
-
|
|
65
|
-
### Modules
|
|
66
|
-
|
|
67
|
-
- [OfflineManager](/docs/modules/offlineManager.md)
|
|
68
|
-
- [SnapshotManager](/docs/modules/snapshotManager.md)
|
|
69
|
-
|
|
70
|
-
### Misc
|
|
71
|
-
|
|
72
|
-
- [MapLibreGL](/docs/guides/MapLibreGL.md)
|
|
73
|
-
- [Custom HTTP Headers](/docs/guides/CustomHTTPHeaders.md)
|
|
74
|
-
- [Logger](/docs/guides/Logger.md)
|
|
30
|
+
https://maplibre.org/maplibre-react-native/
|
|
75
31
|
|
|
76
32
|
## Contributing & Development
|
|
77
33
|
|
|
78
|
-
Read the [CONTRIBUTING
|
|
34
|
+
Read the [CONTRIBUTING](/CONTRIBUTING.md) guide in order to get familiar with how we do things around here and
|
|
79
35
|
set up your local development environment.
|
|
80
36
|
|
|
81
37
|
## Community
|
|
82
38
|
|
|
83
|
-
Join the `#maplibre-react-native` or `#maplibre` [
|
|
39
|
+
Join the [`#maplibre-react-native`](https://osmus.slack.com/archives/C065DB4T2UB) or [`#maplibre`](https://osmus.slack.com/archives/C01G3D28DAB) [on the Open Street Map Slack](https://slack.openstreetmap.us/).
|
package/android/build.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
buildscript {
|
|
2
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["
|
|
3
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["org.maplibre.reactnative.kotlinVersion"]
|
|
4
4
|
|
|
5
5
|
repositories {
|
|
6
6
|
google()
|
|
@@ -32,11 +32,15 @@ apply plugin: "kotlin-android"
|
|
|
32
32
|
// }
|
|
33
33
|
|
|
34
34
|
def getExtOrDefault(name) {
|
|
35
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["
|
|
35
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["org.maplibre.reactnative." + name]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
def getConfigurableExtOrDefault(name) {
|
|
39
|
+
return rootProject.ext.has("org.maplibre.reactnative." + name) ? rootProject.ext.get("org.maplibre.reactnative." + name) : project.properties["org.maplibre.reactnative." + name]
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
def getExtOrIntegerDefault(name) {
|
|
39
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["
|
|
43
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["org.maplibre.reactnative." + name]).toInteger()
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
def supportsNamespace() {
|
|
@@ -68,6 +72,20 @@ android {
|
|
|
68
72
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
69
73
|
}
|
|
70
74
|
|
|
75
|
+
sourceSets {
|
|
76
|
+
main {
|
|
77
|
+
java.srcDirs = ['src/main/java']
|
|
78
|
+
|
|
79
|
+
if (getConfigurableExtOrDefault("locationEngine") == "default") {
|
|
80
|
+
java.srcDirs += 'src/main/location-engine-default'
|
|
81
|
+
} else if (getConfigurableExtOrDefault("locationEngine") == "google") {
|
|
82
|
+
java.srcDirs += 'src/main/location-engine-google'
|
|
83
|
+
} else {
|
|
84
|
+
throw new GradleException("org.maplibre.reactnative.locationEngine.locationEngine should be one of [\"default\", \"google\"]`. \"${getConfigurableExtOrDefault("locationEngine")}\" was provided.")
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
71
89
|
buildTypes {
|
|
72
90
|
release {
|
|
73
91
|
minifyEnabled false
|
|
@@ -98,19 +116,24 @@ dependencies {
|
|
|
98
116
|
implementation "com.facebook.react:react-native:+"
|
|
99
117
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
100
118
|
|
|
101
|
-
// MapLibre
|
|
102
|
-
implementation "org.maplibre.gl:android-sdk
|
|
103
|
-
|
|
119
|
+
// MapLibre Native
|
|
120
|
+
implementation "org.maplibre.gl:android-sdk:${getConfigurableExtOrDefault('nativeVersion')}"
|
|
121
|
+
|
|
122
|
+
// MapLibre Plugins
|
|
123
|
+
implementation "org.maplibre.gl:android-plugin-localization-v9:${getConfigurableExtOrDefault('pluginVersion')}"
|
|
124
|
+
implementation "org.maplibre.gl:android-plugin-annotation-v9:${getConfigurableExtOrDefault('pluginVersion')}"
|
|
125
|
+
implementation "org.maplibre.gl:android-plugin-markerview-v9:${getConfigurableExtOrDefault('pluginVersion')}"
|
|
104
126
|
|
|
105
127
|
// Dependencies
|
|
128
|
+
implementation "org.maplibre.gl:android-sdk-turf:${getConfigurableExtOrDefault('turfVersion')}"
|
|
129
|
+
implementation "com.squareup.okhttp3:okhttp:${getConfigurableExtOrDefault('okhttpVersion')}"
|
|
130
|
+
implementation "com.squareup.okhttp3:okhttp-urlconnection:${getConfigurableExtOrDefault('okhttpVersion')}"
|
|
106
131
|
implementation "androidx.vectordrawable:vectordrawable:1.1.0"
|
|
107
132
|
implementation "androidx.annotation:annotation:1.7.0"
|
|
108
133
|
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
134
|
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
135
|
+
// Dependencies for Google Location Engine
|
|
136
|
+
if (getConfigurableExtOrDefault("locationEngine") == "google") {
|
|
137
|
+
implementation "com.google.android.gms:play-services-location:${getConfigurableExtOrDefault('googlePlayServicesLocationVersion')}"
|
|
138
|
+
}
|
|
116
139
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
org.maplibre.reactnative.kotlinVersion=1.7.0
|
|
2
|
+
org.maplibre.reactnative.minSdkVersion=21
|
|
3
|
+
org.maplibre.reactnative.targetSdkVersion=31
|
|
4
|
+
org.maplibre.reactnative.compileSdkVersion=31
|
|
5
|
+
org.maplibre.reactnative.ndkVersion=21.4.7075529
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# MapLibre React Native
|
|
8
|
+
org.maplibre.reactnative.nativeVersion=11.8.0
|
|
9
|
+
org.maplibre.reactnative.pluginVersion=3.0.2
|
|
10
|
+
org.maplibre.reactnative.turfVersion=6.0.1
|
|
11
|
+
org.maplibre.reactnative.okhttpVersion=4.9.0
|
|
12
|
+
# Available values: default, google
|
|
13
|
+
org.maplibre.reactnative.locationEngine=default
|
|
14
|
+
# Only applied if locationEngine=google
|
|
15
|
+
org.maplibre.reactnative.googlePlayServicesLocationVersion=21.3.0
|
|
@@ -2,6 +2,7 @@ package org.maplibre.reactnative.components.camera;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.location.Location;
|
|
5
|
+
import android.util.Log;
|
|
5
6
|
|
|
6
7
|
import org.maplibre.android.camera.CameraPosition;
|
|
7
8
|
import org.maplibre.android.camera.CameraUpdate;
|
|
@@ -11,13 +12,9 @@ import org.maplibre.android.geometry.LatLngBounds;
|
|
|
11
12
|
import org.maplibre.android.geometry.VisibleRegion;
|
|
12
13
|
import org.maplibre.android.location.OnCameraTrackingChangedListener;
|
|
13
14
|
import org.maplibre.android.location.modes.CameraMode;
|
|
14
|
-
import org.maplibre.android.location.modes.RenderMode;
|
|
15
15
|
import org.maplibre.android.maps.MapLibreMap;
|
|
16
16
|
import org.maplibre.android.maps.Style;
|
|
17
|
-
|
|
18
|
-
import org.maplibre.android.location.LocationComponentOptions;
|
|
19
|
-
import org.maplibre.android.location.LocationComponentActivationOptions;
|
|
20
|
-
// import org.maplibre.android.plugins.locationlayer.LocationLayerPlugin;
|
|
17
|
+
|
|
21
18
|
import org.maplibre.reactnative.components.AbstractMapFeature;
|
|
22
19
|
import org.maplibre.reactnative.components.location.LocationComponentManager;
|
|
23
20
|
import org.maplibre.reactnative.components.mapview.MLRNMapView;
|
|
@@ -31,8 +28,6 @@ import org.maplibre.reactnative.location.UserTrackingMode;
|
|
|
31
28
|
import org.maplibre.reactnative.location.UserTrackingState;
|
|
32
29
|
import org.maplibre.reactnative.utils.GeoJSONUtils;
|
|
33
30
|
|
|
34
|
-
import org.maplibre.reactnative.R;
|
|
35
|
-
|
|
36
31
|
import org.maplibre.reactnative.events.constants.EventTypes;
|
|
37
32
|
|
|
38
33
|
import com.facebook.react.bridge.WritableMap;
|
|
@@ -87,12 +82,12 @@ public class MLRNCamera extends AbstractMapFeature {
|
|
|
87
82
|
private LocationManager.OnUserLocationChange mLocationChangeListener = new LocationManager.OnUserLocationChange() {
|
|
88
83
|
@Override
|
|
89
84
|
public void onLocationChange(Location nextLocation) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
if (getMapboxMap() == null || mLocationComponentManager == null || !mLocationComponentManager.hasLocationComponent() || (!mFollowUserLocation)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
93
88
|
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
mUserLocation.setCurrentLocation(nextLocation);
|
|
90
|
+
sendUserLocationUpdateEvent(nextLocation);
|
|
96
91
|
}
|
|
97
92
|
};
|
|
98
93
|
|
|
@@ -236,12 +231,7 @@ public class MLRNCamera extends AbstractMapFeature {
|
|
|
236
231
|
}
|
|
237
232
|
}
|
|
238
233
|
|
|
239
|
-
return new CameraPosition.Builder()
|
|
240
|
-
.target(center)
|
|
241
|
-
.bearing(getDirectionForUserLocationUpdate())
|
|
242
|
-
.tilt(mPitch)
|
|
243
|
-
.zoom(zoomLevel)
|
|
244
|
-
.build();
|
|
234
|
+
return new CameraPosition.Builder().target(center).bearing(getDirectionForUserLocationUpdate()).tilt(mPitch).zoom(zoomLevel).build();
|
|
245
235
|
}
|
|
246
236
|
|
|
247
237
|
private double getDirectionForUserLocationUpdate() {
|
|
@@ -260,7 +250,7 @@ public class MLRNCamera extends AbstractMapFeature {
|
|
|
260
250
|
}
|
|
261
251
|
|
|
262
252
|
private void sendUserLocationUpdateEvent(Location location) {
|
|
263
|
-
if(location == null){
|
|
253
|
+
if (location == null) {
|
|
264
254
|
return;
|
|
265
255
|
}
|
|
266
256
|
IEvent event = new MapChangeEvent(this, EventTypes.USER_LOCATION_UPDATED, makeLocationChangePayload(location));
|
|
@@ -376,37 +366,38 @@ public class MLRNCamera extends AbstractMapFeature {
|
|
|
376
366
|
}
|
|
377
367
|
|
|
378
368
|
mLocationComponentManager.update(style);
|
|
379
|
-
|
|
380
|
-
if (mFollowUserLocation) {
|
|
381
|
-
mLocationComponentManager.setCameraMode(UserTrackingMode.getCameraMode(mUserTrackingMode));
|
|
382
|
-
}
|
|
383
369
|
mLocationComponentManager.setFollowUserLocation(mFollowUserLocation);
|
|
384
370
|
|
|
385
371
|
if (mFollowUserLocation) {
|
|
386
372
|
mLocationComponentManager.setCameraMode(UserTrackingMode.getCameraMode(mUserTrackingMode));
|
|
387
373
|
mLocationComponentManager.addOnCameraTrackingChangedListener(new OnCameraTrackingChangedListener() {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
@Override public void onCameraTrackingDismissed() {
|
|
374
|
+
@Override
|
|
375
|
+
public void onCameraTrackingChanged(int currentMode) {
|
|
376
|
+
int userTrackingMode;
|
|
377
|
+
|
|
378
|
+
switch (currentMode) {
|
|
379
|
+
case CameraMode.NONE:
|
|
380
|
+
userTrackingMode = UserTrackingMode.NONE;
|
|
381
|
+
break;
|
|
382
|
+
case CameraMode.TRACKING:
|
|
383
|
+
userTrackingMode = UserTrackingMode.FOLLOW;
|
|
384
|
+
break;
|
|
385
|
+
case CameraMode.TRACKING_COMPASS:
|
|
386
|
+
userTrackingMode = UserTrackingMode.FollowWithHeading;
|
|
387
|
+
break;
|
|
388
|
+
case CameraMode.TRACKING_GPS:
|
|
389
|
+
userTrackingMode = UserTrackingMode.FollowWithCourse;
|
|
390
|
+
break;
|
|
391
|
+
default:
|
|
392
|
+
userTrackingMode = UserTrackingMode.NONE;
|
|
409
393
|
}
|
|
394
|
+
|
|
395
|
+
updateUserTrackingMode(userTrackingMode);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
@Override
|
|
399
|
+
public void onCameraTrackingDismissed() {
|
|
400
|
+
}
|
|
410
401
|
});
|
|
411
402
|
} else {
|
|
412
403
|
mLocationComponentManager.setCameraMode(CameraMode.NONE);
|
|
@@ -429,10 +420,7 @@ public class MLRNCamera extends AbstractMapFeature {
|
|
|
429
420
|
}
|
|
430
421
|
|
|
431
422
|
private CameraPosition buildCamera(CameraPosition previousPosition, boolean shouldUpdateTarget) {
|
|
432
|
-
CameraPosition.Builder builder = new CameraPosition.Builder(previousPosition)
|
|
433
|
-
.bearing(mHeading)
|
|
434
|
-
.tilt(mPitch)
|
|
435
|
-
.zoom(mZoomLevel);
|
|
423
|
+
CameraPosition.Builder builder = new CameraPosition.Builder(previousPosition).bearing(mHeading).tilt(mPitch).zoom(mZoomLevel);
|
|
436
424
|
|
|
437
425
|
if (shouldUpdateTarget) {
|
|
438
426
|
builder.target(GeoJSONUtils.toLatLng(mCenterCoordinate));
|
|
@@ -507,6 +495,7 @@ public class MLRNCamera extends AbstractMapFeature {
|
|
|
507
495
|
/**
|
|
508
496
|
* Create a payload of the location data per the web api geolocation spec
|
|
509
497
|
* https://dev.w3.org/geo/api/spec-source.html#position
|
|
498
|
+
*
|
|
510
499
|
* @return
|
|
511
500
|
*/
|
|
512
501
|
private WritableMap makeLocationChangePayload(Location location) {
|
|
@@ -46,6 +46,8 @@ public class LocationComponentManager {
|
|
|
46
46
|
|
|
47
47
|
private boolean mShowingUserLocation = false;
|
|
48
48
|
|
|
49
|
+
private OnCameraTrackingChangedListener mOnCameraTrackingChangedListener = null;
|
|
50
|
+
|
|
49
51
|
public void showUserLocation(boolean showUserLocation) {
|
|
50
52
|
mShowUserLocation = showUserLocation;
|
|
51
53
|
stateChanged();
|
|
@@ -68,16 +70,21 @@ public class LocationComponentManager {
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
public void setPreferredFramesPerSecond(int preferredFramesPerSecond) {
|
|
71
|
-
|
|
73
|
+
if (mLocationComponent == null || preferredFramesPerSecond <= 0) {
|
|
72
74
|
return;
|
|
73
|
-
|
|
75
|
+
}
|
|
74
76
|
|
|
75
77
|
mLocationComponent.setMaxAnimationFps(preferredFramesPerSecond);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
|
|
79
80
|
public void addOnCameraTrackingChangedListener(OnCameraTrackingChangedListener onCameraTrackingChangedListener) {
|
|
80
|
-
|
|
81
|
+
if (mOnCameraTrackingChangedListener != null) {
|
|
82
|
+
mLocationComponent.removeOnCameraTrackingChangedListener(mOnCameraTrackingChangedListener);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
mOnCameraTrackingChangedListener = onCameraTrackingChangedListener;
|
|
86
|
+
|
|
87
|
+
mLocationComponent.addOnCameraTrackingChangedListener(mOnCameraTrackingChangedListener);
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
@SuppressLint("MissingPermission")
|
|
@@ -111,7 +118,7 @@ public class LocationComponentManager {
|
|
|
111
118
|
public void update(boolean displayUserLocation, @NonNull Style style) {
|
|
112
119
|
Integer tintColor = mMapView.getTintColor();
|
|
113
120
|
|
|
114
|
-
if (mLocationComponent == null || tintColor != null
|
|
121
|
+
if (mLocationComponent == null || tintColor != null) {
|
|
115
122
|
mLocationComponent = mMap.getLocationComponent();
|
|
116
123
|
|
|
117
124
|
LocationComponentActivationOptions locationComponentActivationOptions = LocationComponentActivationOptions
|
|
@@ -148,10 +155,10 @@ public class LocationComponentManager {
|
|
|
148
155
|
.accuracyAlpha(0.0f);
|
|
149
156
|
} else if (tintColor != null) {
|
|
150
157
|
builder = builder
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
158
|
+
.enableStaleState(false)
|
|
159
|
+
.bearingTintColor(tintColor)
|
|
160
|
+
.foregroundTintColor(tintColor)
|
|
161
|
+
.accuracyColor(tintColor);
|
|
155
162
|
}
|
|
156
163
|
return builder.build();
|
|
157
164
|
}
|
|
@@ -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
|
|