@rnmapbox/maps 10.1.0-beta.10 → 10.1.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rnmapbox/rnmbx/components/AbstractMapFeature.kt +2 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXCamera.kt +66 -9
- package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImages.kt +2 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/location/LocationComponentManager.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/location/UserTrackingMode.kt +1 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +7 -4
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +51 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/layers/RNMBXSkyLayerManager.kt +0 -6
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/BitmapUtils.kt +0 -31
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/DownloadMapImageTask.kt +28 -67
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableMap.kt +35 -0
- package/android/src/main/mapbox-v11-compat/v11/com/mapbox/rnmbx/v11compat/Image.kt +1 -1
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java +3 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java +1 -0
- package/ios/RNMBX/CustomHttpHeaders.swift +11 -0
- package/ios/RNMBX/RNMBXMapView.swift +56 -1
- package/ios/RNMBX/RNMBXMapViewManager.m +2 -0
- package/ios/install.md +1 -1
- package/lib/commonjs/Mapbox.js +2 -2
- package/lib/commonjs/Mapbox.js.map +1 -1
- package/lib/commonjs/components/AbstractLayer.js +1 -2
- package/lib/commonjs/components/AbstractLayer.js.map +1 -1
- package/lib/commonjs/components/Annotation.js +2 -3
- package/lib/commonjs/components/Annotation.js.map +1 -1
- package/lib/commonjs/components/Atmosphere.js +2 -2
- package/lib/commonjs/components/Atmosphere.js.map +1 -1
- package/lib/commonjs/components/Camera.js +9 -12
- package/lib/commonjs/components/Camera.js.map +1 -1
- package/lib/commonjs/components/Image.js +2 -2
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Light.js +3 -4
- package/lib/commonjs/components/Light.js.map +1 -1
- package/lib/commonjs/components/MapView.js +2 -5
- package/lib/commonjs/components/MapView.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/ShapeSource.js +1 -2
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/Style.js +2 -2
- package/lib/commonjs/components/Style.js.map +1 -1
- package/lib/commonjs/components/StyleImport.js +2 -2
- package/lib/commonjs/components/StyleImport.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js +1 -1
- package/lib/commonjs/components/SymbolLayer.js.map +1 -1
- package/lib/commonjs/components/Terrain.js +2 -2
- package/lib/commonjs/components/Terrain.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +2 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXCameraNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXCameraNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +1 -2
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/module/components/AbstractLayer.js +1 -2
- package/lib/module/components/AbstractLayer.js.map +1 -1
- package/lib/module/components/Annotation.js +2 -3
- package/lib/module/components/Annotation.js.map +1 -1
- package/lib/module/components/Camera.js +7 -10
- package/lib/module/components/Camera.js.map +1 -1
- package/lib/module/components/Light.js +1 -2
- package/lib/module/components/Light.js.map +1 -1
- package/lib/module/components/MapView.js +2 -5
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/ShapeSource.js +1 -2
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SymbolLayer.js +1 -1
- package/lib/module/components/SymbolLayer.js.map +1 -1
- package/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXCameraNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXCameraNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXCircleLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXCircleLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXFillLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXFillLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXLineLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXLineLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXMapViewNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXMapViewNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXRasterLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXRasterLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXSkyLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXSkyLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXSymbolLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXSymbolLayerNativeComponent.js.map +1 -1
- package/lib/module/utils/Logger.js +1 -2
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/typescript/jest.config.d.ts +4 -0
- package/lib/typescript/jest.config.d.ts.map +1 -0
- package/lib/typescript/src/Mapbox.d.ts.map +1 -0
- package/lib/typescript/src/RNMBXModule.d.ts.map +1 -0
- package/lib/typescript/src/components/AbstractLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/AbstractSource.d.ts.map +1 -0
- package/lib/typescript/src/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/src/components/Atmosphere.d.ts.map +1 -0
- package/lib/typescript/src/components/BackgroundLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/Callout.d.ts.map +1 -0
- package/lib/typescript/src/components/Camera.d.ts.map +1 -0
- package/lib/typescript/src/components/CircleLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/FillExtrusionLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/FillLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/HeadingIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/HeatmapLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/Image.d.ts.map +1 -0
- package/lib/typescript/src/components/ImageSource.d.ts.map +1 -0
- package/lib/typescript/src/components/Images.d.ts.map +1 -0
- package/lib/typescript/src/components/Light.d.ts.map +1 -0
- package/lib/typescript/src/components/LineLayer.d.ts.map +1 -0
- package/lib/typescript/{components → src/components}/MapView.d.ts +64 -0
- package/lib/typescript/src/components/MapView.d.ts.map +1 -0
- package/lib/typescript/src/components/MarkerView.d.ts.map +1 -0
- package/lib/typescript/src/components/NativeBridgeComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -0
- package/lib/typescript/src/components/RasterDemSource.d.ts.map +1 -0
- package/lib/typescript/src/components/RasterLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -0
- package/lib/typescript/src/components/SkyLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/Style.d.ts.map +1 -0
- package/lib/typescript/src/components/StyleImport.d.ts.map +1 -0
- package/lib/typescript/src/components/SymbolLayer.d.ts.map +1 -0
- package/lib/typescript/src/components/Terrain.d.ts.map +1 -0
- package/lib/typescript/src/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/src/components/VectorSource.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/modules/location/locationManager.d.ts.map +1 -0
- package/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
- package/lib/typescript/src/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/src/modules/offline/offlineManager.d.ts.map +1 -0
- package/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
- package/lib/typescript/src/modules/snapshot/snapshotManager.d.ts.map +1 -0
- package/lib/typescript/src/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeMapViewModule.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{specs → src/specs}/RNMBXBackgroundLayerNativeComponent.d.ts +7 -6
- package/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{specs → src/specs}/RNMBXCameraNativeComponent.d.ts +12 -11
- package/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts +20 -0
- package/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{specs → src/specs}/RNMBXFillExtrusionLayerNativeComponent.d.ts +10 -9
- package/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts +20 -0
- package/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts +20 -0
- package/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts +20 -0
- package/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{specs → src/specs}/RNMBXMapViewNativeComponent.d.ts +23 -15
- package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts +20 -0
- package/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts +19 -0
- package/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts +20 -0
- package/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{specs → src/specs}/codegenUtils.d.ts +1 -0
- package/lib/typescript/src/specs/codegenUtils.d.ts.map +1 -0
- package/lib/typescript/src/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/src/types/OnPressEvent.d.ts.map +1 -0
- package/lib/typescript/src/types/Position.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/src/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/src/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/src/utils/checkRequiredProps.d.ts.map +1 -0
- package/lib/typescript/src/utils/deprecation.d.ts.map +1 -0
- package/lib/typescript/src/utils/filterUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/geoUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/nativeRef.d.ts.map +1 -0
- package/lib/typescript/src/utils/styleMap.d.ts.map +1 -0
- package/lib/typescript/src/web/MapContext.d.ts.map +1 -0
- package/lib/typescript/src/web/components/Camera.d.ts.map +1 -0
- package/lib/typescript/src/web/components/MapView.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/Logger.d.ts.map +1 -0
- package/package.json +10 -25
- package/rnmapbox-maps.podspec +3 -0
- package/setup-jest.js +19 -4
- package/src/components/MapView.tsx +66 -1
- package/src/specs/RNMBXBackgroundLayerNativeComponent.ts +9 -6
- package/src/specs/RNMBXCameraNativeComponent.ts +14 -11
- package/src/specs/RNMBXCircleLayerNativeComponent.ts +11 -8
- package/src/specs/RNMBXFillExtrusionLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXFillLayerNativeComponent.ts +11 -8
- package/src/specs/RNMBXHeatmapLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXLineLayerNativeComponent.ts +11 -8
- package/src/specs/RNMBXMapViewNativeComponent.ts +27 -15
- package/src/specs/RNMBXRasterLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXSkyLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXSymbolLayerNativeComponent.ts +12 -9
- package/src/specs/codegenUtils.ts +5 -0
- package/lib/typescript/Mapbox.d.ts.map +0 -1
- package/lib/typescript/RNMBXModule.d.ts.map +0 -1
- package/lib/typescript/components/AbstractLayer.d.ts.map +0 -1
- package/lib/typescript/components/AbstractSource.d.ts.map +0 -1
- package/lib/typescript/components/Annotation.d.ts.map +0 -1
- package/lib/typescript/components/Atmosphere.d.ts.map +0 -1
- package/lib/typescript/components/BackgroundLayer.d.ts.map +0 -1
- package/lib/typescript/components/Callout.d.ts.map +0 -1
- package/lib/typescript/components/Camera.d.ts.map +0 -1
- package/lib/typescript/components/CircleLayer.d.ts.map +0 -1
- package/lib/typescript/components/FillExtrusionLayer.d.ts.map +0 -1
- package/lib/typescript/components/FillLayer.d.ts.map +0 -1
- package/lib/typescript/components/HeadingIndicator.d.ts.map +0 -1
- package/lib/typescript/components/HeatmapLayer.d.ts.map +0 -1
- package/lib/typescript/components/Image.d.ts.map +0 -1
- package/lib/typescript/components/ImageSource.d.ts.map +0 -1
- package/lib/typescript/components/Images.d.ts.map +0 -1
- package/lib/typescript/components/Light.d.ts.map +0 -1
- package/lib/typescript/components/LineLayer.d.ts.map +0 -1
- package/lib/typescript/components/MapView.d.ts.map +0 -1
- package/lib/typescript/components/MarkerView.d.ts.map +0 -1
- package/lib/typescript/components/NativeBridgeComponent.d.ts.map +0 -1
- package/lib/typescript/components/NativeUserLocation.d.ts.map +0 -1
- package/lib/typescript/components/PointAnnotation.d.ts.map +0 -1
- package/lib/typescript/components/RasterDemSource.d.ts.map +0 -1
- package/lib/typescript/components/RasterLayer.d.ts.map +0 -1
- package/lib/typescript/components/RasterSource.d.ts.map +0 -1
- package/lib/typescript/components/ShapeSource.d.ts.map +0 -1
- package/lib/typescript/components/SkyLayer.d.ts.map +0 -1
- package/lib/typescript/components/Style.d.ts.map +0 -1
- package/lib/typescript/components/StyleImport.d.ts.map +0 -1
- package/lib/typescript/components/SymbolLayer.d.ts.map +0 -1
- package/lib/typescript/components/Terrain.d.ts.map +0 -1
- package/lib/typescript/components/UserLocation.d.ts.map +0 -1
- package/lib/typescript/components/VectorSource.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/modules/location/locationManager.d.ts.map +0 -1
- package/lib/typescript/modules/offline/OfflineCreatePackOptions.d.ts.map +0 -1
- package/lib/typescript/modules/offline/OfflinePack.d.ts.map +0 -1
- package/lib/typescript/modules/offline/offlineManager.d.ts.map +0 -1
- package/lib/typescript/modules/snapshot/SnapshotOptions.d.ts.map +0 -1
- package/lib/typescript/modules/snapshot/snapshotManager.d.ts.map +0 -1
- package/lib/typescript/requestAndroidLocationPermissions.d.ts.map +0 -1
- package/lib/typescript/specs/NativeMapViewModule.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXAtmosphereNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXCameraNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXCircleLayerNativeComponent.d.ts +0 -19
- package/lib/typescript/specs/RNMBXCircleLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXFillLayerNativeComponent.d.ts +0 -19
- package/lib/typescript/specs/RNMBXFillLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXHeatmapLayerNativeComponent.d.ts +0 -19
- package/lib/typescript/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXLineLayerNativeComponent.d.ts +0 -19
- package/lib/typescript/specs/RNMBXLineLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXRasterLayerNativeComponent.d.ts +0 -19
- package/lib/typescript/specs/RNMBXRasterLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXSkyLayerNativeComponent.d.ts +0 -18
- package/lib/typescript/specs/RNMBXSkyLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXStyleImportNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/RNMBXSymbolLayerNativeComponent.d.ts +0 -19
- package/lib/typescript/specs/RNMBXSymbolLayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/specs/codegenUtils.d.ts.map +0 -1
- package/lib/typescript/types/BaseProps.d.ts.map +0 -1
- package/lib/typescript/types/OnPressEvent.d.ts.map +0 -1
- package/lib/typescript/types/Position.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/utils/BridgeValue.d.ts.map +0 -1
- package/lib/typescript/utils/Logger.d.ts.map +0 -1
- package/lib/typescript/utils/StyleValue.d.ts.map +0 -1
- package/lib/typescript/utils/animated/Animated.d.ts.map +0 -1
- package/lib/typescript/utils/checkRequiredProps.d.ts.map +0 -1
- package/lib/typescript/utils/deprecation.d.ts.map +0 -1
- package/lib/typescript/utils/filterUtils.d.ts.map +0 -1
- package/lib/typescript/utils/geoUtils.d.ts.map +0 -1
- package/lib/typescript/utils/getAnnotationsLayerID.d.ts.map +0 -1
- package/lib/typescript/utils/index.d.ts.map +0 -1
- package/lib/typescript/utils/nativeRef.d.ts.map +0 -1
- package/lib/typescript/utils/styleMap.d.ts.map +0 -1
- package/lib/typescript/web/MapContext.d.ts.map +0 -1
- package/lib/typescript/web/components/Camera.d.ts.map +0 -1
- package/lib/typescript/web/components/MapView.d.ts.map +0 -1
- package/lib/typescript/web/utils/Logger.d.ts.map +0 -1
- /package/lib/typescript/{Mapbox.d.ts → src/Mapbox.d.ts} +0 -0
- /package/lib/typescript/{RNMBXModule.d.ts → src/RNMBXModule.d.ts} +0 -0
- /package/lib/typescript/{components → src/components}/AbstractLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/AbstractSource.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Annotation.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Atmosphere.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/BackgroundLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Callout.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Camera.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/CircleLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/FillExtrusionLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/FillLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/HeadingIndicator.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/HeatmapLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Image.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ImageSource.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Images.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Light.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/LineLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/MarkerView.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/NativeBridgeComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/NativeUserLocation.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/PointAnnotation.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RasterDemSource.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RasterLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RasterSource.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ShapeSource.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/SkyLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Style.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/StyleImport.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/SymbolLayer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Terrain.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UserLocation.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/VectorSource.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{modules → src/modules}/location/locationManager.d.ts +0 -0
- /package/lib/typescript/{modules → src/modules}/offline/OfflineCreatePackOptions.d.ts +0 -0
- /package/lib/typescript/{modules → src/modules}/offline/OfflinePack.d.ts +0 -0
- /package/lib/typescript/{modules → src/modules}/offline/offlineManager.d.ts +0 -0
- /package/lib/typescript/{modules → src/modules}/snapshot/SnapshotOptions.d.ts +0 -0
- /package/lib/typescript/{modules → src/modules}/snapshot/snapshotManager.d.ts +0 -0
- /package/lib/typescript/{requestAndroidLocationPermissions.d.ts → src/requestAndroidLocationPermissions.d.ts} +0 -0
- /package/lib/typescript/{specs → src/specs}/NativeMapViewModule.d.ts +0 -0
- /package/lib/typescript/{specs → src/specs}/RNMBXAndroidTextureMapViewNativeComponent.d.ts +0 -0
- /package/lib/typescript/{specs → src/specs}/RNMBXAtmosphereNativeComponent.d.ts +0 -0
- /package/lib/typescript/{specs → src/specs}/RNMBXStyleImportNativeComponent.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/BaseProps.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/OnPressEvent.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/Position.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/index.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/BridgeValue.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/Logger.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/StyleValue.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/animated/Animated.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/checkRequiredProps.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/deprecation.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/filterUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/geoUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/getAnnotationsLayerID.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/index.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/nativeRef.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/styleMap.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/MapContext.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/components/Camera.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/components/MapView.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/utils/Logger.d.ts +0 -0
|
@@ -15,6 +15,8 @@ abstract class AbstractMapFeature(context: Context?) : ReactViewGroup(context) {
|
|
|
15
15
|
protected var mMapView: RNMBXMapView? = null;
|
|
16
16
|
private var mWithMapViewCallbacks: Array<((RNMBXMapView) -> Unit)>? = null;
|
|
17
17
|
|
|
18
|
+
open var requiresStyleLoad = true;
|
|
19
|
+
|
|
18
20
|
open fun addToMap(mapView: RNMBXMapView) {
|
|
19
21
|
mMapView = mapView;
|
|
20
22
|
mWithMapViewCallbacks?.forEach { it(mapView) }
|
|
@@ -40,6 +40,8 @@ class RNMBXCamera(private val mContext: Context, private val mManager: RNMBXCame
|
|
|
40
40
|
AbstractMapFeature(
|
|
41
41
|
mContext
|
|
42
42
|
) {
|
|
43
|
+
override var requiresStyleLoad = false
|
|
44
|
+
|
|
43
45
|
private var hasSentFirstRegion = false
|
|
44
46
|
private var mDefaultStop: CameraStop? = null
|
|
45
47
|
private var mCameraStop: CameraStop? = null
|
|
@@ -317,21 +319,77 @@ class RNMBXCamera(private val mContext: Context, private val mManager: RNMBXCame
|
|
|
317
319
|
when (status) {
|
|
318
320
|
ViewportStatus.Idle -> return null
|
|
319
321
|
is ViewportStatus.State ->
|
|
320
|
-
return toFollowUserMode(status)
|
|
322
|
+
return toFollowUserMode(status.state)
|
|
321
323
|
is ViewportStatus.Transition ->
|
|
322
324
|
return toFollowUserMode(status.toState)
|
|
323
325
|
}
|
|
324
326
|
}
|
|
325
327
|
|
|
328
|
+
fun toUserTrackingMode(state: ViewportState): Int {
|
|
329
|
+
when (state) {
|
|
330
|
+
is FollowPuckViewportState -> {
|
|
331
|
+
return when (state.options.bearing) {
|
|
332
|
+
is FollowPuckViewportStateBearing.SyncWithLocationPuck -> {
|
|
333
|
+
val location = mMapView?.mapView?.location2
|
|
334
|
+
if (location?.puckBearingEnabled == true) {
|
|
335
|
+
when (location.puckBearingSource) {
|
|
336
|
+
|
|
337
|
+
PuckBearingSource.HEADING -> {
|
|
338
|
+
UserTrackingMode.FollowWithHeading
|
|
339
|
+
}
|
|
340
|
+
PuckBearingSource.COURSE -> {
|
|
341
|
+
UserTrackingMode.FollowWithCourse
|
|
342
|
+
}
|
|
343
|
+
else -> {
|
|
344
|
+
UserTrackingMode.FOLLOW
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
UserTrackingMode.FOLLOW
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
is FollowPuckViewportStateBearing.Constant ->
|
|
353
|
+
UserTrackingMode.FOLLOW
|
|
354
|
+
|
|
355
|
+
else -> {
|
|
356
|
+
Logger.w(LOG_TAG, "Unexpected bearing: ${state.options.bearing}")
|
|
357
|
+
UserTrackingMode.FOLLOW
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
is OverviewViewportState -> {
|
|
363
|
+
return UserTrackingMode.NONE
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
else -> {
|
|
367
|
+
return UserTrackingMode.NONE // TODO
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
fun toUserTrackingMode(status: ViewportStatus): Int {
|
|
373
|
+
return when (status) {
|
|
374
|
+
ViewportStatus.Idle -> UserTrackingMode.NONE
|
|
375
|
+
is ViewportStatus.State ->
|
|
376
|
+
toUserTrackingMode(status.state)
|
|
377
|
+
|
|
378
|
+
is ViewportStatus.Transition ->
|
|
379
|
+
toUserTrackingMode(status.toState)
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
326
383
|
fun toReadableMap(status: ViewportStatus): ReadableMap {
|
|
327
|
-
when (status) {
|
|
328
|
-
ViewportStatus.Idle ->
|
|
384
|
+
return when (status) {
|
|
385
|
+
ViewportStatus.Idle -> writableMapOf("state" to "idle")
|
|
329
386
|
is ViewportStatus.State ->
|
|
330
|
-
|
|
387
|
+
writableMapOf(
|
|
331
388
|
"state" to status.toString()
|
|
332
389
|
)
|
|
390
|
+
|
|
333
391
|
is ViewportStatus.Transition ->
|
|
334
|
-
|
|
392
|
+
writableMapOf(
|
|
335
393
|
"transition" to status.toString()
|
|
336
394
|
)
|
|
337
395
|
}
|
|
@@ -344,12 +402,11 @@ class RNMBXCamera(private val mContext: Context, private val mManager: RNMBXCame
|
|
|
344
402
|
toStatus: ViewportStatus,
|
|
345
403
|
reason: ViewportStatusChangeReason
|
|
346
404
|
) {
|
|
347
|
-
if (reason == ViewportStatusChangeReason.USER_INTERACTION) {
|
|
405
|
+
if (reason == ViewportStatusChangeReason.USER_INTERACTION || reason == ViewportStatusChangeReason.TRANSITION_SUCCEEDED) {
|
|
348
406
|
val followUserLocation = toFollowUserLocation(toStatus)
|
|
349
407
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
mManager.handleEvent(MapUserTrackingModeEvent(this@RNMBXCamera, UserTrackingMode.NONE,
|
|
408
|
+
val mode = toUserTrackingMode(toStatus)
|
|
409
|
+
mManager.handleEvent(MapUserTrackingModeEvent(this@RNMBXCamera, mode,
|
|
353
410
|
writableMapOf(
|
|
354
411
|
"followUserMode" to toFollowUserMode(toStatus),
|
|
355
412
|
"followUserLocation" to followUserLocation,
|
|
@@ -228,8 +228,8 @@ class RNMBXImages(context: Context, private val mManager: RNMBXImagesManager) :
|
|
|
228
228
|
var maxY = info.stretchY.maxOfOrNull { max(it.first, it.second) } ?: 0.0f
|
|
229
229
|
var maxX = info.stretchX.maxOfOrNull { max(it.first, it.second) } ?: 0.0f
|
|
230
230
|
if (info.content != null) {
|
|
231
|
-
maxX = max(max(info.content.left,info.content.right), maxX)
|
|
232
|
-
maxY = max(max(info.content.top,info.content.bottom), maxY)
|
|
231
|
+
maxX = max(max(info.content.left, info.content.right), maxX)
|
|
232
|
+
maxY = max(max(info.content.top, info.content.bottom), maxY)
|
|
233
233
|
}
|
|
234
234
|
return emptyImage(ceil(maxX).toInt()+1, ceil(maxY).toInt()+1)
|
|
235
235
|
} else {
|
package/android/src/main/java/com/rnmapbox/rnmbx/components/location/LocationComponentManager.kt
CHANGED
|
@@ -67,7 +67,7 @@ class LocationComponentManager(mapView: RNMBXMapView, context: Context) {
|
|
|
67
67
|
|
|
68
68
|
private fun applyStateChanges(map: RNMBXMapView, oldState: State, newState: State, fullUpdate: Boolean) {
|
|
69
69
|
val mapView = map.mapView
|
|
70
|
-
if (map.getLifecycleState() != Lifecycle.State.STARTED) {
|
|
70
|
+
if (map.getLifecycleState() != Lifecycle.State.STARTED && map.getLifecycleState() != Lifecycle.State.INITIALIZED) {
|
|
71
71
|
// In case lifecycle was already stopped, so we're part of shutdown, do not call updateSettings as it'll just restart
|
|
72
72
|
// the loationComponent that will not be stopped. See https://github.com/mapbox/mapbox-maps-android/issues/2017
|
|
73
73
|
if (!newState.enabled) {
|
|
@@ -478,7 +478,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
val addToMap = styleLoaded
|
|
481
|
+
val addToMap = styleLoaded || (feature?.requiresStyleLoad == false)
|
|
482
482
|
|
|
483
483
|
var entry = FeatureEntry(feature, childView, false)
|
|
484
484
|
if (addToMap) {
|
|
@@ -541,11 +541,13 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
private fun addFeaturesToMap() {
|
|
544
|
+
private fun addFeaturesToMap(styleLoaded: Boolean = false) {
|
|
545
545
|
mFeatures.forEach {
|
|
546
546
|
if (!it.addedToMap) {
|
|
547
|
-
it.feature?.
|
|
548
|
-
|
|
547
|
+
if (styleLoaded || it.feature?.requiresStyleLoad == false) {
|
|
548
|
+
it.feature?.addToMap(this)
|
|
549
|
+
it.addedToMap = true
|
|
550
|
+
}
|
|
549
551
|
}
|
|
550
552
|
}
|
|
551
553
|
}
|
|
@@ -654,6 +656,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
654
656
|
}
|
|
655
657
|
}
|
|
656
658
|
)
|
|
659
|
+
addFeaturesToMap(false)
|
|
657
660
|
}
|
|
658
661
|
}
|
|
659
662
|
}
|
|
@@ -23,6 +23,8 @@ import com.rnmapbox.rnmbx.utils.ConvertUtils
|
|
|
23
23
|
import com.rnmapbox.rnmbx.utils.ExpressionParser
|
|
24
24
|
import com.rnmapbox.rnmbx.utils.Logger
|
|
25
25
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
26
|
+
import com.rnmapbox.rnmbx.utils.extensions.getAndLogIfNotBoolean
|
|
27
|
+
import com.rnmapbox.rnmbx.utils.extensions.getAndLogIfNotDouble
|
|
26
28
|
import com.rnmapbox.rnmbx.utils.extensions.toCoordinate
|
|
27
29
|
import com.rnmapbox.rnmbx.utils.extensions.toRectF
|
|
28
30
|
import com.rnmapbox.rnmbx.utils.extensions.toScreenCoordinate
|
|
@@ -139,6 +141,55 @@ open class RNMBXMapViewManager(context: ReactApplicationContext, val viewTagReso
|
|
|
139
141
|
mapView.setReactLocalizeLabels(locale, layerIds)
|
|
140
142
|
}
|
|
141
143
|
|
|
144
|
+
@ReactProp(name = "gestureSettings")
|
|
145
|
+
override fun setGestureSettings(mapView: RNMBXMapView, settings: Dynamic) {
|
|
146
|
+
mapView.getMapboxMap().gesturesPlugin {
|
|
147
|
+
val map = settings.asMap()
|
|
148
|
+
this.updateSettings {
|
|
149
|
+
map.getAndLogIfNotBoolean("doubleTapToZoomInEnabled", LOG_TAG)?.let {
|
|
150
|
+
this.doubleTapToZoomInEnabled = it
|
|
151
|
+
}
|
|
152
|
+
map.getAndLogIfNotBoolean("doubleTouchToZoomOutEnabled", LOG_TAG)?.let {
|
|
153
|
+
this.doubleTouchToZoomOutEnabled = it
|
|
154
|
+
}
|
|
155
|
+
map.getAndLogIfNotBoolean("pinchPanEnabled", LOG_TAG)?.let {
|
|
156
|
+
this.pinchScrollEnabled = it
|
|
157
|
+
}
|
|
158
|
+
map.getAndLogIfNotBoolean("pinchZoomEnabled", LOG_TAG)?.let {
|
|
159
|
+
this.pinchToZoomEnabled = it
|
|
160
|
+
}
|
|
161
|
+
map.getAndLogIfNotBoolean("pinchZoomDecelerationEnabled", LOG_TAG)?.let {
|
|
162
|
+
this.pinchToZoomDecelerationEnabled = it
|
|
163
|
+
}
|
|
164
|
+
map.getAndLogIfNotBoolean("pitchEnabled", LOG_TAG)?.let {
|
|
165
|
+
this.pitchEnabled = it
|
|
166
|
+
}
|
|
167
|
+
map.getAndLogIfNotBoolean("quickZoomEnabled", LOG_TAG)?.let {
|
|
168
|
+
this.quickZoomEnabled = it
|
|
169
|
+
}
|
|
170
|
+
map.getAndLogIfNotBoolean("rotateEnabled", LOG_TAG)?.let {
|
|
171
|
+
this.rotateEnabled = it
|
|
172
|
+
}
|
|
173
|
+
map.getAndLogIfNotBoolean("rotateDecelerationEnabled", LOG_TAG)?.let {
|
|
174
|
+
this.rotateDecelerationEnabled = it
|
|
175
|
+
}
|
|
176
|
+
map.getAndLogIfNotBoolean("panEnabled", LOG_TAG)?.let {
|
|
177
|
+
this.scrollEnabled = it
|
|
178
|
+
}
|
|
179
|
+
map.getAndLogIfNotDouble("panDecelerationFactor", LOG_TAG)?.let {
|
|
180
|
+
this.scrollDecelerationEnabled = it > 0.0
|
|
181
|
+
}
|
|
182
|
+
map.getAndLogIfNotBoolean("simultaneousRotateAndPinchToZoomEnabled", LOG_TAG)?.let {
|
|
183
|
+
this.simultaneousRotateAndPinchToZoomEnabled = it
|
|
184
|
+
}
|
|
185
|
+
map.getAndLogIfNotDouble("zoomAnimationAmount", LOG_TAG)?.let {
|
|
186
|
+
this.zoomAnimationAmount = it.toFloat()
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
|
|
142
193
|
@ReactProp(name = "styleURL")
|
|
143
194
|
override fun setStyleURL(mapView: RNMBXMapView, styleURL:Dynamic) {
|
|
144
195
|
mapView.setReactStyleURL(styleURL.asString())
|
package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/layers/RNMBXSkyLayerManager.kt
CHANGED
|
@@ -61,12 +61,6 @@ class RNMBXSkyLayerManager : ViewGroupManager<RNMBXSkyLayer>(),
|
|
|
61
61
|
layer.setReactStyle(style.asMap())
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// not available
|
|
65
|
-
// @ReactProp(name = "sourceLayerID")
|
|
66
|
-
// override fun setSourceLayerId(layer: RNMBXSkyLayer, sourceLayerID: Dynamic) {
|
|
67
|
-
// layer.setSourceLayerID(sourceLayerID.asString())
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
64
|
@ReactProp(name = "filter")
|
|
71
65
|
override fun setFilter(layer: RNMBXSkyLayer, filterList: Dynamic) {
|
|
72
66
|
layer.setFilter(filterList.asArray())
|
|
@@ -33,10 +33,6 @@ object BitmapUtils {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
fun getBitmapFromURL(url: String?): Bitmap? {
|
|
37
|
-
return getBitmapFromURL(url, null)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
36
|
fun toImage(bitmap: Bitmap): Image {
|
|
41
37
|
if (bitmap.config != Bitmap.Config.ARGB_8888) {
|
|
42
38
|
throw RuntimeException("Only ARGB_8888 bitmap config is supported!")
|
|
@@ -71,33 +67,6 @@ object BitmapUtils {
|
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
|
|
74
|
-
fun getBitmapFromURL(url: String?, options: BitmapFactory.Options?): Bitmap? {
|
|
75
|
-
var bitmap = getImage(url)
|
|
76
|
-
if (bitmap != null) {
|
|
77
|
-
return bitmap
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
val bitmapStream = URL(url).openStream()
|
|
81
|
-
bitmap = BitmapFactory.decodeStream(bitmapStream, null, options)
|
|
82
|
-
bitmapStream.close()
|
|
83
|
-
addImage(url, bitmap)
|
|
84
|
-
} catch (e: Exception) {
|
|
85
|
-
Log.w(LOG_TAG, e.localizedMessage)
|
|
86
|
-
bitmap =
|
|
87
|
-
Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8) // Returns a transparent bitmap
|
|
88
|
-
}
|
|
89
|
-
return bitmap
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
fun getBitmapFromResource(
|
|
93
|
-
context: Context,
|
|
94
|
-
resourceName: String?,
|
|
95
|
-
options: BitmapFactory.Options?
|
|
96
|
-
): Bitmap {
|
|
97
|
-
val resources = context.resources
|
|
98
|
-
val resID = resources.getIdentifier(resourceName, "drawable", context.packageName)
|
|
99
|
-
return BitmapFactory.decodeResource(resources, resID, options)
|
|
100
|
-
}
|
|
101
70
|
|
|
102
71
|
@Throws(IOException::class)
|
|
103
72
|
fun createImgTempFile(context: Context, image: Image): String? {
|
|
@@ -4,11 +4,9 @@ import android.content.Context
|
|
|
4
4
|
import android.graphics.Bitmap
|
|
5
5
|
import com.mapbox.maps.Style
|
|
6
6
|
import com.mapbox.maps.MapboxMap
|
|
7
|
-
import com.rnmapbox.rnmbx.utils.DownloadMapImageTask.OnAllImagesLoaded
|
|
8
7
|
import android.os.AsyncTask
|
|
9
8
|
import com.rnmapbox.rnmbx.utils.ImageEntry
|
|
10
9
|
import android.util.DisplayMetrics
|
|
11
|
-
import com.rnmapbox.rnmbx.utils.DownloadMapImageTask
|
|
12
10
|
import android.graphics.BitmapFactory
|
|
13
11
|
import android.net.Uri
|
|
14
12
|
import android.util.Log
|
|
@@ -22,11 +20,8 @@ import com.facebook.imagepipeline.image.CloseableStaticBitmap
|
|
|
22
20
|
import com.facebook.imagepipeline.request.ImageRequestBuilder
|
|
23
21
|
import com.facebook.react.views.imagehelper.ImageSource
|
|
24
22
|
import com.rnmapbox.rnmbx.components.images.ImageInfo
|
|
25
|
-
import com.rnmapbox.rnmbx.components.images.addBitmapImage
|
|
26
23
|
import java.io.File
|
|
27
24
|
import java.lang.ref.WeakReference
|
|
28
|
-
import java.util.AbstractMap
|
|
29
|
-
import java.util.ArrayList
|
|
30
25
|
import java.util.HashMap
|
|
31
26
|
import com.rnmapbox.rnmbx.v11compat.image.*
|
|
32
27
|
|
|
@@ -54,64 +49,40 @@ class DownloadMapImageTask(context: Context, map: MapboxMap, callback: OnAllImag
|
|
|
54
49
|
if (uri.startsWith("/")) {
|
|
55
50
|
uri = Uri.fromFile(File(uri)).toString()
|
|
56
51
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
bitmap
|
|
77
|
-
|
|
78
|
-
1.0
|
|
79
|
-
)).toInt()
|
|
80
|
-
images.add(
|
|
81
|
-
DownloadedImage(name=key, bitmap=bitmap, info=imageEntry.info)
|
|
82
|
-
)
|
|
83
|
-
} else {
|
|
84
|
-
FLog.e(LOG_TAG, "Failed to load bitmap from: $uri")
|
|
85
|
-
}
|
|
52
|
+
val source = ImageSource(context, uri)
|
|
53
|
+
val request = ImageRequestBuilder.newBuilderWithSource(source.uri)
|
|
54
|
+
.setRotationOptions(RotationOptions.autoRotate())
|
|
55
|
+
.build()
|
|
56
|
+
val dataSource =
|
|
57
|
+
Fresco.getImagePipeline().fetchDecodedImage(request, mCallerContext)
|
|
58
|
+
var result: CloseableReference<CloseableImage>? = null
|
|
59
|
+
try {
|
|
60
|
+
result = DataSources.waitForFinalResult(dataSource)
|
|
61
|
+
if (result != null) {
|
|
62
|
+
val image = result.get()
|
|
63
|
+
if (image is CloseableStaticBitmap) {
|
|
64
|
+
val bitmap =
|
|
65
|
+
image.underlyingBitmap // Copy the bitmap to make sure it doesn't get recycled when we release
|
|
66
|
+
// the fresco reference.
|
|
67
|
+
.copy(Bitmap.Config.ARGB_8888, true)
|
|
68
|
+
Log.e("RNMBXImageManager", "downloadImage: $key $uri $image ${image.width}x${image.height}")
|
|
69
|
+
bitmap.density = DisplayMetrics.DENSITY_DEFAULT
|
|
70
|
+
images.add(
|
|
71
|
+
DownloadedImage(name=key, bitmap=bitmap, info=imageEntry.info)
|
|
72
|
+
)
|
|
86
73
|
} else {
|
|
87
74
|
FLog.e(LOG_TAG, "Failed to load bitmap from: $uri")
|
|
88
75
|
}
|
|
89
|
-
} catch (e: Throwable) {
|
|
90
|
-
Log.w(LOG_TAG, e.localizedMessage)
|
|
91
|
-
} finally {
|
|
92
|
-
dataSource.close()
|
|
93
|
-
if (result != null) {
|
|
94
|
-
CloseableReference.closeSafely(result)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
} else {
|
|
98
|
-
// local asset required from JS require('image.png') or import icon from 'image.png' while in release mode
|
|
99
|
-
val bitmap = BitmapUtils.getBitmapFromResource(
|
|
100
|
-
context,
|
|
101
|
-
uri,
|
|
102
|
-
getBitmapOptions(metrics, imageEntry.info.scale)
|
|
103
|
-
)
|
|
104
|
-
if (bitmap != null) {
|
|
105
|
-
images.add(
|
|
106
|
-
DownloadedImage(
|
|
107
|
-
name=key,
|
|
108
|
-
bitmap=bitmap,
|
|
109
|
-
info=imageEntry.info
|
|
110
|
-
)
|
|
111
|
-
)
|
|
112
76
|
} else {
|
|
113
77
|
FLog.e(LOG_TAG, "Failed to load bitmap from: $uri")
|
|
114
78
|
}
|
|
79
|
+
} catch (e: Throwable) {
|
|
80
|
+
Log.w(LOG_TAG, e.localizedMessage)
|
|
81
|
+
} finally {
|
|
82
|
+
dataSource.close()
|
|
83
|
+
if (result != null) {
|
|
84
|
+
CloseableReference.closeSafely(result)
|
|
85
|
+
}
|
|
115
86
|
}
|
|
116
87
|
}
|
|
117
88
|
return images
|
|
@@ -134,16 +105,6 @@ class DownloadMapImageTask(context: Context, map: MapboxMap, callback: OnAllImag
|
|
|
134
105
|
mCallback?.onAllImagesLoaded()
|
|
135
106
|
}
|
|
136
107
|
|
|
137
|
-
private fun getBitmapOptions(metrics: DisplayMetrics, scale: Double?): BitmapFactory.Options {
|
|
138
|
-
val options = BitmapFactory.Options()
|
|
139
|
-
options.inScreenDensity = metrics.densityDpi
|
|
140
|
-
options.inTargetDensity = metrics.densityDpi
|
|
141
|
-
if (scale != null) {
|
|
142
|
-
options.inDensity = (DisplayMetrics.DENSITY_DEFAULT.toDouble() * scale).toInt()
|
|
143
|
-
}
|
|
144
|
-
return options
|
|
145
|
-
}
|
|
146
|
-
|
|
147
108
|
companion object {
|
|
148
109
|
const val LOG_TAG = "DownloadMapImageTask"
|
|
149
110
|
}
|
|
@@ -2,6 +2,7 @@ package com.rnmapbox.rnmbx.utils.extensions
|
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.ReadableMap
|
|
4
4
|
import com.facebook.react.bridge.ReadableType
|
|
5
|
+
import com.rnmapbox.rnmbx.utils.Logger
|
|
5
6
|
|
|
6
7
|
fun ReadableMap.forEach(action: (String, Any) -> Unit) {
|
|
7
8
|
val iterator = this.entryIterator
|
|
@@ -17,3 +18,37 @@ fun ReadableMap.getIfDouble(key: String): Double? {
|
|
|
17
18
|
null
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
|
|
22
|
+
fun ReadableMap.getIfBoolean(key: String): Boolean? {
|
|
23
|
+
return if (hasKey(key) && (getType(key) == ReadableType.Boolean)) {
|
|
24
|
+
getBoolean(key)
|
|
25
|
+
} else {
|
|
26
|
+
null
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fun ReadableMap.getAndLogIfNotBoolean(key: String, tag:String = "RNMBXReadableMap"): Boolean? {
|
|
31
|
+
return if (hasKey(key)) {
|
|
32
|
+
if (getType(key) == ReadableType.Boolean) {
|
|
33
|
+
getBoolean(key)
|
|
34
|
+
} else {
|
|
35
|
+
Logger.e("RNMBXReadableMap", "$key is expected to be a boolean but was: ${getType(key)}")
|
|
36
|
+
null
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
null
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fun ReadableMap.getAndLogIfNotDouble(key: String, tag: String = "RNMBXReadableMap"): Double? {
|
|
44
|
+
return if (hasKey(key)) {
|
|
45
|
+
if (getType(key) == ReadableType.Number) {
|
|
46
|
+
getDouble(key)
|
|
47
|
+
} else {
|
|
48
|
+
Logger.e("RNMBXReadableMap", "$key is expected to be a double but was: ${getType(key)}")
|
|
49
|
+
null
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
null
|
|
53
|
+
}
|
|
54
|
+
}
|
package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java
CHANGED
|
@@ -79,6 +79,9 @@ public class RNMBXMapViewManagerDelegate<T extends View, U extends BaseViewManag
|
|
|
79
79
|
case "styleURL":
|
|
80
80
|
mViewManager.setStyleURL(view, new DynamicFromObject(value));
|
|
81
81
|
break;
|
|
82
|
+
case "gestureSettings":
|
|
83
|
+
mViewManager.setGestureSettings(view, new DynamicFromObject(value));
|
|
84
|
+
break;
|
|
82
85
|
case "scaleBarViewMargins":
|
|
83
86
|
mViewManager.setScaleBarViewMargins(view, new DynamicFromObject(value));
|
|
84
87
|
break;
|
package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java
CHANGED
|
@@ -32,6 +32,7 @@ public interface RNMBXMapViewManagerInterface<T extends View> {
|
|
|
32
32
|
void setProjection(T view, Dynamic value);
|
|
33
33
|
void setLocalizeLabels(T view, Dynamic value);
|
|
34
34
|
void setStyleURL(T view, Dynamic value);
|
|
35
|
+
void setGestureSettings(T view, Dynamic value);
|
|
35
36
|
void setScaleBarViewMargins(T view, Dynamic value);
|
|
36
37
|
void setAttributionViewMargins(T view, Dynamic value);
|
|
37
38
|
void setAttributionViewPosition(T view, Dynamic value);
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import MapboxMaps
|
|
2
2
|
|
|
3
3
|
class CustomHttpHeaders : HttpServiceInterceptorInterface {
|
|
4
|
+
#if RNMBX_11
|
|
5
|
+
func onRequest(for request: HttpRequest, continuation: @escaping HttpServiceInterceptorRequestContinuation) {
|
|
6
|
+
let request = onRequest(for: request)
|
|
7
|
+
continuation(HttpRequestOrResponse.fromHttpRequest(request))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
func onResponse(for response: HttpResponse, continuation: @escaping HttpServiceInterceptorResponseContinuation) {
|
|
11
|
+
continuation(response)
|
|
12
|
+
}
|
|
13
|
+
#endif
|
|
14
|
+
|
|
4
15
|
static var shared : CustomHttpHeaders = {
|
|
5
16
|
let headers = CustomHttpHeaders()
|
|
6
17
|
headers.install()
|
|
@@ -255,7 +255,9 @@ open class RNMBXMapView : MapView {
|
|
|
255
255
|
@objc public func setReactProjection(_ value: String?) {
|
|
256
256
|
if let value = value {
|
|
257
257
|
let projection = StyleProjection(name: value == "globe" ? .globe : .mercator)
|
|
258
|
-
|
|
258
|
+
logged("RNMBXMapView.setReactProjection") {
|
|
259
|
+
try self.mapboxMap.style.setProjection(projection)
|
|
260
|
+
}
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
|
|
@@ -272,6 +274,59 @@ open class RNMBXMapView : MapView {
|
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
|
|
277
|
+
@objc public func setReactGestureSettings(_ value: NSDictionary?) {
|
|
278
|
+
if let value = value, let gestures = self.mapView.gestures {
|
|
279
|
+
var options = gestures.options
|
|
280
|
+
if let doubleTapToZoomInEnabled = value["doubleTapToZoomInEnabled"] as? NSNumber {
|
|
281
|
+
options.doubleTapToZoomInEnabled = doubleTapToZoomInEnabled.boolValue
|
|
282
|
+
}
|
|
283
|
+
if let doubleTouchToZoomOutEnabled = value["doubleTouchToZoomOutEnabled"] as? NSNumber {
|
|
284
|
+
options.doubleTouchToZoomOutEnabled = doubleTouchToZoomOutEnabled.boolValue
|
|
285
|
+
}
|
|
286
|
+
if let pinchScrollEnabled = value["pinchPanEnabled"] as? NSNumber {
|
|
287
|
+
options.pinchPanEnabled = pinchScrollEnabled.boolValue
|
|
288
|
+
}
|
|
289
|
+
if let pinchZoomEnabled = value["pinchZoomEnabled"] as? NSNumber {
|
|
290
|
+
options.pinchZoomEnabled = pinchZoomEnabled.boolValue
|
|
291
|
+
}
|
|
292
|
+
/* android only
|
|
293
|
+
if let pinchZoomDecelerationEnabled = value["pinchZoomDecelerationEnabled"] as? NSNumber {
|
|
294
|
+
options.pinchZoomDecelerationEnabled = pinchZoomDecelerationEnabled.boolValue
|
|
295
|
+
}
|
|
296
|
+
*/
|
|
297
|
+
if let pitchEnabled = value["pitchEnabled"] as? NSNumber {
|
|
298
|
+
options.pitchEnabled = pitchEnabled.boolValue
|
|
299
|
+
}
|
|
300
|
+
if let quickZoomEnabled = value["quickZoomEnabled"] as? NSNumber {
|
|
301
|
+
options.quickZoomEnabled = quickZoomEnabled.boolValue
|
|
302
|
+
}
|
|
303
|
+
if let rotateEnabled = value["rotateEnabled"] as? NSNumber {
|
|
304
|
+
options.rotateEnabled = rotateEnabled.boolValue
|
|
305
|
+
}
|
|
306
|
+
/* android only
|
|
307
|
+
if let rotateDecelerationEnabled = value["rotateDecelerationEnabled"] as? NSNumber {
|
|
308
|
+
options.rotateDecelerationEnabled = rotateDecelerationEnabled.boolValue
|
|
309
|
+
}*/
|
|
310
|
+
if let panEnabled = value["panEnabled"] as? NSNumber {
|
|
311
|
+
options.panEnabled = panEnabled.boolValue
|
|
312
|
+
}
|
|
313
|
+
if let panDecelerationFactor = value["panDecelerationFactor"] as? NSNumber {
|
|
314
|
+
options.panDecelerationFactor = panDecelerationFactor.CGFloat
|
|
315
|
+
}
|
|
316
|
+
#if RNMBX_11
|
|
317
|
+
if let simultaneousRotateAndPinchZoomEnabled = value["simultaneousRotateAndPinchZoomEnabled"] as? NSNumber {
|
|
318
|
+
options.simultaneousRotateAndPinchZoomEnabled = simultaneousRotateAndPinchZoomEnabled.boolValue
|
|
319
|
+
}
|
|
320
|
+
#endif
|
|
321
|
+
/* android only
|
|
322
|
+
if let zoomAnimationAmount = value["zoomAnimationAmount"] as? NSNumber {
|
|
323
|
+
options.zoomAnimationAmount = zoomAnimationAmount.CGFloat
|
|
324
|
+
}*/
|
|
325
|
+
if options != gestures.options {
|
|
326
|
+
gestures.options = options
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
275
330
|
|
|
276
331
|
@objc public func setReactAttributionEnabled(_ value: Bool) {
|
|
277
332
|
mapView.ornaments.options.attributionButton.visibility = value ? .visible : .hidden
|
|
@@ -29,6 +29,8 @@ RCT_REMAP_VIEW_PROPERTY(pitchEnabled, reactPitchEnabled, BOOL)
|
|
|
29
29
|
RCT_REMAP_VIEW_PROPERTY(projection, reactProjection, NSString)
|
|
30
30
|
RCT_REMAP_VIEW_PROPERTY(localizeLabels, reactLocalizeLabels, NSDictionary)
|
|
31
31
|
|
|
32
|
+
RCT_REMAP_VIEW_PROPERTY(gestureSettings, reactGestureSettings, NSDictionary)
|
|
33
|
+
|
|
32
34
|
RCT_REMAP_VIEW_PROPERTY(styleURL, reactStyleURL, NSString)
|
|
33
35
|
RCT_REMAP_VIEW_PROPERTY(onPress, reactOnPress, RCTBubblingEventBlock)
|
|
34
36
|
RCT_REMAP_VIEW_PROPERTY(onLongPress, reactOnLongPress, RCTBubblingEventBlock)
|
package/ios/install.md
CHANGED
package/lib/commonjs/Mapbox.js
CHANGED
|
@@ -361,8 +361,8 @@ var _Logger = _interopRequireDefault(require("./utils/Logger"));
|
|
|
361
361
|
var _requestAndroidLocationPermissions = require("./requestAndroidLocationPermissions");
|
|
362
362
|
var _getAnnotationsLayerID = require("./utils/getAnnotationsLayerID");
|
|
363
363
|
var _deprecation = require("./utils/deprecation");
|
|
364
|
-
function _getRequireWildcardCache(
|
|
365
|
-
function _interopRequireWildcard(
|
|
364
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
365
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
366
366
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
367
367
|
/** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */
|
|
368
368
|
const AnimatedMapPoint = exports.AnimatedMapPoint = (0, _deprecation.deprecatedClass)(_classes.AnimatedPoint, 'AnimatedMapPoint is deprecated please use AnimatedPoint');
|