@maplibre/maplibre-react-native 10.0.0-beta.8 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -54
- package/android/build.gradle +35 -12
- package/android/gradle.properties +14 -6
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.java +37 -48
- package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +16 -9
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.java +11 -13
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +4 -11
- package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
- package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
- package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.java +7 -11
- package/android/src/main/java/org/maplibre/reactnative/location/engine/DefaultLocationEngineProvider.java +18 -0
- package/android/src/main/java/org/maplibre/reactnative/location/engine/LocationEngineProvidable.java +9 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +27 -148
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
- package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +123 -18
- package/android/src/main/location-engine-default/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineImpl.java +151 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineProvider.java +24 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +12 -0
- package/app.plugin.js +1 -1
- package/ios/MLRN/MLRNCamera.m +6 -7
- package/ios/MLRN/MLRNMapView.h +1 -1
- package/ios/MLRN/MLRNMapView.m +7 -7
- package/ios/MLRN/MLRNMapViewManager.m +1 -1
- package/ios/MLRN/MLRNModule.m +8 -139
- package/ios/MLRN/MLRNStyle.m +0 -40
- package/lib/commonjs/MLRNModule.js +3 -5
- package/lib/commonjs/MLRNModule.js.map +1 -1
- package/lib/commonjs/MapLibreRN.js +77 -59
- package/lib/commonjs/MapLibreRN.js.map +1 -1
- package/lib/commonjs/components/Annotation.js +7 -9
- package/lib/commonjs/components/Annotation.js.map +1 -1
- package/lib/commonjs/components/BackgroundLayer.js +6 -8
- package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
- package/lib/commonjs/components/Callout.js +2 -2
- package/lib/commonjs/components/Callout.js.map +1 -1
- package/lib/commonjs/components/Camera.js +111 -63
- package/lib/commonjs/components/Camera.js.map +1 -1
- package/lib/commonjs/components/CircleLayer.js +6 -8
- package/lib/commonjs/components/CircleLayer.js.map +1 -1
- package/lib/commonjs/components/FillExtrusionLayer.js +6 -8
- package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
- package/lib/commonjs/components/FillLayer.js +6 -8
- package/lib/commonjs/components/FillLayer.js.map +1 -1
- package/lib/commonjs/components/HeadingIndicator.js +4 -4
- package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
- package/lib/commonjs/components/HeatmapLayer.js +6 -8
- package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
- package/lib/commonjs/components/ImageSource.js +4 -5
- package/lib/commonjs/components/ImageSource.js.map +1 -1
- package/lib/commonjs/components/Images.js +2 -2
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/Light.js +4 -6
- package/lib/commonjs/components/Light.js.map +1 -1
- package/lib/commonjs/components/LineLayer.js +6 -8
- package/lib/commonjs/components/LineLayer.js.map +1 -1
- package/lib/commonjs/components/MapView.js +69 -76
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/MarkerView.js +4 -5
- package/lib/commonjs/components/MarkerView.js.map +1 -1
- package/lib/commonjs/components/NativeUserLocation.js +2 -2
- package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
- package/lib/commonjs/components/PointAnnotation.js +7 -10
- package/lib/commonjs/components/PointAnnotation.js.map +1 -1
- package/lib/commonjs/components/RasterLayer.js +6 -8
- package/lib/commonjs/components/RasterLayer.js.map +1 -1
- package/lib/commonjs/components/RasterSource.js +8 -10
- package/lib/commonjs/components/RasterSource.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +6 -8
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +6 -7
- package/lib/commonjs/components/SymbolLayer.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +21 -23
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +8 -10
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/hooks/useAbstractLayer.js +1 -1
- package/lib/commonjs/hooks/useAbstractLayer.js.map +1 -1
- package/lib/commonjs/hooks/useAbstractSource.js +1 -1
- package/lib/commonjs/hooks/useAbstractSource.js.map +1 -1
- package/lib/commonjs/hooks/useNativeBridge.js +2 -2
- package/lib/commonjs/hooks/useNativeBridge.js.map +1 -1
- package/lib/commonjs/hooks/useOnce.js +2 -2
- package/lib/commonjs/hooks/useOnce.js.map +1 -1
- package/lib/commonjs/index.js +3 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/location/{locationManager.js → LocationManager.js} +10 -10
- package/lib/commonjs/modules/location/LocationManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +2 -2
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -1
- package/lib/commonjs/modules/offline/{offlineManager.js → OfflineManager.js} +34 -36
- package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflinePack.js +2 -2
- package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -1
- package/lib/commonjs/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +12 -14
- package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js +3 -4
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -1
- package/lib/commonjs/plugin/MapLibrePluginProps.js +2 -0
- package/lib/commonjs/plugin/MapLibrePluginProps.js.map +1 -0
- package/lib/commonjs/plugin/android.js +41 -0
- package/lib/commonjs/plugin/android.js.map +1 -0
- package/lib/commonjs/plugin/ios.js +131 -0
- package/lib/commonjs/plugin/ios.js.map +1 -0
- package/lib/commonjs/plugin/withMapLibre.js +31 -0
- package/lib/commonjs/plugin/withMapLibre.js.map +1 -0
- package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
- package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
- package/lib/commonjs/utils/BridgeValue.js +2 -2
- package/lib/commonjs/utils/BridgeValue.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +2 -2
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/StyleValue.js +4 -5
- package/lib/commonjs/utils/StyleValue.js.map +1 -1
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/commonjs/utils/animated/Animated.js +29 -31
- package/lib/commonjs/utils/animated/Animated.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +4 -5
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +2 -2
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedPoint.js +1 -2
- package/lib/commonjs/utils/animated/AnimatedPoint.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +4 -4
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedShape.js +2 -2
- package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -1
- package/lib/commonjs/utils/getStylePropertyType.js +252 -0
- package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
- package/lib/module/MLRNModule.js +1 -2
- package/lib/module/MLRNModule.js.map +1 -1
- package/lib/module/MapLibreRN.js +40 -28
- package/lib/module/MapLibreRN.js.map +1 -1
- package/lib/module/components/Annotation.js +5 -6
- package/lib/module/components/Annotation.js.map +1 -1
- package/lib/module/components/BackgroundLayer.js +4 -6
- package/lib/module/components/BackgroundLayer.js.map +1 -1
- package/lib/module/components/Callout.js +2 -3
- package/lib/module/components/Callout.js.map +1 -1
- package/lib/module/components/Camera.js +112 -64
- package/lib/module/components/Camera.js.map +1 -1
- package/lib/module/components/CircleLayer.js +4 -6
- package/lib/module/components/CircleLayer.js.map +1 -1
- package/lib/module/components/FillExtrusionLayer.js +4 -6
- package/lib/module/components/FillExtrusionLayer.js.map +1 -1
- package/lib/module/components/FillLayer.js +4 -6
- package/lib/module/components/FillLayer.js.map +1 -1
- package/lib/module/components/HeadingIndicator.js +2 -3
- package/lib/module/components/HeadingIndicator.js.map +1 -1
- package/lib/module/components/HeatmapLayer.js +4 -6
- package/lib/module/components/HeatmapLayer.js.map +1 -1
- package/lib/module/components/ImageSource.js +2 -3
- package/lib/module/components/ImageSource.js.map +1 -1
- package/lib/module/components/Images.js +2 -3
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/Light.js +2 -4
- package/lib/module/components/Light.js.map +1 -1
- package/lib/module/components/LineLayer.js +4 -6
- package/lib/module/components/LineLayer.js.map +1 -1
- package/lib/module/components/MapView.js +65 -72
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/MarkerView.js +2 -3
- package/lib/module/components/MarkerView.js.map +1 -1
- package/lib/module/components/NativeUserLocation.js +1 -2
- package/lib/module/components/NativeUserLocation.js.map +1 -1
- package/lib/module/components/PointAnnotation.js +5 -7
- package/lib/module/components/PointAnnotation.js.map +1 -1
- package/lib/module/components/RasterLayer.js +4 -6
- package/lib/module/components/RasterLayer.js.map +1 -1
- package/lib/module/components/RasterSource.js +5 -7
- package/lib/module/components/RasterSource.js.map +1 -1
- package/lib/module/components/ShapeSource.js +4 -5
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +4 -5
- package/lib/module/components/SymbolLayer.js.map +1 -1
- package/lib/module/components/UserLocation.js +14 -15
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/VectorSource.js +5 -6
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/hooks/useAbstractLayer.js +1 -1
- package/lib/module/hooks/useAbstractLayer.js.map +1 -1
- package/lib/module/hooks/useAbstractSource.js +1 -1
- package/lib/module/hooks/useAbstractSource.js.map +1 -1
- package/lib/module/hooks/useNativeBridge.js +1 -2
- package/lib/module/hooks/useNativeBridge.js.map +1 -1
- package/lib/module/hooks/useNativeRef.js.map +1 -1
- package/lib/module/hooks/useOnce.js +1 -2
- package/lib/module/hooks/useOnce.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/location/{locationManager.js → LocationManager.js} +10 -9
- package/lib/module/modules/location/LocationManager.js.map +1 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js +1 -2
- package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -1
- package/lib/module/modules/offline/{offlineManager.js → OfflineManager.js} +30 -30
- package/lib/module/modules/offline/OfflineManager.js.map +1 -0
- package/lib/module/modules/offline/OfflinePack.js +1 -2
- package/lib/module/modules/offline/OfflinePack.js.map +1 -1
- package/lib/module/modules/snapshot/{snapshotManager.js → SnapshotManager.js} +10 -10
- package/lib/module/modules/snapshot/{snapshotManager.js.map → SnapshotManager.js.map} +1 -1
- package/lib/module/modules/snapshot/SnapshotOptions.js +2 -3
- package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -1
- package/lib/module/plugin/MapLibrePluginProps.js +2 -0
- package/lib/module/plugin/MapLibrePluginProps.js.map +1 -0
- package/lib/module/plugin/android.js +34 -0
- package/lib/module/plugin/android.js.map +1 -0
- package/lib/module/plugin/ios.js +123 -0
- package/lib/module/plugin/ios.js.map +1 -0
- package/lib/module/plugin/withMapLibre.js +27 -0
- package/lib/module/plugin/withMapLibre.js.map +1 -0
- package/lib/module/types/MapLibreRNStyles.js +4 -0
- package/lib/module/types/MapLibreRNStyles.js.map +1 -0
- package/lib/module/utils/BridgeValue.js +1 -1
- package/lib/module/utils/BridgeValue.js.map +1 -1
- package/lib/module/utils/Logger.js +1 -2
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/StyleValue.js +3 -3
- package/lib/module/utils/StyleValue.js.map +1 -1
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +1 -2
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/module/utils/animated/Animated.js +14 -15
- package/lib/module/utils/animated/Animated.js.map +1 -1
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js +2 -3
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -1
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedPoint.js +0 -1
- package/lib/module/utils/animated/AnimatedPoint.js.map +1 -1
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +2 -2
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedShape.js +1 -2
- package/lib/module/utils/animated/AnimatedShape.js.map +1 -1
- package/lib/module/utils/getStylePropertyType.js +248 -0
- package/lib/module/utils/getStylePropertyType.js.map +1 -0
- package/lib/typescript/commonjs/src/MLRNModule.d.ts +2 -6
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +43 -30
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +6 -6
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Callout.d.ts +3 -4
- package/lib/typescript/commonjs/src/components/Callout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Camera.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/Camera.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +2 -3
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts +3 -4
- package/lib/typescript/commonjs/src/components/ImageSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Images.d.ts +5 -5
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Light.d.ts +4 -5
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MapView.d.ts +12 -15
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts +3 -3
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts +2 -3
- package/lib/typescript/commonjs/src/components/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +7 -8
- package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +3 -5
- package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/RasterSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +8 -15
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +3 -4
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts +6 -6
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts +4 -8
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +5 -4
- package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts +4 -3
- package/lib/typescript/commonjs/src/hooks/useAbstractSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts +5 -5
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +2 -2
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts +1 -2
- package/lib/typescript/commonjs/src/hooks/useOnce.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
- package/lib/typescript/commonjs/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
- package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +2 -3
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/{module/src/modules/snapshot/snapshotManager.d.ts → commonjs/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts +77 -0
- package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin/android.d.ts +16 -0
- package/lib/typescript/commonjs/src/plugin/android.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin/ios.d.ts +17 -0
- package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts +5 -0
- package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/Logger.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +19 -19
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +5 -5
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
- package/lib/typescript/module/src/MLRNModule.d.ts +2 -6
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +43 -30
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Annotation.d.ts +6 -6
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Callout.d.ts +3 -4
- package/lib/typescript/module/src/components/Callout.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Camera.d.ts +4 -4
- package/lib/typescript/module/src/components/Camera.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CircleLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/FillLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts +2 -3
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +1 -1
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ImageSource.d.ts +3 -4
- package/lib/typescript/module/src/components/ImageSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Images.d.ts +5 -5
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Light.d.ts +4 -5
- package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/module/src/components/LineLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MapView.d.ts +12 -15
- package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MarkerView.d.ts +3 -3
- package/lib/typescript/module/src/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts +2 -3
- package/lib/typescript/module/src/components/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/PointAnnotation.d.ts +7 -8
- package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterLayer.d.ts +3 -5
- package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RasterSource.d.ts +4 -4
- package/lib/typescript/module/src/components/RasterSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +8 -15
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +3 -4
- package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserLocation.d.ts +6 -6
- package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/VectorSource.d.ts +4 -8
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +5 -4
- package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts +4 -3
- package/lib/typescript/module/src/hooks/useAbstractSource.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts +5 -5
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts +2 -2
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useOnce.d.ts +1 -2
- package/lib/typescript/module/src/hooks/useOnce.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +3 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts +33 -0
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts +1 -2
- package/lib/typescript/module/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/offline/{offlineManager.d.ts → OfflineManager.d.ts} +25 -25
- package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +2 -3
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
- package/lib/typescript/{commonjs/src/modules/snapshot/snapshotManager.d.ts → module/src/modules/snapshot/SnapshotManager.d.ts} +9 -9
- package/lib/typescript/module/src/modules/snapshot/SnapshotManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts +1 -1
- package/lib/typescript/module/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -1
- package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts +77 -0
- package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin/android.d.ts +16 -0
- package/lib/typescript/module/src/plugin/android.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin/ios.d.ts +17 -0
- package/lib/typescript/module/src/plugin/ios.d.ts.map +1 -0
- package/lib/typescript/module/src/plugin/withMapLibre.d.ts +5 -0
- package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -0
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/BridgeValue.d.ts +1 -1
- package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/Logger.d.ts +2 -2
- package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
- package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/Animated.d.ts +19 -19
- package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts +3 -3
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +2 -2
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +5 -5
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
- package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
- package/maplibre-react-native.podspec +15 -14
- package/package.json +17 -14
- package/src/MLRNModule.ts +15 -10
- package/src/MapLibreRN.ts +59 -41
- package/src/components/Annotation.tsx +12 -14
- package/src/components/BackgroundLayer.tsx +7 -9
- package/src/components/Callout.tsx +8 -10
- package/src/components/Camera.tsx +154 -78
- package/src/components/CircleLayer.tsx +7 -9
- package/src/components/FillExtrusionLayer.tsx +7 -9
- package/src/components/FillLayer.tsx +7 -9
- package/src/components/HeadingIndicator.tsx +2 -6
- package/src/components/HeatmapLayer.tsx +7 -9
- package/src/components/ImageSource.tsx +4 -6
- package/src/components/Images.tsx +7 -9
- package/src/components/Light.tsx +5 -7
- package/src/components/LineLayer.tsx +7 -9
- package/src/components/MapView.tsx +85 -94
- package/src/components/MarkerView.tsx +4 -6
- package/src/components/NativeUserLocation.tsx +1 -4
- package/src/components/PointAnnotation.tsx +10 -11
- package/src/components/RasterLayer.tsx +7 -9
- package/src/components/RasterSource.tsx +7 -9
- package/src/components/ShapeSource.tsx +17 -22
- package/src/components/SymbolLayer.tsx +7 -8
- package/src/components/UserLocation.tsx +21 -22
- package/src/components/VectorSource.tsx +8 -15
- package/src/hooks/useAbstractLayer.ts +8 -8
- package/src/hooks/useAbstractSource.ts +6 -6
- package/src/hooks/useNativeBridge.ts +9 -6
- package/src/hooks/useNativeRef.ts +2 -2
- package/src/hooks/useOnce.ts +3 -3
- package/src/index.ts +3 -0
- package/src/modules/location/{locationManager.ts → LocationManager.ts} +16 -15
- package/src/modules/offline/OfflineCreatePackOptions.ts +1 -3
- package/src/modules/offline/{offlineManager.ts → OfflineManager.ts} +30 -29
- package/src/modules/offline/OfflinePack.ts +2 -4
- package/src/modules/snapshot/{snapshotManager.ts → SnapshotManager.ts} +9 -9
- package/src/modules/snapshot/SnapshotOptions.ts +2 -4
- package/src/plugin/MapLibrePluginProps.ts +83 -0
- package/src/plugin/android.ts +64 -0
- package/src/plugin/ios.ts +166 -0
- package/src/plugin/withMapLibre.ts +30 -0
- package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +86 -406
- package/src/utils/BridgeValue.ts +1 -1
- package/src/utils/Logger.ts +1 -3
- package/src/utils/StyleValue.ts +6 -5
- package/src/utils/animated/AbstractAnimatedCoordinates.ts +3 -3
- package/src/utils/animated/Animated.ts +23 -21
- package/src/utils/animated/AnimatedCoordinatesArray.ts +3 -4
- package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +1 -1
- package/src/utils/animated/AnimatedPoint.ts +0 -2
- package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +3 -2
- package/src/utils/animated/AnimatedShape.ts +4 -6
- package/src/utils/filterUtils.ts +1 -1
- package/src/utils/getStylePropertyType.ts +265 -0
- package/lib/commonjs/modules/location/locationManager.js.map +0 -1
- package/lib/commonjs/modules/offline/offlineManager.js.map +0 -1
- package/lib/commonjs/modules/snapshot/snapshotManager.js.map +0 -1
- package/lib/commonjs/types/StyleURL.js +0 -11
- package/lib/commonjs/types/StyleURL.js.map +0 -1
- package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
- package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
- package/lib/commonjs/utils/styleMap.js +0 -255
- package/lib/commonjs/utils/styleMap.js.map +0 -1
- package/lib/module/modules/location/locationManager.js.map +0 -1
- package/lib/module/modules/offline/offlineManager.js.map +0 -1
- package/lib/module/types/StyleURL.js +0 -7
- package/lib/module/types/StyleURL.js.map +0 -1
- package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
- package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
- package/lib/module/utils/styleMap.js +0 -249
- package/lib/module/utils/styleMap.js.map +0 -1
- package/lib/typescript/commonjs/jest.config.d.ts +0 -2
- package/lib/typescript/commonjs/jest.config.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts +0 -64
- package/lib/typescript/commonjs/src/modules/location/locationManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/StyleURL.d.ts +0 -4
- package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
- package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
- package/lib/typescript/module/jest.config.d.ts +0 -2
- package/lib/typescript/module/jest.config.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/location/locationManager.d.ts +0 -64
- package/lib/typescript/module/src/modules/location/locationManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/snapshot/snapshotManager.d.ts.map +0 -1
- package/lib/typescript/module/src/types/StyleURL.d.ts +0 -4
- package/lib/typescript/module/src/types/StyleURL.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
- package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
- package/plugin/build/withMapLibre.d.ts +0 -12
- package/plugin/build/withMapLibre.js +0 -148
- package/src/types/StyleURL.ts +0 -3
- package/src/utils/styleMap.ts +0 -265
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
type EventSubscription,
|
|
5
5
|
} from "react-native";
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
OfflineCreatePackOptions,
|
|
8
9
|
type OfflineCreatePackInputOptions,
|
|
9
10
|
} from "./OfflineCreatePackOptions";
|
|
10
|
-
import OfflinePack,
|
|
11
|
+
import { OfflinePack, type OfflinePackStatus } from "./OfflinePack";
|
|
11
12
|
import { isUndefined, isFunction, isAndroid } from "../../utils";
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
14
15
|
const MLRNOfflineModule = NativeModules.MLRNOfflineModule;
|
|
15
16
|
export const OfflineModuleEventEmitter = new NativeEventEmitter(
|
|
16
17
|
MLRNOfflineModule,
|
|
@@ -67,7 +68,7 @@ class OfflineManager {
|
|
|
67
68
|
* const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);
|
|
68
69
|
* const errorListener = (offlineRegion, err) => console.log(offlineRegion, err);
|
|
69
70
|
*
|
|
70
|
-
* await
|
|
71
|
+
* await OfflineManager.createPack({
|
|
71
72
|
* name: 'offlinePack',
|
|
72
73
|
* styleURL: 'https://demotiles.maplibre.org/tiles/tiles.json',
|
|
73
74
|
* minZoom: 14,
|
|
@@ -106,9 +107,9 @@ class OfflineManager {
|
|
|
106
107
|
* This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded.
|
|
107
108
|
*
|
|
108
109
|
* @example
|
|
109
|
-
* await
|
|
110
|
+
* await OfflineManager.invalidatePack('packName')
|
|
110
111
|
*
|
|
111
|
-
* @param {
|
|
112
|
+
* @param {string} name Name of the offline pack.
|
|
112
113
|
* @return {void}
|
|
113
114
|
*/
|
|
114
115
|
async invalidatePack(name: string): Promise<void> {
|
|
@@ -128,9 +129,9 @@ class OfflineManager {
|
|
|
128
129
|
* Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed.
|
|
129
130
|
*
|
|
130
131
|
* @example
|
|
131
|
-
* await
|
|
132
|
+
* await OfflineManager.deletePack('packName')
|
|
132
133
|
*
|
|
133
|
-
* @param {
|
|
134
|
+
* @param {string} name Name of the offline pack.
|
|
134
135
|
* @return {void}
|
|
135
136
|
*/
|
|
136
137
|
async deletePack(name: string): Promise<void> {
|
|
@@ -154,7 +155,7 @@ class OfflineManager {
|
|
|
154
155
|
* It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects.
|
|
155
156
|
*
|
|
156
157
|
* @example
|
|
157
|
-
* await
|
|
158
|
+
* await OfflineManager.invalidateAmbientCache();
|
|
158
159
|
*
|
|
159
160
|
* @return {void}
|
|
160
161
|
*/
|
|
@@ -168,7 +169,7 @@ class OfflineManager {
|
|
|
168
169
|
* This method clears the cache and decreases the amount of space that map resources take up on the device.
|
|
169
170
|
*
|
|
170
171
|
* @example
|
|
171
|
-
* await
|
|
172
|
+
* await OfflineManager.clearAmbientCache();
|
|
172
173
|
*
|
|
173
174
|
* @return {void}
|
|
174
175
|
*/
|
|
@@ -182,9 +183,9 @@ class OfflineManager {
|
|
|
182
183
|
* This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased.
|
|
183
184
|
*
|
|
184
185
|
* @example
|
|
185
|
-
* await
|
|
186
|
+
* await OfflineManager.setMaximumAmbientCacheSize(5000000);
|
|
186
187
|
*
|
|
187
|
-
* @param {
|
|
188
|
+
* @param {number} size Size of ambient cache.
|
|
188
189
|
* @return {void}
|
|
189
190
|
*/
|
|
190
191
|
async setMaximumAmbientCacheSize(size: number): Promise<void> {
|
|
@@ -196,7 +197,7 @@ class OfflineManager {
|
|
|
196
197
|
* Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it.
|
|
197
198
|
*
|
|
198
199
|
* @example
|
|
199
|
-
* await
|
|
200
|
+
* await OfflineManager.resetDatabase();
|
|
200
201
|
*
|
|
201
202
|
* @return {void}
|
|
202
203
|
*/
|
|
@@ -209,7 +210,7 @@ class OfflineManager {
|
|
|
209
210
|
* Retrieves all the current offline packs that are stored in the database.
|
|
210
211
|
*
|
|
211
212
|
* @example
|
|
212
|
-
* const offlinePacks = await
|
|
213
|
+
* const offlinePacks = await OfflineManager.getPacks();
|
|
213
214
|
*
|
|
214
215
|
* @return {Array<OfflinePack>}
|
|
215
216
|
*/
|
|
@@ -225,9 +226,9 @@ class OfflineManager {
|
|
|
225
226
|
* Retrieves an offline pack that is stored in the database by name.
|
|
226
227
|
*
|
|
227
228
|
* @example
|
|
228
|
-
* const offlinePack = await
|
|
229
|
+
* const offlinePack = await OfflineManager.getPack();
|
|
229
230
|
*
|
|
230
|
-
* @param {
|
|
231
|
+
* @param {string} name Name of the offline pack.
|
|
231
232
|
* @return {OfflinePack}
|
|
232
233
|
*/
|
|
233
234
|
async getPack(name: string) {
|
|
@@ -239,9 +240,9 @@ class OfflineManager {
|
|
|
239
240
|
* Sideloads offline db
|
|
240
241
|
*
|
|
241
242
|
* @example
|
|
242
|
-
* await
|
|
243
|
+
* await OfflineManager.mergeOfflineRegions(path);
|
|
243
244
|
*
|
|
244
|
-
* @param {
|
|
245
|
+
* @param {string} path Path to offline tile db on file system.
|
|
245
246
|
* @return {void}
|
|
246
247
|
*/
|
|
247
248
|
async mergeOfflineRegions(path: string): Promise<void> {
|
|
@@ -254,9 +255,9 @@ class OfflineManager {
|
|
|
254
255
|
* Consult the Terms of Service for your map tile host before changing this value.
|
|
255
256
|
*
|
|
256
257
|
* @example
|
|
257
|
-
*
|
|
258
|
+
* OfflineManager.setTileCountLimit(1000);
|
|
258
259
|
*
|
|
259
|
-
* @param {
|
|
260
|
+
* @param {number} limit Map tile limit count.
|
|
260
261
|
* @return {void}
|
|
261
262
|
*/
|
|
262
263
|
setTileCountLimit(limit: number): void {
|
|
@@ -268,9 +269,9 @@ class OfflineManager {
|
|
|
268
269
|
* The default is 500ms.
|
|
269
270
|
*
|
|
270
271
|
* @example
|
|
271
|
-
*
|
|
272
|
+
* OfflineManager.setProgressEventThrottle(500);
|
|
272
273
|
*
|
|
273
|
-
* @param {
|
|
274
|
+
* @param {number} throttleValue event throttle value in ms.
|
|
274
275
|
* @return {void}
|
|
275
276
|
*/
|
|
276
277
|
setProgressEventThrottle(throttleValue: number): void {
|
|
@@ -284,7 +285,7 @@ class OfflineManager {
|
|
|
284
285
|
* @example
|
|
285
286
|
* const progressListener = (offlinePack, status) => console.log(offlinePack, status)
|
|
286
287
|
* const errorListener = (offlinePack, err) => console.log(offlinePack, err)
|
|
287
|
-
*
|
|
288
|
+
* OfflineManager.subscribe('packName', progressListener, errorListener)
|
|
288
289
|
*
|
|
289
290
|
* @param {string} packName Name of the offline pack.
|
|
290
291
|
* @param {ProgressListener} progressListener Callback that listens for status events while downloading the offline resource.
|
|
@@ -300,7 +301,7 @@ class OfflineManager {
|
|
|
300
301
|
if (isFunction(progressListener)) {
|
|
301
302
|
if (totalProgressListeners === 0) {
|
|
302
303
|
this.subscriptionProgress = OfflineModuleEventEmitter.addListener(
|
|
303
|
-
|
|
304
|
+
MLRNModule.OfflineCallbackName.Progress,
|
|
304
305
|
this._onProgress,
|
|
305
306
|
);
|
|
306
307
|
}
|
|
@@ -311,7 +312,7 @@ class OfflineManager {
|
|
|
311
312
|
if (isFunction(errorListener)) {
|
|
312
313
|
if (totalErrorListeners === 0) {
|
|
313
314
|
this.subscriptionError = OfflineModuleEventEmitter.addListener(
|
|
314
|
-
|
|
315
|
+
MLRNModule.OfflineCallbackName.Error,
|
|
315
316
|
this._onError,
|
|
316
317
|
);
|
|
317
318
|
}
|
|
@@ -335,9 +336,9 @@ class OfflineManager {
|
|
|
335
336
|
* It's a good idea to call this on componentWillUnmount.
|
|
336
337
|
*
|
|
337
338
|
* @example
|
|
338
|
-
*
|
|
339
|
+
* OfflineManager.unsubscribe('packName')
|
|
339
340
|
*
|
|
340
|
-
* @param {
|
|
341
|
+
* @param {string} packName Name of the offline pack.
|
|
341
342
|
* @return {void}
|
|
342
343
|
*/
|
|
343
344
|
unsubscribe(packName: string): void {
|
|
@@ -390,7 +391,7 @@ class OfflineManager {
|
|
|
390
391
|
}
|
|
391
392
|
|
|
392
393
|
// cleanup listeners now that they are no longer needed
|
|
393
|
-
if (state ===
|
|
394
|
+
if (state === MLRNModule.OfflinePackDownloadState.Complete) {
|
|
394
395
|
this.unsubscribe(name);
|
|
395
396
|
}
|
|
396
397
|
}
|
|
@@ -421,4 +422,4 @@ class OfflineManager {
|
|
|
421
422
|
}
|
|
422
423
|
|
|
423
424
|
const offlineManager = new OfflineManager();
|
|
424
|
-
export
|
|
425
|
+
export { offlineManager as OfflineManager };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from "react-native";
|
|
2
2
|
|
|
3
|
-
import OfflineCreatePackOptions from "./OfflineCreatePackOptions";
|
|
3
|
+
import { OfflineCreatePackOptions } from "./OfflineCreatePackOptions";
|
|
4
4
|
|
|
5
5
|
const MLRNOfflineModule = NativeModules.MLRNOfflineModule;
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ export type OfflinePackStatus = {
|
|
|
15
15
|
requiredResourceCount: number;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
class OfflinePack {
|
|
18
|
+
export class OfflinePack {
|
|
19
19
|
private pack: OfflineCreatePackOptions;
|
|
20
20
|
private _metadata: Record<string, any> | null;
|
|
21
21
|
|
|
@@ -52,5 +52,3 @@ class OfflinePack {
|
|
|
52
52
|
return MLRNOfflineModule.pausePackDownload(this.name);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
export default OfflinePack;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NativeModules } from "react-native";
|
|
2
2
|
|
|
3
|
-
import SnapshotOptions,
|
|
3
|
+
import { SnapshotOptions, type SnapshotInputOptions } from "./SnapshotOptions";
|
|
4
4
|
|
|
5
5
|
const MLRNSnapshotModule = NativeModules.MLRNSnapshotModule;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The SnapshotManager generates static raster images of the map.
|
|
9
9
|
* Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide.
|
|
10
10
|
* The snapshotter generates the snapshot asynchronous.
|
|
11
11
|
*/
|
|
@@ -16,35 +16,35 @@ class SnapshotManager {
|
|
|
16
16
|
* @example
|
|
17
17
|
*
|
|
18
18
|
* // creates a temp file png of base map
|
|
19
|
-
* const uri = await
|
|
19
|
+
* const uri = await SnapshotManager.takeSnap({
|
|
20
20
|
* centerCoordinate: [-74.126410, 40.797968],
|
|
21
21
|
* width: width,
|
|
22
22
|
* height: height,
|
|
23
23
|
* zoomLevel: 12,
|
|
24
24
|
* pitch: 30,
|
|
25
25
|
* heading: 20,
|
|
26
|
-
* styleURL:
|
|
26
|
+
* styleURL: StyleURL.Default,
|
|
27
27
|
* writeToDisk: true, // Create a temporary file
|
|
28
28
|
* });
|
|
29
29
|
*
|
|
30
30
|
* // creates base64 png of base map without logo
|
|
31
|
-
* const uri = await
|
|
31
|
+
* const uri = await SnapshotManager.takeSnap({
|
|
32
32
|
* centerCoordinate: [-74.126410, 40.797968],
|
|
33
33
|
* width: width,
|
|
34
34
|
* height: height,
|
|
35
35
|
* zoomLevel: 12,
|
|
36
36
|
* pitch: 30,
|
|
37
37
|
* heading: 20,
|
|
38
|
-
* styleURL:
|
|
38
|
+
* styleURL: StyleURL.Default,
|
|
39
39
|
* withLogo: false, // Disable Mapbox logo (Android only)
|
|
40
40
|
* });
|
|
41
41
|
*
|
|
42
42
|
* // creates snapshot with bounds
|
|
43
|
-
* const uri = await
|
|
43
|
+
* const uri = await SnapshotManager.takeSnap({
|
|
44
44
|
* bounds: [[-74.126410, 40.797968], [-74.143727, 40.772177]],
|
|
45
45
|
* width: width,
|
|
46
46
|
* height: height,
|
|
47
|
-
* styleURL:
|
|
47
|
+
* styleURL: StyleURL.Default,
|
|
48
48
|
* });
|
|
49
49
|
*
|
|
50
50
|
* @param {SnapshotOptions} options Snapshot options for create a static image of the base map
|
|
@@ -59,4 +59,4 @@ class SnapshotManager {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const snapshotManager = new SnapshotManager();
|
|
62
|
-
export
|
|
62
|
+
export { snapshotManager as SnapshotManager };
|
|
@@ -3,7 +3,7 @@ import { NativeModules } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
import { toJSONString } from "../../utils";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
7
7
|
|
|
8
8
|
export interface SnapshotInputOptions {
|
|
9
9
|
centerCoordinate?: GeoJSON.Position;
|
|
@@ -50,7 +50,7 @@ export class SnapshotOptions {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
this.styleURL = options.styleURL ||
|
|
53
|
+
this.styleURL = options.styleURL || MLRNModule.StyleURL.Default;
|
|
54
54
|
this.heading = options.heading || 0.0;
|
|
55
55
|
this.pitch = options.pitch || 0.0;
|
|
56
56
|
this.zoomLevel = options.zoomLevel || 16.0;
|
|
@@ -99,5 +99,3 @@ export class SnapshotOptions {
|
|
|
99
99
|
return toJSONString(featureCollection(features));
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
export default SnapshotOptions;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
type VersionString =
|
|
2
|
+
| `${number}.${number}.${number}`
|
|
3
|
+
| `${number}.${number}.${number}-${string}`;
|
|
4
|
+
|
|
5
|
+
export type MapLibrePluginProps =
|
|
6
|
+
| {
|
|
7
|
+
/**
|
|
8
|
+
* Properties relevant only for Android
|
|
9
|
+
*
|
|
10
|
+
* @platform android
|
|
11
|
+
*/
|
|
12
|
+
android?: {
|
|
13
|
+
/**
|
|
14
|
+
* Version for `org.maplibre.gl:android-sdk`
|
|
15
|
+
*/
|
|
16
|
+
nativeVersion?: VersionString;
|
|
17
|
+
/**
|
|
18
|
+
* Version for `org.maplibre.gl:android-plugin-*-v9`
|
|
19
|
+
*/
|
|
20
|
+
pluginVersion?: VersionString;
|
|
21
|
+
/**
|
|
22
|
+
* Version for `org.maplibre.gl:android-sdk-turf`
|
|
23
|
+
*/
|
|
24
|
+
turfVersion?: VersionString;
|
|
25
|
+
/**
|
|
26
|
+
* Version for `com.squareup.okhttp3:okhttp`
|
|
27
|
+
*/
|
|
28
|
+
okhttpVersion?: VersionString;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Location engine to be used
|
|
32
|
+
*
|
|
33
|
+
* - `default`: Used per default from MapLibre; F-Droid compatible
|
|
34
|
+
* - `google`: Google Play Services Location Engine for higher precision; F-Droid incompatible
|
|
35
|
+
*
|
|
36
|
+
* @default "default"
|
|
37
|
+
*/
|
|
38
|
+
locationEngine?: "default" | "google";
|
|
39
|
+
/**
|
|
40
|
+
* Version for `com.google.android.gms:play-services-location`, only used with `locationEngine: "google"`
|
|
41
|
+
*/
|
|
42
|
+
googlePlayServicesLocationVersion?: VersionString;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Properties relevant only for iOS
|
|
47
|
+
*
|
|
48
|
+
* @platform ios
|
|
49
|
+
*/
|
|
50
|
+
ios?: {
|
|
51
|
+
/**
|
|
52
|
+
* Version for `maplibre-gl-native-distribution`
|
|
53
|
+
*/
|
|
54
|
+
nativeVersion?: VersionString;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Swift Package Manager spec to override the selected version range
|
|
58
|
+
*
|
|
59
|
+
* @default `{
|
|
60
|
+
* url: "https://github.com/maplibre/maplibre-gl-native-distribution",
|
|
61
|
+
* requirement: {
|
|
62
|
+
* kind: "exactVersion",
|
|
63
|
+
* version: $MLRN_NATIVE_VERSION
|
|
64
|
+
* },
|
|
65
|
+
* product_name: "MapLibre"
|
|
66
|
+
* }`
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* spmSpec: `{
|
|
71
|
+
* url: "https://github.com/maplibre/maplibre-gl-native-distribution",
|
|
72
|
+
* requirement: {
|
|
73
|
+
* kind: "upToNextMajorVersion",
|
|
74
|
+
* minimumVersion: "x.x.x"
|
|
75
|
+
* },
|
|
76
|
+
* product_name: "MapLibre"
|
|
77
|
+
* }`
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
spmSpec?: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
| undefined;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ConfigPlugin,
|
|
3
|
+
withGradleProperties as withGradlePropertiesExpo,
|
|
4
|
+
} from "@expo/config-plugins";
|
|
5
|
+
import type { PropertiesItem } from "@expo/config-plugins/build/android/Properties";
|
|
6
|
+
|
|
7
|
+
import type { MapLibrePluginProps } from "./MapLibrePluginProps";
|
|
8
|
+
|
|
9
|
+
type PropertyItem = {
|
|
10
|
+
type: "property";
|
|
11
|
+
key: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const getGradleProperties = (
|
|
16
|
+
props: MapLibrePluginProps,
|
|
17
|
+
): PropertyItem[] => {
|
|
18
|
+
return Object.entries(props?.android || {}).reduce(
|
|
19
|
+
(properties, [key, value]) => {
|
|
20
|
+
if (key && value) {
|
|
21
|
+
properties.push({
|
|
22
|
+
type: "property",
|
|
23
|
+
key: `org.maplibre.reactnative.${key}`,
|
|
24
|
+
value: value.toString(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return properties;
|
|
29
|
+
},
|
|
30
|
+
[] as PropertyItem[],
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const mergeGradleProperties = (
|
|
35
|
+
oldProperties: PropertiesItem[],
|
|
36
|
+
newProperties: PropertyItem[],
|
|
37
|
+
): PropertiesItem[] => {
|
|
38
|
+
const newPropertiesKeys = newProperties.map(({ key }) => key);
|
|
39
|
+
const merged = oldProperties.filter(
|
|
40
|
+
(item) =>
|
|
41
|
+
!(item.type === "property" && newPropertiesKeys.includes(item.key)),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
merged.push(...newProperties);
|
|
45
|
+
|
|
46
|
+
return merged;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const withGradleProperties: ConfigPlugin<MapLibrePluginProps> = (
|
|
50
|
+
config,
|
|
51
|
+
props,
|
|
52
|
+
) => {
|
|
53
|
+
const gradleProperties = getGradleProperties(props);
|
|
54
|
+
|
|
55
|
+
return withGradlePropertiesExpo(config, (c) => {
|
|
56
|
+
c.modResults = mergeGradleProperties(c.modResults, gradleProperties);
|
|
57
|
+
|
|
58
|
+
return c;
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const android = {
|
|
63
|
+
withGradleProperties,
|
|
64
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ConfigPlugin,
|
|
3
|
+
withPodfile,
|
|
4
|
+
withXcodeProject,
|
|
5
|
+
type XcodeProject,
|
|
6
|
+
} from "@expo/config-plugins";
|
|
7
|
+
import {
|
|
8
|
+
mergeContents,
|
|
9
|
+
removeGeneratedContents,
|
|
10
|
+
} from "@expo/config-plugins/build/utils/generateCode";
|
|
11
|
+
|
|
12
|
+
import type { MapLibrePluginProps } from "./MapLibrePluginProps";
|
|
13
|
+
|
|
14
|
+
const TAG_PREFIX = `@maplibre/maplibre-react-native`;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Only the post-install block is required, the post installer block is used for SPM (Swift Package Manager) which Expo
|
|
18
|
+
* doesn't currently support.
|
|
19
|
+
*/
|
|
20
|
+
export function applyPodfilePostInstall(contents: string): string {
|
|
21
|
+
const result = mergeContents({
|
|
22
|
+
tag: `${TAG_PREFIX}:post-install`,
|
|
23
|
+
src: contents,
|
|
24
|
+
newSrc: ` $MLRN.post_install(installer)`,
|
|
25
|
+
anchor: /post_install do \|installer\|/,
|
|
26
|
+
offset: 1,
|
|
27
|
+
comment: "#",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (result.didMerge || result.didClear) {
|
|
31
|
+
return result.contents;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return contents;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const withPodfilePostInstall: ConfigPlugin = (config) => {
|
|
38
|
+
return withPodfile(config, (c) => {
|
|
39
|
+
c.modResults.contents = applyPodfilePostInstall(c.modResults.contents);
|
|
40
|
+
|
|
41
|
+
return c;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const applyPodfileGlobalVariables = (
|
|
46
|
+
contents: string,
|
|
47
|
+
props: MapLibrePluginProps,
|
|
48
|
+
): string => {
|
|
49
|
+
const tag = `${TAG_PREFIX}:global-variables`;
|
|
50
|
+
|
|
51
|
+
const globalVariables = [];
|
|
52
|
+
|
|
53
|
+
if (props?.ios?.nativeVersion) {
|
|
54
|
+
globalVariables.push(`$MLRN_NATIVE_VERSION = "${props.ios.nativeVersion}"`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (props?.ios?.spmSpec) {
|
|
58
|
+
globalVariables.push(`$MLRN_SPM_SPEC = ${props.ios.spmSpec}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (globalVariables.length > 0) {
|
|
62
|
+
return mergeContents({
|
|
63
|
+
tag,
|
|
64
|
+
src: contents,
|
|
65
|
+
newSrc: globalVariables.join("\n"),
|
|
66
|
+
anchor: /target .+ do/,
|
|
67
|
+
offset: 0,
|
|
68
|
+
comment: "#",
|
|
69
|
+
}).contents;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const modified = removeGeneratedContents(contents, tag);
|
|
73
|
+
|
|
74
|
+
return modified ?? contents;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps> = (
|
|
78
|
+
config,
|
|
79
|
+
props,
|
|
80
|
+
) => {
|
|
81
|
+
return withPodfile(config, (c) => {
|
|
82
|
+
c.modResults.contents = applyPodfileGlobalVariables(
|
|
83
|
+
c.modResults.contents,
|
|
84
|
+
props,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
return c;
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Exclude building for arm64 on simulator devices in the pbxproj project.
|
|
93
|
+
* Without this, production builds targeting simulators will fail.
|
|
94
|
+
*/
|
|
95
|
+
function setExcludedArchitectures(project: XcodeProject): XcodeProject {
|
|
96
|
+
const configurations = project.pbxXCBuildConfigurationSection();
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
for (const { name, buildSettings } of Object.values(configurations || {})) {
|
|
100
|
+
// Guessing that this is the best way to emulate Xcode.
|
|
101
|
+
// Using `project.addToBuildSettings` modifies too many targets.
|
|
102
|
+
if (
|
|
103
|
+
name === "Release" &&
|
|
104
|
+
typeof buildSettings?.PRODUCT_NAME !== "undefined"
|
|
105
|
+
) {
|
|
106
|
+
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return project;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const withoutSignatures: ConfigPlugin = (config) => {
|
|
114
|
+
return withXcodeProject(config, async (c) => {
|
|
115
|
+
c.modResults.addBuildPhase(
|
|
116
|
+
[],
|
|
117
|
+
"PBXShellScriptBuildPhase",
|
|
118
|
+
"Remove signature files (Xcode workaround)",
|
|
119
|
+
null,
|
|
120
|
+
{
|
|
121
|
+
shellPath: "/bin/sh",
|
|
122
|
+
shellScript: `
|
|
123
|
+
echo "Remove signature files (Xcode workaround)";
|
|
124
|
+
rm -rf "$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature";
|
|
125
|
+
`,
|
|
126
|
+
},
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
return c;
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Set the Debug Information Format to DWARF with dSYM File during EAS Build for Managed App
|
|
135
|
+
* https://github.com/expo/eas-cli/issues/968
|
|
136
|
+
*
|
|
137
|
+
* Set `artifactPath` in `eas.json`:
|
|
138
|
+
* ```json
|
|
139
|
+
* "ios": {
|
|
140
|
+
* "artifactPath": "ios/build/*"
|
|
141
|
+
* }
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
const withDwarfDsym: ConfigPlugin = (config) => {
|
|
145
|
+
return withXcodeProject(config, async (c) => {
|
|
146
|
+
c.modResults.debugInformationFormat = "dwarf-with-dsym";
|
|
147
|
+
|
|
148
|
+
return c;
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const withExcludedSimulatorArchitectures: ConfigPlugin = (config) => {
|
|
153
|
+
return withXcodeProject(config, (c) => {
|
|
154
|
+
c.modResults = setExcludedArchitectures(c.modResults);
|
|
155
|
+
|
|
156
|
+
return c;
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const ios = {
|
|
161
|
+
withPodfilePostInstall,
|
|
162
|
+
withPodfileGlobalVariables,
|
|
163
|
+
withoutSignatures,
|
|
164
|
+
withDwarfDsym,
|
|
165
|
+
withExcludedSimulatorArchitectures,
|
|
166
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ConfigPlugin, createRunOncePlugin } from "@expo/config-plugins";
|
|
2
|
+
|
|
3
|
+
import type { MapLibrePluginProps } from "./MapLibrePluginProps";
|
|
4
|
+
import { android } from "./android";
|
|
5
|
+
import { ios } from "./ios";
|
|
6
|
+
|
|
7
|
+
let pkg: { name: string; version?: string } = {
|
|
8
|
+
name: "@maplibre/maplibre-react-native",
|
|
9
|
+
};
|
|
10
|
+
try {
|
|
11
|
+
pkg = require("@maplibre/maplibre-react-native/package.json");
|
|
12
|
+
} catch {
|
|
13
|
+
// empty catch block
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const withMapLibre: ConfigPlugin<MapLibrePluginProps> = (config, props) => {
|
|
17
|
+
// Android
|
|
18
|
+
config = android.withGradleProperties(config, props);
|
|
19
|
+
|
|
20
|
+
// iOS
|
|
21
|
+
config = ios.withExcludedSimulatorArchitectures(config);
|
|
22
|
+
config = ios.withDwarfDsym(config);
|
|
23
|
+
config = ios.withoutSignatures(config);
|
|
24
|
+
config = ios.withPodfileGlobalVariables(config, props);
|
|
25
|
+
config = ios.withPodfilePostInstall(config);
|
|
26
|
+
|
|
27
|
+
return config;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default createRunOncePlugin(withMapLibre, pkg.name, pkg.version);
|