@rnmapbox/maps 10.1.0-beta.11 → 10.1.0-beta.14
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/RNMBXPackage.kt +19 -8
- 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/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/NativeMapViewModule.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXAndroidTextureMapViewManager.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +22 -19
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +52 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/layers/RNMBXSkyLayerManager.kt +0 -6
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXImageSource.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSource.kt +21 -23
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +0 -46
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt +61 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/{RCTSource.kt → RNMBXSource.kt} +8 -8
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSource.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/events/FeatureClickEvent.java +4 -4
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt +6 -5
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableMap.kt +35 -0
- package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Image.kt +1 -1
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageSourceManagerDelegate.java +41 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageSourceManagerInterface.java +20 -0
- 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/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterDemSourceManagerDelegate.java +50 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterDemSourceManagerInterface.java +23 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterSourceManagerDelegate.java +56 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterSourceManagerInterface.java +25 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerDelegate.java +77 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerInterface.java +32 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXVectorSourceManagerDelegate.java +59 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXVectorSourceManagerInterface.java +26 -0
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java +48 -0
- package/ios/RNMBX/CustomHttpHeaders.swift +11 -0
- package/ios/RNMBX/RNMBXBackgroundLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXCircleLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXFillExtrusionLayerComponentView.mm +3 -1
- package/ios/RNMBX/RNMBXFillLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXHeatmapLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXImageSource.swift +3 -3
- package/ios/RNMBX/RNMBXImageSourceComponentView.h +15 -0
- package/ios/RNMBX/RNMBXImageSourceComponentView.mm +100 -0
- package/ios/RNMBX/{RNMBXImageSourceManager.m → RNMBXImageSourceViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXImageSourceManager.swift → RNMBXImageSourceViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXInteractiveElement.swift +7 -7
- package/ios/RNMBX/RNMBXLayer.swift +1 -1
- package/ios/RNMBX/RNMBXLineLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXMapFeatureView.h +7 -0
- package/ios/RNMBX/RNMBXMapView.swift +56 -1
- package/ios/RNMBX/RNMBXMapViewManager.m +2 -0
- package/ios/RNMBX/RNMBXRasterDemSource.swift +6 -6
- package/ios/RNMBX/RNMBXRasterDemSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXRasterDemSourceComponentView.mm +116 -0
- package/ios/RNMBX/{RNMBXRasterDemSourceManager.m → RNMBXRasterDemSourceViewManager.m} +1 -7
- package/ios/RNMBX/{RNMBXRasterDemSourceManager.swift → RNMBXRasterDemSourceViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXRasterLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXRasterSource.swift +8 -8
- package/ios/RNMBX/RNMBXRasterSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXRasterSourceComponentView.mm +124 -0
- package/ios/RNMBX/{RNMBXRasterSourceManager.m → RNMBXRasterSourceViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXRasterSourceManager.swift → RNMBXRasterSourceViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXShapeSource.swift +11 -11
- package/ios/RNMBX/RNMBXShapeSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +153 -0
- package/ios/RNMBX/RNMBXShapeSourceModule.h +18 -0
- package/ios/RNMBX/RNMBXShapeSourceModule.mm +87 -0
- package/ios/RNMBX/RNMBXShapeSourceViewManager.m +26 -0
- package/ios/RNMBX/{RNMBXShapeSourceManager.swift → RNMBXShapeSourceViewManager.swift} +12 -42
- package/ios/RNMBX/RNMBXSkyLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXSource.swift +36 -27
- package/ios/RNMBX/RNMBXSymbolLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXTileSource.swift +2 -2
- package/ios/RNMBX/RNMBXVectorSource.swift +6 -6
- package/ios/RNMBX/RNMBXVectorSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXVectorSourceComponentView.mm +141 -0
- package/ios/RNMBX/{RNMBXVectorSourceManager.m → RNMBXVectorSourceViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXVectorSourceManager.swift → RNMBXVectorSourceViewManager.swift} +2 -2
- package/ios/install.md +2 -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/Camera.js +7 -10
- package/lib/commonjs/components/Camera.js.map +1 -1
- package/lib/commonjs/components/ImageSource.js +10 -7
- package/lib/commonjs/components/ImageSource.js.map +1 -1
- package/lib/commonjs/components/Light.js +1 -2
- 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/RasterDemSource.js +11 -8
- package/lib/commonjs/components/RasterDemSource.js.map +1 -1
- package/lib/commonjs/components/RasterSource.js +11 -8
- package/lib/commonjs/components/RasterSource.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +32 -54
- package/lib/commonjs/components/ShapeSource.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/VectorSource.js +26 -39
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js +10 -0
- package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map +1 -0
- 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/RNMBXImageSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js.map +1 -0
- 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/RNMBXRasterDemSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js +1 -0
- package/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map +1 -0
- 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/specs/RNMBXVectorSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js.map +1 -0
- 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/ImageSource.js +10 -7
- package/lib/module/components/ImageSource.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/RasterDemSource.js +11 -8
- package/lib/module/components/RasterDemSource.js.map +1 -1
- package/lib/module/components/RasterSource.js +11 -8
- package/lib/module/components/RasterSource.js.map +1 -1
- package/lib/module/components/ShapeSource.js +33 -55
- 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/components/VectorSource.js +28 -41
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/specs/NativeRNMBXShapeSourceModule.js +5 -0
- package/lib/module/specs/NativeRNMBXShapeSourceModule.js.map +1 -0
- 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/RNMBXImageSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXImageSourceNativeComponent.js.map +1 -0
- 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/RNMBXRasterDemSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXRasterLayerNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXRasterLayerNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXRasterSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXRasterSourceNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXShapeSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map +1 -0
- 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/specs/RNMBXVectorSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXVectorSourceNativeComponent.js.map +1 -0
- 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/{components → src/components}/RasterDemSource.d.ts +0 -1
- 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/{components → src/components}/RasterSource.d.ts +0 -1
- package/lib/typescript/src/components/RasterSource.d.ts.map +1 -0
- package/lib/typescript/{components → src/components}/ShapeSource.d.ts +2 -58
- 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 +88 -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/NativeRNMBXShapeSourceModule.d.ts +11 -0
- package/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.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/RNMBXImageSourceNativeComponent.d.ts +11 -0
- package/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.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/RNMBXRasterDemSourceNativeComponent.d.ts +15 -0
- package/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.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/RNMBXRasterSourceNativeComponent.d.ts +17 -0
- package/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts +29 -0
- package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.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/src/specs/RNMBXVectorSourceNativeComponent.d.ts +23 -0
- package/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.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/plugin/build/withMapbox.d.ts +5 -4
- package/plugin/build/withMapbox.js +46 -19
- package/plugin/install.md +20 -0
- package/plugin/src/withMapbox.ts +79 -21
- package/rnmapbox-maps.podspec +3 -0
- package/setup-jest.js +25 -4
- package/src/components/ImageSource.tsx +4 -6
- package/src/components/MapView.tsx +66 -1
- package/src/components/RasterDemSource.tsx +5 -8
- package/src/components/RasterSource.tsx +5 -8
- package/src/components/ShapeSource.tsx +39 -86
- package/src/components/VectorSource.tsx +20 -44
- package/src/specs/NativeRNMBXShapeSourceModule.ts +23 -0
- 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/RNMBXImageSourceNativeComponent.ts +15 -0
- package/src/specs/RNMBXLineLayerNativeComponent.ts +11 -8
- package/src/specs/RNMBXMapViewNativeComponent.ts +27 -15
- package/src/specs/RNMBXRasterDemSourceNativeComponent.ts +19 -0
- package/src/specs/RNMBXRasterLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXRasterSourceNativeComponent.ts +21 -0
- package/src/specs/RNMBXShapeSourceNativeComponent.ts +35 -0
- package/src/specs/RNMBXSkyLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXSymbolLayerNativeComponent.ts +12 -9
- package/src/specs/RNMBXVectorSourceNativeComponent.ts +28 -0
- package/src/specs/codegenUtils.ts +5 -0
- package/ios/RNMBX/RNMBXShapeSourceManager.m +0 -45
- 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 +0 -149
- 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/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Annotation.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Event.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Feature.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/HttpInterceptor.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Image.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Light.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Location.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/MapboxMap.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/OfflineManager.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/OrnamentSettings.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/ResourceOption.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Snapshot.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/style.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Annotation.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Event.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Feature.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/HttpInterceptor.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Light.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Location.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/MapboxMap.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/OfflineManager.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/OrnamentSettings.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/ResourceOption.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Snapshot.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/style.kt +0 -0
- /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}/RasterLayer.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/{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
|
@@ -34,6 +34,7 @@ import com.rnmapbox.rnmbx.components.styles.sources.RNMBXImageSourceManager
|
|
|
34
34
|
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXRasterDemSourceManager
|
|
35
35
|
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXRasterSourceManager
|
|
36
36
|
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXShapeSourceManager
|
|
37
|
+
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXShapeSourceModule
|
|
37
38
|
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXVectorSourceManager
|
|
38
39
|
import com.rnmapbox.rnmbx.components.styles.terrain.RNMBXTerrainManager
|
|
39
40
|
import com.rnmapbox.rnmbx.modules.RNMBXLocationModule
|
|
@@ -45,12 +46,12 @@ import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
|
45
46
|
|
|
46
47
|
class RNMBXPackage : TurboReactPackage() {
|
|
47
48
|
|
|
48
|
-
var
|
|
49
|
-
fun
|
|
50
|
-
val viewTagResolver =
|
|
49
|
+
var viewTagResolver: ViewTagResolver? = null
|
|
50
|
+
fun getViewTagResolver(context: ReactApplicationContext) : ViewTagResolver {
|
|
51
|
+
val viewTagResolver = viewTagResolver
|
|
51
52
|
if (viewTagResolver == null) {
|
|
52
|
-
val viewTagResolver = ViewTagResolver
|
|
53
|
-
|
|
53
|
+
val viewTagResolver = ViewTagResolver(context)
|
|
54
|
+
this.viewTagResolver = viewTagResolver
|
|
54
55
|
return viewTagResolver
|
|
55
56
|
}
|
|
56
57
|
return viewTagResolver
|
|
@@ -66,7 +67,8 @@ class RNMBXPackage : TurboReactPackage() {
|
|
|
66
67
|
RNMBXOfflineModule.REACT_CLASS -> return RNMBXOfflineModule(reactApplicationContext)
|
|
67
68
|
RNMBXSnapshotModule.REACT_CLASS -> return RNMBXSnapshotModule(reactApplicationContext)
|
|
68
69
|
RNMBXLogging.REACT_CLASS -> return RNMBXLogging(reactApplicationContext)
|
|
69
|
-
NativeMapViewModule.NAME -> return NativeMapViewModule(reactApplicationContext,
|
|
70
|
+
NativeMapViewModule.NAME -> return NativeMapViewModule(reactApplicationContext, getViewTagResolver(reactApplicationContext))
|
|
71
|
+
RNMBXShapeSourceModule.NAME -> return RNMBXShapeSourceModule(reactApplicationContext, getViewTagResolver(reactApplicationContext))
|
|
70
72
|
}
|
|
71
73
|
return null
|
|
72
74
|
}
|
|
@@ -81,8 +83,8 @@ class RNMBXPackage : TurboReactPackage() {
|
|
|
81
83
|
|
|
82
84
|
// components
|
|
83
85
|
managers.add(RNMBXCameraManager(reactApplicationContext))
|
|
84
|
-
managers.add(RNMBXAndroidTextureMapViewManager(reactApplicationContext,
|
|
85
|
-
managers.add(RNMBXMapViewManager(reactApplicationContext,
|
|
86
|
+
managers.add(RNMBXAndroidTextureMapViewManager(reactApplicationContext, getViewTagResolver(reactApplicationContext)))
|
|
87
|
+
managers.add(RNMBXMapViewManager(reactApplicationContext, getViewTagResolver(reactApplicationContext)))
|
|
86
88
|
managers.add(RNMBXStyleImportManager(reactApplicationContext))
|
|
87
89
|
|
|
88
90
|
// annotations
|
|
@@ -176,6 +178,15 @@ class RNMBXPackage : TurboReactPackage() {
|
|
|
176
178
|
false, // isCxxModule
|
|
177
179
|
isTurboModule // isTurboModule
|
|
178
180
|
)
|
|
181
|
+
moduleInfos[RNMBXShapeSourceModule.NAME] = ReactModuleInfo(
|
|
182
|
+
RNMBXShapeSourceModule.NAME,
|
|
183
|
+
RNMBXShapeSourceModule.NAME,
|
|
184
|
+
false, // canOverrideExistingModule
|
|
185
|
+
false, // needsEagerInit
|
|
186
|
+
false, // hasConstants
|
|
187
|
+
false, // isCxxModule
|
|
188
|
+
isTurboModule // isTurboModule
|
|
189
|
+
)
|
|
179
190
|
moduleInfos
|
|
180
191
|
}
|
|
181
192
|
}
|
|
@@ -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,
|
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) {
|
|
@@ -19,7 +19,7 @@ import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
|
19
19
|
import com.rnmapbox.rnmbx.utils.extensions.toCoordinate
|
|
20
20
|
import com.rnmapbox.rnmbx.utils.extensions.toScreenCoordinate
|
|
21
21
|
|
|
22
|
-
class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver
|
|
22
|
+
class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) : NativeMapViewModuleSpec(context) {
|
|
23
23
|
private fun withMapViewOnUIThread(
|
|
24
24
|
viewRef: Double?,
|
|
25
25
|
reject: Promise,
|
|
@@ -9,7 +9,7 @@ import com.facebook.react.viewmanagers.RNMBXMapViewManagerDelegate
|
|
|
9
9
|
import com.mapbox.maps.MapInitOptions
|
|
10
10
|
import com.rnmapbox.rnmbx.utils.ViewTagResolver
|
|
11
11
|
|
|
12
|
-
class RNMBXAndroidTextureMapViewManager(context: ReactApplicationContext, viewTagResolver: ViewTagResolver
|
|
12
|
+
class RNMBXAndroidTextureMapViewManager(context: ReactApplicationContext, viewTagResolver: ViewTagResolver) : RNMBXMapViewManager(
|
|
13
13
|
context,
|
|
14
14
|
viewTagResolver
|
|
15
15
|
), RNMBXAndroidTextureMapViewManagerInterface<RNMBXMapView> {
|
|
@@ -63,7 +63,7 @@ import com.rnmapbox.rnmbx.components.mapview.helpers.CameraChangeReason
|
|
|
63
63
|
import com.rnmapbox.rnmbx.components.mapview.helpers.CameraChangeTracker
|
|
64
64
|
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXLayer
|
|
65
65
|
import com.rnmapbox.rnmbx.components.styles.light.RNMBXLight
|
|
66
|
-
import com.rnmapbox.rnmbx.components.styles.sources.
|
|
66
|
+
import com.rnmapbox.rnmbx.components.styles.sources.RNMBXSource
|
|
67
67
|
import com.rnmapbox.rnmbx.components.styles.terrain.RNMBXTerrain
|
|
68
68
|
import com.rnmapbox.rnmbx.events.AndroidCallbackEvent
|
|
69
69
|
import com.rnmapbox.rnmbx.events.IEvent
|
|
@@ -190,7 +190,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
190
190
|
*/
|
|
191
191
|
public var offscreenAnnotationViewContainer: ViewGroup? = null
|
|
192
192
|
|
|
193
|
-
private val mSources: MutableMap<String,
|
|
193
|
+
private val mSources: MutableMap<String, RNMBXSource<*>>
|
|
194
194
|
private val mImages: MutableList<RNMBXImages>
|
|
195
195
|
private var mPointAnnotationManager: PointAnnotationManager? = null
|
|
196
196
|
private var mActiveMarkerID: AnnotationID = INVALID_ANNOTATION_ID
|
|
@@ -309,7 +309,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
309
309
|
savedStyle = style
|
|
310
310
|
styleLoaded = true
|
|
311
311
|
setUpImage(style)
|
|
312
|
-
addFeaturesToMap()
|
|
312
|
+
addFeaturesToMap(true)
|
|
313
313
|
applyLocalizeLabels()
|
|
314
314
|
style.setProjection(Projection(mProjection))
|
|
315
315
|
}
|
|
@@ -444,7 +444,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
444
444
|
// region Features
|
|
445
445
|
fun addFeature(childView: View?, childPosition: Int) {
|
|
446
446
|
var feature: AbstractMapFeature? = null
|
|
447
|
-
if (childView is
|
|
447
|
+
if (childView is RNMBXSource<*>) {
|
|
448
448
|
val source = childView
|
|
449
449
|
mSources[source.iD.toString()] = source
|
|
450
450
|
feature = childView as AbstractMapFeature?
|
|
@@ -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) {
|
|
@@ -491,7 +491,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
491
491
|
fun removeFeatureAt(childPosition: Int) {
|
|
492
492
|
val entry = mFeatures[childPosition]
|
|
493
493
|
val feature = entry.feature
|
|
494
|
-
if (feature is
|
|
494
|
+
if (feature is RNMBXSource<*>) {
|
|
495
495
|
mSources.remove(feature.iD)
|
|
496
496
|
} else if (feature is RNMBXPointAnnotation) {
|
|
497
497
|
val annotation = feature
|
|
@@ -541,19 +541,21 @@ 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
|
}
|
|
552
554
|
|
|
553
555
|
|
|
554
|
-
private val allTouchableSources: List<
|
|
556
|
+
private val allTouchableSources: List<RNMBXSource<*>>
|
|
555
557
|
private get() {
|
|
556
|
-
val sources: MutableList<
|
|
558
|
+
val sources: MutableList<RNMBXSource<*>> = ArrayList()
|
|
557
559
|
for (key in mSources.keys) {
|
|
558
560
|
val source = mSources[key]
|
|
559
561
|
if (source != null && source.hasPressListener()) {
|
|
@@ -563,14 +565,14 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
563
565
|
return sources
|
|
564
566
|
}
|
|
565
567
|
|
|
566
|
-
private fun getTouchableSourceWithHighestZIndex(sources: List<
|
|
568
|
+
private fun getTouchableSourceWithHighestZIndex(sources: List<RNMBXSource<*>>?): RNMBXSource<*>? {
|
|
567
569
|
if (sources == null || sources.size == 0) {
|
|
568
570
|
return null
|
|
569
571
|
}
|
|
570
572
|
if (sources.size == 1) {
|
|
571
573
|
return sources[0]
|
|
572
574
|
}
|
|
573
|
-
val layerToSourceMap: MutableMap<String,
|
|
575
|
+
val layerToSourceMap: MutableMap<String, RNMBXSource<*>> = HashMap()
|
|
574
576
|
for (source in sources) {
|
|
575
577
|
val layerIDs: Array<out String>? = source.layerIDs.toTypedArray()
|
|
576
578
|
if (layerIDs != null) {
|
|
@@ -654,18 +656,19 @@ 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
|
}
|
|
660
663
|
|
|
661
664
|
interface HandleTap {
|
|
662
|
-
fun run(hitTouchableSources: List<
|
|
665
|
+
fun run(hitTouchableSources: List<RNMBXSource<*>?>?, hits: Map<String?, List<Feature?>?>)
|
|
663
666
|
}
|
|
664
667
|
|
|
665
668
|
fun handleTapInSources(
|
|
666
|
-
sources: LinkedList<
|
|
669
|
+
sources: LinkedList<RNMBXSource<*>>, screenPoint: ScreenCoordinate,
|
|
667
670
|
hits: HashMap<String?, List<Feature?>?>,
|
|
668
|
-
hitTouchableSources: ArrayList<
|
|
671
|
+
hitTouchableSources: ArrayList<RNMBXSource<*>?>,
|
|
669
672
|
handleTap: HandleTap
|
|
670
673
|
) {
|
|
671
674
|
if (sources.isEmpty()) {
|
|
@@ -720,11 +723,11 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
720
723
|
val hits = HashMap<String?, List<Feature?>?>()
|
|
721
724
|
if (screenPoint != null) {
|
|
722
725
|
handleTapInSources(LinkedList(touchableSources), screenPoint, hits, ArrayList(), object : HandleTap {
|
|
723
|
-
override fun run(hitTouchableSources: List<
|
|
726
|
+
override fun run(hitTouchableSources: List<RNMBXSource<*>?>?, hits: Map<String?, List<Feature?>?>) {
|
|
724
727
|
if (hits.size > 0) {
|
|
725
|
-
val source = getTouchableSourceWithHighestZIndex(hitTouchableSources as List<
|
|
728
|
+
val source = getTouchableSourceWithHighestZIndex(hitTouchableSources as List<RNMBXSource<*>>?)
|
|
726
729
|
if (source != null && source.hasPressListener() && source.iD != null && source.iD in hits) {
|
|
727
|
-
source.onPress(
|
|
730
|
+
source.onPress(RNMBXSource.OnPressEvent(
|
|
728
731
|
hits[source.iD] as List<Feature>,
|
|
729
732
|
GeoJSONUtils.toLatLng(point),
|
|
730
733
|
PointF(screenPoint.x.toFloat(), screenPoint.y.toFloat())
|
|
@@ -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
|
|
@@ -47,7 +49,7 @@ interface CommandResponse {
|
|
|
47
49
|
fun error(message: String)
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
open class RNMBXMapViewManager(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver
|
|
52
|
+
open class RNMBXMapViewManager(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) :
|
|
51
53
|
AbstractEventEmitter<RNMBXMapView>(context), RNMBXMapViewManagerInterface<RNMBXMapView> {
|
|
52
54
|
private val mViews: MutableMap<Int, RNMBXMapView>
|
|
53
55
|
|
|
@@ -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())
|
package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXImageSource.kt
CHANGED
|
@@ -8,7 +8,7 @@ import com.mapbox.maps.extension.style.sources.generated.ImageSource
|
|
|
8
8
|
import com.rnmapbox.rnmbx.utils.LatLngQuad
|
|
9
9
|
import java.net.URL
|
|
10
10
|
|
|
11
|
-
class RNMBXImageSource(context: Context?) :
|
|
11
|
+
class RNMBXImageSource(context: Context?) : RNMBXSource<ImageSource?>(context) {
|
|
12
12
|
private var mURL: URL? = null
|
|
13
13
|
private var mResourceId = 0
|
|
14
14
|
private var mCoordQuad: LatLngQuad? = null
|
package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSource.kt
CHANGED
|
@@ -4,6 +4,7 @@ import android.content.Context
|
|
|
4
4
|
import com.mapbox.maps.extension.style.sources.generated.GeoJsonSource
|
|
5
5
|
import com.rnmapbox.rnmbx.utils.ImageEntry
|
|
6
6
|
import android.graphics.drawable.BitmapDrawable
|
|
7
|
+
import com.facebook.react.bridge.Promise
|
|
7
8
|
import com.facebook.react.bridge.ReadableMap
|
|
8
9
|
import com.rnmapbox.rnmbx.components.mapview.RNMBXMapView
|
|
9
10
|
import com.rnmapbox.rnmbx.events.FeatureClickEvent
|
|
@@ -23,7 +24,7 @@ import java.util.HashMap
|
|
|
23
24
|
import com.rnmapbox.rnmbx.v11compat.feature.*
|
|
24
25
|
|
|
25
26
|
class RNMBXShapeSource(context: Context, private val mManager: RNMBXShapeSourceManager) :
|
|
26
|
-
|
|
27
|
+
RNMBXSource<GeoJsonSource>(context) {
|
|
27
28
|
private var mURL: URL? = null
|
|
28
29
|
private var mShape: String? = null
|
|
29
30
|
private var mCluster: Boolean? = null
|
|
@@ -176,18 +177,14 @@ class RNMBXShapeSource(context: Context, private val mManager: RNMBXShapeSourceM
|
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
private fun callbackSuccess(
|
|
180
|
-
|
|
181
|
-
mManager.handleEvent(event)
|
|
180
|
+
private fun callbackSuccess(payload: WritableMap, promise: Promise) {
|
|
181
|
+
promise.resolve(payload)
|
|
182
182
|
}
|
|
183
|
-
private fun callbackError(
|
|
184
|
-
|
|
185
|
-
payload.putString("error", "$where: $error")
|
|
186
|
-
val event = AndroidCallbackEvent(this, callbackID, payload)
|
|
187
|
-
mManager.handleEvent(event)
|
|
183
|
+
private fun callbackError(error: String, where: String, promise: Promise) {
|
|
184
|
+
promise.reject("error", "$where: $error")
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
fun getClusterExpansionZoom(
|
|
187
|
+
fun getClusterExpansionZoom(featureJSON: String, promise: Promise) {
|
|
191
188
|
val feature = Feature.fromJson(featureJSON)
|
|
192
189
|
|
|
193
190
|
mMap!!.getGeoJsonClusterExpansionZoom(iD!!, feature, QueryFeatureExtensionCallback { features ->
|
|
@@ -198,28 +195,29 @@ class RNMBXShapeSource(context: Context, private val mManager: RNMBXShapeSourceM
|
|
|
198
195
|
if (contents is Long) {
|
|
199
196
|
val payload: WritableMap = WritableNativeMap()
|
|
200
197
|
payload.putInt("data", contents.toInt())
|
|
201
|
-
callbackSuccess(
|
|
198
|
+
callbackSuccess(payload, promise)
|
|
202
199
|
return@QueryFeatureExtensionCallback
|
|
203
200
|
} else {
|
|
204
201
|
callbackError(
|
|
205
|
-
|
|
202
|
+
|
|
206
203
|
"Not a number: $contents",
|
|
207
|
-
"getClusterExpansionZoom/getGeoJsonClusterExpansionZoom"
|
|
204
|
+
"getClusterExpansionZoom/getGeoJsonClusterExpansionZoom",
|
|
205
|
+
promise
|
|
208
206
|
)
|
|
209
207
|
return@QueryFeatureExtensionCallback
|
|
210
208
|
}
|
|
211
209
|
} else {
|
|
212
210
|
callbackError(
|
|
213
|
-
callbackID,
|
|
214
211
|
features.error ?: "Unknown error",
|
|
215
|
-
"getClusterExpansionZoom/getGeoJsonClusterExpansionZoom"
|
|
212
|
+
"getClusterExpansionZoom/getGeoJsonClusterExpansionZoom",
|
|
213
|
+
promise
|
|
216
214
|
)
|
|
217
215
|
return@QueryFeatureExtensionCallback
|
|
218
216
|
}
|
|
219
217
|
})
|
|
220
218
|
}
|
|
221
219
|
|
|
222
|
-
fun getClusterLeaves(
|
|
220
|
+
fun getClusterLeaves(featureJSON: String, number: Int, offset: Int, promise: Promise) {
|
|
223
221
|
val feature = Feature.fromJson(featureJSON)
|
|
224
222
|
|
|
225
223
|
val _this = this
|
|
@@ -232,19 +230,19 @@ class RNMBXShapeSource(context: Context, private val mManager: RNMBXShapeSourceM
|
|
|
232
230
|
"data",
|
|
233
231
|
FeatureCollection.fromFeatures(leaves!!).toJson()
|
|
234
232
|
)
|
|
235
|
-
callbackSuccess(
|
|
233
|
+
callbackSuccess(payload, promise)
|
|
236
234
|
} else {
|
|
237
235
|
callbackError(
|
|
238
|
-
callbackID,
|
|
239
236
|
features.error ?: "Unknown error",
|
|
240
|
-
"getClusterLeaves/getGeoJsonClusterLeaves"
|
|
237
|
+
"getClusterLeaves/getGeoJsonClusterLeaves",
|
|
238
|
+
promise
|
|
241
239
|
)
|
|
242
240
|
return@QueryFeatureExtensionCallback
|
|
243
241
|
}
|
|
244
242
|
})
|
|
245
243
|
}
|
|
246
244
|
|
|
247
|
-
fun getClusterChildren(
|
|
245
|
+
fun getClusterChildren(featureJSON: String, promise: Promise) {
|
|
248
246
|
val feature = Feature.fromJson(featureJSON)
|
|
249
247
|
|
|
250
248
|
val _this = this
|
|
@@ -257,12 +255,12 @@ class RNMBXShapeSource(context: Context, private val mManager: RNMBXShapeSourceM
|
|
|
257
255
|
"data",
|
|
258
256
|
FeatureCollection.fromFeatures(children!!).toJson()
|
|
259
257
|
)
|
|
260
|
-
callbackSuccess(
|
|
258
|
+
callbackSuccess(payload, promise)
|
|
261
259
|
}else {
|
|
262
260
|
callbackError(
|
|
263
|
-
callbackID,
|
|
264
261
|
features.error ?: "Unknown error",
|
|
265
|
-
"getClusterLeaves/queryFeatureExtensions"
|
|
262
|
+
"getClusterLeaves/queryFeatureExtensions",
|
|
263
|
+
promise
|
|
266
264
|
)
|
|
267
265
|
return@QueryFeatureExtensionCallback
|
|
268
266
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
package com.rnmapbox.rnmbx.components.styles.sources
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import android.view.View
|
|
5
4
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
5
|
import com.rnmapbox.rnmbx.components.AbstractEventEmitter
|
|
7
6
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
7
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
9
8
|
import com.facebook.react.bridge.ReadableMap
|
|
10
|
-
import com.facebook.react.bridge.ReadableArray
|
|
11
9
|
import com.facebook.react.bridge.ReadableType
|
|
12
10
|
import com.facebook.react.common.MapBuilder
|
|
13
11
|
import com.mapbox.bindgen.Value
|
|
@@ -153,52 +151,8 @@ class RNMBXShapeSourceManager(private val mContext: ReactApplicationContext) :
|
|
|
153
151
|
.build()
|
|
154
152
|
}
|
|
155
153
|
|
|
156
|
-
override fun getCommandsMap(): Map<String, Int>? {
|
|
157
|
-
return MapBuilder.builder<String, Int>()
|
|
158
|
-
.put("features", METHOD_FEATURES)
|
|
159
|
-
.put("getClusterExpansionZoom", METHOD_GET_CLUSTER_EXPANSION_ZOOM)
|
|
160
|
-
.put("getClusterLeaves", METHOD_GET_CLUSTER_LEAVES)
|
|
161
|
-
.put("getClusterChildren", METHOD_GET_CLUSTER_CHILDREN)
|
|
162
|
-
.build()
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
override fun receiveCommand(source: RNMBXShapeSource, commandID: Int, args: ReadableArray?) {
|
|
166
|
-
if (args == null) {
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
val callbackID = args.getString(0);
|
|
171
|
-
|
|
172
|
-
when (commandID) {
|
|
173
|
-
METHOD_FEATURES -> source.querySourceFeatures(
|
|
174
|
-
callbackID,
|
|
175
|
-
ExpressionParser.from(args.getArray(1))
|
|
176
|
-
)
|
|
177
|
-
METHOD_GET_CLUSTER_EXPANSION_ZOOM -> source.getClusterExpansionZoom(
|
|
178
|
-
callbackID,
|
|
179
|
-
args.getString(1)
|
|
180
|
-
)
|
|
181
|
-
METHOD_GET_CLUSTER_LEAVES -> source.getClusterLeaves(
|
|
182
|
-
callbackID,
|
|
183
|
-
args.getString(1),
|
|
184
|
-
args.getInt(2),
|
|
185
|
-
args.getInt(3)
|
|
186
|
-
)
|
|
187
|
-
METHOD_GET_CLUSTER_CHILDREN -> source.getClusterChildren(
|
|
188
|
-
callbackID,
|
|
189
|
-
args.getString(1)
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
154
|
companion object {
|
|
195
155
|
const val LOG_TAG = "RNMBXShapeSourceMgr"
|
|
196
156
|
const val REACT_CLASS = "RNMBXShapeSource"
|
|
197
|
-
|
|
198
|
-
//region React Methods
|
|
199
|
-
const val METHOD_FEATURES = 103
|
|
200
|
-
const val METHOD_GET_CLUSTER_EXPANSION_ZOOM = 104
|
|
201
|
-
const val METHOD_GET_CLUSTER_LEAVES = 105
|
|
202
|
-
const val METHOD_GET_CLUSTER_CHILDREN = 106
|
|
203
157
|
}
|
|
204
158
|
}
|