@maplibre/maplibre-react-native 10.0.0-beta.11 → 10.0.0-beta.13
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 +3 -3
- package/android/build.gradle +1 -1
- package/ios/MLRN/MLRNStyle.m +0 -40
- 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 +2 -3
- 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 +38 -39
- 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 +4 -6
- 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 +20 -22
- 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} +26 -28
- 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/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 +2 -3
- 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/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 +1 -2
- 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 +34 -35
- 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 +2 -3
- 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 +13 -14
- 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} +22 -22
- 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/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 +1 -1
- 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/typescript/commonjs/src/MLRNModule.d.ts +1 -1
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +41 -29
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +1 -3
- 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 +1 -3
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +1 -3
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +1 -3
- 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 +1 -3
- 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 +4 -4
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Light.d.ts +2 -3
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +1 -3
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MapView.d.ts +4 -4
- 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 +4 -3
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +1 -3
- 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 +4 -4
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +1 -2
- 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 -3
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +3 -2
- 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} +17 -17
- 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/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.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/module/src/MLRNModule.d.ts +1 -1
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +41 -29
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Annotation.d.ts +4 -4
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +1 -3
- 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 +1 -3
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +1 -3
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillLayer.d.ts +1 -3
- 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 +1 -3
- 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 +4 -4
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Light.d.ts +2 -3
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/module/src/components/LineLayer.d.ts +1 -3
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MapView.d.ts +4 -4
- 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 +4 -3
- package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterLayer.d.ts +1 -3
- 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 +4 -4
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +1 -2
- 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 -3
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +3 -2
- 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} +17 -17
- 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/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.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/maplibre-react-native.podspec +1 -1
- package/package.json +7 -5
- package/src/MLRNModule.ts +1 -1
- package/src/MapLibreRN.ts +46 -30
- package/src/components/Annotation.tsx +9 -11
- package/src/components/BackgroundLayer.tsx +5 -7
- package/src/components/Callout.tsx +8 -10
- package/src/components/Camera.tsx +3 -5
- package/src/components/CircleLayer.tsx +5 -7
- package/src/components/FillExtrusionLayer.tsx +5 -7
- package/src/components/FillLayer.tsx +5 -7
- package/src/components/HeadingIndicator.tsx +2 -6
- package/src/components/HeatmapLayer.tsx +5 -7
- package/src/components/ImageSource.tsx +4 -6
- package/src/components/Images.tsx +6 -8
- package/src/components/Light.tsx +3 -5
- package/src/components/LineLayer.tsx +5 -7
- package/src/components/MapView.tsx +36 -37
- package/src/components/MarkerView.tsx +4 -6
- package/src/components/NativeUserLocation.tsx +1 -4
- package/src/components/PointAnnotation.tsx +7 -6
- package/src/components/RasterLayer.tsx +5 -7
- package/src/components/RasterSource.tsx +7 -9
- package/src/components/ShapeSource.tsx +6 -8
- package/src/components/SymbolLayer.tsx +5 -6
- package/src/components/UserLocation.tsx +18 -19
- package/src/components/VectorSource.tsx +7 -9
- package/src/hooks/useAbstractLayer.ts +5 -5
- 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} +22 -21
- 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/types/MapLibreRNStyles.ts +1 -1
- package/src/utils/BridgeValue.ts +1 -1
- package/src/utils/Logger.ts +1 -3
- package/src/utils/StyleValue.ts +2 -1
- 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/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/module/modules/location/locationManager.js.map +0 -1
- package/lib/module/modules/offline/offlineManager.js.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/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
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
1
|
+
import { Component, useRef } from "react";
|
|
2
2
|
import { type NativeMethods } from "react-native";
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export function useAbstractSource<NativePropsType extends object>(): {
|
|
5
5
|
_nativeRef:
|
|
6
|
-
| (
|
|
6
|
+
| (Component<NativePropsType> & Readonly<NativeMethods>)
|
|
7
7
|
| undefined;
|
|
8
8
|
setNativeRef: (
|
|
9
|
-
instance:
|
|
9
|
+
instance: Component<NativePropsType> & Readonly<NativeMethods>,
|
|
10
10
|
) => void;
|
|
11
11
|
setNativeProps: (nativeProps: NativePropsType) => void;
|
|
12
12
|
} {
|
|
13
13
|
const _nativeRef = useRef<
|
|
14
|
-
(
|
|
14
|
+
(Component<NativePropsType> & Readonly<NativeMethods>) | undefined
|
|
15
15
|
>(undefined);
|
|
16
16
|
|
|
17
17
|
const setNativeRef = (
|
|
18
|
-
instance:
|
|
18
|
+
instance: Component<NativePropsType> & Readonly<NativeMethods>,
|
|
19
19
|
): void => {
|
|
20
20
|
_nativeRef.current = instance;
|
|
21
21
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
type MutableRefObject,
|
|
4
|
+
type SyntheticEvent,
|
|
5
|
+
useRef,
|
|
6
|
+
} from "react";
|
|
2
7
|
|
|
3
8
|
import { runNativeCommand, isAndroid, type NativeArg } from "../utils";
|
|
4
9
|
|
|
@@ -12,8 +17,8 @@ let callbackIncrement = 0;
|
|
|
12
17
|
type UseNativeBridge = {
|
|
13
18
|
_nativeModuleName: string;
|
|
14
19
|
_onAndroidCallback: (e: SyntheticEvent<Element, RNMLEvent>) => void;
|
|
15
|
-
_callbackMap:
|
|
16
|
-
_preRefMapMethodQueue:
|
|
20
|
+
_callbackMap: MutableRefObject<Map<string, any>>;
|
|
21
|
+
_preRefMapMethodQueue: MutableRefObject<any[]>;
|
|
17
22
|
_addAddAndroidCallback: <ReturnType>(
|
|
18
23
|
id: string,
|
|
19
24
|
resolve: (value: ReturnType) => void,
|
|
@@ -30,7 +35,7 @@ type UseNativeBridge = {
|
|
|
30
35
|
) => Promise<ReturnType>;
|
|
31
36
|
};
|
|
32
37
|
|
|
33
|
-
const useNativeBridge: (moduleName: string) => UseNativeBridge = (
|
|
38
|
+
export const useNativeBridge: (moduleName: string) => UseNativeBridge = (
|
|
34
39
|
_nativeModuleName: string,
|
|
35
40
|
) => {
|
|
36
41
|
const _callbackMap = useRef<Map<string, any>>(new Map());
|
|
@@ -121,5 +126,3 @@ const useNativeBridge: (moduleName: string) => UseNativeBridge = (
|
|
|
121
126
|
_runNativeCommand,
|
|
122
127
|
};
|
|
123
128
|
};
|
|
124
|
-
|
|
125
|
-
export default useNativeBridge;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, useRef } from "react";
|
|
1
|
+
import { Component, type RefObject, useRef } from "react";
|
|
2
2
|
import { type NativeMethods } from "react-native";
|
|
3
3
|
|
|
4
4
|
export type NativeRef<NativeProps> = Component<NativeProps> &
|
|
@@ -7,7 +7,7 @@ export type NativeRef<NativeProps> = Component<NativeProps> &
|
|
|
7
7
|
/**
|
|
8
8
|
* Separate module which allows to be mocked in tests.
|
|
9
9
|
*/
|
|
10
|
-
export function useNativeRef<NativeProps = object>():
|
|
10
|
+
export function useNativeRef<NativeProps = object>(): RefObject<
|
|
11
11
|
NativeRef<NativeProps>
|
|
12
12
|
> {
|
|
13
13
|
return useRef<NativeRef<NativeProps>>(null);
|
package/src/hooks/useOnce.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useRef } from "react";
|
|
2
2
|
|
|
3
|
-
const useOnce: (callback: () => void) => void = (
|
|
3
|
+
export const useOnce: (callback: () => void) => void = (
|
|
4
|
+
callback: () => void,
|
|
5
|
+
) => {
|
|
4
6
|
const once = useRef(false);
|
|
5
7
|
|
|
6
8
|
if (!once.current) {
|
|
@@ -8,5 +10,3 @@ const useOnce: (callback: () => void) => void = (callback: () => void) => {
|
|
|
8
10
|
callback();
|
|
9
11
|
}
|
|
10
12
|
};
|
|
11
|
-
|
|
12
|
-
export default useOnce;
|
package/src/index.ts
CHANGED
|
@@ -4,26 +4,26 @@ import {
|
|
|
4
4
|
type EmitterSubscription,
|
|
5
5
|
} from "react-native";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
8
8
|
const MLRNLocationModule = NativeModules.MLRNLocationModule;
|
|
9
9
|
|
|
10
10
|
export const LocationModuleEventEmitter = new NativeEventEmitter(
|
|
11
11
|
MLRNLocationModule,
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
* Location sent by
|
|
14
|
+
/*
|
|
15
|
+
* Location sent by LocationManager
|
|
16
16
|
*/
|
|
17
17
|
export interface Location {
|
|
18
18
|
coords: Coordinates;
|
|
19
19
|
timestamp?: number;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
*
|
|
22
|
+
/*
|
|
23
|
+
* Coordinates sent by LocationManager
|
|
24
24
|
*/
|
|
25
25
|
interface Coordinates {
|
|
26
|
-
|
|
26
|
+
/*
|
|
27
27
|
* The heading (measured in degrees) relative to true north.
|
|
28
28
|
* Heading is used to describe the direction the device is pointing to (the value of the compass).
|
|
29
29
|
* Note that on Android this is incorrectly reporting the course value as mentioned in issue https://github.com/rnmapbox/maps/issues/1213
|
|
@@ -31,33 +31,33 @@ interface Coordinates {
|
|
|
31
31
|
*/
|
|
32
32
|
heading?: number;
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
/*
|
|
35
35
|
* The direction in which the device is traveling, measured in degrees and relative to due north.
|
|
36
36
|
* The course refers to the direction the device is actually moving (not the same as heading).
|
|
37
37
|
*/
|
|
38
38
|
course?: number;
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
/*
|
|
41
41
|
* The instantaneous speed of the device, measured in meters per second.
|
|
42
42
|
*/
|
|
43
43
|
speed?: number;
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
/*
|
|
46
46
|
* The latitude in degrees.
|
|
47
47
|
*/
|
|
48
48
|
latitude: number;
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
/*
|
|
51
51
|
* The longitude in degrees.
|
|
52
52
|
*/
|
|
53
53
|
longitude: number;
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
/*
|
|
56
56
|
* The radius of uncertainty for the location, measured in meters.
|
|
57
57
|
*/
|
|
58
58
|
accuracy?: number;
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
/*
|
|
61
61
|
* The altitude, measured in meters.
|
|
62
62
|
*/
|
|
63
63
|
altitude?: number;
|
|
@@ -88,7 +88,7 @@ class LocationManager {
|
|
|
88
88
|
try {
|
|
89
89
|
lastKnownLocation = await MLRNLocationModule.getLastKnownLocation();
|
|
90
90
|
} catch (error) {
|
|
91
|
-
console.log("
|
|
91
|
+
console.log("LocationManager Error: ", error);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (!this._lastKnownLocation && lastKnownLocation) {
|
|
@@ -129,7 +129,7 @@ class LocationManager {
|
|
|
129
129
|
MLRNLocationModule.start(displacement);
|
|
130
130
|
|
|
131
131
|
this.subscription = LocationModuleEventEmitter.addListener(
|
|
132
|
-
|
|
132
|
+
MLRNModule.LocationCallbackName.Update,
|
|
133
133
|
this.onUpdate,
|
|
134
134
|
);
|
|
135
135
|
|
|
@@ -158,4 +158,5 @@ class LocationManager {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
const locationManager = new LocationManager();
|
|
162
|
+
export { locationManager as LocationManager };
|
|
@@ -9,7 +9,7 @@ export interface OfflineCreatePackInputOptions {
|
|
|
9
9
|
metadata?: Record<string, any>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
class OfflineCreatePackOptions {
|
|
12
|
+
export class OfflineCreatePackOptions {
|
|
13
13
|
name: string;
|
|
14
14
|
styleURL: string;
|
|
15
15
|
bounds: string;
|
|
@@ -51,5 +51,3 @@ class OfflineCreatePackOptions {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
export default OfflineCreatePackOptions;
|
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
type EventSubscription,
|
|
5
5
|
} from "react-native";
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
OfflineCreatePackOptions,
|
|
8
9
|
type OfflineCreatePackInputOptions,
|
|
9
10
|
} from "./OfflineCreatePackOptions";
|
|
10
|
-
import OfflinePack,
|
|
11
|
+
import { OfflinePack, type OfflinePackStatus } from "./OfflinePack";
|
|
11
12
|
import { isUndefined, isFunction, isAndroid } from "../../utils";
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
14
15
|
const MLRNOfflineModule = NativeModules.MLRNOfflineModule;
|
|
15
16
|
export const OfflineModuleEventEmitter = new NativeEventEmitter(
|
|
16
17
|
MLRNOfflineModule,
|
|
@@ -67,7 +68,7 @@ class OfflineManager {
|
|
|
67
68
|
* const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);
|
|
68
69
|
* const errorListener = (offlineRegion, err) => console.log(offlineRegion, err);
|
|
69
70
|
*
|
|
70
|
-
* await
|
|
71
|
+
* await OfflineManager.createPack({
|
|
71
72
|
* name: 'offlinePack',
|
|
72
73
|
* styleURL: 'https://demotiles.maplibre.org/tiles/tiles.json',
|
|
73
74
|
* minZoom: 14,
|
|
@@ -106,7 +107,7 @@ class OfflineManager {
|
|
|
106
107
|
* This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded.
|
|
107
108
|
*
|
|
108
109
|
* @example
|
|
109
|
-
* await
|
|
110
|
+
* await OfflineManager.invalidatePack('packName')
|
|
110
111
|
*
|
|
111
112
|
* @param {String} name Name of the offline pack.
|
|
112
113
|
* @return {void}
|
|
@@ -128,7 +129,7 @@ class OfflineManager {
|
|
|
128
129
|
* Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed.
|
|
129
130
|
*
|
|
130
131
|
* @example
|
|
131
|
-
* await
|
|
132
|
+
* await OfflineManager.deletePack('packName')
|
|
132
133
|
*
|
|
133
134
|
* @param {String} name Name of the offline pack.
|
|
134
135
|
* @return {void}
|
|
@@ -154,7 +155,7 @@ class OfflineManager {
|
|
|
154
155
|
* It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects.
|
|
155
156
|
*
|
|
156
157
|
* @example
|
|
157
|
-
* await
|
|
158
|
+
* await OfflineManager.invalidateAmbientCache();
|
|
158
159
|
*
|
|
159
160
|
* @return {void}
|
|
160
161
|
*/
|
|
@@ -168,7 +169,7 @@ class OfflineManager {
|
|
|
168
169
|
* This method clears the cache and decreases the amount of space that map resources take up on the device.
|
|
169
170
|
*
|
|
170
171
|
* @example
|
|
171
|
-
* await
|
|
172
|
+
* await OfflineManager.clearAmbientCache();
|
|
172
173
|
*
|
|
173
174
|
* @return {void}
|
|
174
175
|
*/
|
|
@@ -182,7 +183,7 @@ class OfflineManager {
|
|
|
182
183
|
* This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased.
|
|
183
184
|
*
|
|
184
185
|
* @example
|
|
185
|
-
* await
|
|
186
|
+
* await OfflineManager.setMaximumAmbientCacheSize(5000000);
|
|
186
187
|
*
|
|
187
188
|
* @param {Number} size Size of ambient cache.
|
|
188
189
|
* @return {void}
|
|
@@ -196,7 +197,7 @@ class OfflineManager {
|
|
|
196
197
|
* Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it.
|
|
197
198
|
*
|
|
198
199
|
* @example
|
|
199
|
-
* await
|
|
200
|
+
* await OfflineManager.resetDatabase();
|
|
200
201
|
*
|
|
201
202
|
* @return {void}
|
|
202
203
|
*/
|
|
@@ -209,7 +210,7 @@ class OfflineManager {
|
|
|
209
210
|
* Retrieves all the current offline packs that are stored in the database.
|
|
210
211
|
*
|
|
211
212
|
* @example
|
|
212
|
-
* const offlinePacks = await
|
|
213
|
+
* const offlinePacks = await OfflineManager.getPacks();
|
|
213
214
|
*
|
|
214
215
|
* @return {Array<OfflinePack>}
|
|
215
216
|
*/
|
|
@@ -225,7 +226,7 @@ class OfflineManager {
|
|
|
225
226
|
* Retrieves an offline pack that is stored in the database by name.
|
|
226
227
|
*
|
|
227
228
|
* @example
|
|
228
|
-
* const offlinePack = await
|
|
229
|
+
* const offlinePack = await OfflineManager.getPack();
|
|
229
230
|
*
|
|
230
231
|
* @param {String} name Name of the offline pack.
|
|
231
232
|
* @return {OfflinePack}
|
|
@@ -239,7 +240,7 @@ class OfflineManager {
|
|
|
239
240
|
* Sideloads offline db
|
|
240
241
|
*
|
|
241
242
|
* @example
|
|
242
|
-
* await
|
|
243
|
+
* await OfflineManager.mergeOfflineRegions(path);
|
|
243
244
|
*
|
|
244
245
|
* @param {String} path Path to offline tile db on file system.
|
|
245
246
|
* @return {void}
|
|
@@ -254,7 +255,7 @@ class OfflineManager {
|
|
|
254
255
|
* Consult the Terms of Service for your map tile host before changing this value.
|
|
255
256
|
*
|
|
256
257
|
* @example
|
|
257
|
-
*
|
|
258
|
+
* OfflineManager.setTileCountLimit(1000);
|
|
258
259
|
*
|
|
259
260
|
* @param {Number} limit Map tile limit count.
|
|
260
261
|
* @return {void}
|
|
@@ -268,7 +269,7 @@ class OfflineManager {
|
|
|
268
269
|
* The default is 500ms.
|
|
269
270
|
*
|
|
270
271
|
* @example
|
|
271
|
-
*
|
|
272
|
+
* OfflineManager.setProgressEventThrottle(500);
|
|
272
273
|
*
|
|
273
274
|
* @param {Number} throttleValue event throttle value in ms.
|
|
274
275
|
* @return {void}
|
|
@@ -284,7 +285,7 @@ class OfflineManager {
|
|
|
284
285
|
* @example
|
|
285
286
|
* const progressListener = (offlinePack, status) => console.log(offlinePack, status)
|
|
286
287
|
* const errorListener = (offlinePack, err) => console.log(offlinePack, err)
|
|
287
|
-
*
|
|
288
|
+
* OfflineManager.subscribe('packName', progressListener, errorListener)
|
|
288
289
|
*
|
|
289
290
|
* @param {string} packName Name of the offline pack.
|
|
290
291
|
* @param {ProgressListener} progressListener Callback that listens for status events while downloading the offline resource.
|
|
@@ -300,7 +301,7 @@ class OfflineManager {
|
|
|
300
301
|
if (isFunction(progressListener)) {
|
|
301
302
|
if (totalProgressListeners === 0) {
|
|
302
303
|
this.subscriptionProgress = OfflineModuleEventEmitter.addListener(
|
|
303
|
-
|
|
304
|
+
MLRNModule.OfflineCallbackName.Progress,
|
|
304
305
|
this._onProgress,
|
|
305
306
|
);
|
|
306
307
|
}
|
|
@@ -311,7 +312,7 @@ class OfflineManager {
|
|
|
311
312
|
if (isFunction(errorListener)) {
|
|
312
313
|
if (totalErrorListeners === 0) {
|
|
313
314
|
this.subscriptionError = OfflineModuleEventEmitter.addListener(
|
|
314
|
-
|
|
315
|
+
MLRNModule.OfflineCallbackName.Error,
|
|
315
316
|
this._onError,
|
|
316
317
|
);
|
|
317
318
|
}
|
|
@@ -335,7 +336,7 @@ class OfflineManager {
|
|
|
335
336
|
* It's a good idea to call this on componentWillUnmount.
|
|
336
337
|
*
|
|
337
338
|
* @example
|
|
338
|
-
*
|
|
339
|
+
* OfflineManager.unsubscribe('packName')
|
|
339
340
|
*
|
|
340
341
|
* @param {String} packName Name of the offline pack.
|
|
341
342
|
* @return {void}
|
|
@@ -390,7 +391,7 @@ class OfflineManager {
|
|
|
390
391
|
}
|
|
391
392
|
|
|
392
393
|
// cleanup listeners now that they are no longer needed
|
|
393
|
-
if (state ===
|
|
394
|
+
if (state === MLRNModule.OfflinePackDownloadState.Complete) {
|
|
394
395
|
this.unsubscribe(name);
|
|
395
396
|
}
|
|
396
397
|
}
|
|
@@ -421,4 +422,4 @@ class OfflineManager {
|
|
|
421
422
|
}
|
|
422
423
|
|
|
423
424
|
const offlineManager = new OfflineManager();
|
|
424
|
-
export
|
|
425
|
+
export { offlineManager as OfflineManager };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from "react-native";
|
|
2
2
|
|
|
3
|
-
import OfflineCreatePackOptions from "./OfflineCreatePackOptions";
|
|
3
|
+
import { OfflineCreatePackOptions } from "./OfflineCreatePackOptions";
|
|
4
4
|
|
|
5
5
|
const MLRNOfflineModule = NativeModules.MLRNOfflineModule;
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ export type OfflinePackStatus = {
|
|
|
15
15
|
requiredResourceCount: number;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
class OfflinePack {
|
|
18
|
+
export class OfflinePack {
|
|
19
19
|
private pack: OfflineCreatePackOptions;
|
|
20
20
|
private _metadata: Record<string, any> | null;
|
|
21
21
|
|
|
@@ -52,5 +52,3 @@ class OfflinePack {
|
|
|
52
52
|
return MLRNOfflineModule.pausePackDownload(this.name);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
export default OfflinePack;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NativeModules } from "react-native";
|
|
2
2
|
|
|
3
|
-
import SnapshotOptions,
|
|
3
|
+
import { SnapshotOptions, type SnapshotInputOptions } from "./SnapshotOptions";
|
|
4
4
|
|
|
5
5
|
const MLRNSnapshotModule = NativeModules.MLRNSnapshotModule;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The SnapshotManager generates static raster images of the map.
|
|
9
9
|
* Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide.
|
|
10
10
|
* The snapshotter generates the snapshot asynchronous.
|
|
11
11
|
*/
|
|
@@ -16,35 +16,35 @@ class SnapshotManager {
|
|
|
16
16
|
* @example
|
|
17
17
|
*
|
|
18
18
|
* // creates a temp file png of base map
|
|
19
|
-
* const uri = await
|
|
19
|
+
* const uri = await SnapshotManager.takeSnap({
|
|
20
20
|
* centerCoordinate: [-74.126410, 40.797968],
|
|
21
21
|
* width: width,
|
|
22
22
|
* height: height,
|
|
23
23
|
* zoomLevel: 12,
|
|
24
24
|
* pitch: 30,
|
|
25
25
|
* heading: 20,
|
|
26
|
-
* styleURL:
|
|
26
|
+
* styleURL: StyleURL.Default,
|
|
27
27
|
* writeToDisk: true, // Create a temporary file
|
|
28
28
|
* });
|
|
29
29
|
*
|
|
30
30
|
* // creates base64 png of base map without logo
|
|
31
|
-
* const uri = await
|
|
31
|
+
* const uri = await SnapshotManager.takeSnap({
|
|
32
32
|
* centerCoordinate: [-74.126410, 40.797968],
|
|
33
33
|
* width: width,
|
|
34
34
|
* height: height,
|
|
35
35
|
* zoomLevel: 12,
|
|
36
36
|
* pitch: 30,
|
|
37
37
|
* heading: 20,
|
|
38
|
-
* styleURL:
|
|
38
|
+
* styleURL: StyleURL.Default,
|
|
39
39
|
* withLogo: false, // Disable Mapbox logo (Android only)
|
|
40
40
|
* });
|
|
41
41
|
*
|
|
42
42
|
* // creates snapshot with bounds
|
|
43
|
-
* const uri = await
|
|
43
|
+
* const uri = await SnapshotManager.takeSnap({
|
|
44
44
|
* bounds: [[-74.126410, 40.797968], [-74.143727, 40.772177]],
|
|
45
45
|
* width: width,
|
|
46
46
|
* height: height,
|
|
47
|
-
* styleURL:
|
|
47
|
+
* styleURL: StyleURL.Default,
|
|
48
48
|
* });
|
|
49
49
|
*
|
|
50
50
|
* @param {SnapshotOptions} options Snapshot options for create a static image of the base map
|
|
@@ -59,4 +59,4 @@ class SnapshotManager {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const snapshotManager = new SnapshotManager();
|
|
62
|
-
export
|
|
62
|
+
export { snapshotManager as SnapshotManager };
|
|
@@ -3,7 +3,7 @@ import { NativeModules } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
import { toJSONString } from "../../utils";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
7
7
|
|
|
8
8
|
export interface SnapshotInputOptions {
|
|
9
9
|
centerCoordinate?: GeoJSON.Position;
|
|
@@ -50,7 +50,7 @@ export class SnapshotOptions {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
this.styleURL = options.styleURL ||
|
|
53
|
+
this.styleURL = options.styleURL || MLRNModule.StyleURL.Default;
|
|
54
54
|
this.heading = options.heading || 0.0;
|
|
55
55
|
this.pitch = options.pitch || 0.0;
|
|
56
56
|
this.zoomLevel = options.zoomLevel || 16.0;
|
|
@@ -99,5 +99,3 @@ export class SnapshotOptions {
|
|
|
99
99
|
return toJSONString(featureCollection(features));
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
export default SnapshotOptions;
|
package/src/utils/BridgeValue.ts
CHANGED
package/src/utils/Logger.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface Log {
|
|
|
14
14
|
|
|
15
15
|
type LogCallback = (log: Log) => boolean;
|
|
16
16
|
|
|
17
|
-
class Logger {
|
|
17
|
+
export class Logger {
|
|
18
18
|
static instance: Logger | null = null;
|
|
19
19
|
|
|
20
20
|
static sharedInstance(): Logger {
|
|
@@ -129,5 +129,3 @@ class Logger {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
export default Logger;
|
package/src/utils/StyleValue.ts
CHANGED
|
@@ -17,7 +17,9 @@ const defaultConfig = {
|
|
|
17
17
|
useNativeDriver: false,
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
abstract class AbstractAnimatedCoordinates<
|
|
20
|
+
export abstract class AbstractAnimatedCoordinates<
|
|
21
|
+
State,
|
|
22
|
+
> extends AnimatedWithChildren {
|
|
21
23
|
constructor(coords: AnimatedCoordinates[]) {
|
|
22
24
|
super();
|
|
23
25
|
|
|
@@ -130,5 +132,3 @@ abstract class AbstractAnimatedCoordinates<State> extends AnimatedWithChildren {
|
|
|
130
132
|
);
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
|
-
|
|
134
|
-
export default AbstractAnimatedCoordinates;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
type ForwardRefExoticComponent,
|
|
3
|
+
type MemoExoticComponent,
|
|
4
|
+
type RefAttributes,
|
|
5
|
+
} from "react";
|
|
2
6
|
import { Animated as RNAnimated } from "react-native";
|
|
3
7
|
|
|
4
|
-
import AnimatedCoordinatesArray from "./AnimatedCoordinatesArray";
|
|
5
|
-
import AnimatedExtractCoordinateFromArray from "./AnimatedExtractCoordinateFromArray";
|
|
6
|
-
import AnimatedRouteCoordinatesArray from "./AnimatedRouteCoordinatesArray";
|
|
7
|
-
import AnimatedShape from "./AnimatedShape";
|
|
8
|
-
import BackgroundLayer from "../../components/BackgroundLayer";
|
|
9
|
-
import CircleLayer from "../../components/CircleLayer";
|
|
10
|
-
import FillExtrusionLayer from "../../components/FillExtrusionLayer";
|
|
11
|
-
import FillLayer from "../../components/FillLayer";
|
|
12
|
-
import ImageSource from "../../components/ImageSource";
|
|
13
|
-
import LineLayer from "../../components/LineLayer";
|
|
14
|
-
import RasterLayer from "../../components/RasterLayer";
|
|
15
|
-
import
|
|
8
|
+
import { AnimatedCoordinatesArray } from "./AnimatedCoordinatesArray";
|
|
9
|
+
import { AnimatedExtractCoordinateFromArray } from "./AnimatedExtractCoordinateFromArray";
|
|
10
|
+
import { AnimatedRouteCoordinatesArray } from "./AnimatedRouteCoordinatesArray";
|
|
11
|
+
import { AnimatedShape } from "./AnimatedShape";
|
|
12
|
+
import { BackgroundLayer } from "../../components/BackgroundLayer";
|
|
13
|
+
import { CircleLayer } from "../../components/CircleLayer";
|
|
14
|
+
import { FillExtrusionLayer } from "../../components/FillExtrusionLayer";
|
|
15
|
+
import { FillLayer } from "../../components/FillLayer";
|
|
16
|
+
import { ImageSource } from "../../components/ImageSource";
|
|
17
|
+
import { LineLayer } from "../../components/LineLayer";
|
|
18
|
+
import { RasterLayer } from "../../components/RasterLayer";
|
|
19
|
+
import {
|
|
20
|
+
ShapeSource,
|
|
16
21
|
type ShapeSourceProps,
|
|
17
22
|
type ShapeSourceRef,
|
|
18
23
|
} from "../../components/ShapeSource";
|
|
19
|
-
import SymbolLayer from "../../components/SymbolLayer";
|
|
24
|
+
import { SymbolLayer } from "../../components/SymbolLayer";
|
|
20
25
|
|
|
21
|
-
const Animated = {
|
|
26
|
+
export const Animated = {
|
|
22
27
|
// sources
|
|
23
28
|
ShapeSource: RNAnimated.createAnimatedComponent(ShapeSource),
|
|
24
29
|
ImageSource: RNAnimated.createAnimatedComponent(ImageSource),
|
|
@@ -39,15 +44,14 @@ const Animated = {
|
|
|
39
44
|
ExtractCoordinateFromArray: AnimatedExtractCoordinateFromArray,
|
|
40
45
|
};
|
|
41
46
|
|
|
42
|
-
type ShapeSourcePropsWithRef = ShapeSourceProps &
|
|
43
|
-
React.RefAttributes<ShapeSourceRef>;
|
|
47
|
+
type ShapeSourcePropsWithRef = ShapeSourceProps & RefAttributes<ShapeSourceRef>;
|
|
44
48
|
|
|
45
49
|
type BaseShapeSourceComponent =
|
|
46
|
-
|
|
50
|
+
ForwardRefExoticComponent<ShapeSourcePropsWithRef>;
|
|
47
51
|
|
|
48
52
|
type AnimatedShapeSourceType =
|
|
49
53
|
RNAnimated.AnimatedComponent<BaseShapeSourceComponent> &
|
|
50
|
-
|
|
54
|
+
MemoExoticComponent<BaseShapeSourceComponent>;
|
|
51
55
|
|
|
52
56
|
/**
|
|
53
57
|
* Manual typing is required for AnimatedShapeSource because the
|
|
@@ -57,5 +61,3 @@ type AnimatedShapeSourceType =
|
|
|
57
61
|
export const AnimatedShapeSource = RNAnimated.createAnimatedComponent(
|
|
58
62
|
ShapeSource,
|
|
59
63
|
) as AnimatedShapeSourceType;
|
|
60
|
-
|
|
61
|
-
export default Animated;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
AbstractAnimatedCoordinates,
|
|
2
3
|
type AnimatedCoordinates,
|
|
3
4
|
} from "./AbstractAnimatedCoordinates";
|
|
4
5
|
|
|
@@ -7,7 +8,7 @@ interface CoordinatesState {
|
|
|
7
8
|
targetCoords: AnimatedCoordinates[];
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
class AnimatedCoordinatesArray extends AbstractAnimatedCoordinates<CoordinatesState> {
|
|
11
|
+
export class AnimatedCoordinatesArray extends AbstractAnimatedCoordinates<CoordinatesState> {
|
|
11
12
|
/**
|
|
12
13
|
* Subclasses can override to calculate initial state
|
|
13
14
|
*
|
|
@@ -109,5 +110,3 @@ class AnimatedCoordinatesArray extends AbstractAnimatedCoordinates<CoordinatesSt
|
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
|
-
|
|
113
|
-
export default AnimatedCoordinatesArray;
|
|
@@ -11,7 +11,7 @@ if (__DEV__) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export class AnimatedExtractCoordinateFromArray extends AnimatedWithChildren {
|
|
15
15
|
_array: AnimatedExtractCoordinateFromArray;
|
|
16
16
|
|
|
17
17
|
_index = 0;
|