@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
|
@@ -22,17 +22,17 @@ import {
|
|
|
22
22
|
type NativeSyntheticEvent,
|
|
23
23
|
} from "react-native";
|
|
24
24
|
|
|
25
|
-
import useNativeBridge from "../hooks/useNativeBridge";
|
|
26
|
-
import useOnce from "../hooks/useOnce";
|
|
27
|
-
import { type Location } from "../modules/location/
|
|
25
|
+
import { useNativeBridge } from "../hooks/useNativeBridge";
|
|
26
|
+
import { useOnce } from "../hooks/useOnce";
|
|
27
|
+
import { type Location } from "../modules/location/LocationManager";
|
|
28
28
|
import { type BaseProps } from "../types/BaseProps";
|
|
29
29
|
import { type FilterExpression } from "../types/MapLibreRNStyles";
|
|
30
30
|
import { isFunction, isAndroid } from "../utils";
|
|
31
|
-
import Logger from "../utils/Logger";
|
|
31
|
+
import { Logger } from "../utils/Logger";
|
|
32
32
|
import { getFilter } from "../utils/filterUtils";
|
|
33
33
|
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
34
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
35
|
+
if (MLRNModule == null) {
|
|
36
36
|
console.error(
|
|
37
37
|
"Native module of @maplibre/maplibre-react-native library was not registered properly, please consult the docs: https://github.com/maplibre/maplibre-react-native",
|
|
38
38
|
);
|
|
@@ -67,7 +67,7 @@ interface MapViewProps extends BaseProps {
|
|
|
67
67
|
*/
|
|
68
68
|
style?: ViewProps["style"];
|
|
69
69
|
/**
|
|
70
|
-
* Style for map - either a URL or a Style JSON (https://maplibre.org/maplibre-style-spec/). Default: `
|
|
70
|
+
* Style for map - either a URL or a Style JSON (https://maplibre.org/maplibre-style-spec/). Default: `StyleURL.Default`
|
|
71
71
|
*/
|
|
72
72
|
mapStyle?: string | object;
|
|
73
73
|
/**
|
|
@@ -278,7 +278,7 @@ export interface MapViewRef {
|
|
|
278
278
|
/**
|
|
279
279
|
* MapView backed by MapLibre Native
|
|
280
280
|
*/
|
|
281
|
-
const MapView = memo(
|
|
281
|
+
export const MapView = memo(
|
|
282
282
|
forwardRef<MapViewRef, MapViewProps>(
|
|
283
283
|
(
|
|
284
284
|
{
|
|
@@ -433,46 +433,46 @@ const MapView = memo(
|
|
|
433
433
|
const events = [];
|
|
434
434
|
|
|
435
435
|
if (props.onRegionWillChange) {
|
|
436
|
-
events.push(
|
|
436
|
+
events.push(MLRNModule.EventTypes.RegionWillChange);
|
|
437
437
|
}
|
|
438
438
|
if (props.onRegionIsChanging) {
|
|
439
|
-
events.push(
|
|
439
|
+
events.push(MLRNModule.EventTypes.RegionIsChanging);
|
|
440
440
|
}
|
|
441
441
|
if (props.onRegionDidChange) {
|
|
442
|
-
events.push(
|
|
442
|
+
events.push(MLRNModule.EventTypes.RegionDidChange);
|
|
443
443
|
}
|
|
444
444
|
if (props.onUserLocationUpdate) {
|
|
445
|
-
events.push(
|
|
445
|
+
events.push(MLRNModule.EventTypes.UserLocationUpdated);
|
|
446
446
|
}
|
|
447
447
|
if (props.onWillStartLoadingMap) {
|
|
448
|
-
events.push(
|
|
448
|
+
events.push(MLRNModule.EventTypes.WillStartLoadingMap);
|
|
449
449
|
}
|
|
450
450
|
if (props.onDidFinishLoadingMap) {
|
|
451
|
-
events.push(
|
|
451
|
+
events.push(MLRNModule.EventTypes.DidFinishLoadingMap);
|
|
452
452
|
}
|
|
453
453
|
if (props.onDidFailLoadingMap) {
|
|
454
|
-
events.push(
|
|
454
|
+
events.push(MLRNModule.EventTypes.DidFailLoadingMap);
|
|
455
455
|
}
|
|
456
456
|
if (props.onWillStartRenderingFrame) {
|
|
457
|
-
events.push(
|
|
457
|
+
events.push(MLRNModule.EventTypes.WillStartRenderingFrame);
|
|
458
458
|
}
|
|
459
459
|
if (props.onDidFinishRenderingFrame) {
|
|
460
|
-
events.push(
|
|
460
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingFrame);
|
|
461
461
|
}
|
|
462
462
|
if (props.onDidFinishRenderingFrameFully) {
|
|
463
|
-
events.push(
|
|
463
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingFrameFully);
|
|
464
464
|
}
|
|
465
465
|
if (props.onWillStartRenderingMap) {
|
|
466
|
-
events.push(
|
|
466
|
+
events.push(MLRNModule.EventTypes.WillStartRenderingMap);
|
|
467
467
|
}
|
|
468
468
|
if (props.onDidFinishRenderingMap) {
|
|
469
|
-
events.push(
|
|
469
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingMap);
|
|
470
470
|
}
|
|
471
471
|
if (props.onDidFinishRenderingMapFully) {
|
|
472
|
-
events.push(
|
|
472
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingMapFully);
|
|
473
473
|
}
|
|
474
474
|
if (props.onDidFinishLoadingStyle) {
|
|
475
|
-
events.push(
|
|
475
|
+
events.push(MLRNModule.EventTypes.DidFinishLoadingStyle);
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
_runNativeCommand(
|
|
@@ -656,7 +656,7 @@ const MapView = memo(
|
|
|
656
656
|
let propName: CallableProps | undefined;
|
|
657
657
|
|
|
658
658
|
switch (type) {
|
|
659
|
-
case
|
|
659
|
+
case MLRNModule.EventTypes.RegionWillChange:
|
|
660
660
|
if (
|
|
661
661
|
regionWillChangeDebounceTime &&
|
|
662
662
|
regionWillChangeDebounceTime > 0
|
|
@@ -670,10 +670,10 @@ const MapView = memo(
|
|
|
670
670
|
propName = "onRegionWillChange";
|
|
671
671
|
}
|
|
672
672
|
break;
|
|
673
|
-
case
|
|
673
|
+
case MLRNModule.EventTypes.RegionIsChanging:
|
|
674
674
|
propName = "onRegionIsChanging";
|
|
675
675
|
break;
|
|
676
|
-
case
|
|
676
|
+
case MLRNModule.EventTypes.RegionDidChange:
|
|
677
677
|
if (
|
|
678
678
|
regionDidChangeDebounceTime &&
|
|
679
679
|
regionDidChangeDebounceTime > 0
|
|
@@ -687,37 +687,37 @@ const MapView = memo(
|
|
|
687
687
|
propName = "onRegionDidChange";
|
|
688
688
|
}
|
|
689
689
|
break;
|
|
690
|
-
case
|
|
690
|
+
case MLRNModule.EventTypes.UserLocationUpdated:
|
|
691
691
|
propName = "onUserLocationUpdate";
|
|
692
692
|
break;
|
|
693
|
-
case
|
|
693
|
+
case MLRNModule.EventTypes.WillStartLoadingMap:
|
|
694
694
|
propName = "onWillStartLoadingMap";
|
|
695
695
|
break;
|
|
696
|
-
case
|
|
696
|
+
case MLRNModule.EventTypes.DidFinishLoadingMap:
|
|
697
697
|
propName = "onDidFinishLoadingMap";
|
|
698
698
|
break;
|
|
699
|
-
case
|
|
699
|
+
case MLRNModule.EventTypes.DidFailLoadingMap:
|
|
700
700
|
propName = "onDidFailLoadingMap";
|
|
701
701
|
break;
|
|
702
|
-
case
|
|
702
|
+
case MLRNModule.EventTypes.WillStartRenderingFrame:
|
|
703
703
|
propName = "onWillStartRenderingFrame";
|
|
704
704
|
break;
|
|
705
|
-
case
|
|
705
|
+
case MLRNModule.EventTypes.DidFinishRenderingFrame:
|
|
706
706
|
propName = "onDidFinishRenderingFrame";
|
|
707
707
|
break;
|
|
708
|
-
case
|
|
708
|
+
case MLRNModule.EventTypes.DidFinishRenderingFrameFully:
|
|
709
709
|
propName = "onDidFinishRenderingFrameFully";
|
|
710
710
|
break;
|
|
711
|
-
case
|
|
711
|
+
case MLRNModule.EventTypes.WillStartRenderingMap:
|
|
712
712
|
propName = "onWillStartRenderingMap";
|
|
713
713
|
break;
|
|
714
|
-
case
|
|
714
|
+
case MLRNModule.EventTypes.DidFinishRenderingMap:
|
|
715
715
|
propName = "onDidFinishRenderingMap";
|
|
716
716
|
break;
|
|
717
|
-
case
|
|
717
|
+
case MLRNModule.EventTypes.DidFinishRenderingMapFully:
|
|
718
718
|
propName = "onDidFinishRenderingMapFully";
|
|
719
719
|
break;
|
|
720
|
-
case
|
|
720
|
+
case MLRNModule.EventTypes.DidFinishLoadingStyle:
|
|
721
721
|
propName = "onDidFinishLoadingStyle";
|
|
722
722
|
break;
|
|
723
723
|
default:
|
|
@@ -852,4 +852,3 @@ if (isAndroid()) {
|
|
|
852
852
|
ANDROID_TEXTURE_NATIVE_MODULE_NAME,
|
|
853
853
|
);
|
|
854
854
|
}
|
|
855
|
-
export default MapView;
|
|
@@ -2,7 +2,7 @@ import { point } from "@turf/helpers";
|
|
|
2
2
|
import { type ReactElement, useMemo } from "react";
|
|
3
3
|
import { Platform, requireNativeComponent, type ViewProps } from "react-native";
|
|
4
4
|
|
|
5
|
-
import PointAnnotation from "./PointAnnotation";
|
|
5
|
+
import { PointAnnotation } from "./PointAnnotation";
|
|
6
6
|
import { toJSONString } from "../utils";
|
|
7
7
|
|
|
8
8
|
export const NATIVE_MODULE_NAME = "MLRNMarkerView";
|
|
@@ -35,7 +35,7 @@ interface MarkerViewProps extends ViewProps {
|
|
|
35
35
|
/**
|
|
36
36
|
* Expects one child - can be container with multiple elements
|
|
37
37
|
*/
|
|
38
|
-
children:
|
|
38
|
+
children: ReactElement;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
interface NativeProps extends ViewProps {
|
|
@@ -53,12 +53,12 @@ interface NativeProps extends ViewProps {
|
|
|
53
53
|
* This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android
|
|
54
54
|
* and PointAnnotation on iOS.
|
|
55
55
|
*/
|
|
56
|
-
const MarkerView = ({
|
|
56
|
+
export const MarkerView = ({
|
|
57
57
|
anchor = { x: 0.5, y: 0.5 },
|
|
58
58
|
allowOverlap = false,
|
|
59
59
|
isSelected = false,
|
|
60
60
|
...rest
|
|
61
|
-
}: MarkerViewProps)
|
|
61
|
+
}: MarkerViewProps) => {
|
|
62
62
|
const props = { anchor, allowOverlap, isSelected, ...rest };
|
|
63
63
|
const coordinate = props.coordinate
|
|
64
64
|
? toJSONString(point(props.coordinate))
|
|
@@ -84,5 +84,3 @@ const MarkerView = ({
|
|
|
84
84
|
let lastId = 0;
|
|
85
85
|
|
|
86
86
|
const MLRNMarkerView = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
87
|
-
|
|
88
|
-
export default MarkerView;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
1
|
import { requireNativeComponent } from "react-native";
|
|
3
2
|
|
|
4
3
|
const NATIVE_MODULE_NAME = "MLRNNativeUserLocation";
|
|
@@ -26,10 +25,8 @@ interface NativeUserLocationProps {
|
|
|
26
25
|
androidPreferredFramesPerSecond?: number;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
const NativeUserLocation = (props: NativeUserLocationProps)
|
|
28
|
+
export const NativeUserLocation = (props: NativeUserLocationProps) => {
|
|
30
29
|
return <MLRNNativeUserLocation {...props} />;
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
const MLRNNativeUserLocation = requireNativeComponent(NATIVE_MODULE_NAME);
|
|
34
|
-
|
|
35
|
-
export default NativeUserLocation;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
requireNativeComponent,
|
|
15
15
|
} from "react-native";
|
|
16
16
|
|
|
17
|
-
import useNativeBridge,
|
|
17
|
+
import { useNativeBridge, type RNMLEvent } from "../hooks/useNativeBridge";
|
|
18
18
|
import { isFunction, toJSONString } from "../utils";
|
|
19
19
|
|
|
20
20
|
export const NATIVE_MODULE_NAME = "MLRNPointAnnotation";
|
|
@@ -102,7 +102,7 @@ export interface PointAnnotationProps {
|
|
|
102
102
|
/**
|
|
103
103
|
* Expects one child, and an optional callout can be added as well
|
|
104
104
|
*/
|
|
105
|
-
children:
|
|
105
|
+
children: ReactElement | [ReactElement, ReactElement];
|
|
106
106
|
|
|
107
107
|
style?: ViewProps["style"];
|
|
108
108
|
}
|
|
@@ -125,7 +125,10 @@ export interface PointAnnotationRef {
|
|
|
125
125
|
* If you need interctive views please use MarkerView,
|
|
126
126
|
* as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
127
127
|
*/
|
|
128
|
-
const PointAnnotation = forwardRef<
|
|
128
|
+
export const PointAnnotation = forwardRef<
|
|
129
|
+
PointAnnotationRef,
|
|
130
|
+
PointAnnotationProps
|
|
131
|
+
>(
|
|
129
132
|
(
|
|
130
133
|
{
|
|
131
134
|
anchor = { x: 0.5, y: 0.5 },
|
|
@@ -133,7 +136,7 @@ const PointAnnotation = forwardRef<PointAnnotationRef, PointAnnotationProps>(
|
|
|
133
136
|
...props
|
|
134
137
|
}: PointAnnotationProps,
|
|
135
138
|
ref,
|
|
136
|
-
)
|
|
139
|
+
) => {
|
|
137
140
|
useImperativeHandle(
|
|
138
141
|
ref,
|
|
139
142
|
(): PointAnnotationRef => ({
|
|
@@ -241,5 +244,3 @@ PointAnnotation.displayName = "PointAnnotation";
|
|
|
241
244
|
|
|
242
245
|
const MLRNPointAnnotation =
|
|
243
246
|
requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
244
|
-
|
|
245
|
-
export default PointAnnotation;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { NativeModules, requireNativeComponent } from "react-native";
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
useAbstractLayer,
|
|
5
5
|
type BaseLayerProps,
|
|
6
6
|
type NativeBaseProps,
|
|
7
7
|
} from "../hooks/useAbstractLayer";
|
|
8
8
|
import { type BaseProps } from "../types/BaseProps";
|
|
9
9
|
import { type RasterLayerStyle } from "../types/MapLibreRNStyles";
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
12
12
|
|
|
13
13
|
export const NATIVE_MODULE_NAME = "MLRNRasterLayer";
|
|
14
14
|
|
|
@@ -25,8 +25,8 @@ interface NativeProps
|
|
|
25
25
|
|
|
26
26
|
const MLRNRasterLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
27
27
|
|
|
28
|
-
const RasterLayer
|
|
29
|
-
sourceID =
|
|
28
|
+
export const RasterLayer = ({
|
|
29
|
+
sourceID = MLRNModule.StyleSource.DefaultSourceID,
|
|
30
30
|
...props
|
|
31
31
|
}: RasterLayerProps) => {
|
|
32
32
|
const { baseProps, setNativeLayer } = useAbstractLayer<
|
|
@@ -39,5 +39,3 @@ const RasterLayer: React.FC<RasterLayerProps> = ({
|
|
|
39
39
|
|
|
40
40
|
return <MLRNRasterLayer ref={setNativeLayer} {...baseProps} />;
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
export default RasterLayer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { NativeModules, requireNativeComponent } from "react-native";
|
|
3
3
|
|
|
4
|
-
import useAbstractSource from "../hooks/useAbstractSource";
|
|
5
|
-
import useOnce from "../hooks/useOnce";
|
|
4
|
+
import { useAbstractSource } from "../hooks/useAbstractSource";
|
|
5
|
+
import { useOnce } from "../hooks/useOnce";
|
|
6
6
|
import { type BaseProps } from "../types/BaseProps";
|
|
7
7
|
import { cloneReactChildrenWithProps } from "../utils";
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
10
10
|
|
|
11
11
|
export const NATIVE_MODULE_NAME = "MLRNRasterSource";
|
|
12
12
|
|
|
@@ -55,7 +55,7 @@ interface RasterSourceProps extends BaseProps {
|
|
|
55
55
|
*/
|
|
56
56
|
attribution?: string;
|
|
57
57
|
|
|
58
|
-
children?:
|
|
58
|
+
children?: ReactNode;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
type NativeProps = RasterSourceProps;
|
|
@@ -68,8 +68,8 @@ const MLRNRasterSource =
|
|
|
68
68
|
* The location of and metadata about the tiles are defined either by an option dictionary
|
|
69
69
|
* or by an external file that conforms to the TileJSON specification.
|
|
70
70
|
*/
|
|
71
|
-
const RasterSource
|
|
72
|
-
id =
|
|
71
|
+
export const RasterSource = ({
|
|
72
|
+
id = MLRNModule.StyleSource.DefaultSourceID,
|
|
73
73
|
...props
|
|
74
74
|
}: RasterSourceProps) => {
|
|
75
75
|
useOnce(() => {
|
|
@@ -110,5 +110,3 @@ const RasterSource: React.FC<RasterSourceProps> = ({
|
|
|
110
110
|
</MLRNRasterSource>
|
|
111
111
|
);
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
export default RasterSource;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Component,
|
|
3
|
-
type ReactElement,
|
|
4
3
|
forwardRef,
|
|
5
4
|
memo,
|
|
5
|
+
type ReactNode,
|
|
6
6
|
useImperativeHandle,
|
|
7
7
|
useRef,
|
|
8
8
|
} from "react";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
requireNativeComponent,
|
|
14
14
|
} from "react-native";
|
|
15
15
|
|
|
16
|
-
import useNativeBridge from "../hooks/useNativeBridge";
|
|
16
|
+
import { useNativeBridge } from "../hooks/useNativeBridge";
|
|
17
17
|
import { type BaseProps } from "../types/BaseProps";
|
|
18
18
|
import {
|
|
19
19
|
type ExpressionField,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "../utils";
|
|
29
29
|
import { getFilter } from "../utils/filterUtils";
|
|
30
30
|
|
|
31
|
-
const
|
|
31
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
32
32
|
export const NATIVE_MODULE_NAME = "MLRNShapeSource";
|
|
33
33
|
|
|
34
34
|
interface NativeProps {
|
|
@@ -133,7 +133,7 @@ export interface ShapeSourceProps extends BaseProps {
|
|
|
133
133
|
height: number;
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
children?:
|
|
136
|
+
children?: ReactNode;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
export interface ShapeSourceRef {
|
|
@@ -158,11 +158,11 @@ export interface ShapeSourceRef {
|
|
|
158
158
|
* ShapeSource is a map content source that supplies vector shapes to be shown on the map.
|
|
159
159
|
* The shape may be a url or a GeoJSON object
|
|
160
160
|
*/
|
|
161
|
-
const ShapeSource = memo(
|
|
161
|
+
export const ShapeSource = memo(
|
|
162
162
|
forwardRef<ShapeSourceRef, ShapeSourceProps>(
|
|
163
163
|
(
|
|
164
164
|
{
|
|
165
|
-
id: shapeId =
|
|
165
|
+
id: shapeId = MLRNModule.StyleSource.DefaultSourceID,
|
|
166
166
|
...props
|
|
167
167
|
}: ShapeSourceProps,
|
|
168
168
|
ref,
|
|
@@ -364,5 +364,3 @@ const ShapeSource = memo(
|
|
|
364
364
|
);
|
|
365
365
|
|
|
366
366
|
const MLRNShapeSource = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
367
|
-
|
|
368
|
-
export default ShapeSource;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { NativeModules, requireNativeComponent } from "react-native";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
useAbstractLayer,
|
|
4
5
|
type BaseLayerProps,
|
|
5
6
|
type NativeBaseProps,
|
|
6
7
|
} from "../hooks/useAbstractLayer";
|
|
7
8
|
import { type BaseProps } from "../types/BaseProps";
|
|
8
9
|
import { type SymbolLayerStyle } from "../types/MapLibreRNStyles";
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
11
12
|
|
|
12
13
|
export const NATIVE_MODULE_NAME = "MLRNSymbolLayer";
|
|
13
14
|
|
|
@@ -27,8 +28,8 @@ const MLRNSymbolLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
|
27
28
|
/**
|
|
28
29
|
* SymbolLayer is a style layer that renders icon and text labels at points or along lines on the map.
|
|
29
30
|
*/
|
|
30
|
-
const SymbolLayer
|
|
31
|
-
sourceID =
|
|
31
|
+
export const SymbolLayer = ({
|
|
32
|
+
sourceID = MLRNModule.StyleSource.DefaultSourceID,
|
|
32
33
|
...props
|
|
33
34
|
}: SymbolLayerProps) => {
|
|
34
35
|
const { baseProps, setNativeLayer } = useAbstractLayer<
|
|
@@ -45,5 +46,3 @@ const SymbolLayer: React.FC<SymbolLayerProps> = ({
|
|
|
45
46
|
|
|
46
47
|
return <MLRNSymbolLayer ref={setNativeLayer} {...updatedProps} />;
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
-
export default SymbolLayer;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
forwardRef,
|
|
3
3
|
memo,
|
|
4
|
-
type
|
|
4
|
+
type ReactNode,
|
|
5
5
|
useEffect,
|
|
6
6
|
useImperativeHandle,
|
|
7
7
|
useRef,
|
|
8
8
|
useState,
|
|
9
9
|
} from "react";
|
|
10
10
|
|
|
11
|
-
import Annotation from "./Annotation";
|
|
12
|
-
import CircleLayer from "./CircleLayer";
|
|
13
|
-
import HeadingIndicator from "./HeadingIndicator";
|
|
14
|
-
import NativeUserLocation from "./NativeUserLocation";
|
|
15
|
-
import
|
|
11
|
+
import { Annotation } from "./Annotation";
|
|
12
|
+
import { CircleLayer } from "./CircleLayer";
|
|
13
|
+
import { HeadingIndicator } from "./HeadingIndicator";
|
|
14
|
+
import { NativeUserLocation } from "./NativeUserLocation";
|
|
15
|
+
import {
|
|
16
16
|
type Location,
|
|
17
|
-
|
|
17
|
+
LocationManager,
|
|
18
|
+
} from "../modules/location/LocationManager";
|
|
18
19
|
import { type CircleLayerStyle } from "../types/MapLibreRNStyles";
|
|
19
20
|
|
|
20
21
|
const mapboxBlue = "rgba(51, 181, 229, 100)";
|
|
@@ -41,7 +42,7 @@ const layerStyles: Record<string, CircleLayerStyle> = {
|
|
|
41
42
|
export const normalIcon = (
|
|
42
43
|
showsUserHeadingIndicator?: boolean,
|
|
43
44
|
heading?: number,
|
|
44
|
-
)
|
|
45
|
+
) => [
|
|
45
46
|
<CircleLayer
|
|
46
47
|
key="mapboxUserLocationPluseCircle"
|
|
47
48
|
id="mapboxUserLocationPluseCircle"
|
|
@@ -114,7 +115,7 @@ interface UserLocationProps {
|
|
|
114
115
|
*
|
|
115
116
|
* NOTE: Forking maintainer does not understand the above comment.
|
|
116
117
|
*/
|
|
117
|
-
children?:
|
|
118
|
+
children?: ReactNode;
|
|
118
119
|
}
|
|
119
120
|
|
|
120
121
|
interface UserLocationState {
|
|
@@ -134,7 +135,7 @@ export interface UserLocationRef {
|
|
|
134
135
|
_onLocationUpdate: (location: Location | null) => void;
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
const UserLocation = memo(
|
|
138
|
+
export const UserLocation = memo(
|
|
138
139
|
forwardRef<UserLocationRef, UserLocationProps>(
|
|
139
140
|
(
|
|
140
141
|
{
|
|
@@ -163,7 +164,7 @@ const UserLocation = memo(
|
|
|
163
164
|
ref,
|
|
164
165
|
(): UserLocationRef => ({
|
|
165
166
|
/**
|
|
166
|
-
* Whether to start or stop listening to the
|
|
167
|
+
* Whether to start or stop listening to the LocationManager
|
|
167
168
|
*
|
|
168
169
|
* Notice, that listening will start automatically when
|
|
169
170
|
* either `onUpdate` or `visible` are set
|
|
@@ -175,7 +176,7 @@ const UserLocation = memo(
|
|
|
175
176
|
setLocationManager,
|
|
176
177
|
/**
|
|
177
178
|
*
|
|
178
|
-
* If
|
|
179
|
+
* If LocationManager should be running
|
|
179
180
|
*
|
|
180
181
|
* @return {boolean}
|
|
181
182
|
*/
|
|
@@ -194,7 +195,7 @@ const UserLocation = memo(
|
|
|
194
195
|
return;
|
|
195
196
|
}
|
|
196
197
|
|
|
197
|
-
|
|
198
|
+
LocationManager.setMinDisplacement(minDisplacement ?? 0);
|
|
198
199
|
});
|
|
199
200
|
|
|
200
201
|
return (): void => {
|
|
@@ -205,7 +206,7 @@ const UserLocation = memo(
|
|
|
205
206
|
}, []);
|
|
206
207
|
|
|
207
208
|
useEffect(() => {
|
|
208
|
-
|
|
209
|
+
LocationManager.setMinDisplacement(minDisplacement ?? 0);
|
|
209
210
|
}, [minDisplacement]);
|
|
210
211
|
|
|
211
212
|
useEffect(() => {
|
|
@@ -227,11 +228,11 @@ const UserLocation = memo(
|
|
|
227
228
|
locationManagerRunning.current = running;
|
|
228
229
|
|
|
229
230
|
if (running) {
|
|
230
|
-
|
|
231
|
-
const location = await
|
|
231
|
+
LocationManager.addListener(_onLocationUpdate);
|
|
232
|
+
const location = await LocationManager.getLastKnownLocation();
|
|
232
233
|
_onLocationUpdate(location);
|
|
233
234
|
} else {
|
|
234
|
-
|
|
235
|
+
LocationManager.removeListener(_onLocationUpdate);
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
}
|
|
@@ -303,5 +304,3 @@ const UserLocation = memo(
|
|
|
303
304
|
},
|
|
304
305
|
),
|
|
305
306
|
);
|
|
306
|
-
|
|
307
|
-
export default UserLocation;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { featureCollection } from "@turf/helpers";
|
|
2
|
-
import { forwardRef, memo, useImperativeHandle } from "react";
|
|
2
|
+
import { forwardRef, memo, type ReactNode, useImperativeHandle } from "react";
|
|
3
3
|
import {
|
|
4
4
|
NativeModules,
|
|
5
5
|
type NativeSyntheticEvent,
|
|
6
6
|
requireNativeComponent,
|
|
7
7
|
} from "react-native";
|
|
8
8
|
|
|
9
|
-
import useAbstractSource from "../hooks/useAbstractSource";
|
|
10
|
-
import useNativeBridge from "../hooks/useNativeBridge";
|
|
9
|
+
import { useAbstractSource } from "../hooks/useAbstractSource";
|
|
10
|
+
import { useNativeBridge } from "../hooks/useNativeBridge";
|
|
11
11
|
import { type BaseProps } from "../types/BaseProps";
|
|
12
12
|
import { type FilterExpression } from "../types/MapLibreRNStyles";
|
|
13
13
|
import { type OnPressEvent } from "../types/OnPressEvent";
|
|
14
14
|
import { cloneReactChildrenWithProps, isFunction, isAndroid } from "../utils";
|
|
15
15
|
import { getFilter } from "../utils/filterUtils";
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
18
18
|
|
|
19
19
|
export const NATIVE_MODULE_NAME = "MLRNVectorSource";
|
|
20
20
|
|
|
@@ -77,7 +77,7 @@ interface VectorSourceProps extends BaseProps {
|
|
|
77
77
|
height: number;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
children?:
|
|
80
|
+
children?: ReactNode;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
type NativeProps = VectorSourceProps;
|
|
@@ -89,11 +89,11 @@ const MLRNVectorSource =
|
|
|
89
89
|
* VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map.
|
|
90
90
|
* The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification.
|
|
91
91
|
*/
|
|
92
|
-
const VectorSource = memo(
|
|
92
|
+
export const VectorSource = memo(
|
|
93
93
|
forwardRef(
|
|
94
94
|
(
|
|
95
95
|
{
|
|
96
|
-
id =
|
|
96
|
+
id = MLRNModule.StyleSource.DefaultSourceID,
|
|
97
97
|
...props
|
|
98
98
|
}: VectorSourceProps,
|
|
99
99
|
ref,
|
|
@@ -198,5 +198,3 @@ const VectorSource = memo(
|
|
|
198
198
|
},
|
|
199
199
|
),
|
|
200
200
|
);
|
|
201
|
-
|
|
202
|
-
export default VectorSource;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useRef } from "react";
|
|
1
|
+
import { type Component, useMemo, useRef } from "react";
|
|
2
2
|
import { processColor, type NativeMethods } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { type BaseProps } from "../types/BaseProps";
|
|
@@ -60,7 +60,7 @@ export interface NativeBaseProps {
|
|
|
60
60
|
reactStyle?: { [key: string]: StyleValue };
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export
|
|
63
|
+
export function useAbstractLayer<
|
|
64
64
|
Props extends BaseProps,
|
|
65
65
|
NativeProps extends NativeBaseProps,
|
|
66
66
|
>(
|
|
@@ -68,13 +68,13 @@ export default function useAbstractLayer<
|
|
|
68
68
|
): {
|
|
69
69
|
baseProps: Props & BaseLayerProps;
|
|
70
70
|
setNativeLayer: (
|
|
71
|
-
instance: (
|
|
71
|
+
instance: (Component<NativeProps> & Readonly<NativeMethods>) | null,
|
|
72
72
|
) => void;
|
|
73
73
|
getStyleTypeFormatter: (styleType: string) => typeof processColor | undefined;
|
|
74
74
|
setNativeProps: (nativeProps: { [key: string]: unknown }) => void;
|
|
75
75
|
} {
|
|
76
76
|
const nativeLayer = useRef<
|
|
77
|
-
(
|
|
77
|
+
(Component<NativeProps> & Readonly<NativeMethods>) | null
|
|
78
78
|
>(null);
|
|
79
79
|
|
|
80
80
|
const baseProps = useMemo(() => {
|
|
@@ -94,7 +94,7 @@ export default function useAbstractLayer<
|
|
|
94
94
|
}, [props]);
|
|
95
95
|
|
|
96
96
|
const setNativeLayer = (
|
|
97
|
-
instance: (
|
|
97
|
+
instance: (Component<NativeProps> & Readonly<NativeMethods>) | null,
|
|
98
98
|
): void => {
|
|
99
99
|
nativeLayer.current = instance;
|
|
100
100
|
};
|