@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
package/ios/MLRN/MLRNModule.m
CHANGED
|
@@ -19,10 +19,6 @@ RCT_EXPORT_MODULE();
|
|
|
19
19
|
{
|
|
20
20
|
// style urls
|
|
21
21
|
NSMutableDictionary *styleURLS = [[NSMutableDictionary alloc] init];
|
|
22
|
-
|
|
23
|
-
for (MLNDefaultStyle* style in [MLNStyle predefinedStyles]) {
|
|
24
|
-
[styleURLS setObject:[style.url absoluteString] forKey:style.name];
|
|
25
|
-
}
|
|
26
22
|
[styleURLS setObject:[[MLNStyle defaultStyleURL] absoluteString] forKey:@"Default"];
|
|
27
23
|
|
|
28
24
|
// event types
|
|
@@ -71,120 +67,6 @@ RCT_EXPORT_MODULE();
|
|
|
71
67
|
NSMutableDictionary *styleSourceConsts = [[NSMutableDictionary alloc] init];
|
|
72
68
|
[styleSourceConsts setObject:DEFAULT_SOURCE_ID forKey:@"DefaultSourceID"];
|
|
73
69
|
|
|
74
|
-
// line layer constants
|
|
75
|
-
NSMutableDictionary *lineJoin = [[NSMutableDictionary alloc] init];
|
|
76
|
-
[lineJoin setObject:@(MLNLineJoinBevel) forKey:@"Bevel"];
|
|
77
|
-
[lineJoin setObject:@(MLNLineJoinRound) forKey:@"Round"];
|
|
78
|
-
[lineJoin setObject:@(MLNLineJoinMiter) forKey:@"Miter"];
|
|
79
|
-
|
|
80
|
-
NSMutableDictionary *lineCap = [[NSMutableDictionary alloc] init];
|
|
81
|
-
[lineCap setObject:@(MLNLineCapButt) forKey:@"Butt"];
|
|
82
|
-
[lineCap setObject:@(MLNLineCapRound) forKey:@"Round"];
|
|
83
|
-
[lineCap setObject:@(MLNLineCapSquare) forKey:@"Square"];
|
|
84
|
-
|
|
85
|
-
NSMutableDictionary *lineTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
86
|
-
[lineTranslateAnchor setObject:@(MLNLineTranslationAnchorMap) forKey:@"Map"];
|
|
87
|
-
[lineTranslateAnchor setObject:@(MLNLineTranslationAnchorViewport) forKey:@"Viewport"];
|
|
88
|
-
|
|
89
|
-
// circle layer constants
|
|
90
|
-
NSMutableDictionary *circlePitchScale = [[NSMutableDictionary alloc] init];
|
|
91
|
-
[circlePitchScale setObject:@(MLNCircleScaleAlignmentMap) forKey:@"Map"];
|
|
92
|
-
[circlePitchScale setObject:@(MLNCircleScaleAlignmentViewport) forKey:@"Viewport"];
|
|
93
|
-
|
|
94
|
-
NSMutableDictionary *circlePitchAlignment = [[NSMutableDictionary alloc] init];
|
|
95
|
-
[circlePitchAlignment setObject:@(MLNCirclePitchAlignmentMap) forKey:@"Map"];
|
|
96
|
-
[circlePitchAlignment setObject:@(MLNCirclePitchAlignmentViewport) forKey:@"Viewport"];
|
|
97
|
-
|
|
98
|
-
NSMutableDictionary *circleTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
99
|
-
[circleTranslateAnchor setObject:@(MLNCircleTranslationAnchorMap) forKey:@"Map"];
|
|
100
|
-
[circleTranslateAnchor setObject:@(MLNCircleTranslationAnchorViewport) forKey:@"Viewport"];
|
|
101
|
-
|
|
102
|
-
// fill extrusion layer constants
|
|
103
|
-
NSMutableDictionary *fillExtrusionTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
104
|
-
[fillExtrusionTranslateAnchor setObject:@(MLNFillExtrusionTranslationAnchorMap) forKey:@"Map"];
|
|
105
|
-
[fillExtrusionTranslateAnchor setObject:@(MLNFillExtrusionTranslationAnchorViewport) forKey:@"Viewport"];
|
|
106
|
-
|
|
107
|
-
// fill layer constants
|
|
108
|
-
NSMutableDictionary *fillTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
109
|
-
[fillTranslateAnchor setObject:@(MLNFillTranslationAnchorMap) forKey:@"Map"];
|
|
110
|
-
[fillTranslateAnchor setObject:@(MLNFillTranslationAnchorViewport) forKey:@"Viewport"];
|
|
111
|
-
|
|
112
|
-
// symbol layer constants
|
|
113
|
-
NSMutableDictionary *iconRotationAlignment = [[NSMutableDictionary alloc] init];
|
|
114
|
-
[iconRotationAlignment setObject:@(MLNIconRotationAlignmentAuto) forKey:@"Auto"];
|
|
115
|
-
[iconRotationAlignment setObject:@(MLNIconRotationAlignmentMap) forKey:@"Map"];
|
|
116
|
-
[iconRotationAlignment setObject:@(MLNIconRotationAlignmentViewport) forKey:@"Viewport"];
|
|
117
|
-
|
|
118
|
-
NSMutableDictionary *iconTextFit = [[NSMutableDictionary alloc] init];
|
|
119
|
-
[iconTextFit setObject:@(MLNIconTextFitNone) forKey:@"None"];
|
|
120
|
-
[iconTextFit setObject:@(MLNIconTextFitWidth) forKey:@"Width"];
|
|
121
|
-
[iconTextFit setObject:@(MLNIconTextFitHeight) forKey:@"Height"];
|
|
122
|
-
[iconTextFit setObject:@(MLNIconTextFitBoth) forKey:@"Both"];
|
|
123
|
-
|
|
124
|
-
NSMutableDictionary *iconAnchor = [[NSMutableDictionary alloc] init];
|
|
125
|
-
[iconAnchor setObject:@(MLNIconAnchorCenter) forKey:@"Center"];
|
|
126
|
-
[iconAnchor setObject:@(MLNIconAnchorTop) forKey:@"Top"];
|
|
127
|
-
[iconAnchor setObject:@(MLNIconAnchorBottom) forKey:@"Bottom"];
|
|
128
|
-
[iconAnchor setObject:@(MLNIconAnchorLeft) forKey:@"Left"];
|
|
129
|
-
[iconAnchor setObject:@(MLNIconAnchorRight) forKey:@"Right"];
|
|
130
|
-
[iconAnchor setObject:@(MLNIconAnchorTopLeft) forKey:@"TopLeft"];
|
|
131
|
-
[iconAnchor setObject:@(MLNIconAnchorTopRight) forKey:@"TopRight"];
|
|
132
|
-
[iconAnchor setObject:@(MLNIconAnchorBottomLeft) forKey:@"BottomLeft"];
|
|
133
|
-
[iconAnchor setObject:@(MLNIconAnchorBottomRight) forKey:@"BottomRight"];
|
|
134
|
-
|
|
135
|
-
NSMutableDictionary *iconTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
136
|
-
[iconTranslateAnchor setObject:@(MLNIconTranslationAnchorMap) forKey:@"Map"];
|
|
137
|
-
[iconTranslateAnchor setObject:@(MLNIconTranslationAnchorViewport) forKey:@"Viewport"];
|
|
138
|
-
|
|
139
|
-
NSMutableDictionary *iconPitchAlignment = [[NSMutableDictionary alloc] init];
|
|
140
|
-
[iconPitchAlignment setObject:@(MLNIconPitchAlignmentAuto) forKey:@"Auto"];
|
|
141
|
-
[iconPitchAlignment setObject:@(MLNIconPitchAlignmentMap) forKey:@"Map"];
|
|
142
|
-
[iconPitchAlignment setObject:@(MLNIconPitchAlignmentViewport) forKey:@"Viewport"];
|
|
143
|
-
|
|
144
|
-
NSMutableDictionary *symbolPlacement = [[NSMutableDictionary alloc] init];
|
|
145
|
-
[symbolPlacement setObject:@(MLNSymbolPlacementLine) forKey:@"Line"];
|
|
146
|
-
[symbolPlacement setObject:@(MLNSymbolPlacementPoint) forKey:@"Point"];
|
|
147
|
-
|
|
148
|
-
NSMutableDictionary *textAnchor = [[NSMutableDictionary alloc] init];
|
|
149
|
-
[textAnchor setObject:@(MLNTextAnchorCenter) forKey:@"Center"];
|
|
150
|
-
[textAnchor setObject:@(MLNTextAnchorLeft) forKey:@"Left"];
|
|
151
|
-
[textAnchor setObject:@(MLNTextAnchorRight) forKey:@"Right"];
|
|
152
|
-
[textAnchor setObject:@(MLNTextAnchorTop) forKey:@"Top"];
|
|
153
|
-
[textAnchor setObject:@(MLNTextAnchorBottom) forKey:@"Bottom"];
|
|
154
|
-
[textAnchor setObject:@(MLNTextAnchorTopLeft) forKey:@"TopLeft"];
|
|
155
|
-
[textAnchor setObject:@(MLNTextAnchorTopRight) forKey:@"TopRight"];
|
|
156
|
-
[textAnchor setObject:@(MLNTextAnchorBottomLeft) forKey:@"BottomLeft"];
|
|
157
|
-
[textAnchor setObject:@(MLNTextAnchorBottomRight) forKey:@"BottomRight"];
|
|
158
|
-
|
|
159
|
-
NSMutableDictionary *textJustify = [[NSMutableDictionary alloc] init];
|
|
160
|
-
[textJustify setObject:@(MLNTextJustificationCenter) forKey:@"Center"];
|
|
161
|
-
[textJustify setObject:@(MLNTextJustificationLeft) forKey:@"Left"];
|
|
162
|
-
[textJustify setObject:@(MLNTextJustificationRight) forKey:@"Right"];
|
|
163
|
-
|
|
164
|
-
NSMutableDictionary *textPitchAlignment = [[NSMutableDictionary alloc] init];
|
|
165
|
-
[textPitchAlignment setObject:@(MLNTextPitchAlignmentAuto) forKey:@"Auto"];
|
|
166
|
-
[textPitchAlignment setObject:@(MLNTextPitchAlignmentMap) forKey:@"Map"];
|
|
167
|
-
[textPitchAlignment setObject:@(MLNTextPitchAlignmentViewport) forKey:@"Viewport"];
|
|
168
|
-
|
|
169
|
-
NSMutableDictionary *textRotationAlignment = [[NSMutableDictionary alloc] init];
|
|
170
|
-
[textRotationAlignment setObject:@(MLNTextRotationAlignmentAuto) forKey:@"Auto"];
|
|
171
|
-
[textRotationAlignment setObject:@(MLNTextRotationAlignmentMap) forKey:@"Map"];
|
|
172
|
-
[textRotationAlignment setObject:@(MLNTextRotationAlignmentViewport) forKey:@"Viewport"];
|
|
173
|
-
|
|
174
|
-
NSMutableDictionary *textTransform = [[NSMutableDictionary alloc] init];
|
|
175
|
-
[textTransform setObject:@(MLNTextTransformNone) forKey:@"None"];
|
|
176
|
-
[textTransform setObject:@(MLNTextTransformLowercase) forKey:@"Lowercase"];
|
|
177
|
-
[textTransform setObject:@(MLNTextTransformUppercase) forKey:@"Uppercase"];
|
|
178
|
-
|
|
179
|
-
NSMutableDictionary *textTranslateAnchor = [[NSMutableDictionary alloc] init];
|
|
180
|
-
[textTranslateAnchor setObject:@(MLNTextTranslationAnchorMap) forKey:@"Map"];
|
|
181
|
-
[textTranslateAnchor setObject:@(MLNTextTranslationAnchorViewport) forKey:@"Viewport"];
|
|
182
|
-
|
|
183
|
-
// light constants
|
|
184
|
-
NSMutableDictionary *lightAnchor = [[NSMutableDictionary alloc] init];
|
|
185
|
-
[lightAnchor setObject:@(MLNLightAnchorMap) forKey:@"Map"];
|
|
186
|
-
[lightAnchor setObject:@(MLNLightAnchorViewport) forKey:@"Viewport"];
|
|
187
|
-
|
|
188
70
|
// offline module callback names
|
|
189
71
|
NSMutableDictionary *offlineModuleCallbackNames = [[NSMutableDictionary alloc] init];
|
|
190
72
|
[offlineModuleCallbackNames setObject:RCT_MAPBOX_OFFLINE_CALLBACK_ERROR forKey:@"Error"];
|
|
@@ -202,33 +84,16 @@ RCT_EXPORT_MODULE();
|
|
|
202
84
|
@"UserLocationVerticalAlignment": userLocationVerticalAlignment,
|
|
203
85
|
@"CameraModes": cameraModes,
|
|
204
86
|
@"StyleSource": styleSourceConsts,
|
|
205
|
-
@"LineJoin": lineJoin,
|
|
206
|
-
@"LineCap": lineCap,
|
|
207
|
-
@"LineTranslateAnchor": lineTranslateAnchor,
|
|
208
|
-
@"CirclePitchScale": circlePitchScale,
|
|
209
|
-
@"CircleTranslateAnchor": circleTranslateAnchor,
|
|
210
|
-
@"CirclePitchAlignment": circlePitchAlignment,
|
|
211
|
-
@"FillExtrusionTranslateAnchor": fillExtrusionTranslateAnchor,
|
|
212
|
-
@"FillTranslateAnchor": fillTranslateAnchor,
|
|
213
|
-
@"IconRotationAlignment": iconRotationAlignment,
|
|
214
|
-
@"IconTextFit": iconTextFit,
|
|
215
|
-
@"IconTranslateAnchor": iconTranslateAnchor,
|
|
216
|
-
@"IconAnchor": iconAnchor,
|
|
217
|
-
@"IconPitchAlignment": iconPitchAlignment,
|
|
218
|
-
@"SymbolPlacement": symbolPlacement,
|
|
219
|
-
@"TextAnchor": textAnchor,
|
|
220
|
-
@"TextJustify": textJustify,
|
|
221
|
-
@"TextPitchAlignment": textPitchAlignment,
|
|
222
|
-
@"TextRotationAlignment": textRotationAlignment,
|
|
223
|
-
@"TextTransform": textTransform,
|
|
224
|
-
@"TextTranslateAnchor": textTranslateAnchor,
|
|
225
|
-
@"LightAnchor": lightAnchor,
|
|
226
87
|
@"OfflineCallbackName": offlineModuleCallbackNames,
|
|
227
88
|
@"OfflinePackDownloadState": offlinePackDownloadState,
|
|
228
89
|
@"LocationCallbackName": locationModuleEvents
|
|
229
90
|
};
|
|
230
91
|
}
|
|
231
92
|
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated This will be removed in the next major version.
|
|
95
|
+
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
96
|
+
*/
|
|
232
97
|
RCT_EXPORT_METHOD(setAccessToken:(NSString *)accessToken)
|
|
233
98
|
{
|
|
234
99
|
if (accessToken.length > 0) {
|
|
@@ -246,6 +111,10 @@ RCT_EXPORT_METHOD(removeCustomHeader:(NSString *)headerName)
|
|
|
246
111
|
[MLRNCustomHeaders.sharedInstance removeHeader:headerName];
|
|
247
112
|
}
|
|
248
113
|
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated This will be removed in the next major version.
|
|
116
|
+
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
117
|
+
*/
|
|
249
118
|
RCT_EXPORT_METHOD(getAccessToken:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
250
119
|
{
|
|
251
120
|
NSString* accessToken = MLNSettings.apiKey;
|
|
@@ -31,15 +31,4 @@
|
|
|
31
31
|
|
|
32
32
|
- (double)getClusterExpansionZoom:(nonnull NSString *)featureJSON;
|
|
33
33
|
|
|
34
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
35
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterLeavesById:(nonnull NSNumber *)clusterId
|
|
36
|
-
number:(NSUInteger)number
|
|
37
|
-
offset:(NSUInteger)offset;
|
|
38
|
-
|
|
39
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
40
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterChildrenById:(nonnull NSNumber *)clusterId;
|
|
41
|
-
|
|
42
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
43
|
-
- (double)getClusterExpansionZoomById:(nonnull NSNumber *)clusterId;
|
|
44
|
-
|
|
45
34
|
@end
|
|
@@ -145,42 +145,4 @@ static UIImage * _placeHolderImage;
|
|
|
145
145
|
return [shapeSource childrenOfCluster:cluster];
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
150
|
-
- (double)getClusterExpansionZoomById:(nonnull NSNumber *)clusterId
|
|
151
|
-
{
|
|
152
|
-
MLNShapeSource *shapeSource = (MLNShapeSource *)self.source;
|
|
153
|
-
NSArray<id<MLNFeature>> *features = [shapeSource featuresMatchingPredicate: [NSPredicate predicateWithFormat:@"%K = %i", @"cluster_id", clusterId.intValue]];
|
|
154
|
-
if (features.count == 0) {
|
|
155
|
-
return -1;
|
|
156
|
-
}
|
|
157
|
-
return [shapeSource zoomLevelForExpandingCluster:(MLNPointFeatureCluster *)features[0]];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
161
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterLeavesById:(nonnull NSNumber *)clusterId
|
|
162
|
-
number:(NSUInteger)number
|
|
163
|
-
offset:(NSUInteger)offset
|
|
164
|
-
{
|
|
165
|
-
MLNShapeSource *shapeSource = (MLNShapeSource *)self.source;
|
|
166
|
-
|
|
167
|
-
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"cluster_id == %@", clusterId];
|
|
168
|
-
NSArray<id<MLNFeature>> *features = [shapeSource featuresMatchingPredicate:predicate];
|
|
169
|
-
|
|
170
|
-
MLNPointFeatureCluster * cluster = (MLNPointFeatureCluster *)features[0];
|
|
171
|
-
return [shapeSource leavesOfCluster:cluster offset:offset limit:number];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
175
|
-
- (nonnull NSArray<id <MLNFeature>> *)getClusterChildrenById:(nonnull NSNumber *)clusterId
|
|
176
|
-
{
|
|
177
|
-
MLNShapeSource *shapeSource = (MLNShapeSource *)self.source;
|
|
178
|
-
|
|
179
|
-
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"cluster_id == %@", clusterId];
|
|
180
|
-
NSArray<id<MLNFeature>> *features = [shapeSource featuresMatchingPredicate:predicate];
|
|
181
|
-
|
|
182
|
-
MLNPointFeatureCluster * cluster = (MLNPointFeatureCluster *)features[0];
|
|
183
|
-
return [shapeSource childrenOfCluster:cluster];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
148
|
@end
|
|
@@ -128,72 +128,4 @@ RCT_EXPORT_METHOD(getClusterChildren:(nonnull NSNumber*)reactTag
|
|
|
128
128
|
}];
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
132
|
-
RCT_EXPORT_METHOD(getClusterExpansionZoomById:(nonnull NSNumber*)reactTag
|
|
133
|
-
clusterId:(nonnull NSNumber*)clusterId
|
|
134
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
135
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
136
|
-
{
|
|
137
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *manager, NSDictionary<NSNumber*, UIView*> *viewRegistry) {
|
|
138
|
-
MLRNShapeSource* shapeSource = (MLRNShapeSource *)viewRegistry[reactTag];
|
|
139
|
-
|
|
140
|
-
if (![shapeSource isKindOfClass:[MLRNShapeSource class]]) {
|
|
141
|
-
RCTLogError(@"Invalid react tag, could not find MLRNMapView");
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
double zoom = [shapeSource getClusterExpansionZoomById:clusterId];
|
|
146
|
-
if (zoom == -1) {
|
|
147
|
-
reject(@"zoom_error", [NSString stringWithFormat:@"Could not get zoom for cluster id %@", clusterId], nil);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
resolve(@{@"data":@(zoom)});
|
|
151
|
-
}];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
155
|
-
RCT_EXPORT_METHOD(getClusterLeavesById:(nonnull NSNumber*)reactTag
|
|
156
|
-
clusterId:(nonnull NSNumber *)clusterId
|
|
157
|
-
number:(NSUInteger) number
|
|
158
|
-
offset:(NSUInteger) offset
|
|
159
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
160
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
161
|
-
{
|
|
162
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *manager, NSDictionary<NSNumber*, UIView*> *viewRegistry) {
|
|
163
|
-
MLRNShapeSource* shapeSource = (MLRNShapeSource *)viewRegistry[reactTag];
|
|
164
|
-
|
|
165
|
-
NSArray<id<MLNFeature>> *shapes = [shapeSource getClusterLeavesById:clusterId number:number offset:offset];
|
|
166
|
-
|
|
167
|
-
NSMutableArray<NSDictionary*> *features = [[NSMutableArray alloc] initWithCapacity:shapes.count];
|
|
168
|
-
for (int i = 0; i < shapes.count; i++) {
|
|
169
|
-
[features addObject:shapes[i].geoJSONDictionary];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
resolve(@{
|
|
173
|
-
@"data": @{ @"type": @"FeatureCollection", @"features": features }
|
|
174
|
-
});
|
|
175
|
-
}];
|
|
176
|
-
}
|
|
177
|
-
// Deprecated. Will be removed in 9+ ver.
|
|
178
|
-
RCT_EXPORT_METHOD(getClusterChildrenById:(nonnull NSNumber*)reactTag
|
|
179
|
-
clusterId:(nonnull NSNumber *)clusterId
|
|
180
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
181
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
182
|
-
{
|
|
183
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *manager, NSDictionary<NSNumber*, UIView*> *viewRegistry) {
|
|
184
|
-
MLRNShapeSource* shapeSource = (MLRNShapeSource *)viewRegistry[reactTag];
|
|
185
|
-
|
|
186
|
-
NSArray<id<MLNFeature>> *shapes = [shapeSource getClusterChildrenById: clusterId];
|
|
187
|
-
|
|
188
|
-
NSMutableArray<NSDictionary*> *features = [[NSMutableArray alloc] initWithCapacity:shapes.count];
|
|
189
|
-
for (int i = 0; i < shapes.count; i++) {
|
|
190
|
-
[features addObject:shapes[i].geoJSONDictionary];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
resolve(@{
|
|
194
|
-
@"data": @{ @"type": @"FeatureCollection", @"features": features }
|
|
195
|
-
});
|
|
196
|
-
}];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
131
|
@end
|
package/ios/MLRN/MLRNStyle.m
CHANGED
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
26
26
|
for (NSString *prop in styleProps) {
|
|
27
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
27
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
32
28
|
|
|
33
29
|
if ([prop isEqualToString:@"fillSortKey"]) {
|
|
@@ -88,10 +84,6 @@
|
|
|
88
84
|
|
|
89
85
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
90
86
|
for (NSString *prop in styleProps) {
|
|
91
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
87
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
96
88
|
|
|
97
89
|
if ([prop isEqualToString:@"lineCap"]) {
|
|
@@ -176,10 +168,6 @@
|
|
|
176
168
|
|
|
177
169
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
178
170
|
for (NSString *prop in styleProps) {
|
|
179
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
171
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
184
172
|
|
|
185
173
|
if ([prop isEqualToString:@"symbolPlacement"]) {
|
|
@@ -348,10 +336,6 @@
|
|
|
348
336
|
|
|
349
337
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
350
338
|
for (NSString *prop in styleProps) {
|
|
351
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
339
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
356
340
|
|
|
357
341
|
if ([prop isEqualToString:@"circleSortKey"]) {
|
|
@@ -411,10 +395,6 @@
|
|
|
411
395
|
|
|
412
396
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
413
397
|
for (NSString *prop in styleProps) {
|
|
414
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
398
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
419
399
|
|
|
420
400
|
if ([prop isEqualToString:@"visibility"]) {
|
|
@@ -450,10 +430,6 @@
|
|
|
450
430
|
|
|
451
431
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
452
432
|
for (NSString *prop in styleProps) {
|
|
453
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
433
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
458
434
|
|
|
459
435
|
if ([prop isEqualToString:@"visibility"]) {
|
|
@@ -516,10 +492,6 @@
|
|
|
516
492
|
|
|
517
493
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
518
494
|
for (NSString *prop in styleProps) {
|
|
519
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
520
|
-
continue;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
495
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
524
496
|
|
|
525
497
|
if ([prop isEqualToString:@"visibility"]) {
|
|
@@ -567,10 +539,6 @@
|
|
|
567
539
|
|
|
568
540
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
569
541
|
for (NSString *prop in styleProps) {
|
|
570
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
571
|
-
continue;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
542
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
575
543
|
|
|
576
544
|
if ([prop isEqualToString:@"visibility"]) {
|
|
@@ -610,10 +578,6 @@
|
|
|
610
578
|
|
|
611
579
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
612
580
|
for (NSString *prop in styleProps) {
|
|
613
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
614
|
-
continue;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
581
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
618
582
|
|
|
619
583
|
if ([prop isEqualToString:@"visibility"]) {
|
|
@@ -660,10 +624,6 @@
|
|
|
660
624
|
|
|
661
625
|
NSArray<NSString*> *styleProps = [reactStyle allKeys];
|
|
662
626
|
for (NSString *prop in styleProps) {
|
|
663
|
-
if ([prop isEqualToString:@"__MAPBOX_STYLESHEET__"]) {
|
|
664
|
-
continue;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
627
|
MLRNStyleValue *styleValue = [MLRNStyleValue make:reactStyle[prop]];
|
|
668
628
|
|
|
669
629
|
if ([prop isEqualToString:@"anchor"]) {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
#import <React/RCTComponent.h>
|
|
2
1
|
#import "MLRNVectorLayer.h"
|
|
3
2
|
|
|
4
|
-
@interface MLRNSymbolLayer : MLRNVectorLayer
|
|
5
|
-
|
|
6
|
-
@property (nonatomic, strong) NSMutableArray<id<RCTComponent>> *reactSubviews;
|
|
7
|
-
|
|
8
|
-
@property (nonatomic, assign) BOOL snapshot;
|
|
9
|
-
@property (nonatomic, copy) NSString *sourceLayerID;
|
|
3
|
+
@interface MLRNSymbolLayer : MLRNVectorLayer
|
|
10
4
|
|
|
11
5
|
@end
|
|
@@ -1,85 +1,10 @@
|
|
|
1
1
|
#import "MLRNSymbolLayer.h"
|
|
2
2
|
#import "MLRNStyle.h"
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
#import <React/RCTLog.h>
|
|
5
5
|
|
|
6
6
|
@implementation MLRNSymbolLayer
|
|
7
7
|
|
|
8
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
9
|
-
{
|
|
10
|
-
if (self = [super initWithFrame:frame]) {
|
|
11
|
-
_reactSubviews = [[NSMutableArray alloc] init];
|
|
12
|
-
}
|
|
13
|
-
return self;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
- (void)invalidate
|
|
17
|
-
{
|
|
18
|
-
if (_snapshot == YES && self.style != nil) {
|
|
19
|
-
[self.style removeImageForName:self.id];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
#pragma clang diagnostic push
|
|
24
|
-
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
|
|
25
|
-
- (void)insertReactSubview:(id<RCTComponent>)subview atIndex:(NSInteger)atIndex {
|
|
26
|
-
[_reactSubviews insertObject:(UIView *)subview atIndex:(NSUInteger) atIndex];
|
|
27
|
-
}
|
|
28
|
-
#pragma clang diagnostic pop
|
|
29
|
-
|
|
30
|
-
#pragma clang diagnostic push
|
|
31
|
-
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
|
|
32
|
-
- (void)removeReactSubview:(id<RCTComponent>)subview {
|
|
33
|
-
[_reactSubviews removeObject:(UIView *)subview];
|
|
34
|
-
}
|
|
35
|
-
#pragma clang diagnostic pop
|
|
36
|
-
|
|
37
|
-
#pragma clang diagnostic push
|
|
38
|
-
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
|
|
39
|
-
- (NSArray<id<RCTComponent>> *)reactSubviews {
|
|
40
|
-
return nil;
|
|
41
|
-
}
|
|
42
|
-
#pragma clang diagnostic pop
|
|
43
|
-
|
|
44
|
-
- (void)setSnapshot:(BOOL)snapshot
|
|
45
|
-
{
|
|
46
|
-
_snapshot = snapshot;
|
|
47
|
-
|
|
48
|
-
if (self.style != nil) {
|
|
49
|
-
UIImage *image;
|
|
50
|
-
MLNSymbolStyleLayer *layer = (MLNSymbolStyleLayer *) self.styleLayer;
|
|
51
|
-
|
|
52
|
-
if (_snapshot == YES) {
|
|
53
|
-
image = [self _createViewSnapshot];
|
|
54
|
-
[self.style setImage:image forName:self.id];
|
|
55
|
-
layer.iconImageName = [NSExpression expressionWithFormat:self.id];
|
|
56
|
-
} else {
|
|
57
|
-
image = [self.style imageForName:self.id];
|
|
58
|
-
|
|
59
|
-
if (image != nil) {
|
|
60
|
-
[self.style removeImageForName:self.id];
|
|
61
|
-
layer.iconImageName = nil;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
- (void)addedToMap
|
|
68
|
-
{
|
|
69
|
-
[super addedToMap];
|
|
70
|
-
|
|
71
|
-
if (_snapshot == YES) {
|
|
72
|
-
UIImage *image = [self _createViewSnapshot];
|
|
73
|
-
|
|
74
|
-
if (image != nil) {
|
|
75
|
-
[self.style setImage:image forName:self.id];
|
|
76
|
-
|
|
77
|
-
MLNSymbolStyleLayer *layer = (MLNSymbolStyleLayer *)self.styleLayer;
|
|
78
|
-
layer.iconImageName = [NSExpression expressionForConstantValue:self.id];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
8
|
- (MLNSymbolStyleLayer*)makeLayer:(MLNStyle*)style
|
|
84
9
|
{
|
|
85
10
|
MLNSource *source = [self layerWithSourceIDInStyle: style];
|
|
@@ -97,17 +22,4 @@
|
|
|
97
22
|
}];
|
|
98
23
|
}
|
|
99
24
|
|
|
100
|
-
- (UIImage *)_createViewSnapshot
|
|
101
|
-
{
|
|
102
|
-
if (_reactSubviews.count == 0) {
|
|
103
|
-
return nil;
|
|
104
|
-
}
|
|
105
|
-
UIView *view = (UIView *)_reactSubviews[0];
|
|
106
|
-
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.f);
|
|
107
|
-
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
|
|
108
|
-
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
|
|
109
|
-
UIGraphicsEndImageContext();
|
|
110
|
-
return snapshot;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
25
|
@end
|
|
@@ -12,7 +12,6 @@ RCT_EXPORT_VIEW_PROPERTY(sourceLayerID, NSString);
|
|
|
12
12
|
RCT_EXPORT_VIEW_PROPERTY(id, NSString);
|
|
13
13
|
RCT_EXPORT_VIEW_PROPERTY(sourceID, NSString);
|
|
14
14
|
RCT_EXPORT_VIEW_PROPERTY(filter, NSArray);
|
|
15
|
-
RCT_EXPORT_VIEW_PROPERTY(snapshot, BOOL);
|
|
16
15
|
|
|
17
16
|
RCT_EXPORT_VIEW_PROPERTY(aboveLayerID, NSString);
|
|
18
17
|
RCT_EXPORT_VIEW_PROPERTY(belowLayerID, NSString);
|
|
@@ -3,25 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setConnected = exports.setAccessToken = exports.getAccessToken = exports.
|
|
6
|
+
exports.setConnected = exports.setAccessToken = exports.removeCustomHeader = exports.getAccessToken = exports.addCustomHeader = exports.StyleURL = exports.StyleSource = exports.OfflinePackDownloadState = exports.CameraModes = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
const MLRNModule = Object.create(_reactNative.NativeModules.MLRNModule);
|
|
9
9
|
const {
|
|
10
10
|
CameraModes,
|
|
11
|
-
StyleURL,
|
|
12
11
|
OfflinePackDownloadState,
|
|
13
|
-
LineJoin,
|
|
14
12
|
StyleSource,
|
|
13
|
+
StyleURL,
|
|
15
14
|
setAccessToken,
|
|
16
15
|
getAccessToken,
|
|
16
|
+
addCustomHeader,
|
|
17
|
+
removeCustomHeader,
|
|
17
18
|
setConnected
|
|
18
19
|
} = MLRNModule;
|
|
19
20
|
exports.setConnected = setConnected;
|
|
21
|
+
exports.removeCustomHeader = removeCustomHeader;
|
|
22
|
+
exports.addCustomHeader = addCustomHeader;
|
|
20
23
|
exports.getAccessToken = getAccessToken;
|
|
21
24
|
exports.setAccessToken = setAccessToken;
|
|
25
|
+
exports.StyleURL = StyleURL;
|
|
22
26
|
exports.StyleSource = StyleSource;
|
|
23
|
-
exports.LineJoin = LineJoin;
|
|
24
27
|
exports.OfflinePackDownloadState = OfflinePackDownloadState;
|
|
25
|
-
exports.StyleURL = StyleURL;
|
|
26
28
|
exports.CameraModes = CameraModes;
|
|
27
29
|
//# sourceMappingURL=MLRNModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","MLRNModule","Object","create","NativeModules","CameraModes","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","MLRNModule","Object","create","NativeModules","CameraModes","OfflinePackDownloadState","StyleSource","StyleURL","setAccessToken","getAccessToken","addCustomHeader","removeCustomHeader","setConnected","exports"],"sourceRoot":"../../src","sources":["MLRNModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AA4CA,MAAMC,UAAuB,GAAGC,MAAM,CAACC,MAAM,CAACC,0BAAa,CAACH,UAAU,CAAC;AAEhE,MAAM;EACXI,WAAW;EACXC,wBAAwB;EACxBC,WAAW;EACXC,QAAQ;EAERC,cAAc;EACdC,cAAc;EAEdC,eAAe;EACfC,kBAAkB;EAElBC;AACF,CAAC,GAAGZ,UAAU;AAACa,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAAAC,OAAA,CAAAF,kBAAA,GAAAA,kBAAA;AAAAE,OAAA,CAAAH,eAAA,GAAAA,eAAA;AAAAG,OAAA,CAAAJ,cAAA,GAAAA,cAAA;AAAAI,OAAA,CAAAL,cAAA,GAAAA,cAAA;AAAAK,OAAA,CAAAN,QAAA,GAAAA,QAAA;AAAAM,OAAA,CAAAP,WAAA,GAAAA,WAAA;AAAAO,OAAA,CAAAR,wBAAA,GAAAA,wBAAA;AAAAQ,OAAA,CAAAT,WAAA,GAAAA,WAAA","ignoreList":[]}
|