@maplibre/maplibre-react-native 10.0.0-beta.2 → 10.0.0-beta.21
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 +12 -56
- package/android/build.gradle +120 -50
- package/android/gradle.properties +15 -0
- package/android/src/main/AndroidManifest.xml +4 -2
- package/android/src/main/AndroidManifestNew.xml +5 -0
- package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.java +0 -5
- 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/components/styles/sources/MLRNShapeSource.java +0 -66
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
- 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/MLRNBackgroundLayer.h +0 -1
- package/ios/MLRN/MLRNCamera.m +6 -7
- package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
- package/ios/MLRN/MLRNFillLayer.h +0 -1
- package/ios/MLRN/MLRNFillLayer.m +1 -0
- package/ios/MLRN/MLRNLineLayer.h +0 -1
- 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/MLRNRasterLayer.h +0 -1
- package/ios/MLRN/MLRNShapeSource.h +0 -11
- package/ios/MLRN/MLRNShapeSource.m +0 -38
- package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
- package/ios/MLRN/MLRNStyle.m +0 -40
- package/ios/MLRN/MLRNSymbolLayer.h +1 -7
- package/ios/MLRN/MLRNSymbolLayer.m +1 -89
- package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
- package/lib/commonjs/MLRNModule.js +7 -5
- package/lib/commonjs/MLRNModule.js.map +1 -1
- package/lib/commonjs/MapLibreRN.js +74 -68
- 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 +3 -7
- 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 -83
- 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 +11 -45
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +8 -24
- 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 +9 -21
- 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 +3 -2
- package/lib/module/MLRNModule.js.map +1 -1
- package/lib/module/MapLibreRN.js +40 -32
- 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 +3 -8
- 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 -79
- 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 +9 -42
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +7 -23
- 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 +6 -17
- 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 +3 -7
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +44 -34
- 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 -16
- 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 -16
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +3 -10
- 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/{module/src/modules/offline/offlineManager.d.ts → commonjs/src/modules/offline/OfflineManager.d.ts} +27 -37
- package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +3 -4
- 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 +3 -7
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +44 -34
- 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 -16
- 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 -16
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SymbolLayer.d.ts +3 -10
- 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/{commonjs/src/modules/offline/offlineManager.d.ts → module/src/modules/offline/OfflineManager.d.ts} +27 -37
- package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +3 -4
- 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 +24 -10
- package/src/MapLibreRN.ts +66 -49
- 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 +8 -19
- package/src/components/Light.tsx +5 -7
- package/src/components/LineLayer.tsx +7 -9
- package/src/components/MapView.tsx +85 -105
- 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 +22 -95
- package/src/components/SymbolLayer.tsx +12 -41
- package/src/components/UserLocation.tsx +21 -22
- package/src/components/VectorSource.tsx +12 -35
- 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} +32 -45
- package/src/modules/offline/OfflinePack.ts +3 -5
- 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/android/src/main/res/values/strings.xml +0 -3
- package/lib/commonjs/components/Style.js +0 -266
- package/lib/commonjs/components/Style.js.map +0 -1
- 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/deprecation.js +0 -31
- package/lib/commonjs/utils/deprecation.js.map +0 -1
- package/lib/commonjs/utils/styleMap.js +0 -255
- package/lib/commonjs/utils/styleMap.js.map +0 -1
- package/lib/module/components/Style.js +0 -261
- package/lib/module/components/Style.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/deprecation.js +0 -27
- package/lib/module/utils/deprecation.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/components/Style.d.ts +0 -81
- package/lib/typescript/commonjs/src/components/Style.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/deprecation.d.ts +0 -6
- package/lib/typescript/commonjs/src/utils/deprecation.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/components/Style.d.ts +0 -81
- package/lib/typescript/module/src/components/Style.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/deprecation.d.ts +0 -6
- package/lib/typescript/module/src/utils/deprecation.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/components/Style.tsx +0 -371
- package/src/types/StyleURL.ts +0 -3
- package/src/utils/deprecation.ts +0 -31
- package/src/utils/styleMap.ts +0 -265
|
@@ -22,17 +22,17 @@ import {
|
|
|
22
22
|
type NativeSyntheticEvent,
|
|
23
23
|
} from "react-native";
|
|
24
24
|
|
|
25
|
-
import useNativeBridge from "../hooks/useNativeBridge";
|
|
26
|
-
import useOnce from "../hooks/useOnce";
|
|
27
|
-
import { type Location } from "../modules/location/
|
|
25
|
+
import { useNativeBridge } from "../hooks/useNativeBridge";
|
|
26
|
+
import { useOnce } from "../hooks/useOnce";
|
|
27
|
+
import { type Location } from "../modules/location/LocationManager";
|
|
28
28
|
import { type BaseProps } from "../types/BaseProps";
|
|
29
|
+
import { type FilterExpression } from "../types/MapLibreRNStyles";
|
|
29
30
|
import { isFunction, isAndroid } from "../utils";
|
|
30
|
-
import Logger from "../utils/Logger";
|
|
31
|
-
import { type FilterExpression } from "../utils/MapLibreRNStyles";
|
|
31
|
+
import { Logger } from "../utils/Logger";
|
|
32
32
|
import { getFilter } from "../utils/filterUtils";
|
|
33
33
|
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
34
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
35
|
+
if (MLRNModule == null) {
|
|
36
36
|
console.error(
|
|
37
37
|
"Native module of @maplibre/maplibre-react-native library was not registered properly, please consult the docs: https://github.com/maplibre/maplibre-react-native",
|
|
38
38
|
);
|
|
@@ -46,8 +46,6 @@ const styles = StyleSheet.create({
|
|
|
46
46
|
matchParent: { flex: 1 },
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
const defaultStyleURL = MapLibreRN.StyleURL.Street;
|
|
50
|
-
|
|
51
49
|
export interface RegionPayload {
|
|
52
50
|
zoomLevel: number;
|
|
53
51
|
heading: number;
|
|
@@ -69,13 +67,9 @@ interface MapViewProps extends BaseProps {
|
|
|
69
67
|
*/
|
|
70
68
|
style?: ViewProps["style"];
|
|
71
69
|
/**
|
|
72
|
-
* Style
|
|
73
|
-
*/
|
|
74
|
-
styleURL?: string;
|
|
75
|
-
/**
|
|
76
|
-
* StyleJSON for map - according to TileJSON specs: https://github.com/mapbox/tilejson-spec
|
|
70
|
+
* Style for map - either a URL or a Style JSON (https://maplibre.org/maplibre-style-spec/). Default: `StyleURL.Default`
|
|
77
71
|
*/
|
|
78
|
-
|
|
72
|
+
mapStyle?: string | object;
|
|
79
73
|
/**
|
|
80
74
|
* iOS: The preferred frame rate at which the map view is rendered.
|
|
81
75
|
* The default value for this property is MLNMapViewPreferredFramesPerSecondDefault,
|
|
@@ -165,7 +159,7 @@ interface MapViewProps extends BaseProps {
|
|
|
165
159
|
/**
|
|
166
160
|
* This event is triggered whenever the currently displayed map region is about to change.
|
|
167
161
|
*
|
|
168
|
-
* @param {
|
|
162
|
+
* @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
|
|
169
163
|
*/
|
|
170
164
|
onRegionWillChange?(
|
|
171
165
|
feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
|
|
@@ -173,7 +167,7 @@ interface MapViewProps extends BaseProps {
|
|
|
173
167
|
/**
|
|
174
168
|
* This event is triggered whenever the currently displayed map region is changing.
|
|
175
169
|
*
|
|
176
|
-
* @param {
|
|
170
|
+
* @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
|
|
177
171
|
*/
|
|
178
172
|
onRegionIsChanging?(
|
|
179
173
|
feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
|
|
@@ -181,7 +175,7 @@ interface MapViewProps extends BaseProps {
|
|
|
181
175
|
/**
|
|
182
176
|
* This event is triggered whenever the currently displayed map region finished changing
|
|
183
177
|
*
|
|
184
|
-
* @param {
|
|
178
|
+
* @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
|
|
185
179
|
*/
|
|
186
180
|
onRegionDidChange?(
|
|
187
181
|
feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
|
|
@@ -250,13 +244,18 @@ type CallableProps = {
|
|
|
250
244
|
}[keyof MapViewProps];
|
|
251
245
|
|
|
252
246
|
interface NativeProps extends Omit<MapViewProps, "onPress" | "onLongPress"> {
|
|
247
|
+
mapStyle?: string;
|
|
253
248
|
onPress(event: NativeSyntheticEvent<{ payload: GeoJSON.Feature }>): void;
|
|
254
249
|
onLongPress(event: NativeSyntheticEvent<{ payload: GeoJSON.Feature }>): void;
|
|
255
250
|
}
|
|
256
251
|
|
|
257
252
|
export interface MapViewRef {
|
|
258
|
-
getPointInView: (
|
|
259
|
-
|
|
253
|
+
getPointInView: (
|
|
254
|
+
coordinate: GeoJSON.Position,
|
|
255
|
+
) => Promise<[x: number, y: number]>;
|
|
256
|
+
getCoordinateFromView: (
|
|
257
|
+
point: [x: number, y: number],
|
|
258
|
+
) => Promise<GeoJSON.Position>;
|
|
260
259
|
getVisibleBounds: () => Promise<VisibleBounds>;
|
|
261
260
|
queryRenderedFeaturesAtPoint: (
|
|
262
261
|
point: [screenPointX: number, screenPointY: number],
|
|
@@ -268,7 +267,6 @@ export interface MapViewRef {
|
|
|
268
267
|
filter: FilterExpression | undefined,
|
|
269
268
|
layerIDs: string[],
|
|
270
269
|
) => Promise<GeoJSON.FeatureCollection>;
|
|
271
|
-
setCamera: () => void;
|
|
272
270
|
takeSnap: (writeToDisk?: boolean) => Promise<string>;
|
|
273
271
|
getZoom: () => Promise<number>;
|
|
274
272
|
getCenter: () => Promise<GeoJSON.Position>;
|
|
@@ -284,7 +282,7 @@ export interface MapViewRef {
|
|
|
284
282
|
/**
|
|
285
283
|
* MapView backed by MapLibre Native
|
|
286
284
|
*/
|
|
287
|
-
const MapView = memo(
|
|
285
|
+
export const MapView = memo(
|
|
288
286
|
forwardRef<MapViewRef, MapViewProps>(
|
|
289
287
|
(
|
|
290
288
|
{
|
|
@@ -306,23 +304,23 @@ const MapView = memo(
|
|
|
306
304
|
ref,
|
|
307
305
|
(): MapViewRef => ({
|
|
308
306
|
/**
|
|
309
|
-
* Converts a geographic coordinate to a point
|
|
307
|
+
* Converts a geographic coordinate to a pixel point of the view.
|
|
310
308
|
*
|
|
311
309
|
* @example
|
|
312
|
-
* const pointInView = await
|
|
310
|
+
* const pointInView = await mapViewRef.current?.getPointInView([-37.817070, 144.949901]);
|
|
313
311
|
*
|
|
314
|
-
* @param {
|
|
315
|
-
* @return {
|
|
312
|
+
* @param {GeoJSON.Position} coordinate Geographic coordinate
|
|
313
|
+
* @return {[x: number, y: number]} Pixel point
|
|
316
314
|
*/
|
|
317
315
|
getPointInView,
|
|
318
316
|
/**
|
|
319
|
-
* Converts a point
|
|
317
|
+
* Converts a pixel point of the view to a geographic coordinate.
|
|
320
318
|
*
|
|
321
319
|
* @example
|
|
322
|
-
* const coordinate = await
|
|
320
|
+
* const coordinate = await mapViewRef.current?.getCoordinateFromView([100, 100]);
|
|
323
321
|
*
|
|
324
|
-
* @param {
|
|
325
|
-
* @return {
|
|
322
|
+
* @param {[x: number, y: number]} point Pixel point
|
|
323
|
+
* @return {GeoJSON.Position} Geographic coordinate
|
|
326
324
|
*/
|
|
327
325
|
getCoordinateFromView,
|
|
328
326
|
/**
|
|
@@ -340,7 +338,7 @@ const MapView = memo(
|
|
|
340
338
|
* @example
|
|
341
339
|
* this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])
|
|
342
340
|
*
|
|
343
|
-
* @param {
|
|
341
|
+
* @param {number[]} coordinate - A point expressed in the map view’s coordinate system.
|
|
344
342
|
* @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
|
|
345
343
|
* @param {Array=} layerIDs - A array of layer id's to filter the features by
|
|
346
344
|
* @return {GeoJSON.FeatureCollection}
|
|
@@ -353,20 +351,16 @@ const MapView = memo(
|
|
|
353
351
|
* @example
|
|
354
352
|
* this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])
|
|
355
353
|
*
|
|
356
|
-
* @param {
|
|
354
|
+
* @param {number[]} bbox - A rectangle expressed in the map view’s coordinate system.
|
|
357
355
|
* @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
|
|
358
356
|
* @param {Array=} layerIDs - A array of layer id's to filter the features by
|
|
359
357
|
* @return {GeoJSON.FeatureCollection}
|
|
360
358
|
*/
|
|
361
359
|
queryRenderedFeaturesInRect,
|
|
362
|
-
/**
|
|
363
|
-
* Map camera will perform updates based on provided config. Deprecated use Camera#setCamera.
|
|
364
|
-
*/
|
|
365
|
-
setCamera,
|
|
366
360
|
/**
|
|
367
361
|
* Takes snapshot of map with current tiles and returns a URI to the image
|
|
368
|
-
* @param {
|
|
369
|
-
* @return {
|
|
362
|
+
* @param {boolean} writeToDisk If true will create a temp file, otherwise it is in base64
|
|
363
|
+
* @return {string}
|
|
370
364
|
*/
|
|
371
365
|
takeSnap,
|
|
372
366
|
/**
|
|
@@ -375,7 +369,7 @@ const MapView = memo(
|
|
|
375
369
|
* @example
|
|
376
370
|
* const zoom = await this._map.getZoom();
|
|
377
371
|
*
|
|
378
|
-
* @return {
|
|
372
|
+
* @return {number}
|
|
379
373
|
*/
|
|
380
374
|
getZoom,
|
|
381
375
|
/**
|
|
@@ -384,7 +378,7 @@ const MapView = memo(
|
|
|
384
378
|
* @example
|
|
385
379
|
* const center = await this._map.getCenter();
|
|
386
380
|
*
|
|
387
|
-
* @return {
|
|
381
|
+
* @return {number[]} Coordinates
|
|
388
382
|
*/
|
|
389
383
|
getCenter,
|
|
390
384
|
/**
|
|
@@ -394,8 +388,8 @@ const MapView = memo(
|
|
|
394
388
|
* await this._map.setSourceVisibility(false, 'composite', 'building')
|
|
395
389
|
*
|
|
396
390
|
* @param {boolean} visible - Visibility of the layers
|
|
397
|
-
* @param {
|
|
398
|
-
* @param {
|
|
391
|
+
* @param {string} sourceId - Identifier of the target source (e.g. 'composite')
|
|
392
|
+
* @param {string=} sourceLayerId - Identifier of the target source-layer (e.g. 'building')
|
|
399
393
|
*/
|
|
400
394
|
setSourceVisibility,
|
|
401
395
|
/**
|
|
@@ -443,46 +437,46 @@ const MapView = memo(
|
|
|
443
437
|
const events = [];
|
|
444
438
|
|
|
445
439
|
if (props.onRegionWillChange) {
|
|
446
|
-
events.push(
|
|
440
|
+
events.push(MLRNModule.EventTypes.RegionWillChange);
|
|
447
441
|
}
|
|
448
442
|
if (props.onRegionIsChanging) {
|
|
449
|
-
events.push(
|
|
443
|
+
events.push(MLRNModule.EventTypes.RegionIsChanging);
|
|
450
444
|
}
|
|
451
445
|
if (props.onRegionDidChange) {
|
|
452
|
-
events.push(
|
|
446
|
+
events.push(MLRNModule.EventTypes.RegionDidChange);
|
|
453
447
|
}
|
|
454
448
|
if (props.onUserLocationUpdate) {
|
|
455
|
-
events.push(
|
|
449
|
+
events.push(MLRNModule.EventTypes.UserLocationUpdated);
|
|
456
450
|
}
|
|
457
451
|
if (props.onWillStartLoadingMap) {
|
|
458
|
-
events.push(
|
|
452
|
+
events.push(MLRNModule.EventTypes.WillStartLoadingMap);
|
|
459
453
|
}
|
|
460
454
|
if (props.onDidFinishLoadingMap) {
|
|
461
|
-
events.push(
|
|
455
|
+
events.push(MLRNModule.EventTypes.DidFinishLoadingMap);
|
|
462
456
|
}
|
|
463
457
|
if (props.onDidFailLoadingMap) {
|
|
464
|
-
events.push(
|
|
458
|
+
events.push(MLRNModule.EventTypes.DidFailLoadingMap);
|
|
465
459
|
}
|
|
466
460
|
if (props.onWillStartRenderingFrame) {
|
|
467
|
-
events.push(
|
|
461
|
+
events.push(MLRNModule.EventTypes.WillStartRenderingFrame);
|
|
468
462
|
}
|
|
469
463
|
if (props.onDidFinishRenderingFrame) {
|
|
470
|
-
events.push(
|
|
464
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingFrame);
|
|
471
465
|
}
|
|
472
466
|
if (props.onDidFinishRenderingFrameFully) {
|
|
473
|
-
events.push(
|
|
467
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingFrameFully);
|
|
474
468
|
}
|
|
475
469
|
if (props.onWillStartRenderingMap) {
|
|
476
|
-
events.push(
|
|
470
|
+
events.push(MLRNModule.EventTypes.WillStartRenderingMap);
|
|
477
471
|
}
|
|
478
472
|
if (props.onDidFinishRenderingMap) {
|
|
479
|
-
events.push(
|
|
473
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingMap);
|
|
480
474
|
}
|
|
481
475
|
if (props.onDidFinishRenderingMapFully) {
|
|
482
|
-
events.push(
|
|
476
|
+
events.push(MLRNModule.EventTypes.DidFinishRenderingMapFully);
|
|
483
477
|
}
|
|
484
478
|
if (props.onDidFinishLoadingStyle) {
|
|
485
|
-
events.push(
|
|
479
|
+
events.push(MLRNModule.EventTypes.DidFinishLoadingStyle);
|
|
486
480
|
}
|
|
487
481
|
|
|
488
482
|
_runNativeCommand(
|
|
@@ -495,22 +489,23 @@ const MapView = memo(
|
|
|
495
489
|
|
|
496
490
|
const getPointInView = async (
|
|
497
491
|
coordinate: GeoJSON.Position,
|
|
498
|
-
): Promise<
|
|
499
|
-
const res: { pointInView:
|
|
500
|
-
"getPointInView",
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
492
|
+
): Promise<[x: number, y: number]> => {
|
|
493
|
+
const res: { pointInView: [x: number, y: number] } =
|
|
494
|
+
await _runNativeCommand("getPointInView", _nativeRef.current, [
|
|
495
|
+
coordinate,
|
|
496
|
+
]);
|
|
497
|
+
|
|
504
498
|
return res.pointInView;
|
|
505
499
|
};
|
|
506
500
|
|
|
507
501
|
const getCoordinateFromView = async (
|
|
508
|
-
point: number
|
|
502
|
+
point: [x: number, y: number],
|
|
509
503
|
): Promise<GeoJSON.Position> => {
|
|
510
504
|
const res: { coordinateFromView: GeoJSON.Position } =
|
|
511
505
|
await _runNativeCommand("getCoordinateFromView", _nativeRef.current, [
|
|
512
506
|
point,
|
|
513
507
|
]);
|
|
508
|
+
|
|
514
509
|
return res.coordinateFromView;
|
|
515
510
|
};
|
|
516
511
|
|
|
@@ -571,12 +566,6 @@ const MapView = memo(
|
|
|
571
566
|
return res.data as GeoJSON.FeatureCollection;
|
|
572
567
|
};
|
|
573
568
|
|
|
574
|
-
const setCamera = (): void => {
|
|
575
|
-
console.warn(
|
|
576
|
-
"MapView.setCamera is deprecated - please use Camera#setCamera",
|
|
577
|
-
);
|
|
578
|
-
};
|
|
579
|
-
|
|
580
569
|
const takeSnap = async (writeToDisk = false): Promise<string> => {
|
|
581
570
|
const res: { uri: string } = await _runNativeCommand(
|
|
582
571
|
"takeSnap",
|
|
@@ -672,7 +661,7 @@ const MapView = memo(
|
|
|
672
661
|
let propName: CallableProps | undefined;
|
|
673
662
|
|
|
674
663
|
switch (type) {
|
|
675
|
-
case
|
|
664
|
+
case MLRNModule.EventTypes.RegionWillChange:
|
|
676
665
|
if (
|
|
677
666
|
regionWillChangeDebounceTime &&
|
|
678
667
|
regionWillChangeDebounceTime > 0
|
|
@@ -686,10 +675,10 @@ const MapView = memo(
|
|
|
686
675
|
propName = "onRegionWillChange";
|
|
687
676
|
}
|
|
688
677
|
break;
|
|
689
|
-
case
|
|
678
|
+
case MLRNModule.EventTypes.RegionIsChanging:
|
|
690
679
|
propName = "onRegionIsChanging";
|
|
691
680
|
break;
|
|
692
|
-
case
|
|
681
|
+
case MLRNModule.EventTypes.RegionDidChange:
|
|
693
682
|
if (
|
|
694
683
|
regionDidChangeDebounceTime &&
|
|
695
684
|
regionDidChangeDebounceTime > 0
|
|
@@ -703,37 +692,37 @@ const MapView = memo(
|
|
|
703
692
|
propName = "onRegionDidChange";
|
|
704
693
|
}
|
|
705
694
|
break;
|
|
706
|
-
case
|
|
695
|
+
case MLRNModule.EventTypes.UserLocationUpdated:
|
|
707
696
|
propName = "onUserLocationUpdate";
|
|
708
697
|
break;
|
|
709
|
-
case
|
|
698
|
+
case MLRNModule.EventTypes.WillStartLoadingMap:
|
|
710
699
|
propName = "onWillStartLoadingMap";
|
|
711
700
|
break;
|
|
712
|
-
case
|
|
701
|
+
case MLRNModule.EventTypes.DidFinishLoadingMap:
|
|
713
702
|
propName = "onDidFinishLoadingMap";
|
|
714
703
|
break;
|
|
715
|
-
case
|
|
704
|
+
case MLRNModule.EventTypes.DidFailLoadingMap:
|
|
716
705
|
propName = "onDidFailLoadingMap";
|
|
717
706
|
break;
|
|
718
|
-
case
|
|
707
|
+
case MLRNModule.EventTypes.WillStartRenderingFrame:
|
|
719
708
|
propName = "onWillStartRenderingFrame";
|
|
720
709
|
break;
|
|
721
|
-
case
|
|
710
|
+
case MLRNModule.EventTypes.DidFinishRenderingFrame:
|
|
722
711
|
propName = "onDidFinishRenderingFrame";
|
|
723
712
|
break;
|
|
724
|
-
case
|
|
713
|
+
case MLRNModule.EventTypes.DidFinishRenderingFrameFully:
|
|
725
714
|
propName = "onDidFinishRenderingFrameFully";
|
|
726
715
|
break;
|
|
727
|
-
case
|
|
716
|
+
case MLRNModule.EventTypes.WillStartRenderingMap:
|
|
728
717
|
propName = "onWillStartRenderingMap";
|
|
729
718
|
break;
|
|
730
|
-
case
|
|
719
|
+
case MLRNModule.EventTypes.DidFinishRenderingMap:
|
|
731
720
|
propName = "onDidFinishRenderingMap";
|
|
732
721
|
break;
|
|
733
|
-
case
|
|
722
|
+
case MLRNModule.EventTypes.DidFinishRenderingMapFully:
|
|
734
723
|
propName = "onDidFinishRenderingMapFully";
|
|
735
724
|
break;
|
|
736
|
-
case
|
|
725
|
+
case MLRNModule.EventTypes.DidFinishLoadingStyle:
|
|
737
726
|
propName = "onDidFinishLoadingStyle";
|
|
738
727
|
break;
|
|
739
728
|
default:
|
|
@@ -782,27 +771,20 @@ const MapView = memo(
|
|
|
782
771
|
}
|
|
783
772
|
};
|
|
784
773
|
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
// user neither set styleJSON nor styleURL
|
|
797
|
-
// set defaultStyleUrl
|
|
798
|
-
if (!props.styleJSON || !props.styleURL) {
|
|
799
|
-
props.styleURL = defaultStyleURL;
|
|
774
|
+
const nativeProps = useMemo(() => {
|
|
775
|
+
const { mapStyle, ...otherProps } = props;
|
|
776
|
+
|
|
777
|
+
let nativeMapStyle = undefined;
|
|
778
|
+
if (mapStyle) {
|
|
779
|
+
if (typeof mapStyle === "string") {
|
|
780
|
+
nativeMapStyle = mapStyle;
|
|
781
|
+
} else if (typeof mapStyle === "object") {
|
|
782
|
+
nativeMapStyle = JSON.stringify(mapStyle);
|
|
783
|
+
}
|
|
800
784
|
}
|
|
801
|
-
};
|
|
802
785
|
|
|
803
|
-
const nativeProps = useMemo(() => {
|
|
804
786
|
return {
|
|
805
|
-
...
|
|
787
|
+
...otherProps,
|
|
806
788
|
localizeLabels,
|
|
807
789
|
scrollEnabled,
|
|
808
790
|
pitchEnabled,
|
|
@@ -812,10 +794,12 @@ const MapView = memo(
|
|
|
812
794
|
surfaceView,
|
|
813
795
|
regionWillChangeDebounceTime,
|
|
814
796
|
regionDidChangeDebounceTime,
|
|
797
|
+
mapStyle: nativeMapStyle,
|
|
815
798
|
contentInset: contentInsetValue,
|
|
816
799
|
style: styles.matchParent,
|
|
817
800
|
};
|
|
818
801
|
}, [
|
|
802
|
+
props,
|
|
819
803
|
localizeLabels,
|
|
820
804
|
scrollEnabled,
|
|
821
805
|
pitchEnabled,
|
|
@@ -825,12 +809,9 @@ const MapView = memo(
|
|
|
825
809
|
surfaceView,
|
|
826
810
|
regionWillChangeDebounceTime,
|
|
827
811
|
regionDidChangeDebounceTime,
|
|
828
|
-
props,
|
|
829
812
|
contentInsetValue,
|
|
830
813
|
]);
|
|
831
814
|
|
|
832
|
-
_setStyleURL(nativeProps);
|
|
833
|
-
|
|
834
815
|
const callbacks = {
|
|
835
816
|
ref: (ref: MLRNMapViewRefType): void => _setNativeRef(ref),
|
|
836
817
|
onPress: _onPress,
|
|
@@ -876,4 +857,3 @@ if (isAndroid()) {
|
|
|
876
857
|
ANDROID_TEXTURE_NATIVE_MODULE_NAME,
|
|
877
858
|
);
|
|
878
859
|
}
|
|
879
|
-
export default MapView;
|
|
@@ -2,7 +2,7 @@ import { point } from "@turf/helpers";
|
|
|
2
2
|
import { type ReactElement, useMemo } from "react";
|
|
3
3
|
import { Platform, requireNativeComponent, type ViewProps } from "react-native";
|
|
4
4
|
|
|
5
|
-
import PointAnnotation from "./PointAnnotation";
|
|
5
|
+
import { PointAnnotation } from "./PointAnnotation";
|
|
6
6
|
import { toJSONString } from "../utils";
|
|
7
7
|
|
|
8
8
|
export const NATIVE_MODULE_NAME = "MLRNMarkerView";
|
|
@@ -35,7 +35,7 @@ interface MarkerViewProps extends ViewProps {
|
|
|
35
35
|
/**
|
|
36
36
|
* Expects one child - can be container with multiple elements
|
|
37
37
|
*/
|
|
38
|
-
children:
|
|
38
|
+
children: ReactElement;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
interface NativeProps extends ViewProps {
|
|
@@ -53,12 +53,12 @@ interface NativeProps extends ViewProps {
|
|
|
53
53
|
* This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android
|
|
54
54
|
* and PointAnnotation on iOS.
|
|
55
55
|
*/
|
|
56
|
-
const MarkerView = ({
|
|
56
|
+
export const MarkerView = ({
|
|
57
57
|
anchor = { x: 0.5, y: 0.5 },
|
|
58
58
|
allowOverlap = false,
|
|
59
59
|
isSelected = false,
|
|
60
60
|
...rest
|
|
61
|
-
}: MarkerViewProps)
|
|
61
|
+
}: MarkerViewProps) => {
|
|
62
62
|
const props = { anchor, allowOverlap, isSelected, ...rest };
|
|
63
63
|
const coordinate = props.coordinate
|
|
64
64
|
? toJSONString(point(props.coordinate))
|
|
@@ -84,5 +84,3 @@ const MarkerView = ({
|
|
|
84
84
|
let lastId = 0;
|
|
85
85
|
|
|
86
86
|
const MLRNMarkerView = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
87
|
-
|
|
88
|
-
export default MarkerView;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
1
|
import { requireNativeComponent } from "react-native";
|
|
3
2
|
|
|
4
3
|
const NATIVE_MODULE_NAME = "MLRNNativeUserLocation";
|
|
@@ -26,10 +25,8 @@ interface NativeUserLocationProps {
|
|
|
26
25
|
androidPreferredFramesPerSecond?: number;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
const NativeUserLocation = (props: NativeUserLocationProps)
|
|
28
|
+
export const NativeUserLocation = (props: NativeUserLocationProps) => {
|
|
30
29
|
return <MLRNNativeUserLocation {...props} />;
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
const MLRNNativeUserLocation = requireNativeComponent(NATIVE_MODULE_NAME);
|
|
34
|
-
|
|
35
|
-
export default NativeUserLocation;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
requireNativeComponent,
|
|
15
15
|
} from "react-native";
|
|
16
16
|
|
|
17
|
-
import useNativeBridge,
|
|
17
|
+
import { useNativeBridge, type RNMLEvent } from "../hooks/useNativeBridge";
|
|
18
18
|
import { isFunction, toJSONString } from "../utils";
|
|
19
19
|
|
|
20
20
|
export const NATIVE_MODULE_NAME = "MLRNPointAnnotation";
|
|
@@ -50,7 +50,6 @@ export interface PointAnnotationProps {
|
|
|
50
50
|
snippet?: string;
|
|
51
51
|
/**
|
|
52
52
|
* Manually selects/deselects annotation
|
|
53
|
-
* @type {[type]}
|
|
54
53
|
*/
|
|
55
54
|
selected?: boolean;
|
|
56
55
|
/**
|
|
@@ -102,7 +101,7 @@ export interface PointAnnotationProps {
|
|
|
102
101
|
/**
|
|
103
102
|
* Expects one child, and an optional callout can be added as well
|
|
104
103
|
*/
|
|
105
|
-
children:
|
|
104
|
+
children: ReactElement | [ReactElement, ReactElement];
|
|
106
105
|
|
|
107
106
|
style?: ViewProps["style"];
|
|
108
107
|
}
|
|
@@ -118,14 +117,16 @@ export interface PointAnnotationRef {
|
|
|
118
117
|
/**
|
|
119
118
|
* PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.
|
|
120
119
|
*
|
|
121
|
-
* Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,
|
|
122
|
-
* they'll offer much better performance
|
|
120
|
+
* Consider using ShapeSource and SymbolLayer instead, if you have many points, and you have static images,
|
|
121
|
+
* they'll offer much better performance.
|
|
123
122
|
*
|
|
124
|
-
*
|
|
125
|
-
* If you need interctive views please use MarkerView,
|
|
123
|
+
* If you need interactive views please use MarkerView,
|
|
126
124
|
* as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
127
125
|
*/
|
|
128
|
-
const PointAnnotation = forwardRef<
|
|
126
|
+
export const PointAnnotation = forwardRef<
|
|
127
|
+
PointAnnotationRef,
|
|
128
|
+
PointAnnotationProps
|
|
129
|
+
>(
|
|
129
130
|
(
|
|
130
131
|
{
|
|
131
132
|
anchor = { x: 0.5, y: 0.5 },
|
|
@@ -133,7 +134,7 @@ const PointAnnotation = forwardRef<PointAnnotationRef, PointAnnotationProps>(
|
|
|
133
134
|
...props
|
|
134
135
|
}: PointAnnotationProps,
|
|
135
136
|
ref,
|
|
136
|
-
)
|
|
137
|
+
) => {
|
|
137
138
|
useImperativeHandle(
|
|
138
139
|
ref,
|
|
139
140
|
(): PointAnnotationRef => ({
|
|
@@ -241,5 +242,3 @@ PointAnnotation.displayName = "PointAnnotation";
|
|
|
241
242
|
|
|
242
243
|
const MLRNPointAnnotation =
|
|
243
244
|
requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
244
|
-
|
|
245
|
-
export default PointAnnotation;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { NativeModules, requireNativeComponent } from "react-native";
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
useAbstractLayer,
|
|
5
5
|
type BaseLayerProps,
|
|
6
6
|
type NativeBaseProps,
|
|
7
7
|
} from "../hooks/useAbstractLayer";
|
|
8
8
|
import { type BaseProps } from "../types/BaseProps";
|
|
9
|
-
import { type
|
|
9
|
+
import { type RasterLayerStyle } from "../types/MapLibreRNStyles";
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
12
12
|
|
|
13
13
|
export const NATIVE_MODULE_NAME = "MLRNRasterLayer";
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ export interface RasterLayerProps extends BaseProps, BaseLayerProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* Customizable style attributes
|
|
18
18
|
*/
|
|
19
|
-
style?:
|
|
19
|
+
style?: RasterLayerStyle;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface NativeProps
|
|
@@ -25,8 +25,8 @@ interface NativeProps
|
|
|
25
25
|
|
|
26
26
|
const MLRNRasterLayer = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
27
27
|
|
|
28
|
-
const RasterLayer
|
|
29
|
-
sourceID =
|
|
28
|
+
export const RasterLayer = ({
|
|
29
|
+
sourceID = MLRNModule.StyleSource.DefaultSourceID,
|
|
30
30
|
...props
|
|
31
31
|
}: RasterLayerProps) => {
|
|
32
32
|
const { baseProps, setNativeLayer } = useAbstractLayer<
|
|
@@ -39,5 +39,3 @@ const RasterLayer: React.FC<RasterLayerProps> = ({
|
|
|
39
39
|
|
|
40
40
|
return <MLRNRasterLayer ref={setNativeLayer} {...baseProps} />;
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
export default RasterLayer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { NativeModules, requireNativeComponent } from "react-native";
|
|
3
3
|
|
|
4
|
-
import useAbstractSource from "../hooks/useAbstractSource";
|
|
5
|
-
import useOnce from "../hooks/useOnce";
|
|
4
|
+
import { useAbstractSource } from "../hooks/useAbstractSource";
|
|
5
|
+
import { useOnce } from "../hooks/useOnce";
|
|
6
6
|
import { type BaseProps } from "../types/BaseProps";
|
|
7
7
|
import { cloneReactChildrenWithProps } from "../utils";
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const MLRNModule = NativeModules.MLRNModule;
|
|
10
10
|
|
|
11
11
|
export const NATIVE_MODULE_NAME = "MLRNRasterSource";
|
|
12
12
|
|
|
@@ -55,7 +55,7 @@ interface RasterSourceProps extends BaseProps {
|
|
|
55
55
|
*/
|
|
56
56
|
attribution?: string;
|
|
57
57
|
|
|
58
|
-
children?:
|
|
58
|
+
children?: ReactNode;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
type NativeProps = RasterSourceProps;
|
|
@@ -68,8 +68,8 @@ const MLRNRasterSource =
|
|
|
68
68
|
* The location of and metadata about the tiles are defined either by an option dictionary
|
|
69
69
|
* or by an external file that conforms to the TileJSON specification.
|
|
70
70
|
*/
|
|
71
|
-
const RasterSource
|
|
72
|
-
id =
|
|
71
|
+
export const RasterSource = ({
|
|
72
|
+
id = MLRNModule.StyleSource.DefaultSourceID,
|
|
73
73
|
...props
|
|
74
74
|
}: RasterSourceProps) => {
|
|
75
75
|
useOnce(() => {
|
|
@@ -110,5 +110,3 @@ const RasterSource: React.FC<RasterSourceProps> = ({
|
|
|
110
110
|
</MLRNRasterSource>
|
|
111
111
|
);
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
export default RasterSource;
|