@maplibre/maplibre-react-native 10.0.0-alpha.26 → 10.0.0-alpha.28
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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/android/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFactory.java +1 -1
- package/ios/RCTMLN/RCTMLNStyle.h +1 -1
- package/ios/RCTMLN/RCTMLNStyle.m +1 -1
- package/lib/commonjs/MLNModule.js +27 -0
- package/lib/commonjs/MLNModule.js.map +1 -0
- package/lib/commonjs/MapLibreRN.js +281 -0
- package/lib/commonjs/MapLibreRN.js.map +1 -0
- package/lib/commonjs/assets/png.d.js +2 -0
- package/lib/commonjs/assets/png.d.js.map +1 -0
- package/lib/commonjs/components/Annotation.js +109 -0
- package/lib/commonjs/components/Annotation.js.map +1 -0
- package/lib/commonjs/components/BackgroundLayer.js +33 -0
- package/lib/commonjs/components/BackgroundLayer.js.map +1 -0
- package/lib/commonjs/components/Callout.js +101 -0
- package/lib/commonjs/components/Callout.js.map +1 -0
- package/lib/commonjs/components/Camera.js +285 -0
- package/lib/commonjs/components/Camera.js.map +1 -0
- package/lib/commonjs/components/CircleLayer.js +37 -0
- package/lib/commonjs/components/CircleLayer.js.map +1 -0
- package/lib/commonjs/components/FillExtrusionLayer.js +36 -0
- package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -0
- package/lib/commonjs/components/FillLayer.js +36 -0
- package/lib/commonjs/components/FillLayer.js.map +1 -0
- package/lib/commonjs/components/HeadingIndicator.js +28 -0
- package/lib/commonjs/components/HeadingIndicator.js.map +1 -0
- package/lib/commonjs/components/HeatmapLayer.js +35 -0
- package/lib/commonjs/components/HeatmapLayer.js.map +1 -0
- package/lib/commonjs/components/ImageSource.js +42 -0
- package/lib/commonjs/components/ImageSource.js.map +1 -0
- package/lib/commonjs/components/Images.js +80 -0
- package/lib/commonjs/components/Images.js.map +1 -0
- package/lib/commonjs/components/Light.js +32 -0
- package/lib/commonjs/components/Light.js.map +1 -0
- package/lib/commonjs/components/LineLayer.js +36 -0
- package/lib/commonjs/components/LineLayer.js.map +1 -0
- package/lib/commonjs/components/MapView.js +463 -0
- package/lib/commonjs/components/MapView.js.map +1 -0
- package/lib/commonjs/components/MarkerView.js +61 -0
- package/lib/commonjs/components/MarkerView.js.map +1 -0
- package/lib/commonjs/components/NativeUserLocation.js +17 -0
- package/lib/commonjs/components/NativeUserLocation.js.map +1 -0
- package/lib/commonjs/components/PointAnnotation.js +121 -0
- package/lib/commonjs/components/PointAnnotation.js.map +1 -0
- package/lib/commonjs/components/RasterLayer.js +32 -0
- package/lib/commonjs/components/RasterLayer.js.map +1 -0
- package/lib/commonjs/components/RasterSource.js +67 -0
- package/lib/commonjs/components/RasterSource.js.map +1 -0
- package/lib/commonjs/components/ShapeSource.js +203 -0
- package/lib/commonjs/components/ShapeSource.js.map +1 -0
- package/lib/commonjs/components/Style.js +266 -0
- package/lib/commonjs/components/Style.js.map +1 -0
- package/lib/commonjs/components/SymbolLayer.js +53 -0
- package/lib/commonjs/components/SymbolLayer.js.map +1 -0
- package/lib/commonjs/components/UserLocation.js +188 -0
- package/lib/commonjs/components/UserLocation.js.map +1 -0
- package/lib/commonjs/components/VectorSource.js +129 -0
- package/lib/commonjs/components/VectorSource.js.map +1 -0
- package/lib/commonjs/hooks/useAbstractLayer.js +53 -0
- package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -0
- package/lib/commonjs/hooks/useAbstractSource.js +24 -0
- package/lib/commonjs/hooks/useAbstractSource.js.map +1 -0
- package/lib/commonjs/hooks/useNativeBridge.js +84 -0
- package/lib/commonjs/hooks/useNativeBridge.js.map +1 -0
- package/lib/commonjs/hooks/useNativeRef.js +14 -0
- package/lib/commonjs/hooks/useNativeRef.js.map +1 -0
- package/lib/commonjs/hooks/useOnce.js +16 -0
- package/lib/commonjs/hooks/useOnce.js.map +1 -0
- package/lib/commonjs/index.js +23 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/modules/location/locationManager.js +91 -0
- package/lib/commonjs/modules/location/locationManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +37 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflinePack.js +40 -0
- package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -0
- package/lib/commonjs/modules/offline/offlineManager.js +346 -0
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js +58 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -0
- package/lib/commonjs/modules/snapshot/snapshotManager.js +66 -0
- package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -0
- package/lib/commonjs/requestAndroidLocationPermissions.js +25 -0
- package/lib/commonjs/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/commonjs/types/BaseProps.js +2 -0
- package/lib/commonjs/types/BaseProps.js.map +1 -0
- package/lib/commonjs/types/CameraMode.js +14 -0
- package/lib/commonjs/types/CameraMode.js.map +1 -0
- package/lib/commonjs/types/MapLibreRNEvent.js +6 -0
- package/lib/commonjs/types/MapLibreRNEvent.js.map +1 -0
- package/lib/commonjs/types/OnPressEvent.js +2 -0
- package/lib/commonjs/types/OnPressEvent.js.map +1 -0
- package/lib/commonjs/types/StyleURL.js +11 -0
- package/lib/commonjs/types/StyleURL.js.map +1 -0
- package/lib/commonjs/utils/BridgeValue.js +59 -0
- package/lib/commonjs/utils/BridgeValue.js.map +1 -0
- package/lib/commonjs/utils/Logger.js +118 -0
- package/lib/commonjs/utils/Logger.js.map +1 -0
- package/lib/commonjs/utils/MapLibreRNStyles.d.js +181 -0
- package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +1 -0
- package/lib/commonjs/utils/StyleValue.js +39 -0
- package/lib/commonjs/utils/StyleValue.js.map +1 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +95 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -0
- package/lib/commonjs/utils/animated/Animated.js +47 -0
- package/lib/commonjs/utils/animated/Animated.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +92 -0
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +40 -0
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedPoint.js +111 -0
- package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +137 -0
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -0
- package/lib/commonjs/utils/animated/AnimatedShape.js +75 -0
- package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -0
- package/lib/commonjs/utils/deprecation.js +31 -0
- package/lib/commonjs/utils/deprecation.js.map +1 -0
- package/lib/commonjs/utils/filterUtils.js +13 -0
- package/lib/commonjs/utils/filterUtils.js.map +1 -0
- package/lib/commonjs/utils/index.js +97 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/makeNativeBounds.js +11 -0
- package/lib/commonjs/utils/makeNativeBounds.js.map +1 -0
- package/lib/commonjs/utils/styleMap.js +255 -0
- package/lib/commonjs/utils/styleMap.js.map +1 -0
- package/lib/module/MLNModule.js +15 -0
- package/lib/module/MLNModule.js.map +1 -0
- package/lib/module/MapLibreRN.js +37 -0
- package/lib/module/MapLibreRN.js.map +1 -0
- package/lib/module/assets/heading.png +0 -0
- package/lib/module/assets/heading@2x.png +0 -0
- package/lib/module/assets/heading@3x.png +0 -0
- package/lib/module/assets/png.d.js +2 -0
- package/lib/module/assets/png.d.js.map +1 -0
- package/lib/module/components/Annotation.js +104 -0
- package/lib/module/components/Annotation.js.map +1 -0
- package/lib/module/components/BackgroundLayer.js +28 -0
- package/lib/module/components/BackgroundLayer.js.map +1 -0
- package/lib/module/components/Callout.js +97 -0
- package/lib/module/components/Callout.js.map +1 -0
- package/lib/module/components/Camera.js +280 -0
- package/lib/module/components/Camera.js.map +1 -0
- package/lib/module/components/CircleLayer.js +32 -0
- package/lib/module/components/CircleLayer.js.map +1 -0
- package/lib/module/components/FillExtrusionLayer.js +31 -0
- package/lib/module/components/FillExtrusionLayer.js.map +1 -0
- package/lib/module/components/FillLayer.js +31 -0
- package/lib/module/components/FillLayer.js.map +1 -0
- package/lib/module/components/HeadingIndicator.js +23 -0
- package/lib/module/components/HeadingIndicator.js.map +1 -0
- package/lib/module/components/HeatmapLayer.js +30 -0
- package/lib/module/components/HeatmapLayer.js.map +1 -0
- package/lib/module/components/ImageSource.js +37 -0
- package/lib/module/components/ImageSource.js.map +1 -0
- package/lib/module/components/Images.js +76 -0
- package/lib/module/components/Images.js.map +1 -0
- package/lib/module/components/Light.js +27 -0
- package/lib/module/components/Light.js.map +1 -0
- package/lib/module/components/LineLayer.js +31 -0
- package/lib/module/components/LineLayer.js.map +1 -0
- package/lib/module/components/MapView.js +458 -0
- package/lib/module/components/MapView.js.map +1 -0
- package/lib/module/components/MarkerView.js +56 -0
- package/lib/module/components/MarkerView.js.map +1 -0
- package/lib/module/components/NativeUserLocation.js +13 -0
- package/lib/module/components/NativeUserLocation.js.map +1 -0
- package/lib/module/components/PointAnnotation.js +116 -0
- package/lib/module/components/PointAnnotation.js.map +1 -0
- package/lib/module/components/RasterLayer.js +27 -0
- package/lib/module/components/RasterLayer.js.map +1 -0
- package/lib/module/components/RasterSource.js +62 -0
- package/lib/module/components/RasterSource.js.map +1 -0
- package/lib/module/components/ShapeSource.js +198 -0
- package/lib/module/components/ShapeSource.js.map +1 -0
- package/lib/module/components/Style.js +261 -0
- package/lib/module/components/Style.js.map +1 -0
- package/lib/module/components/SymbolLayer.js +48 -0
- package/lib/module/components/SymbolLayer.js.map +1 -0
- package/lib/module/components/UserLocation.js +182 -0
- package/lib/module/components/UserLocation.js.map +1 -0
- package/lib/module/components/VectorSource.js +124 -0
- package/lib/module/components/VectorSource.js.map +1 -0
- package/lib/module/hooks/useAbstractLayer.js +49 -0
- package/lib/module/hooks/useAbstractLayer.js.map +1 -0
- package/lib/module/hooks/useAbstractSource.js +20 -0
- package/lib/module/hooks/useAbstractSource.js.map +1 -0
- package/lib/module/hooks/useNativeBridge.js +80 -0
- package/lib/module/hooks/useNativeBridge.js.map +1 -0
- package/lib/module/hooks/useNativeRef.js +10 -0
- package/lib/module/hooks/useNativeRef.js.map +1 -0
- package/lib/module/hooks/useOnce.js +12 -0
- package/lib/module/hooks/useOnce.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/modules/location/locationManager.js +87 -0
- package/lib/module/modules/location/locationManager.js.map +1 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js +33 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -0
- package/lib/module/modules/offline/OfflinePack.js +36 -0
- package/lib/module/modules/offline/OfflinePack.js.map +1 -0
- package/lib/module/modules/offline/offlineManager.js +341 -0
- package/lib/module/modules/offline/offlineManager.js.map +1 -0
- package/lib/module/modules/snapshot/SnapshotOptions.js +53 -0
- package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -0
- package/lib/module/modules/snapshot/snapshotManager.js +61 -0
- package/lib/module/modules/snapshot/snapshotManager.js.map +1 -0
- package/lib/module/requestAndroidLocationPermissions.js +21 -0
- package/lib/module/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/module/types/BaseProps.js +2 -0
- package/lib/module/types/BaseProps.js.map +1 -0
- package/lib/module/types/CameraMode.js +10 -0
- package/lib/module/types/CameraMode.js.map +1 -0
- package/lib/module/types/MapLibreRNEvent.js +4 -0
- package/lib/module/types/MapLibreRNEvent.js.map +1 -0
- package/lib/module/types/OnPressEvent.js +2 -0
- package/lib/module/types/OnPressEvent.js.map +1 -0
- package/lib/module/types/StyleURL.js +7 -0
- package/lib/module/types/StyleURL.js.map +1 -0
- package/lib/module/utils/BridgeValue.js +54 -0
- package/lib/module/utils/BridgeValue.js.map +1 -0
- package/lib/module/utils/Logger.js +114 -0
- package/lib/module/utils/Logger.js.map +1 -0
- package/lib/module/utils/MapLibreRNStyles.d.js +180 -0
- package/lib/module/utils/MapLibreRNStyles.d.js.map +1 -0
- package/lib/module/utils/StyleValue.js +34 -0
- package/lib/module/utils/StyleValue.js.map +1 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +92 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -0
- package/lib/module/utils/animated/Animated.js +42 -0
- package/lib/module/utils/animated/Animated.js.map +1 -0
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js +87 -0
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -0
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +36 -0
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -0
- package/lib/module/utils/animated/AnimatedPoint.js +107 -0
- package/lib/module/utils/animated/AnimatedPoint.js.map +1 -0
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +131 -0
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -0
- package/lib/module/utils/animated/AnimatedShape.js +71 -0
- package/lib/module/utils/animated/AnimatedShape.js.map +1 -0
- package/lib/module/utils/deprecation.js +27 -0
- package/lib/module/utils/deprecation.js.map +1 -0
- package/lib/module/utils/filterUtils.js +9 -0
- package/lib/module/utils/filterUtils.js.map +1 -0
- package/lib/module/utils/index.js +81 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/makeNativeBounds.js +7 -0
- package/lib/module/utils/makeNativeBounds.js.map +1 -0
- package/lib/module/utils/styleMap.js +249 -0
- package/lib/module/utils/styleMap.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/MLNModule.d.ts +21 -0
- package/lib/typescript/commonjs/src/MLNModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +42 -0
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +21 -0
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +14 -0
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Callout.d.ts +35 -0
- package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Camera.d.ts +134 -0
- package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +8 -0
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts +31 -0
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Images.d.ts +33 -0
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Light.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MapView.d.ts +235 -0
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts +44 -0
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +26 -0
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +91 -0
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +14 -0
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts +53 -0
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +124 -0
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Style.d.ts +81 -0
- package/lib/typescript/commonjs/src/components/Style.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +22 -0
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts +70 -0
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts +70 -0
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +62 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +7 -0
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +21 -0
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +8 -0
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts +64 -0
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +210 -0
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +42 -0
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts +52 -0
- package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/requestAndroidLocationPermissions.d.ts +2 -0
- package/lib/typescript/commonjs/src/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/BaseProps.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/CameraMode.d.ts +7 -0
- package/lib/typescript/commonjs/src/types/CameraMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts +6 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts +12 -0
- package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/StyleURL.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts +29 -0
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/Logger.d.ts +52 -0
- package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +10 -0
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +36 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +33 -0
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +40 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +11 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +31 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +54 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +27 -0
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts +6 -0
- package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +3 -0
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts +21 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/makeNativeBounds.d.ts +2 -0
- package/lib/typescript/commonjs/src/utils/makeNativeBounds.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts +231 -0
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/MLNModule.d.ts +21 -0
- package/lib/typescript/module/src/MLNModule.d.ts.map +1 -0
- package/lib/typescript/module/src/MapLibreRN.d.ts +42 -0
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Annotation.d.ts +21 -0
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +14 -0
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Callout.d.ts +35 -0
- package/lib/typescript/module/src/components/Callout.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Camera.d.ts +134 -0
- package/lib/typescript/module/src/components/Camera.d.ts.map +1 -0
- package/lib/typescript/module/src/components/CircleLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/FillLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts +8 -0
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -0
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ImageSource.d.ts +31 -0
- package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Images.d.ts +33 -0
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Light.d.ts +17 -0
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -0
- package/lib/typescript/module/src/components/LineLayer.d.ts +17 -0
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MapView.d.ts +235 -0
- package/lib/typescript/module/src/components/MapView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MarkerView.d.ts +44 -0
- package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts +26 -0
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/PointAnnotation.d.ts +91 -0
- package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/RasterLayer.d.ts +14 -0
- package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/RasterSource.d.ts +53 -0
- package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ShapeSource.d.ts +124 -0
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Style.d.ts +81 -0
- package/lib/typescript/module/src/components/Style.d.ts.map +1 -0
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +22 -0
- package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UserLocation.d.ts +70 -0
- package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/module/src/components/VectorSource.d.ts +70 -0
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +62 -0
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +7 -0
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +21 -0
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts +8 -0
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useOnce.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/location/locationManager.d.ts +64 -0
- package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +21 -0
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +24 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +210 -0
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +42 -0
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts +52 -0
- package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts.map +1 -0
- package/lib/typescript/module/src/requestAndroidLocationPermissions.d.ts +2 -0
- package/lib/typescript/module/src/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/module/src/types/BaseProps.d.ts +4 -0
- package/lib/typescript/module/src/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/module/src/types/CameraMode.d.ts +7 -0
- package/lib/typescript/module/src/types/CameraMode.d.ts.map +1 -0
- package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts +6 -0
- package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/types/OnPressEvent.d.ts +12 -0
- package/lib/typescript/module/src/types/OnPressEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/types/StyleURL.d.ts +4 -0
- package/lib/typescript/module/src/types/StyleURL.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/BridgeValue.d.ts +29 -0
- package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/Logger.d.ts +52 -0
- package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/StyleValue.d.ts +10 -0
- package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +36 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/Animated.d.ts +33 -0
- package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +40 -0
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +11 -0
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +31 -0
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +54 -0
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +27 -0
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/deprecation.d.ts +6 -0
- package/lib/typescript/module/src/utils/deprecation.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/filterUtils.d.ts +3 -0
- package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/index.d.ts +21 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/makeNativeBounds.d.ts +2 -0
- package/lib/typescript/module/src/utils/makeNativeBounds.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/styleMap.d.ts +231 -0
- package/lib/typescript/module/src/utils/styleMap.d.ts.map +1 -0
- package/package.json +83 -6
- package/plugin/build/withMapLibre.d.ts +1 -1
- package/{javascript/Maplibre.ts → src/MapLibreRN.ts} +1 -1
- package/src/assets/heading.png +0 -0
- package/src/assets/heading@2x.png +0 -0
- package/src/assets/heading@3x.png +0 -0
- package/src/assets/png.d.ts +4 -0
- package/{javascript → src}/components/Annotation.tsx +8 -8
- package/{javascript → src}/components/BackgroundLayer.tsx +4 -4
- package/{javascript → src}/components/Callout.tsx +5 -5
- package/{javascript → src}/components/Camera.tsx +5 -5
- package/{javascript → src}/components/CircleLayer.tsx +4 -4
- package/{javascript → src}/components/FillExtrusionLayer.tsx +4 -4
- package/{javascript → src}/components/FillLayer.tsx +4 -4
- package/{javascript → src}/components/HeadingIndicator.tsx +3 -4
- package/{javascript → src}/components/HeatmapLayer.tsx +4 -4
- package/{javascript → src}/components/ImageSource.tsx +2 -2
- package/{javascript → src}/components/Images.tsx +7 -7
- package/{javascript → src}/components/Light.tsx +6 -4
- package/{javascript → src}/components/LineLayer.tsx +4 -4
- package/{javascript → src}/components/MapView.tsx +12 -11
- package/{javascript → src}/components/MarkerView.tsx +2 -2
- package/{javascript → src}/components/NativeUserLocation.tsx +1 -1
- package/{javascript → src}/components/PointAnnotation.tsx +5 -5
- package/{javascript → src}/components/RasterLayer.tsx +4 -4
- package/{javascript → src}/components/RasterSource.tsx +1 -1
- package/{javascript → src}/components/ShapeSource.tsx +13 -9
- package/{javascript → src}/components/Style.tsx +32 -29
- package/{javascript → src}/components/SymbolLayer.tsx +7 -7
- package/{javascript → src}/components/UserLocation.tsx +18 -8
- package/{javascript → src}/components/VectorSource.tsx +6 -6
- package/{javascript → src}/hooks/useAbstractLayer.ts +9 -9
- package/{javascript → src}/hooks/useAbstractSource.ts +2 -2
- package/{javascript → src}/hooks/useNativeBridge.ts +2 -2
- package/{javascript → src}/hooks/useNativeRef.ts +2 -2
- package/src/index.ts +4 -0
- package/{javascript → src}/modules/location/locationManager.ts +1 -1
- package/{javascript → src}/modules/offline/offlineManager.ts +18 -13
- package/{javascript → src}/modules/snapshot/snapshotManager.ts +1 -1
- package/{javascript → src}/requestAndroidLocationPermissions.ts +3 -3
- package/src/types/BaseProps.ts +3 -0
- package/src/types/MapLibreRNEvent.ts +7 -0
- package/{javascript → src}/types/OnPressEvent.ts +1 -3
- package/src/types/StyleURL.ts +3 -0
- package/{javascript → src}/utils/BridgeValue.ts +8 -8
- package/{javascript → src}/utils/Logger.ts +1 -1
- package/{javascript/utils/MaplibreStyles.d.ts → src/utils/MapLibreRNStyles.d.ts} +3 -1
- package/{javascript → src}/utils/StyleValue.ts +2 -2
- package/{javascript → src}/utils/animated/Animated.ts +2 -2
- package/{javascript → src}/utils/animated/AnimatedCoordinatesArray.ts +24 -19
- package/{javascript → src}/utils/animated/AnimatedPoint.ts +4 -4
- package/{javascript → src}/utils/animated/AnimatedRouteCoordinatesArray.ts +14 -9
- package/{javascript → src}/utils/filterUtils.ts +1 -1
- package/{javascript → src}/utils/index.ts +13 -12
- package/{javascript → src}/utils/styleMap.ts +1 -1
- package/.eslintrc.js +0 -5
- package/.git-blame-ignore-revs +0 -3
- package/.gitattributes +0 -1
- package/.nvmrc +0 -1
- package/.sonarcloud.properties +0 -15
- package/CODE_OF_CONDUCT.md +0 -2
- package/CONTRIBUTING.md +0 -61
- package/RELEASE.md +0 -30
- package/assets/indoor_building_map_android.png +0 -0
- package/assets/indoor_building_map_ios.png +0 -0
- package/babel.config.js +0 -12
- package/docs/Annotation.md +0 -29
- package/docs/Annotations.md +0 -12
- package/docs/BackgroundLayer.md +0 -166
- package/docs/Callout.md +0 -16
- package/docs/Camera.md +0 -132
- package/docs/CircleLayer.md +0 -487
- package/docs/CustomHttpHeaders.md +0 -87
- package/docs/FillExtrusionLayer.md +0 -349
- package/docs/FillLayer.md +0 -317
- package/docs/GettingStarted.md +0 -113
- package/docs/HeadingIndicator.md +0 -11
- package/docs/HeatmapLayer.md +0 -214
- package/docs/ImageSource.md +0 -14
- package/docs/Images.md +0 -15
- package/docs/Light.md +0 -167
- package/docs/LineLayer.md +0 -603
- package/docs/Logger.md +0 -23
- package/docs/MapLibreGL.md +0 -65
- package/docs/MapView.md +0 -178
- package/docs/MarkerView.md +0 -17
- package/docs/NativeUserLocation.md +0 -13
- package/docs/PointAnnotation.md +0 -28
- package/docs/RasterLayer.md +0 -357
- package/docs/RasterSource.md +0 -19
- package/docs/ShapeSource.md +0 -104
- package/docs/Style.md +0 -11
- package/docs/StyleSheet.md +0 -451
- package/docs/SymbolLayer.md +0 -1752
- package/docs/UserLocation.md +0 -43
- package/docs/VectorSource.md +0 -50
- package/docs/coordinates.md +0 -7
- package/docs/docs.json +0 -5390
- package/docs/location.md +0 -7
- package/docs/offlineManager.md +0 -231
- package/docs/snapshotManager.md +0 -54
- package/ios/RCTMLN/index.d.ts +0 -1183
- package/javascript/index.ts +0 -4
- package/javascript/types/BaseProps.ts +0 -5
- package/javascript/types/index.ts +0 -11
- package/jest-setup.ts +0 -113
- package/jest.config.js +0 -8
- package/plugin/install.md +0 -25
- package/scripts/.eslintrc.js +0 -3
- package/scripts/codegen.ts +0 -340
- package/scripts/templates/MaplibreStyles.ts.ejs +0 -100
- package/scripts/templates/RCTMLNStyle.h.ejs +0 -34
- package/scripts/templates/RCTMLNStyle.m.ejs +0 -98
- package/scripts/templates/RCTMLNStyleFactory.java.ejs +0 -108
- package/scripts/templates/component.md.ejs +0 -125
- package/scripts/templates/index.d.ts.ejs +0 -86
- package/scripts/templates/styleMap.ts.ejs +0 -86
- package/scripts/utils/DocJSONBuilder.ts +0 -463
- package/scripts/utils/JSDocNodeTree.ts +0 -135
- package/scripts/utils/MarkdownBuilder.ts +0 -44
- package/scripts/utils/TemplateHelpers.ts +0 -499
- package/scripts/utils/getNativeVersion.ts +0 -53
- package/tsconfig.json +0 -22
- /package/{assets → lib/commonjs/assets}/heading.png +0 -0
- /package/{assets → lib/commonjs/assets}/heading@2x.png +0 -0
- /package/{assets → lib/commonjs/assets}/heading@3x.png +0 -0
- /package/{javascript → src}/MLNModule.ts +0 -0
- /package/{javascript → src}/hooks/useOnce.ts +0 -0
- /package/{javascript → src}/modules/offline/OfflineCreatePackOptions.ts +0 -0
- /package/{javascript → src}/modules/offline/OfflinePack.ts +0 -0
- /package/{javascript → src}/modules/snapshot/SnapshotOptions.ts +0 -0
- /package/{javascript → src}/types/CameraMode.ts +0 -0
- /package/{javascript → src}/utils/animated/AbstractAnimatedCoordinates.ts +0 -0
- /package/{javascript → src}/utils/animated/AnimatedExtractCoordinateFromArray.ts +0 -0
- /package/{javascript → src}/utils/animated/AnimatedShape.ts +0 -0
- /package/{javascript → src}/utils/deprecation.ts +0 -0
- /package/{javascript → src}/utils/makeNativeBounds.ts +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import debounce from "debounce";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
3
|
Component,
|
|
4
|
+
forwardRef,
|
|
4
5
|
memo,
|
|
5
|
-
ReactElement,
|
|
6
|
-
ReactNode,
|
|
6
|
+
type ReactElement,
|
|
7
|
+
type ReactNode,
|
|
7
8
|
useCallback,
|
|
8
9
|
useEffect,
|
|
9
10
|
useImperativeHandle,
|
|
@@ -16,18 +17,18 @@ import {
|
|
|
16
17
|
StyleSheet,
|
|
17
18
|
NativeModules,
|
|
18
19
|
requireNativeComponent,
|
|
19
|
-
ViewProps,
|
|
20
|
-
NativeMethods,
|
|
21
|
-
NativeSyntheticEvent,
|
|
20
|
+
type ViewProps,
|
|
21
|
+
type NativeMethods,
|
|
22
|
+
type NativeSyntheticEvent,
|
|
22
23
|
} from "react-native";
|
|
23
24
|
|
|
24
25
|
import useNativeBridge from "../hooks/useNativeBridge";
|
|
25
26
|
import useOnce from "../hooks/useOnce";
|
|
26
|
-
import { Location } from "../modules/location/locationManager";
|
|
27
|
-
import BaseProps from "../types/BaseProps";
|
|
27
|
+
import { type Location } from "../modules/location/locationManager";
|
|
28
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
28
29
|
import { isFunction, isAndroid } from "../utils";
|
|
29
30
|
import Logger from "../utils/Logger";
|
|
30
|
-
import { FilterExpression } from "../utils/
|
|
31
|
+
import { type FilterExpression } from "../utils/MapLibreRNStyles";
|
|
31
32
|
import { getFilter } from "../utils/filterUtils";
|
|
32
33
|
|
|
33
34
|
const MapLibreGL = NativeModules.MLNModule;
|
|
@@ -284,7 +285,7 @@ export interface MapViewRef {
|
|
|
284
285
|
* MapView backed by MapLibre Native
|
|
285
286
|
*/
|
|
286
287
|
const MapView = memo(
|
|
287
|
-
|
|
288
|
+
forwardRef<MapViewRef, MapViewProps>(
|
|
288
289
|
(
|
|
289
290
|
{
|
|
290
291
|
localizeLabels = false,
|
|
@@ -760,7 +761,7 @@ const MapView = memo(
|
|
|
760
761
|
|
|
761
762
|
const contentInsetValue = useMemo(() => {
|
|
762
763
|
if (props.contentInset === undefined) {
|
|
763
|
-
return;
|
|
764
|
+
return undefined;
|
|
764
765
|
}
|
|
765
766
|
|
|
766
767
|
if (!Array.isArray(props.contentInset)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { point } from "@turf/helpers";
|
|
2
|
-
import
|
|
3
|
-
import { Platform, requireNativeComponent, ViewProps } from "react-native";
|
|
2
|
+
import { type ReactElement, useMemo } from "react";
|
|
3
|
+
import { Platform, requireNativeComponent, type ViewProps } from "react-native";
|
|
4
4
|
|
|
5
5
|
import PointAnnotation from "./PointAnnotation";
|
|
6
6
|
import { toJSONString } from "../utils";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { point } from "@turf/helpers";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
3
|
Component,
|
|
4
|
-
SyntheticEvent,
|
|
4
|
+
type SyntheticEvent,
|
|
5
5
|
forwardRef,
|
|
6
6
|
useImperativeHandle,
|
|
7
7
|
useRef,
|
|
8
|
-
ReactElement,
|
|
8
|
+
type ReactElement,
|
|
9
9
|
} from "react";
|
|
10
10
|
import {
|
|
11
11
|
Platform,
|
|
12
12
|
StyleSheet,
|
|
13
|
-
ViewProps,
|
|
13
|
+
type ViewProps,
|
|
14
14
|
requireNativeComponent,
|
|
15
15
|
} from "react-native";
|
|
16
16
|
|
|
17
|
-
import useNativeBridge, { RNMLEvent } from "../hooks/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 = "RCTMLNPointAnnotation";
|
|
@@ -2,11 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { NativeModules, requireNativeComponent } from "react-native";
|
|
3
3
|
|
|
4
4
|
import useAbstractLayer, {
|
|
5
|
-
BaseLayerProps,
|
|
6
|
-
NativeBaseProps,
|
|
5
|
+
type BaseLayerProps,
|
|
6
|
+
type NativeBaseProps,
|
|
7
7
|
} from "../hooks/useAbstractLayer";
|
|
8
|
-
import BaseProps from "../types/BaseProps";
|
|
9
|
-
import { RasterLayerStyleProps } from "../utils/
|
|
8
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
9
|
+
import { type RasterLayerStyleProps } from "../utils/MapLibreRNStyles";
|
|
10
10
|
|
|
11
11
|
const MapLibreGL = NativeModules.MLNModule;
|
|
12
12
|
|
|
@@ -3,7 +3,7 @@ import { NativeModules, requireNativeComponent } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
import useAbstractSource from "../hooks/useAbstractSource";
|
|
5
5
|
import useOnce from "../hooks/useOnce";
|
|
6
|
-
import BaseProps from "../types/BaseProps";
|
|
6
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
7
7
|
import { cloneReactChildrenWithProps } from "../utils";
|
|
8
8
|
|
|
9
9
|
const MapLibreGL = NativeModules.MLNModule;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
2
|
Component,
|
|
3
|
-
ReactElement,
|
|
3
|
+
type ReactElement,
|
|
4
|
+
forwardRef,
|
|
4
5
|
memo,
|
|
5
6
|
useImperativeHandle,
|
|
6
7
|
useRef,
|
|
7
8
|
} from "react";
|
|
8
9
|
import {
|
|
9
|
-
NativeMethods,
|
|
10
|
+
type NativeMethods,
|
|
10
11
|
NativeModules,
|
|
11
|
-
NativeSyntheticEvent,
|
|
12
|
+
type NativeSyntheticEvent,
|
|
12
13
|
requireNativeComponent,
|
|
13
14
|
} from "react-native";
|
|
14
15
|
|
|
15
16
|
import useNativeBridge from "../hooks/useNativeBridge";
|
|
16
|
-
import BaseProps from "../types/BaseProps";
|
|
17
|
-
import OnPressEvent from "../types/OnPressEvent";
|
|
17
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
18
|
+
import { type OnPressEvent } from "../types/OnPressEvent";
|
|
18
19
|
import {
|
|
19
20
|
cloneReactChildrenWithProps,
|
|
20
21
|
isAndroid,
|
|
21
22
|
isFunction,
|
|
22
23
|
toJSONString,
|
|
23
24
|
} from "../utils";
|
|
24
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
type ExpressionField,
|
|
27
|
+
type FilterExpression,
|
|
28
|
+
} from "../utils/MapLibreRNStyles";
|
|
25
29
|
import { copyPropertiesAsDeprecated } from "../utils/deprecation";
|
|
26
30
|
import { getFilter } from "../utils/filterUtils";
|
|
27
31
|
|
|
@@ -158,7 +162,7 @@ export interface ShapeSourceRef {
|
|
|
158
162
|
* The shape may be a url or a GeoJSON object
|
|
159
163
|
*/
|
|
160
164
|
const ShapeSource = memo(
|
|
161
|
-
|
|
165
|
+
forwardRef<ShapeSourceRef, ShapeSourceProps>(
|
|
162
166
|
(
|
|
163
167
|
{
|
|
164
168
|
id: shapeId = MapLibreGL.StyleSource.DefaultSourceID,
|
|
@@ -356,7 +360,7 @@ const ShapeSource = memo(
|
|
|
356
360
|
|
|
357
361
|
function _getShape(): string | undefined {
|
|
358
362
|
if (!props.shape) {
|
|
359
|
-
return;
|
|
363
|
+
return undefined;
|
|
360
364
|
}
|
|
361
365
|
return toJSONString(props.shape);
|
|
362
366
|
}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
2
|
useMemo,
|
|
3
3
|
useState,
|
|
4
4
|
useEffect,
|
|
5
|
-
ReactElement,
|
|
6
|
-
ComponentType,
|
|
5
|
+
type ReactElement,
|
|
6
|
+
type ComponentType,
|
|
7
7
|
} from "react";
|
|
8
8
|
|
|
9
|
-
import BackgroundLayer, { BackgroundLayerProps } from "./BackgroundLayer";
|
|
10
|
-
import CircleLayer, { CircleLayerProps } from "./CircleLayer";
|
|
9
|
+
import BackgroundLayer, { type BackgroundLayerProps } from "./BackgroundLayer";
|
|
10
|
+
import CircleLayer, { type CircleLayerProps } from "./CircleLayer";
|
|
11
11
|
import FillExtrusionLayer, {
|
|
12
|
-
FillExtrusionLayerProps,
|
|
12
|
+
type FillExtrusionLayerProps,
|
|
13
13
|
} from "./FillExtrusionLayer";
|
|
14
|
-
import FillLayer, { FillLayerProps } from "./FillLayer";
|
|
15
|
-
import HeatmapLayer, { HeatmapLayerProps } from "./HeatmapLayer";
|
|
14
|
+
import FillLayer, { type FillLayerProps } from "./FillLayer";
|
|
15
|
+
import HeatmapLayer, { type HeatmapLayerProps } from "./HeatmapLayer";
|
|
16
16
|
import ImageSource from "./ImageSource";
|
|
17
|
-
import LineLayer, { LineLayerProps } from "./LineLayer";
|
|
18
|
-
import RasterLayer, { RasterLayerProps } from "./RasterLayer";
|
|
17
|
+
import LineLayer, { type LineLayerProps } from "./LineLayer";
|
|
18
|
+
import RasterLayer, { type RasterLayerProps } from "./RasterLayer";
|
|
19
19
|
import RasterSource from "./RasterSource";
|
|
20
20
|
import ShapeSource from "./ShapeSource";
|
|
21
|
-
import SymbolLayer, { SymbolLayerProps } from "./SymbolLayer";
|
|
21
|
+
import SymbolLayer, { type SymbolLayerProps } from "./SymbolLayer";
|
|
22
22
|
import VectorSource from "./VectorSource";
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
type ExpressionField,
|
|
25
|
+
type FilterExpression,
|
|
26
|
+
} from "../utils/MapLibreRNStyles";
|
|
24
27
|
|
|
25
28
|
function toCamelCase(s: string): string {
|
|
26
29
|
return s.replace(/([-_][a-z])/gi, ($1) => {
|
|
@@ -59,7 +62,7 @@ type LayerProps =
|
|
|
59
62
|
| HeatmapLayerProps;
|
|
60
63
|
|
|
61
64
|
function getLayerComponentType(
|
|
62
|
-
layer:
|
|
65
|
+
layer: MapLibreJSONLayer,
|
|
63
66
|
): ComponentType<LayerProps> | null {
|
|
64
67
|
const { type } = layer;
|
|
65
68
|
|
|
@@ -87,7 +90,7 @@ function getLayerComponentType(
|
|
|
87
90
|
return null;
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
interface
|
|
93
|
+
interface MapLibreJSONLayer {
|
|
91
94
|
type: string;
|
|
92
95
|
paint: { [k: string]: unknown };
|
|
93
96
|
layout: { [k: string]: unknown };
|
|
@@ -100,7 +103,7 @@ interface MaplibreJSONLayer {
|
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
function asLayerComponent(
|
|
103
|
-
layer:
|
|
106
|
+
layer: MapLibreJSONLayer,
|
|
104
107
|
): ReactElement<LayerProps> | null {
|
|
105
108
|
const LayerComponent = getLayerComponentType(layer);
|
|
106
109
|
|
|
@@ -137,7 +140,7 @@ function asLayerComponent(
|
|
|
137
140
|
return <LayerComponent key={layer.id} id={layer.id} {...layerProps} />;
|
|
138
141
|
}
|
|
139
142
|
|
|
140
|
-
interface
|
|
143
|
+
interface MapLibreJSONSource {
|
|
141
144
|
type: string;
|
|
142
145
|
url?: string;
|
|
143
146
|
tiles?: string[];
|
|
@@ -175,7 +178,7 @@ type SourceProps = {
|
|
|
175
178
|
tms?: boolean;
|
|
176
179
|
};
|
|
177
180
|
|
|
178
|
-
function getTileSourceProps(source:
|
|
181
|
+
function getTileSourceProps(source: MapLibreJSONSource): SourceProps {
|
|
179
182
|
const sourceProps: Partial<SourceProps> = {};
|
|
180
183
|
if (source.url) {
|
|
181
184
|
sourceProps.url = source.url;
|
|
@@ -198,12 +201,12 @@ function getTileSourceProps(source: MaplibreJSONSource): SourceProps {
|
|
|
198
201
|
return sourceProps;
|
|
199
202
|
}
|
|
200
203
|
|
|
201
|
-
function getVectorSource(id: string, source:
|
|
204
|
+
function getVectorSource(id: string, source: MapLibreJSONSource): ReactElement {
|
|
202
205
|
const sourceProps = { ...getTileSourceProps(source) };
|
|
203
206
|
return <VectorSource key={id} id={id} {...sourceProps} />;
|
|
204
207
|
}
|
|
205
208
|
|
|
206
|
-
function getRasterSource(id: string, source:
|
|
209
|
+
function getRasterSource(id: string, source: MapLibreJSONSource): ReactElement {
|
|
207
210
|
const sourceProps: SourceProps & { tileSize?: number } = {
|
|
208
211
|
...getTileSourceProps(source),
|
|
209
212
|
};
|
|
@@ -213,7 +216,7 @@ function getRasterSource(id: string, source: MaplibreJSONSource): ReactElement {
|
|
|
213
216
|
return <RasterSource key={id} id={id} {...sourceProps} />;
|
|
214
217
|
}
|
|
215
218
|
|
|
216
|
-
function getImageSource(id: string, source:
|
|
219
|
+
function getImageSource(id: string, source: MapLibreJSONSource): ReactElement {
|
|
217
220
|
const sourceProps = {
|
|
218
221
|
url: source.url,
|
|
219
222
|
coordinates: source.coordinates,
|
|
@@ -223,7 +226,7 @@ function getImageSource(id: string, source: MaplibreJSONSource): ReactElement {
|
|
|
223
226
|
|
|
224
227
|
type ShapeSourceShape = (typeof ShapeSource.prototype.props)["shape"];
|
|
225
228
|
|
|
226
|
-
function getShapeSource(id: string, source:
|
|
229
|
+
function getShapeSource(id: string, source: MapLibreJSONSource): ReactElement {
|
|
227
230
|
const sourceProps: SourceProps & {
|
|
228
231
|
shape?: ShapeSourceShape;
|
|
229
232
|
cluster?: boolean;
|
|
@@ -268,7 +271,7 @@ function getShapeSource(id: string, source: MaplibreJSONSource): ReactElement {
|
|
|
268
271
|
|
|
269
272
|
function asSourceComponent(
|
|
270
273
|
id: string,
|
|
271
|
-
source:
|
|
274
|
+
source: MapLibreJSONSource,
|
|
272
275
|
): ReactElement | null {
|
|
273
276
|
switch (source.type) {
|
|
274
277
|
case "vector":
|
|
@@ -286,16 +289,16 @@ function asSourceComponent(
|
|
|
286
289
|
return null;
|
|
287
290
|
}
|
|
288
291
|
|
|
289
|
-
interface
|
|
290
|
-
layers?:
|
|
291
|
-
sources?: { [key: string]:
|
|
292
|
+
interface MapLibreJSON {
|
|
293
|
+
layers?: MapLibreJSONLayer[];
|
|
294
|
+
sources?: { [key: string]: MapLibreJSONSource };
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
interface StyleProps {
|
|
295
298
|
/**
|
|
296
299
|
* A JSON object conforming to the schema described in the MapLibre Style Specification, or a URL to such JSON.
|
|
297
300
|
*/
|
|
298
|
-
json?:
|
|
301
|
+
json?: MapLibreJSON | URL;
|
|
299
302
|
}
|
|
300
303
|
|
|
301
304
|
/**
|
|
@@ -307,7 +310,7 @@ interface StyleProps {
|
|
|
307
310
|
*/
|
|
308
311
|
const Style = (props: StyleProps): ReactElement => {
|
|
309
312
|
const [fetchedJson, setFetchedJson] = useState({});
|
|
310
|
-
const json:
|
|
313
|
+
const json: MapLibreJSON =
|
|
311
314
|
typeof props.json === "object" ? props.json : fetchedJson;
|
|
312
315
|
|
|
313
316
|
// Fetch style when props.json is a URL
|
|
@@ -352,8 +355,8 @@ const Style = (props: StyleProps): ReactElement => {
|
|
|
352
355
|
if (!sources || !Object.keys(sources)) {
|
|
353
356
|
return [];
|
|
354
357
|
}
|
|
355
|
-
return Object.
|
|
356
|
-
.map((id) => asSourceComponent(id,
|
|
358
|
+
return Object.entries(sources)
|
|
359
|
+
.map(([id, source]) => asSourceComponent(id, source))
|
|
357
360
|
.filter((x) => !!x);
|
|
358
361
|
}, [json]);
|
|
359
362
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Children, type ReactElement } from "react";
|
|
2
2
|
import { View, NativeModules, requireNativeComponent } from "react-native";
|
|
3
3
|
|
|
4
4
|
import useAbstractLayer, {
|
|
5
|
-
BaseLayerProps,
|
|
6
|
-
NativeBaseProps,
|
|
5
|
+
type BaseLayerProps,
|
|
6
|
+
type NativeBaseProps,
|
|
7
7
|
} from "../hooks/useAbstractLayer";
|
|
8
|
-
import BaseProps from "../types/BaseProps";
|
|
9
|
-
import { type SymbolLayerStyleProps } from "../utils/
|
|
8
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
9
|
+
import { type SymbolLayerStyleProps } from "../utils/MapLibreRNStyles";
|
|
10
10
|
|
|
11
11
|
const MapLibreGL = NativeModules.MLNModule;
|
|
12
12
|
|
|
@@ -50,11 +50,11 @@ const SymbolLayer: React.FC<SymbolLayerProps> = ({
|
|
|
50
50
|
const _shouldSnapshot = (): boolean => {
|
|
51
51
|
let isSnapshot = false;
|
|
52
52
|
|
|
53
|
-
if (
|
|
53
|
+
if (Children.count(props.children) <= 0) {
|
|
54
54
|
return isSnapshot;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Children.forEach(props.children, (child) => {
|
|
58
58
|
if (child?.type === View) {
|
|
59
59
|
isSnapshot = true;
|
|
60
60
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
memo,
|
|
4
|
+
type ReactElement,
|
|
5
|
+
useEffect,
|
|
6
|
+
useImperativeHandle,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from "react";
|
|
2
10
|
|
|
3
11
|
import Annotation from "./Annotation";
|
|
4
12
|
import CircleLayer from "./CircleLayer";
|
|
5
13
|
import HeadingIndicator from "./HeadingIndicator";
|
|
6
14
|
import NativeUserLocation from "./NativeUserLocation";
|
|
7
|
-
import locationManager, {
|
|
8
|
-
|
|
15
|
+
import locationManager, {
|
|
16
|
+
type Location,
|
|
17
|
+
} from "../modules/location/locationManager";
|
|
18
|
+
import { type CircleLayerStyleProps } from "../utils/MapLibreRNStyles";
|
|
9
19
|
|
|
10
20
|
const mapboxBlue = "rgba(51, 181, 229, 100)";
|
|
11
21
|
|
|
@@ -124,8 +134,8 @@ export interface UserLocationRef {
|
|
|
124
134
|
_onLocationUpdate: (location: Location | null) => void;
|
|
125
135
|
}
|
|
126
136
|
|
|
127
|
-
const UserLocation =
|
|
128
|
-
|
|
137
|
+
const UserLocation = memo(
|
|
138
|
+
forwardRef<UserLocationRef, UserLocationProps>(
|
|
129
139
|
(
|
|
130
140
|
{
|
|
131
141
|
animated = true,
|
|
@@ -141,11 +151,11 @@ const UserLocation = React.memo(
|
|
|
141
151
|
}: UserLocationProps,
|
|
142
152
|
ref,
|
|
143
153
|
) => {
|
|
144
|
-
const _isMounted =
|
|
145
|
-
const locationManagerRunning =
|
|
154
|
+
const _isMounted = useRef<boolean | null>(null);
|
|
155
|
+
const locationManagerRunning = useRef<boolean>(false);
|
|
146
156
|
|
|
147
157
|
const [userLocationState, setUserLocationState] =
|
|
148
|
-
|
|
158
|
+
useState<UserLocationState>({
|
|
149
159
|
shouldShowUserLocation: false,
|
|
150
160
|
});
|
|
151
161
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { featureCollection } from "@turf/helpers";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRef, memo, useImperativeHandle } from "react";
|
|
3
3
|
import {
|
|
4
4
|
NativeModules,
|
|
5
|
-
NativeSyntheticEvent,
|
|
5
|
+
type NativeSyntheticEvent,
|
|
6
6
|
requireNativeComponent,
|
|
7
7
|
} from "react-native";
|
|
8
8
|
|
|
9
9
|
import useAbstractSource from "../hooks/useAbstractSource";
|
|
10
10
|
import useNativeBridge from "../hooks/useNativeBridge";
|
|
11
|
-
import BaseProps from "../types/BaseProps";
|
|
12
|
-
import OnPressEvent from "../types/OnPressEvent";
|
|
11
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
12
|
+
import { type OnPressEvent } from "../types/OnPressEvent";
|
|
13
13
|
import { cloneReactChildrenWithProps, isFunction, isAndroid } from "../utils";
|
|
14
|
-
import { FilterExpression } from "../utils/
|
|
14
|
+
import { type FilterExpression } from "../utils/MapLibreRNStyles";
|
|
15
15
|
import { copyPropertiesAsDeprecated } from "../utils/deprecation";
|
|
16
16
|
import { getFilter } from "../utils/filterUtils";
|
|
17
17
|
|
|
@@ -91,7 +91,7 @@ const RCTMLNVectorSource =
|
|
|
91
91
|
* 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.
|
|
92
92
|
*/
|
|
93
93
|
const VectorSource = memo(
|
|
94
|
-
|
|
94
|
+
forwardRef(
|
|
95
95
|
(
|
|
96
96
|
{
|
|
97
97
|
id = MapLibreGL.StyleSource.DefaultSourceID,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { processColor, NativeMethods } from "react-native";
|
|
1
|
+
import { useMemo, useRef } from "react";
|
|
2
|
+
import { processColor, type NativeMethods } from "react-native";
|
|
3
3
|
|
|
4
|
-
import BaseProps from "../types/BaseProps";
|
|
4
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
5
5
|
import {
|
|
6
|
-
AllLayerStyleProps,
|
|
7
|
-
ExpressionField,
|
|
8
|
-
ExpressionName,
|
|
9
|
-
FilterExpression,
|
|
10
|
-
} from "../utils/
|
|
11
|
-
import { StyleValue, transformStyle } from "../utils/StyleValue";
|
|
6
|
+
type AllLayerStyleProps,
|
|
7
|
+
type ExpressionField,
|
|
8
|
+
type ExpressionName,
|
|
9
|
+
type FilterExpression,
|
|
10
|
+
} from "../utils/MapLibreRNStyles";
|
|
11
|
+
import { type StyleValue, transformStyle } from "../utils/StyleValue";
|
|
12
12
|
import { getFilter } from "../utils/filterUtils";
|
|
13
13
|
|
|
14
14
|
export interface BaseLayerProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { NativeMethods } from "react-native";
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { type NativeMethods } from "react-native";
|
|
3
3
|
|
|
4
4
|
export default function useAbstractSource<NativePropsType extends object>(): {
|
|
5
5
|
_nativeRef:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component, type SyntheticEvent, useRef } from "react";
|
|
2
2
|
|
|
3
|
-
import { runNativeCommand, isAndroid, NativeArg } from "../utils";
|
|
3
|
+
import { runNativeCommand, isAndroid, type NativeArg } from "../utils";
|
|
4
4
|
|
|
5
5
|
export type RNMLEvent<PayloadType = { [key: string]: string }> = {
|
|
6
6
|
payload: PayloadType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { NativeMethods } from "react-native";
|
|
1
|
+
import { Component, useRef } from "react";
|
|
2
|
+
import { type NativeMethods } from "react-native";
|
|
3
3
|
|
|
4
4
|
export type NativeRef<NativeProps> = Component<NativeProps> &
|
|
5
5
|
Readonly<NativeMethods>;
|
package/src/index.ts
ADDED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NativeModules,
|
|
3
3
|
NativeEventEmitter,
|
|
4
|
-
EventSubscription,
|
|
4
|
+
type EventSubscription,
|
|
5
5
|
} from "react-native";
|
|
6
6
|
|
|
7
7
|
import OfflineCreatePackOptions, {
|
|
8
|
-
OfflineCreatePackInputOptions,
|
|
8
|
+
type OfflineCreatePackInputOptions,
|
|
9
9
|
} from "./OfflineCreatePackOptions";
|
|
10
10
|
import OfflinePack from "./OfflinePack";
|
|
11
11
|
import { isUndefined, isFunction, isAndroid } from "../../utils";
|
|
@@ -90,8 +90,8 @@ class OfflineManager {
|
|
|
90
90
|
* }, progressListener, errorListener)
|
|
91
91
|
*
|
|
92
92
|
* @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download.
|
|
93
|
-
* @param {
|
|
94
|
-
* @param {
|
|
93
|
+
* @param {ProgressListener} progressListener Callback that listens for status events while downloading the offline resource.
|
|
94
|
+
* @param {ErrorListener} errorListener Callback that listens for status events while downloading the offline resource.
|
|
95
95
|
* @return {void}
|
|
96
96
|
*/
|
|
97
97
|
async createPack(
|
|
@@ -230,9 +230,10 @@ class OfflineManager {
|
|
|
230
230
|
*/
|
|
231
231
|
async getPacks(): Promise<OfflinePack[]> {
|
|
232
232
|
await this._initialize();
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
|
|
234
|
+
return Object.keys(this._offlinePacks)
|
|
235
|
+
.map((name) => this._offlinePacks[name])
|
|
236
|
+
.filter((pack) => !!pack);
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
/**
|
|
@@ -244,7 +245,7 @@ class OfflineManager {
|
|
|
244
245
|
* @param {String} name Name of the offline pack.
|
|
245
246
|
* @return {OfflinePack}
|
|
246
247
|
*/
|
|
247
|
-
async getPack(name: string)
|
|
248
|
+
async getPack(name: string) {
|
|
248
249
|
await this._initialize();
|
|
249
250
|
return this._offlinePacks[name];
|
|
250
251
|
}
|
|
@@ -300,9 +301,9 @@ class OfflineManager {
|
|
|
300
301
|
* const errorListener = (offlinePack, err) => console.log(offlinePack, err)
|
|
301
302
|
* MapLibreGL.offlineManager.subscribe('packName', progressListener, errorListener)
|
|
302
303
|
*
|
|
303
|
-
* @param {
|
|
304
|
-
* @param {
|
|
305
|
-
* @param {
|
|
304
|
+
* @param {string} packName Name of the offline pack.
|
|
305
|
+
* @param {ProgressListener} progressListener Callback that listens for status events while downloading the offline resource.
|
|
306
|
+
* @param {ErrorListener} errorListener Callback that listens for status events while downloading the offline resource.
|
|
306
307
|
* @return {void}
|
|
307
308
|
*/
|
|
308
309
|
async subscribe(
|
|
@@ -399,7 +400,9 @@ class OfflineManager {
|
|
|
399
400
|
}
|
|
400
401
|
|
|
401
402
|
const pack = this._offlinePacks[name];
|
|
402
|
-
|
|
403
|
+
if (pack) {
|
|
404
|
+
this._progressListeners[name]?.(pack, e.payload);
|
|
405
|
+
}
|
|
403
406
|
|
|
404
407
|
// cleanup listeners now that they are no longer needed
|
|
405
408
|
if (state === MapLibreGL.OfflinePackDownloadState.Complete) {
|
|
@@ -415,7 +418,9 @@ class OfflineManager {
|
|
|
415
418
|
}
|
|
416
419
|
|
|
417
420
|
const pack = this._offlinePacks[name];
|
|
418
|
-
|
|
421
|
+
if (pack) {
|
|
422
|
+
this._errorListeners[name]?.(pack, e.payload);
|
|
423
|
+
}
|
|
419
424
|
}
|
|
420
425
|
|
|
421
426
|
_hasListeners(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from "react-native";
|
|
2
2
|
|
|
3
|
-
import SnapshotOptions, { SnapshotInputOptions } from "./SnapshotOptions";
|
|
3
|
+
import SnapshotOptions, { type SnapshotInputOptions } from "./SnapshotOptions";
|
|
4
4
|
|
|
5
5
|
const MapLibreGLSnapshotManger = NativeModules.MLNSnapshotModule;
|
|
6
6
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Permission, PermissionsAndroid } from "react-native";
|
|
1
|
+
import { type Permission, PermissionsAndroid } from "react-native";
|
|
2
2
|
|
|
3
3
|
import { isAndroid } from "./utils";
|
|
4
4
|
|
|
5
5
|
export async function requestAndroidLocationPermissions(): Promise<boolean> {
|
|
6
6
|
if (isAndroid()) {
|
|
7
7
|
const res = await PermissionsAndroid.requestMultiple([
|
|
8
|
-
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
|
9
|
-
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
|
|
8
|
+
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION as Permission,
|
|
9
|
+
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION as Permission,
|
|
10
10
|
]);
|
|
11
11
|
|
|
12
12
|
if (!res) {
|