From 57f3d46ca95eed2ac48cf8b0de0b6a2118564f8a Mon Sep 17 00:00:00 2001 From: Craig Martin Date: Wed, 31 Jan 2024 23:40:10 -0500 Subject: [PATCH] Update docs, add lib folder --- .gitignore | 2 +- docs/Camera.md | 12 +- docs/OfflineManager.md | 242 ++++---- docs/docs.json | 16 +- lib/commonjs/Mapbox.js | 459 ++++++++++++++ lib/commonjs/Mapbox.js.map | 1 + lib/commonjs/RNMBXModule.js | 47 ++ lib/commonjs/RNMBXModule.js.map | 1 + lib/commonjs/assets/heading.png | Bin 0 -> 258 bytes lib/commonjs/assets/heading@2x.png | Bin 0 -> 405 bytes lib/commonjs/assets/heading@3x.png | Bin 0 -> 687 bytes .../classes/AnimatedCoordinatesArray.js | 165 +++++ .../classes/AnimatedCoordinatesArray.js.map | 1 + .../AnimatedExtractCoordinateFromArray.js | 44 ++ .../AnimatedExtractCoordinateFromArray.js.map | 1 + lib/commonjs/classes/AnimatedPoint.js | 117 ++++ lib/commonjs/classes/AnimatedPoint.js.map | 1 + .../classes/AnimatedRouteCoordinatesArray.js | 155 +++++ .../AnimatedRouteCoordinatesArray.js.map | 1 + lib/commonjs/classes/AnimatedShape.js | 78 +++ lib/commonjs/classes/AnimatedShape.js.map | 1 + lib/commonjs/classes/index.d.js | 18 + lib/commonjs/classes/index.d.js.map | 1 + lib/commonjs/classes/index.js | 61 ++ lib/commonjs/classes/index.js.map | 1 + lib/commonjs/components/AbstractLayer.js | 62 ++ lib/commonjs/components/AbstractLayer.js.map | 1 + lib/commonjs/components/AbstractSource.js | 25 + lib/commonjs/components/AbstractSource.js.map | 1 + lib/commonjs/components/Annotation.js | 101 +++ lib/commonjs/components/Annotation.js.map | 1 + lib/commonjs/components/Atmosphere.js | 24 + lib/commonjs/components/Atmosphere.js.map | 1 + lib/commonjs/components/BackgroundLayer.js | 33 + .../components/BackgroundLayer.js.map | 1 + lib/commonjs/components/Callout.js | 90 +++ lib/commonjs/components/Callout.js.map | 1 + lib/commonjs/components/Camera.js | 369 +++++++++++ lib/commonjs/components/Camera.js.map | 1 + lib/commonjs/components/CircleLayer.js | 42 ++ lib/commonjs/components/CircleLayer.js.map | 1 + .../components/CustomLocationProvider.js | 17 + .../components/CustomLocationProvider.js.map | 1 + lib/commonjs/components/FillExtrusionLayer.js | 37 ++ .../components/FillExtrusionLayer.js.map | 1 + lib/commonjs/components/FillLayer.js | 41 ++ lib/commonjs/components/FillLayer.js.map | 1 + lib/commonjs/components/HeadingIndicator.js | 42 ++ .../components/HeadingIndicator.js.map | 1 + lib/commonjs/components/HeatmapLayer.js | 42 ++ lib/commonjs/components/HeatmapLayer.js.map | 1 + lib/commonjs/components/Image.js | 49 ++ lib/commonjs/components/Image.js.map | 1 + lib/commonjs/components/ImageSource.js | 51 ++ lib/commonjs/components/ImageSource.js.map | 1 + lib/commonjs/components/Images.js | 102 +++ lib/commonjs/components/Images.js.map | 1 + lib/commonjs/components/Light.js | 48 ++ lib/commonjs/components/Light.js.map | 1 + lib/commonjs/components/LineLayer.js | 41 ++ lib/commonjs/components/LineLayer.js.map | 1 + lib/commonjs/components/LocationPuck.js | 67 ++ lib/commonjs/components/LocationPuck.js.map | 1 + lib/commonjs/components/MapView.js | 582 +++++++++++++++++ lib/commonjs/components/MapView.js.map | 1 + lib/commonjs/components/MarkerView.js | 100 +++ lib/commonjs/components/MarkerView.js.map | 1 + lib/commonjs/components/ModelLayer.js | 37 ++ lib/commonjs/components/ModelLayer.js.map | 1 + lib/commonjs/components/Models.js | 43 ++ lib/commonjs/components/Models.js.map | 1 + .../components/NativeBridgeComponent.js | 43 ++ .../components/NativeBridgeComponent.js.map | 1 + lib/commonjs/components/PointAnnotation.js | 139 +++++ .../components/PointAnnotation.js.map | 1 + lib/commonjs/components/RasterDemSource.js | 64 ++ .../components/RasterDemSource.js.map | 1 + lib/commonjs/components/RasterLayer.js | 38 ++ lib/commonjs/components/RasterLayer.js.map | 1 + lib/commonjs/components/RasterSource.js | 71 +++ lib/commonjs/components/RasterSource.js.map | 1 + lib/commonjs/components/ShapeSource.js | 161 +++++ lib/commonjs/components/ShapeSource.js.map | 1 + lib/commonjs/components/SkyLayer.js | 32 + lib/commonjs/components/SkyLayer.js.map | 1 + lib/commonjs/components/Style.js | 265 ++++++++ lib/commonjs/components/Style.js.map | 1 + lib/commonjs/components/StyleImport.js | 21 + lib/commonjs/components/StyleImport.js.map | 1 + lib/commonjs/components/SymbolLayer.js | 65 ++ lib/commonjs/components/SymbolLayer.js.map | 1 + lib/commonjs/components/Terrain.js | 34 + lib/commonjs/components/Terrain.js.map | 1 + lib/commonjs/components/UserLocation.js | 215 +++++++ lib/commonjs/components/UserLocation.js.map | 1 + lib/commonjs/components/VectorSource.js | 95 +++ lib/commonjs/components/VectorSource.js.map | 1 + lib/commonjs/components/Viewport.js | 106 ++++ lib/commonjs/components/Viewport.js.map | 1 + .../codeparts/LayerPropsCommon.codepart-tsx | 62 ++ lib/commonjs/global.d.js | 2 + lib/commonjs/global.d.js.map | 1 + lib/commonjs/index.js | 24 + lib/commonjs/index.js.map | 1 + lib/commonjs/index.web.js | 27 + lib/commonjs/index.web.js.map | 1 + .../modules/location/locationManager.js | 138 +++++ .../modules/location/locationManager.js.map | 1 + .../offline/OfflineCreatePackOptions.js | 43 ++ .../offline/OfflineCreatePackOptions.js.map | 1 + lib/commonjs/modules/offline/OfflinePack.js | 41 ++ .../modules/offline/OfflinePack.js.map | 1 + .../modules/offline/OfflinePackLegacy.js | 41 ++ .../modules/offline/OfflinePackLegacy.js.map | 1 + lib/commonjs/modules/offline/TileStore.js | 46 ++ lib/commonjs/modules/offline/TileStore.js.map | 1 + .../modules/offline/offlineManager.js | 449 ++++++++++++++ .../modules/offline/offlineManager.js.map | 1 + .../modules/offline/offlineManagerLegacy.js | 167 +++++ .../offline/offlineManagerLegacy.js.map | 1 + .../modules/snapshot/SnapshotOptions.js | 60 ++ .../modules/snapshot/SnapshotOptions.js.map | 1 + .../modules/snapshot/snapshotManager.js | 68 ++ .../modules/snapshot/snapshotManager.js.map | 1 + .../requestAndroidLocationPermissions.js | 25 + .../requestAndroidLocationPermissions.js.map | 1 + .../shape_animators/MovePointShapeAnimator.js | 21 + .../MovePointShapeAnimator.js.map | 1 + .../shape_animators/ShapeAnimatorManager.js | 16 + .../ShapeAnimatorManager.js.map | 1 + lib/commonjs/specs/NativeMapViewModule.js | 11 + lib/commonjs/specs/NativeMapViewModule.js.map | 1 + lib/commonjs/specs/NativeRNMBXImageModule.js | 11 + .../specs/NativeRNMBXImageModule.js.map | 1 + ...NativeRNMBXMovePointShapeAnimatorModule.js | 10 + ...veRNMBXMovePointShapeAnimatorModule.js.map | 1 + .../specs/NativeRNMBXPointAnnotationModule.js | 11 + .../NativeRNMBXPointAnnotationModule.js.map | 1 + .../specs/NativeRNMBXShapeSourceModule.js | 11 + .../specs/NativeRNMBXShapeSourceModule.js.map | 1 + .../specs/NativeRNMBXTileStoreModule.js | 10 + .../specs/NativeRNMBXTileStoreModule.js.map | 1 + .../specs/NativeRNMBXViewportModule.js | 10 + .../specs/NativeRNMBXViewportModule.js.map | 1 + .../specs/RNMBXAtmosphereNativeComponent.js | 11 + .../RNMBXAtmosphereNativeComponent.js.map | 1 + .../RNMBXBackgroundLayerNativeComponent.js | 11 + ...RNMBXBackgroundLayerNativeComponent.js.map | 1 + .../specs/RNMBXCalloutNativeComponent.js | 11 + .../specs/RNMBXCalloutNativeComponent.js.map | 1 + .../specs/RNMBXCameraNativeComponent.js | 11 + .../specs/RNMBXCameraNativeComponent.js.map | 1 + .../specs/RNMBXCircleLayerNativeComponent.js | 11 + .../RNMBXCircleLayerNativeComponent.js.map | 1 + ...BXCustomLocationProviderNativeComponent.js | 11 + ...stomLocationProviderNativeComponent.js.map | 1 + .../RNMBXFillExtrusionLayerNativeComponent.js | 11 + ...BXFillExtrusionLayerNativeComponent.js.map | 1 + .../specs/RNMBXFillLayerNativeComponent.js | 11 + .../RNMBXFillLayerNativeComponent.js.map | 1 + .../specs/RNMBXHeatmapLayerNativeComponent.js | 11 + .../RNMBXHeatmapLayerNativeComponent.js.map | 1 + .../specs/RNMBXImageNativeComponent.js | 11 + .../specs/RNMBXImageNativeComponent.js.map | 1 + .../specs/RNMBXImageSourceNativeComponent.js | 11 + .../RNMBXImageSourceNativeComponent.js.map | 1 + .../specs/RNMBXImagesNativeComponent.js | 11 + .../specs/RNMBXImagesNativeComponent.js.map | 1 + .../specs/RNMBXLightNativeComponent.js | 11 + .../specs/RNMBXLightNativeComponent.js.map | 1 + .../specs/RNMBXLineLayerNativeComponent.js | 11 + .../RNMBXLineLayerNativeComponent.js.map | 1 + .../specs/RNMBXMapViewNativeComponent.js | 11 + .../specs/RNMBXMapViewNativeComponent.js.map | 1 + .../RNMBXMarkerViewContentNativeComponent.js | 11 + ...MBXMarkerViewContentNativeComponent.js.map | 1 + .../specs/RNMBXMarkerViewNativeComponent.js | 11 + .../RNMBXMarkerViewNativeComponent.js.map | 1 + .../specs/RNMBXModelLayerNativeComponent.js | 11 + .../RNMBXModelLayerNativeComponent.js.map | 1 + .../specs/RNMBXModelsNativeComponent.js | 11 + .../specs/RNMBXModelsNativeComponent.js.map | 1 + .../RNMBXNativeUserLocationNativeComponent.js | 11 + ...BXNativeUserLocationNativeComponent.js.map | 1 + .../RNMBXPointAnnotationNativeComponent.js | 11 + ...RNMBXPointAnnotationNativeComponent.js.map | 1 + .../RNMBXRasterDemSourceNativeComponent.js | 11 + ...RNMBXRasterDemSourceNativeComponent.js.map | 1 + .../specs/RNMBXRasterLayerNativeComponent.js | 11 + .../RNMBXRasterLayerNativeComponent.js.map | 1 + .../specs/RNMBXRasterSourceNativeComponent.js | 11 + .../RNMBXRasterSourceNativeComponent.js.map | 1 + .../specs/RNMBXShapeSourceNativeComponent.js | 11 + .../RNMBXShapeSourceNativeComponent.js.map | 1 + .../specs/RNMBXSkyLayerNativeComponent.js | 11 + .../specs/RNMBXSkyLayerNativeComponent.js.map | 1 + .../specs/RNMBXStyleImportNativeComponent.js | 11 + .../RNMBXStyleImportNativeComponent.js.map | 1 + .../specs/RNMBXSymbolLayerNativeComponent.js | 11 + .../RNMBXSymbolLayerNativeComponent.js.map | 1 + .../specs/RNMBXTerrainNativeComponent.js | 11 + .../specs/RNMBXTerrainNativeComponent.js.map | 1 + .../specs/RNMBXVectorSourceNativeComponent.js | 11 + .../RNMBXVectorSourceNativeComponent.js.map | 1 + .../specs/RNMBXViewportNativeComponent.js | 11 + .../specs/RNMBXViewportNativeComponent.js.map | 1 + lib/commonjs/specs/codegenUtils.js | 6 + lib/commonjs/specs/codegenUtils.js.map | 1 + ...mmonLayerNativeComponentsProps.codepart-ts | 18 + lib/commonjs/types/BaseProps.js | 2 + lib/commonjs/types/BaseProps.js.map | 1 + lib/commonjs/types/OnPressEvent.js | 2 + lib/commonjs/types/OnPressEvent.js.map | 1 + lib/commonjs/types/Position.js | 2 + lib/commonjs/types/Position.js.map | 1 + lib/commonjs/types/index.js | 6 + lib/commonjs/types/index.js.map | 1 + lib/commonjs/utils/BridgeValue.js | 64 ++ lib/commonjs/utils/BridgeValue.js.map | 1 + lib/commonjs/utils/Logger.js | 119 ++++ lib/commonjs/utils/Logger.js.map | 1 + lib/commonjs/utils/MapboxStyles.d.js | 188 ++++++ lib/commonjs/utils/MapboxStyles.d.js.map | 1 + lib/commonjs/utils/StyleValue.js | 44 ++ lib/commonjs/utils/StyleValue.js.map | 1 + lib/commonjs/utils/animated/Animated.js | 33 + lib/commonjs/utils/animated/Animated.js.map | 1 + lib/commonjs/utils/checkRequiredProps.js | 14 + lib/commonjs/utils/checkRequiredProps.js.map | 1 + lib/commonjs/utils/deprecation.js | 40 ++ lib/commonjs/utils/deprecation.js.map | 1 + lib/commonjs/utils/filterUtils.js | 13 + lib/commonjs/utils/filterUtils.js.map | 1 + lib/commonjs/utils/geoUtils.js | 39 ++ lib/commonjs/utils/geoUtils.js.map | 1 + lib/commonjs/utils/getAnnotationsLayerID.js | 21 + .../utils/getAnnotationsLayerID.js.map | 1 + lib/commonjs/utils/index.js | 82 +++ lib/commonjs/utils/index.js.map | 1 + lib/commonjs/utils/nativeRef.js | 27 + lib/commonjs/utils/nativeRef.js.map | 1 + lib/commonjs/utils/styleMap.js | 339 ++++++++++ lib/commonjs/utils/styleMap.js.map | 1 + lib/commonjs/web/MapContext.js | 12 + lib/commonjs/web/MapContext.js.map | 1 + lib/commonjs/web/MapboxModule.js | 21 + lib/commonjs/web/MapboxModule.js.map | 1 + lib/commonjs/web/UnimplementedComponent.js | 16 + .../web/UnimplementedComponent.js.map | 1 + lib/commonjs/web/components/Camera.js | 44 ++ lib/commonjs/web/components/Camera.js.map | 1 + lib/commonjs/web/components/MapView.js | 67 ++ lib/commonjs/web/components/MapView.js.map | 1 + lib/commonjs/web/index.js | 41 ++ lib/commonjs/web/index.js.map | 1 + lib/commonjs/web/install.md | 25 + lib/commonjs/web/utils/Logger.js | 99 +++ lib/commonjs/web/utils/Logger.js.map | 1 + lib/module/Mapbox.js | 79 +++ lib/module/Mapbox.js.map | 1 + lib/module/RNMBXModule.js | 28 + lib/module/RNMBXModule.js.map | 1 + lib/module/assets/heading.png | Bin 0 -> 258 bytes lib/module/assets/heading@2x.png | Bin 0 -> 405 bytes lib/module/assets/heading@3x.png | Bin 0 -> 687 bytes .../classes/AnimatedCoordinatesArray.js | 158 +++++ .../classes/AnimatedCoordinatesArray.js.map | 1 + .../AnimatedExtractCoordinateFromArray.js | 37 ++ .../AnimatedExtractCoordinateFromArray.js.map | 1 + lib/module/classes/AnimatedPoint.js | 110 ++++ lib/module/classes/AnimatedPoint.js.map | 1 + .../classes/AnimatedRouteCoordinatesArray.js | 148 +++++ .../AnimatedRouteCoordinatesArray.js.map | 1 + lib/module/classes/AnimatedShape.js | 71 +++ lib/module/classes/AnimatedShape.js.map | 1 + lib/module/classes/index.d.js | 7 + lib/module/classes/index.d.js.map | 1 + lib/module/classes/index.js | 6 + lib/module/classes/index.js.map | 1 + lib/module/components/AbstractLayer.js | 54 ++ lib/module/components/AbstractLayer.js.map | 1 + lib/module/components/AbstractSource.js | 17 + lib/module/components/AbstractSource.js.map | 1 + lib/module/components/Annotation.js | 93 +++ lib/module/components/Annotation.js.map | 1 + lib/module/components/Atmosphere.js | 14 + lib/module/components/Atmosphere.js.map | 1 + lib/module/components/BackgroundLayer.js | 25 + lib/module/components/BackgroundLayer.js.map | 1 + lib/module/components/Callout.js | 82 +++ lib/module/components/Callout.js.map | 1 + lib/module/components/Camera.js | 358 +++++++++++ lib/module/components/Camera.js.map | 1 + lib/module/components/CircleLayer.js | 34 + lib/module/components/CircleLayer.js.map | 1 + .../components/CustomLocationProvider.js | 7 + .../components/CustomLocationProvider.js.map | 1 + lib/module/components/FillExtrusionLayer.js | 29 + .../components/FillExtrusionLayer.js.map | 1 + lib/module/components/FillLayer.js | 33 + lib/module/components/FillLayer.js.map | 1 + lib/module/components/HeadingIndicator.js | 34 + lib/module/components/HeadingIndicator.js.map | 1 + lib/module/components/HeatmapLayer.js | 34 + lib/module/components/HeatmapLayer.js.map | 1 + lib/module/components/Image.js | 39 ++ lib/module/components/Image.js.map | 1 + lib/module/components/ImageSource.js | 42 ++ lib/module/components/ImageSource.js.map | 1 + lib/module/components/Images.js | 93 +++ lib/module/components/Images.js.map | 1 + lib/module/components/Light.js | 38 ++ lib/module/components/Light.js.map | 1 + lib/module/components/LineLayer.js | 33 + lib/module/components/LineLayer.js.map | 1 + lib/module/components/LocationPuck.js | 57 ++ lib/module/components/LocationPuck.js.map | 1 + lib/module/components/MapView.js | 574 +++++++++++++++++ lib/module/components/MapView.js.map | 1 + lib/module/components/MarkerView.js | 92 +++ lib/module/components/MarkerView.js.map | 1 + lib/module/components/ModelLayer.js | 29 + lib/module/components/ModelLayer.js.map | 1 + lib/module/components/Models.js | 36 ++ lib/module/components/Models.js.map | 1 + .../components/NativeBridgeComponent.js | 36 ++ .../components/NativeBridgeComponent.js.map | 1 + lib/module/components/PointAnnotation.js | 130 ++++ lib/module/components/PointAnnotation.js.map | 1 + lib/module/components/RasterDemSource.js | 56 ++ lib/module/components/RasterDemSource.js.map | 1 + lib/module/components/RasterLayer.js | 30 + lib/module/components/RasterLayer.js.map | 1 + lib/module/components/RasterSource.js | 63 ++ lib/module/components/RasterSource.js.map | 1 + lib/module/components/ShapeSource.js | 153 +++++ lib/module/components/ShapeSource.js.map | 1 + lib/module/components/SkyLayer.js | 24 + lib/module/components/SkyLayer.js.map | 1 + lib/module/components/Style.js | 255 ++++++++ lib/module/components/Style.js.map | 1 + lib/module/components/StyleImport.js | 11 + lib/module/components/StyleImport.js.map | 1 + lib/module/components/SymbolLayer.js | 56 ++ lib/module/components/SymbolLayer.js.map | 1 + lib/module/components/Terrain.js | 24 + lib/module/components/Terrain.js.map | 1 + lib/module/components/UserLocation.js | 206 ++++++ lib/module/components/UserLocation.js.map | 1 + lib/module/components/VectorSource.js | 86 +++ lib/module/components/VectorSource.js.map | 1 + lib/module/components/Viewport.js | 96 +++ lib/module/components/Viewport.js.map | 1 + .../codeparts/LayerPropsCommon.codepart-tsx | 62 ++ lib/module/global.d.js | 2 + lib/module/global.d.js.map | 1 + lib/module/index.js | 4 + lib/module/index.js.map | 1 + lib/module/index.web.js | 3 + lib/module/index.web.js.map | 1 + .../modules/location/locationManager.js | 130 ++++ .../modules/location/locationManager.js.map | 1 + .../offline/OfflineCreatePackOptions.js | 36 ++ .../offline/OfflineCreatePackOptions.js.map | 1 + lib/module/modules/offline/OfflinePack.js | 34 + lib/module/modules/offline/OfflinePack.js.map | 1 + .../modules/offline/OfflinePackLegacy.js | 34 + .../modules/offline/OfflinePackLegacy.js.map | 1 + lib/module/modules/offline/TileStore.js | 38 ++ lib/module/modules/offline/TileStore.js.map | 1 + lib/module/modules/offline/offlineManager.js | 435 +++++++++++++ .../modules/offline/offlineManager.js.map | 1 + .../modules/offline/offlineManagerLegacy.js | 154 +++++ .../offline/offlineManagerLegacy.js.map | 1 + .../modules/snapshot/SnapshotOptions.js | 53 ++ .../modules/snapshot/SnapshotOptions.js.map | 1 + .../modules/snapshot/snapshotManager.js | 60 ++ .../modules/snapshot/snapshotManager.js.map | 1 + .../requestAndroidLocationPermissions.js | 19 + .../requestAndroidLocationPermissions.js.map | 1 + .../shape_animators/MovePointShapeAnimator.js | 13 + .../MovePointShapeAnimator.js.map | 1 + .../shape_animators/ShapeAnimatorManager.js | 9 + .../ShapeAnimatorManager.js.map | 1 + lib/module/specs/NativeMapViewModule.js | 5 + lib/module/specs/NativeMapViewModule.js.map | 1 + lib/module/specs/NativeRNMBXImageModule.js | 5 + .../specs/NativeRNMBXImageModule.js.map | 1 + ...NativeRNMBXMovePointShapeAnimatorModule.js | 6 + ...veRNMBXMovePointShapeAnimatorModule.js.map | 1 + .../specs/NativeRNMBXPointAnnotationModule.js | 5 + .../NativeRNMBXPointAnnotationModule.js.map | 1 + .../specs/NativeRNMBXShapeSourceModule.js | 5 + .../specs/NativeRNMBXShapeSourceModule.js.map | 1 + .../specs/NativeRNMBXTileStoreModule.js | 6 + .../specs/NativeRNMBXTileStoreModule.js.map | 1 + lib/module/specs/NativeRNMBXViewportModule.js | 3 + .../specs/NativeRNMBXViewportModule.js.map | 1 + .../specs/RNMBXAtmosphereNativeComponent.js | 3 + .../RNMBXAtmosphereNativeComponent.js.map | 1 + .../RNMBXBackgroundLayerNativeComponent.js | 3 + ...RNMBXBackgroundLayerNativeComponent.js.map | 1 + .../specs/RNMBXCalloutNativeComponent.js | 6 + .../specs/RNMBXCalloutNativeComponent.js.map | 1 + .../specs/RNMBXCameraNativeComponent.js | 3 + .../specs/RNMBXCameraNativeComponent.js.map | 1 + .../specs/RNMBXCircleLayerNativeComponent.js | 3 + .../RNMBXCircleLayerNativeComponent.js.map | 1 + ...BXCustomLocationProviderNativeComponent.js | 3 + ...stomLocationProviderNativeComponent.js.map | 1 + .../RNMBXFillExtrusionLayerNativeComponent.js | 3 + ...BXFillExtrusionLayerNativeComponent.js.map | 1 + .../specs/RNMBXFillLayerNativeComponent.js | 3 + .../RNMBXFillLayerNativeComponent.js.map | 1 + .../specs/RNMBXHeatmapLayerNativeComponent.js | 3 + .../RNMBXHeatmapLayerNativeComponent.js.map | 1 + lib/module/specs/RNMBXImageNativeComponent.js | 3 + .../specs/RNMBXImageNativeComponent.js.map | 1 + .../specs/RNMBXImageSourceNativeComponent.js | 3 + .../RNMBXImageSourceNativeComponent.js.map | 1 + .../specs/RNMBXImagesNativeComponent.js | 3 + .../specs/RNMBXImagesNativeComponent.js.map | 1 + lib/module/specs/RNMBXLightNativeComponent.js | 3 + .../specs/RNMBXLightNativeComponent.js.map | 1 + .../specs/RNMBXLineLayerNativeComponent.js | 3 + .../RNMBXLineLayerNativeComponent.js.map | 1 + .../specs/RNMBXMapViewNativeComponent.js | 5 + .../specs/RNMBXMapViewNativeComponent.js.map | 1 + .../RNMBXMarkerViewContentNativeComponent.js | 6 + ...MBXMarkerViewContentNativeComponent.js.map | 1 + .../specs/RNMBXMarkerViewNativeComponent.js | 3 + .../RNMBXMarkerViewNativeComponent.js.map | 1 + .../specs/RNMBXModelLayerNativeComponent.js | 3 + .../RNMBXModelLayerNativeComponent.js.map | 1 + .../specs/RNMBXModelsNativeComponent.js | 3 + .../specs/RNMBXModelsNativeComponent.js.map | 1 + .../RNMBXNativeUserLocationNativeComponent.js | 3 + ...BXNativeUserLocationNativeComponent.js.map | 1 + .../RNMBXPointAnnotationNativeComponent.js | 3 + ...RNMBXPointAnnotationNativeComponent.js.map | 1 + .../RNMBXRasterDemSourceNativeComponent.js | 3 + ...RNMBXRasterDemSourceNativeComponent.js.map | 1 + .../specs/RNMBXRasterLayerNativeComponent.js | 3 + .../RNMBXRasterLayerNativeComponent.js.map | 1 + .../specs/RNMBXRasterSourceNativeComponent.js | 3 + .../RNMBXRasterSourceNativeComponent.js.map | 1 + .../specs/RNMBXShapeSourceNativeComponent.js | 3 + .../RNMBXShapeSourceNativeComponent.js.map | 1 + .../specs/RNMBXSkyLayerNativeComponent.js | 3 + .../specs/RNMBXSkyLayerNativeComponent.js.map | 1 + .../specs/RNMBXStyleImportNativeComponent.js | 3 + .../RNMBXStyleImportNativeComponent.js.map | 1 + .../specs/RNMBXSymbolLayerNativeComponent.js | 3 + .../RNMBXSymbolLayerNativeComponent.js.map | 1 + .../specs/RNMBXTerrainNativeComponent.js | 3 + .../specs/RNMBXTerrainNativeComponent.js.map | 1 + .../specs/RNMBXVectorSourceNativeComponent.js | 3 + .../RNMBXVectorSourceNativeComponent.js.map | 1 + .../specs/RNMBXViewportNativeComponent.js | 3 + .../specs/RNMBXViewportNativeComponent.js.map | 1 + lib/module/specs/codegenUtils.js | 2 + lib/module/specs/codegenUtils.js.map | 1 + ...mmonLayerNativeComponentsProps.codepart-ts | 18 + lib/module/types/BaseProps.js | 2 + lib/module/types/BaseProps.js.map | 1 + lib/module/types/OnPressEvent.js | 2 + lib/module/types/OnPressEvent.js.map | 1 + lib/module/types/Position.js | 2 + lib/module/types/Position.js.map | 1 + lib/module/types/index.js | 2 + lib/module/types/index.js.map | 1 + lib/module/utils/BridgeValue.js | 57 ++ lib/module/utils/BridgeValue.js.map | 1 + lib/module/utils/Logger.js | 112 ++++ lib/module/utils/Logger.js.map | 1 + lib/module/utils/MapboxStyles.d.js | 184 ++++++ lib/module/utils/MapboxStyles.d.js.map | 1 + lib/module/utils/StyleValue.js | 37 ++ lib/module/utils/StyleValue.js.map | 1 + lib/module/utils/animated/Animated.js | 25 + lib/module/utils/animated/Animated.js.map | 1 + lib/module/utils/checkRequiredProps.js | 8 + lib/module/utils/checkRequiredProps.js.map | 1 + lib/module/utils/deprecation.js | 33 + lib/module/utils/deprecation.js.map | 1 + lib/module/utils/filterUtils.js | 7 + lib/module/utils/filterUtils.js.map | 1 + lib/module/utils/geoUtils.js | 23 + lib/module/utils/geoUtils.js.map | 1 + lib/module/utils/getAnnotationsLayerID.js | 15 + lib/module/utils/getAnnotationsLayerID.js.map | 1 + lib/module/utils/index.js | 63 ++ lib/module/utils/index.js.map | 1 + lib/module/utils/nativeRef.js | 21 + lib/module/utils/nativeRef.js.map | 1 + lib/module/utils/styleMap.js | 329 ++++++++++ lib/module/utils/styleMap.js.map | 1 + lib/module/web/MapContext.js | 4 + lib/module/web/MapContext.js.map | 1 + lib/module/web/MapboxModule.js | 13 + lib/module/web/MapboxModule.js.map | 1 + lib/module/web/UnimplementedComponent.js | 8 + lib/module/web/UnimplementedComponent.js.map | 1 + lib/module/web/components/Camera.js | 36 ++ lib/module/web/components/Camera.js.map | 1 + lib/module/web/components/MapView.js | 60 ++ lib/module/web/components/MapView.js.map | 1 + lib/module/web/index.js | 16 + lib/module/web/index.js.map | 1 + lib/module/web/install.md | 25 + lib/module/web/utils/Logger.js | 92 +++ lib/module/web/utils/Logger.js.map | 1 + lib/typescript/jest.config.d.ts | 4 + lib/typescript/jest.config.d.ts.map | 1 + lib/typescript/src/Mapbox.d.ts | 70 +++ lib/typescript/src/Mapbox.d.ts.map | 1 + lib/typescript/src/RNMBXModule.d.ts | 22 + lib/typescript/src/RNMBXModule.d.ts.map | 1 + .../src/components/AbstractLayer.d.ts | 35 ++ .../src/components/AbstractLayer.d.ts.map | 1 + .../src/components/AbstractSource.d.ts | 10 + .../src/components/AbstractSource.d.ts.map | 1 + lib/typescript/src/components/Annotation.d.ts | 34 + .../src/components/Annotation.d.ts.map | 1 + lib/typescript/src/components/Atmosphere.d.ts | 9 + .../src/components/Atmosphere.d.ts.map | 1 + .../src/components/BackgroundLayer.d.ts | 65 ++ .../src/components/BackgroundLayer.d.ts.map | 1 + lib/typescript/src/components/Callout.d.ts | 40 ++ .../src/components/Callout.d.ts.map | 1 + lib/typescript/src/components/Camera.d.ts | 123 ++++ lib/typescript/src/components/Camera.d.ts.map | 1 + .../src/components/CircleLayer.d.ts | 77 +++ .../src/components/CircleLayer.d.ts.map | 1 + .../components/CustomLocationProvider.d.ts | 15 + .../CustomLocationProvider.d.ts.map | 1 + .../src/components/FillExtrusionLayer.d.ts | 68 ++ .../components/FillExtrusionLayer.d.ts.map | 1 + lib/typescript/src/components/FillLayer.d.ts | 77 +++ .../src/components/FillLayer.d.ts.map | 1 + .../src/components/HeadingIndicator.d.ts | 8 + .../src/components/HeadingIndicator.d.ts.map | 1 + .../src/components/HeatmapLayer.d.ts | 77 +++ .../src/components/HeatmapLayer.d.ts.map | 1 + lib/typescript/src/components/Image.d.ts | 25 + lib/typescript/src/components/Image.d.ts.map | 1 + .../src/components/ImageSource.d.ts | 36 ++ .../src/components/ImageSource.d.ts.map | 1 + lib/typescript/src/components/Images.d.ts | 80 +++ lib/typescript/src/components/Images.d.ts.map | 1 + lib/typescript/src/components/Light.d.ts | 16 + lib/typescript/src/components/Light.d.ts.map | 1 + lib/typescript/src/components/LineLayer.d.ts | 77 +++ .../src/components/LineLayer.d.ts.map | 1 + .../src/components/LocationPuck.d.ts | 85 +++ .../src/components/LocationPuck.d.ts.map | 1 + lib/typescript/src/components/MapView.d.ts | 586 ++++++++++++++++++ .../src/components/MapView.d.ts.map | 1 + lib/typescript/src/components/MarkerView.d.ts | 57 ++ .../src/components/MarkerView.d.ts.map | 1 + lib/typescript/src/components/ModelLayer.d.ts | 77 +++ .../src/components/ModelLayer.d.ts.map | 1 + lib/typescript/src/components/Models.d.ts | 15 + lib/typescript/src/components/Models.d.ts.map | 1 + .../src/components/NativeBridgeComponent.d.ts | 46 ++ .../components/NativeBridgeComponent.d.ts.map | 1 + .../src/components/PointAnnotation.d.ts | 160 +++++ .../src/components/PointAnnotation.d.ts.map | 1 + .../src/components/RasterDemSource.d.ts | 49 ++ .../src/components/RasterDemSource.d.ts.map | 1 + .../src/components/RasterLayer.d.ts | 74 +++ .../src/components/RasterLayer.d.ts.map | 1 + .../src/components/RasterSource.d.ts | 62 ++ .../src/components/RasterSource.d.ts.map | 1 + .../src/components/ShapeSource.d.ts | 198 ++++++ .../src/components/ShapeSource.d.ts.map | 1 + lib/typescript/src/components/SkyLayer.d.ts | 55 ++ .../src/components/SkyLayer.d.ts.map | 1 + lib/typescript/src/components/Style.d.ts | 74 +++ lib/typescript/src/components/Style.d.ts.map | 1 + .../src/components/StyleImport.d.ts | 27 + .../src/components/StyleImport.d.ts.map | 1 + .../src/components/SymbolLayer.d.ts | 88 +++ .../src/components/SymbolLayer.d.ts.map | 1 + lib/typescript/src/components/Terrain.d.ts | 20 + .../src/components/Terrain.d.ts.map | 1 + .../src/components/UserLocation.d.ts | 103 +++ .../src/components/UserLocation.d.ts.map | 1 + .../src/components/VectorSource.d.ts | 87 +++ .../src/components/VectorSource.d.ts.map | 1 + lib/typescript/src/components/Viewport.d.ts | 136 ++++ .../src/components/Viewport.d.ts.map | 1 + lib/typescript/src/index.d.ts | 4 + lib/typescript/src/index.d.ts.map | 1 + .../src/modules/location/locationManager.d.ts | 87 +++ .../modules/location/locationManager.d.ts.map | 1 + .../offline/OfflineCreatePackOptions.d.ts | 22 + .../offline/OfflineCreatePackOptions.d.ts.map | 1 + .../src/modules/offline/OfflinePack.d.ts | 24 + .../src/modules/offline/OfflinePack.d.ts.map | 1 + .../modules/offline/OfflinePackLegacy.d.ts | 24 + .../offline/OfflinePackLegacy.d.ts.map | 1 + .../src/modules/offline/TileStore.d.ts | 30 + .../src/modules/offline/TileStore.d.ts.map | 1 + .../src/modules/offline/offlineManager.d.ts | 276 +++++++++ .../modules/offline/offlineManager.d.ts.map | 1 + .../modules/offline/offlineManagerLegacy.d.ts | 93 +++ .../offline/offlineManagerLegacy.d.ts.map | 1 + .../src/modules/snapshot/SnapshotOptions.d.ts | 41 ++ .../modules/snapshot/SnapshotOptions.d.ts.map | 1 + .../src/modules/snapshot/snapshotManager.d.ts | 52 ++ .../modules/snapshot/snapshotManager.d.ts.map | 1 + .../requestAndroidLocationPermissions.d.ts | 2 + ...requestAndroidLocationPermissions.d.ts.map | 1 + .../MovePointShapeAnimator.d.ts | 7 + .../MovePointShapeAnimator.d.ts.map | 1 + .../shape_animators/ShapeAnimatorManager.d.ts | 5 + .../ShapeAnimatorManager.d.ts.map | 1 + .../src/specs/NativeMapViewModule.d.ts | 20 + .../src/specs/NativeMapViewModule.d.ts.map | 1 + .../src/specs/NativeRNMBXImageModule.d.ts | 8 + .../src/specs/NativeRNMBXImageModule.d.ts.map | 1 + ...tiveRNMBXMovePointShapeAnimatorModule.d.ts | 10 + ...RNMBXMovePointShapeAnimatorModule.d.ts.map | 1 + .../NativeRNMBXPointAnnotationModule.d.ts | 8 + .../NativeRNMBXPointAnnotationModule.d.ts.map | 1 + .../specs/NativeRNMBXShapeSourceModule.d.ts | 10 + .../NativeRNMBXShapeSourceModule.d.ts.map | 1 + .../src/specs/NativeRNMBXTileStoreModule.d.ts | 16 + .../specs/NativeRNMBXTileStoreModule.d.ts.map | 1 + .../src/specs/NativeRNMBXViewportModule.d.ts | 35 ++ .../specs/NativeRNMBXViewportModule.d.ts.map | 1 + .../specs/RNMBXAtmosphereNativeComponent.d.ts | 8 + .../RNMBXAtmosphereNativeComponent.d.ts.map | 1 + .../RNMBXBackgroundLayerNativeComponent.d.ts | 19 + ...MBXBackgroundLayerNativeComponent.d.ts.map | 1 + .../specs/RNMBXCalloutNativeComponent.d.ts | 6 + .../RNMBXCalloutNativeComponent.d.ts.map | 1 + .../src/specs/RNMBXCameraNativeComponent.d.ts | 32 + .../specs/RNMBXCameraNativeComponent.d.ts.map | 1 + .../RNMBXCircleLayerNativeComponent.d.ts | 25 + .../RNMBXCircleLayerNativeComponent.d.ts.map | 1 + ...CustomLocationProviderNativeComponent.d.ts | 12 + ...omLocationProviderNativeComponent.d.ts.map | 1 + ...NMBXFillExtrusionLayerNativeComponent.d.ts | 20 + ...FillExtrusionLayerNativeComponent.d.ts.map | 1 + .../specs/RNMBXFillLayerNativeComponent.d.ts | 25 + .../RNMBXFillLayerNativeComponent.d.ts.map | 1 + .../RNMBXHeatmapLayerNativeComponent.d.ts | 25 + .../RNMBXHeatmapLayerNativeComponent.d.ts.map | 1 + .../src/specs/RNMBXImageNativeComponent.d.ts | 14 + .../specs/RNMBXImageNativeComponent.d.ts.map | 1 + .../RNMBXImageSourceNativeComponent.d.ts | 11 + .../RNMBXImageSourceNativeComponent.d.ts.map | 1 + .../src/specs/RNMBXImagesNativeComponent.d.ts | 18 + .../specs/RNMBXImagesNativeComponent.d.ts.map | 1 + .../src/specs/RNMBXLightNativeComponent.d.ts | 8 + .../specs/RNMBXLightNativeComponent.d.ts.map | 1 + .../specs/RNMBXLineLayerNativeComponent.d.ts | 25 + .../RNMBXLineLayerNativeComponent.d.ts.map | 1 + .../specs/RNMBXMapViewNativeComponent.d.ts | 106 ++++ .../RNMBXMapViewNativeComponent.d.ts.map | 1 + ...RNMBXMarkerViewContentNativeComponent.d.ts | 6 + ...XMarkerViewContentNativeComponent.d.ts.map | 1 + .../specs/RNMBXMarkerViewNativeComponent.d.ts | 18 + .../RNMBXMarkerViewNativeComponent.d.ts.map | 1 + .../specs/RNMBXModelLayerNativeComponent.d.ts | 28 + .../RNMBXModelLayerNativeComponent.d.ts.map | 1 + .../src/specs/RNMBXModelsNativeComponent.d.ts | 15 + .../specs/RNMBXModelsNativeComponent.d.ts.map | 1 + ...NMBXNativeUserLocationNativeComponent.d.ts | 26 + ...NativeUserLocationNativeComponent.d.ts.map | 1 + .../RNMBXPointAnnotationNativeComponent.d.ts | 37 ++ ...MBXPointAnnotationNativeComponent.d.ts.map | 1 + .../RNMBXRasterDemSourceNativeComponent.d.ts | 15 + ...MBXRasterDemSourceNativeComponent.d.ts.map | 1 + .../RNMBXRasterLayerNativeComponent.d.ts | 25 + .../RNMBXRasterLayerNativeComponent.d.ts.map | 1 + .../RNMBXRasterSourceNativeComponent.d.ts | 17 + .../RNMBXRasterSourceNativeComponent.d.ts.map | 1 + .../RNMBXShapeSourceNativeComponent.d.ts | 27 + .../RNMBXShapeSourceNativeComponent.d.ts.map | 1 + .../specs/RNMBXSkyLayerNativeComponent.d.ts | 19 + .../RNMBXSkyLayerNativeComponent.d.ts.map | 1 + .../RNMBXStyleImportNativeComponent.d.ts | 12 + .../RNMBXStyleImportNativeComponent.d.ts.map | 1 + .../RNMBXSymbolLayerNativeComponent.d.ts | 25 + .../RNMBXSymbolLayerNativeComponent.d.ts.map | 1 + .../specs/RNMBXTerrainNativeComponent.d.ts | 9 + .../RNMBXTerrainNativeComponent.d.ts.map | 1 + .../RNMBXVectorSourceNativeComponent.d.ts | 23 + .../RNMBXVectorSourceNativeComponent.d.ts.map | 1 + .../specs/RNMBXViewportNativeComponent.d.ts | 59 ++ .../RNMBXViewportNativeComponent.d.ts.map | 1 + lib/typescript/src/specs/codegenUtils.d.ts | 21 + .../src/specs/codegenUtils.d.ts.map | 1 + lib/typescript/src/types/BaseProps.d.ts | 5 + lib/typescript/src/types/BaseProps.d.ts.map | 1 + lib/typescript/src/types/OnPressEvent.d.ts | 12 + .../src/types/OnPressEvent.d.ts.map | 1 + lib/typescript/src/types/Position.d.ts | 5 + lib/typescript/src/types/Position.d.ts.map | 1 + lib/typescript/src/types/index.d.ts | 16 + lib/typescript/src/types/index.d.ts.map | 1 + lib/typescript/src/utils/BridgeValue.d.ts | 46 ++ lib/typescript/src/utils/BridgeValue.d.ts.map | 1 + lib/typescript/src/utils/Logger.d.ts | 53 ++ lib/typescript/src/utils/Logger.d.ts.map | 1 + lib/typescript/src/utils/StyleValue.d.ts | 10 + lib/typescript/src/utils/StyleValue.d.ts.map | 1 + .../src/utils/animated/Animated.d.ts | 23 + .../src/utils/animated/Animated.d.ts.map | 1 + .../src/utils/checkRequiredProps.d.ts | 8 + .../src/utils/checkRequiredProps.d.ts.map | 1 + lib/typescript/src/utils/deprecation.d.ts | 13 + lib/typescript/src/utils/deprecation.d.ts.map | 1 + lib/typescript/src/utils/filterUtils.d.ts | 2 + lib/typescript/src/utils/filterUtils.d.ts.map | 1 + lib/typescript/src/utils/geoUtils.d.ts | 15 + lib/typescript/src/utils/geoUtils.d.ts.map | 1 + .../src/utils/getAnnotationsLayerID.d.ts | 2 + .../src/utils/getAnnotationsLayerID.d.ts.map | 1 + lib/typescript/src/utils/index.d.ts | 33 + lib/typescript/src/utils/index.d.ts.map | 1 + lib/typescript/src/utils/nativeRef.d.ts | 21 + lib/typescript/src/utils/nativeRef.d.ts.map | 1 + lib/typescript/src/utils/styleMap.d.ts | 43 ++ lib/typescript/src/utils/styleMap.d.ts.map | 1 + lib/typescript/src/web/MapContext.d.ts | 7 + lib/typescript/src/web/MapContext.d.ts.map | 1 + lib/typescript/src/web/components/Camera.d.ts | 18 + .../src/web/components/Camera.d.ts.map | 1 + .../src/web/components/MapView.d.ts | 20 + .../src/web/components/MapView.d.ts.map | 1 + lib/typescript/src/web/utils/Logger.d.ts | 48 ++ lib/typescript/src/web/utils/Logger.d.ts.map | 1 + 736 files changed, 19091 insertions(+), 120 deletions(-) create mode 100644 lib/commonjs/Mapbox.js create mode 100644 lib/commonjs/Mapbox.js.map create mode 100644 lib/commonjs/RNMBXModule.js create mode 100644 lib/commonjs/RNMBXModule.js.map create mode 100644 lib/commonjs/assets/heading.png create mode 100644 lib/commonjs/assets/heading@2x.png create mode 100644 lib/commonjs/assets/heading@3x.png create mode 100644 lib/commonjs/classes/AnimatedCoordinatesArray.js create mode 100644 lib/commonjs/classes/AnimatedCoordinatesArray.js.map create mode 100644 lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js create mode 100644 lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js.map create mode 100644 lib/commonjs/classes/AnimatedPoint.js create mode 100644 lib/commonjs/classes/AnimatedPoint.js.map create mode 100644 lib/commonjs/classes/AnimatedRouteCoordinatesArray.js create mode 100644 lib/commonjs/classes/AnimatedRouteCoordinatesArray.js.map create mode 100644 lib/commonjs/classes/AnimatedShape.js create mode 100644 lib/commonjs/classes/AnimatedShape.js.map create mode 100644 lib/commonjs/classes/index.d.js create mode 100644 lib/commonjs/classes/index.d.js.map create mode 100644 lib/commonjs/classes/index.js create mode 100644 lib/commonjs/classes/index.js.map create mode 100644 lib/commonjs/components/AbstractLayer.js create mode 100644 lib/commonjs/components/AbstractLayer.js.map create mode 100644 lib/commonjs/components/AbstractSource.js create mode 100644 lib/commonjs/components/AbstractSource.js.map create mode 100644 lib/commonjs/components/Annotation.js create mode 100644 lib/commonjs/components/Annotation.js.map create mode 100644 lib/commonjs/components/Atmosphere.js create mode 100644 lib/commonjs/components/Atmosphere.js.map create mode 100644 lib/commonjs/components/BackgroundLayer.js create mode 100644 lib/commonjs/components/BackgroundLayer.js.map create mode 100644 lib/commonjs/components/Callout.js create mode 100644 lib/commonjs/components/Callout.js.map create mode 100644 lib/commonjs/components/Camera.js create mode 100644 lib/commonjs/components/Camera.js.map create mode 100644 lib/commonjs/components/CircleLayer.js create mode 100644 lib/commonjs/components/CircleLayer.js.map create mode 100644 lib/commonjs/components/CustomLocationProvider.js create mode 100644 lib/commonjs/components/CustomLocationProvider.js.map create mode 100644 lib/commonjs/components/FillExtrusionLayer.js create mode 100644 lib/commonjs/components/FillExtrusionLayer.js.map create mode 100644 lib/commonjs/components/FillLayer.js create mode 100644 lib/commonjs/components/FillLayer.js.map create mode 100644 lib/commonjs/components/HeadingIndicator.js create mode 100644 lib/commonjs/components/HeadingIndicator.js.map create mode 100644 lib/commonjs/components/HeatmapLayer.js create mode 100644 lib/commonjs/components/HeatmapLayer.js.map create mode 100644 lib/commonjs/components/Image.js create mode 100644 lib/commonjs/components/Image.js.map create mode 100644 lib/commonjs/components/ImageSource.js create mode 100644 lib/commonjs/components/ImageSource.js.map create mode 100644 lib/commonjs/components/Images.js create mode 100644 lib/commonjs/components/Images.js.map create mode 100644 lib/commonjs/components/Light.js create mode 100644 lib/commonjs/components/Light.js.map create mode 100644 lib/commonjs/components/LineLayer.js create mode 100644 lib/commonjs/components/LineLayer.js.map create mode 100644 lib/commonjs/components/LocationPuck.js create mode 100644 lib/commonjs/components/LocationPuck.js.map create mode 100644 lib/commonjs/components/MapView.js create mode 100644 lib/commonjs/components/MapView.js.map create mode 100644 lib/commonjs/components/MarkerView.js create mode 100644 lib/commonjs/components/MarkerView.js.map create mode 100644 lib/commonjs/components/ModelLayer.js create mode 100644 lib/commonjs/components/ModelLayer.js.map create mode 100644 lib/commonjs/components/Models.js create mode 100644 lib/commonjs/components/Models.js.map create mode 100644 lib/commonjs/components/NativeBridgeComponent.js create mode 100644 lib/commonjs/components/NativeBridgeComponent.js.map create mode 100644 lib/commonjs/components/PointAnnotation.js create mode 100644 lib/commonjs/components/PointAnnotation.js.map create mode 100644 lib/commonjs/components/RasterDemSource.js create mode 100644 lib/commonjs/components/RasterDemSource.js.map create mode 100644 lib/commonjs/components/RasterLayer.js create mode 100644 lib/commonjs/components/RasterLayer.js.map create mode 100644 lib/commonjs/components/RasterSource.js create mode 100644 lib/commonjs/components/RasterSource.js.map create mode 100644 lib/commonjs/components/ShapeSource.js create mode 100644 lib/commonjs/components/ShapeSource.js.map create mode 100644 lib/commonjs/components/SkyLayer.js create mode 100644 lib/commonjs/components/SkyLayer.js.map create mode 100644 lib/commonjs/components/Style.js create mode 100644 lib/commonjs/components/Style.js.map create mode 100644 lib/commonjs/components/StyleImport.js create mode 100644 lib/commonjs/components/StyleImport.js.map create mode 100644 lib/commonjs/components/SymbolLayer.js create mode 100644 lib/commonjs/components/SymbolLayer.js.map create mode 100644 lib/commonjs/components/Terrain.js create mode 100644 lib/commonjs/components/Terrain.js.map create mode 100644 lib/commonjs/components/UserLocation.js create mode 100644 lib/commonjs/components/UserLocation.js.map create mode 100644 lib/commonjs/components/VectorSource.js create mode 100644 lib/commonjs/components/VectorSource.js.map create mode 100644 lib/commonjs/components/Viewport.js create mode 100644 lib/commonjs/components/Viewport.js.map create mode 100644 lib/commonjs/components/codeparts/LayerPropsCommon.codepart-tsx create mode 100644 lib/commonjs/global.d.js create mode 100644 lib/commonjs/global.d.js.map create mode 100644 lib/commonjs/index.js create mode 100644 lib/commonjs/index.js.map create mode 100644 lib/commonjs/index.web.js create mode 100644 lib/commonjs/index.web.js.map create mode 100644 lib/commonjs/modules/location/locationManager.js create mode 100644 lib/commonjs/modules/location/locationManager.js.map create mode 100644 lib/commonjs/modules/offline/OfflineCreatePackOptions.js create mode 100644 lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map create mode 100644 lib/commonjs/modules/offline/OfflinePack.js create mode 100644 lib/commonjs/modules/offline/OfflinePack.js.map create mode 100644 lib/commonjs/modules/offline/OfflinePackLegacy.js create mode 100644 lib/commonjs/modules/offline/OfflinePackLegacy.js.map create mode 100644 lib/commonjs/modules/offline/TileStore.js create mode 100644 lib/commonjs/modules/offline/TileStore.js.map create mode 100644 lib/commonjs/modules/offline/offlineManager.js create mode 100644 lib/commonjs/modules/offline/offlineManager.js.map create mode 100644 lib/commonjs/modules/offline/offlineManagerLegacy.js create mode 100644 lib/commonjs/modules/offline/offlineManagerLegacy.js.map create mode 100644 lib/commonjs/modules/snapshot/SnapshotOptions.js create mode 100644 lib/commonjs/modules/snapshot/SnapshotOptions.js.map create mode 100644 lib/commonjs/modules/snapshot/snapshotManager.js create mode 100644 lib/commonjs/modules/snapshot/snapshotManager.js.map create mode 100644 lib/commonjs/requestAndroidLocationPermissions.js create mode 100644 lib/commonjs/requestAndroidLocationPermissions.js.map create mode 100644 lib/commonjs/shape_animators/MovePointShapeAnimator.js create mode 100644 lib/commonjs/shape_animators/MovePointShapeAnimator.js.map create mode 100644 lib/commonjs/shape_animators/ShapeAnimatorManager.js create mode 100644 lib/commonjs/shape_animators/ShapeAnimatorManager.js.map create mode 100644 lib/commonjs/specs/NativeMapViewModule.js create mode 100644 lib/commonjs/specs/NativeMapViewModule.js.map create mode 100644 lib/commonjs/specs/NativeRNMBXImageModule.js create mode 100644 lib/commonjs/specs/NativeRNMBXImageModule.js.map create mode 100644 lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js create mode 100644 lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map create mode 100644 lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js create mode 100644 lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map create mode 100644 lib/commonjs/specs/NativeRNMBXShapeSourceModule.js create mode 100644 lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map create mode 100644 lib/commonjs/specs/NativeRNMBXTileStoreModule.js create mode 100644 lib/commonjs/specs/NativeRNMBXTileStoreModule.js.map create mode 100644 lib/commonjs/specs/NativeRNMBXViewportModule.js create mode 100644 lib/commonjs/specs/NativeRNMBXViewportModule.js.map create mode 100644 lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXCalloutNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXCameraNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXCameraNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXFillLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXFillLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXImageNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXImageNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXImageSourceNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXImageSourceNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXImagesNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXImagesNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXLightNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXLightNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXLineLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXLineLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXMapViewNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXModelLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXModelLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXModelsNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXModelsNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXStyleImportNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXStyleImportNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXTerrainNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js.map create mode 100644 lib/commonjs/specs/RNMBXViewportNativeComponent.js create mode 100644 lib/commonjs/specs/RNMBXViewportNativeComponent.js.map create mode 100644 lib/commonjs/specs/codegenUtils.js create mode 100644 lib/commonjs/specs/codegenUtils.js.map create mode 100644 lib/commonjs/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts create mode 100644 lib/commonjs/types/BaseProps.js create mode 100644 lib/commonjs/types/BaseProps.js.map create mode 100644 lib/commonjs/types/OnPressEvent.js create mode 100644 lib/commonjs/types/OnPressEvent.js.map create mode 100644 lib/commonjs/types/Position.js create mode 100644 lib/commonjs/types/Position.js.map create mode 100644 lib/commonjs/types/index.js create mode 100644 lib/commonjs/types/index.js.map create mode 100644 lib/commonjs/utils/BridgeValue.js create mode 100644 lib/commonjs/utils/BridgeValue.js.map create mode 100644 lib/commonjs/utils/Logger.js create mode 100644 lib/commonjs/utils/Logger.js.map create mode 100644 lib/commonjs/utils/MapboxStyles.d.js create mode 100644 lib/commonjs/utils/MapboxStyles.d.js.map create mode 100644 lib/commonjs/utils/StyleValue.js create mode 100644 lib/commonjs/utils/StyleValue.js.map create mode 100644 lib/commonjs/utils/animated/Animated.js create mode 100644 lib/commonjs/utils/animated/Animated.js.map create mode 100644 lib/commonjs/utils/checkRequiredProps.js create mode 100644 lib/commonjs/utils/checkRequiredProps.js.map create mode 100644 lib/commonjs/utils/deprecation.js create mode 100644 lib/commonjs/utils/deprecation.js.map create mode 100644 lib/commonjs/utils/filterUtils.js create mode 100644 lib/commonjs/utils/filterUtils.js.map create mode 100644 lib/commonjs/utils/geoUtils.js create mode 100644 lib/commonjs/utils/geoUtils.js.map create mode 100644 lib/commonjs/utils/getAnnotationsLayerID.js create mode 100644 lib/commonjs/utils/getAnnotationsLayerID.js.map create mode 100644 lib/commonjs/utils/index.js create mode 100644 lib/commonjs/utils/index.js.map create mode 100644 lib/commonjs/utils/nativeRef.js create mode 100644 lib/commonjs/utils/nativeRef.js.map create mode 100644 lib/commonjs/utils/styleMap.js create mode 100644 lib/commonjs/utils/styleMap.js.map create mode 100644 lib/commonjs/web/MapContext.js create mode 100644 lib/commonjs/web/MapContext.js.map create mode 100644 lib/commonjs/web/MapboxModule.js create mode 100644 lib/commonjs/web/MapboxModule.js.map create mode 100644 lib/commonjs/web/UnimplementedComponent.js create mode 100644 lib/commonjs/web/UnimplementedComponent.js.map create mode 100644 lib/commonjs/web/components/Camera.js create mode 100644 lib/commonjs/web/components/Camera.js.map create mode 100644 lib/commonjs/web/components/MapView.js create mode 100644 lib/commonjs/web/components/MapView.js.map create mode 100644 lib/commonjs/web/index.js create mode 100644 lib/commonjs/web/index.js.map create mode 100644 lib/commonjs/web/install.md create mode 100644 lib/commonjs/web/utils/Logger.js create mode 100644 lib/commonjs/web/utils/Logger.js.map create mode 100644 lib/module/Mapbox.js create mode 100644 lib/module/Mapbox.js.map create mode 100644 lib/module/RNMBXModule.js create mode 100644 lib/module/RNMBXModule.js.map create mode 100644 lib/module/assets/heading.png create mode 100644 lib/module/assets/heading@2x.png create mode 100644 lib/module/assets/heading@3x.png create mode 100644 lib/module/classes/AnimatedCoordinatesArray.js create mode 100644 lib/module/classes/AnimatedCoordinatesArray.js.map create mode 100644 lib/module/classes/AnimatedExtractCoordinateFromArray.js create mode 100644 lib/module/classes/AnimatedExtractCoordinateFromArray.js.map create mode 100644 lib/module/classes/AnimatedPoint.js create mode 100644 lib/module/classes/AnimatedPoint.js.map create mode 100644 lib/module/classes/AnimatedRouteCoordinatesArray.js create mode 100644 lib/module/classes/AnimatedRouteCoordinatesArray.js.map create mode 100644 lib/module/classes/AnimatedShape.js create mode 100644 lib/module/classes/AnimatedShape.js.map create mode 100644 lib/module/classes/index.d.js create mode 100644 lib/module/classes/index.d.js.map create mode 100644 lib/module/classes/index.js create mode 100644 lib/module/classes/index.js.map create mode 100644 lib/module/components/AbstractLayer.js create mode 100644 lib/module/components/AbstractLayer.js.map create mode 100644 lib/module/components/AbstractSource.js create mode 100644 lib/module/components/AbstractSource.js.map create mode 100644 lib/module/components/Annotation.js create mode 100644 lib/module/components/Annotation.js.map create mode 100644 lib/module/components/Atmosphere.js create mode 100644 lib/module/components/Atmosphere.js.map create mode 100644 lib/module/components/BackgroundLayer.js create mode 100644 lib/module/components/BackgroundLayer.js.map create mode 100644 lib/module/components/Callout.js create mode 100644 lib/module/components/Callout.js.map create mode 100644 lib/module/components/Camera.js create mode 100644 lib/module/components/Camera.js.map create mode 100644 lib/module/components/CircleLayer.js create mode 100644 lib/module/components/CircleLayer.js.map create mode 100644 lib/module/components/CustomLocationProvider.js create mode 100644 lib/module/components/CustomLocationProvider.js.map create mode 100644 lib/module/components/FillExtrusionLayer.js create mode 100644 lib/module/components/FillExtrusionLayer.js.map create mode 100644 lib/module/components/FillLayer.js create mode 100644 lib/module/components/FillLayer.js.map create mode 100644 lib/module/components/HeadingIndicator.js create mode 100644 lib/module/components/HeadingIndicator.js.map create mode 100644 lib/module/components/HeatmapLayer.js create mode 100644 lib/module/components/HeatmapLayer.js.map create mode 100644 lib/module/components/Image.js create mode 100644 lib/module/components/Image.js.map create mode 100644 lib/module/components/ImageSource.js create mode 100644 lib/module/components/ImageSource.js.map create mode 100644 lib/module/components/Images.js create mode 100644 lib/module/components/Images.js.map create mode 100644 lib/module/components/Light.js create mode 100644 lib/module/components/Light.js.map create mode 100644 lib/module/components/LineLayer.js create mode 100644 lib/module/components/LineLayer.js.map create mode 100644 lib/module/components/LocationPuck.js create mode 100644 lib/module/components/LocationPuck.js.map create mode 100644 lib/module/components/MapView.js create mode 100644 lib/module/components/MapView.js.map create mode 100644 lib/module/components/MarkerView.js create mode 100644 lib/module/components/MarkerView.js.map create mode 100644 lib/module/components/ModelLayer.js create mode 100644 lib/module/components/ModelLayer.js.map create mode 100644 lib/module/components/Models.js create mode 100644 lib/module/components/Models.js.map create mode 100644 lib/module/components/NativeBridgeComponent.js create mode 100644 lib/module/components/NativeBridgeComponent.js.map create mode 100644 lib/module/components/PointAnnotation.js create mode 100644 lib/module/components/PointAnnotation.js.map create mode 100644 lib/module/components/RasterDemSource.js create mode 100644 lib/module/components/RasterDemSource.js.map create mode 100644 lib/module/components/RasterLayer.js create mode 100644 lib/module/components/RasterLayer.js.map create mode 100644 lib/module/components/RasterSource.js create mode 100644 lib/module/components/RasterSource.js.map create mode 100644 lib/module/components/ShapeSource.js create mode 100644 lib/module/components/ShapeSource.js.map create mode 100644 lib/module/components/SkyLayer.js create mode 100644 lib/module/components/SkyLayer.js.map create mode 100644 lib/module/components/Style.js create mode 100644 lib/module/components/Style.js.map create mode 100644 lib/module/components/StyleImport.js create mode 100644 lib/module/components/StyleImport.js.map create mode 100644 lib/module/components/SymbolLayer.js create mode 100644 lib/module/components/SymbolLayer.js.map create mode 100644 lib/module/components/Terrain.js create mode 100644 lib/module/components/Terrain.js.map create mode 100644 lib/module/components/UserLocation.js create mode 100644 lib/module/components/UserLocation.js.map create mode 100644 lib/module/components/VectorSource.js create mode 100644 lib/module/components/VectorSource.js.map create mode 100644 lib/module/components/Viewport.js create mode 100644 lib/module/components/Viewport.js.map create mode 100644 lib/module/components/codeparts/LayerPropsCommon.codepart-tsx create mode 100644 lib/module/global.d.js create mode 100644 lib/module/global.d.js.map create mode 100644 lib/module/index.js create mode 100644 lib/module/index.js.map create mode 100644 lib/module/index.web.js create mode 100644 lib/module/index.web.js.map create mode 100644 lib/module/modules/location/locationManager.js create mode 100644 lib/module/modules/location/locationManager.js.map create mode 100644 lib/module/modules/offline/OfflineCreatePackOptions.js create mode 100644 lib/module/modules/offline/OfflineCreatePackOptions.js.map create mode 100644 lib/module/modules/offline/OfflinePack.js create mode 100644 lib/module/modules/offline/OfflinePack.js.map create mode 100644 lib/module/modules/offline/OfflinePackLegacy.js create mode 100644 lib/module/modules/offline/OfflinePackLegacy.js.map create mode 100644 lib/module/modules/offline/TileStore.js create mode 100644 lib/module/modules/offline/TileStore.js.map create mode 100644 lib/module/modules/offline/offlineManager.js create mode 100644 lib/module/modules/offline/offlineManager.js.map create mode 100644 lib/module/modules/offline/offlineManagerLegacy.js create mode 100644 lib/module/modules/offline/offlineManagerLegacy.js.map create mode 100644 lib/module/modules/snapshot/SnapshotOptions.js create mode 100644 lib/module/modules/snapshot/SnapshotOptions.js.map create mode 100644 lib/module/modules/snapshot/snapshotManager.js create mode 100644 lib/module/modules/snapshot/snapshotManager.js.map create mode 100644 lib/module/requestAndroidLocationPermissions.js create mode 100644 lib/module/requestAndroidLocationPermissions.js.map create mode 100644 lib/module/shape_animators/MovePointShapeAnimator.js create mode 100644 lib/module/shape_animators/MovePointShapeAnimator.js.map create mode 100644 lib/module/shape_animators/ShapeAnimatorManager.js create mode 100644 lib/module/shape_animators/ShapeAnimatorManager.js.map create mode 100644 lib/module/specs/NativeMapViewModule.js create mode 100644 lib/module/specs/NativeMapViewModule.js.map create mode 100644 lib/module/specs/NativeRNMBXImageModule.js create mode 100644 lib/module/specs/NativeRNMBXImageModule.js.map create mode 100644 lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js create mode 100644 lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map create mode 100644 lib/module/specs/NativeRNMBXPointAnnotationModule.js create mode 100644 lib/module/specs/NativeRNMBXPointAnnotationModule.js.map create mode 100644 lib/module/specs/NativeRNMBXShapeSourceModule.js create mode 100644 lib/module/specs/NativeRNMBXShapeSourceModule.js.map create mode 100644 lib/module/specs/NativeRNMBXTileStoreModule.js create mode 100644 lib/module/specs/NativeRNMBXTileStoreModule.js.map create mode 100644 lib/module/specs/NativeRNMBXViewportModule.js create mode 100644 lib/module/specs/NativeRNMBXViewportModule.js.map create mode 100644 lib/module/specs/RNMBXAtmosphereNativeComponent.js create mode 100644 lib/module/specs/RNMBXAtmosphereNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXBackgroundLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXBackgroundLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXCalloutNativeComponent.js create mode 100644 lib/module/specs/RNMBXCalloutNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXCameraNativeComponent.js create mode 100644 lib/module/specs/RNMBXCameraNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXCircleLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXCircleLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js create mode 100644 lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXFillLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXFillLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXHeatmapLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXHeatmapLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXImageNativeComponent.js create mode 100644 lib/module/specs/RNMBXImageNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXImageSourceNativeComponent.js create mode 100644 lib/module/specs/RNMBXImageSourceNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXImagesNativeComponent.js create mode 100644 lib/module/specs/RNMBXImagesNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXLightNativeComponent.js create mode 100644 lib/module/specs/RNMBXLightNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXLineLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXLineLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXMapViewNativeComponent.js create mode 100644 lib/module/specs/RNMBXMapViewNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXMarkerViewContentNativeComponent.js create mode 100644 lib/module/specs/RNMBXMarkerViewContentNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXMarkerViewNativeComponent.js create mode 100644 lib/module/specs/RNMBXMarkerViewNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXModelLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXModelLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXModelsNativeComponent.js create mode 100644 lib/module/specs/RNMBXModelsNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXNativeUserLocationNativeComponent.js create mode 100644 lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXPointAnnotationNativeComponent.js create mode 100644 lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXRasterDemSourceNativeComponent.js create mode 100644 lib/module/specs/RNMBXRasterDemSourceNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXRasterLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXRasterLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXRasterSourceNativeComponent.js create mode 100644 lib/module/specs/RNMBXRasterSourceNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXShapeSourceNativeComponent.js create mode 100644 lib/module/specs/RNMBXShapeSourceNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXSkyLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXSkyLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXStyleImportNativeComponent.js create mode 100644 lib/module/specs/RNMBXStyleImportNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXSymbolLayerNativeComponent.js create mode 100644 lib/module/specs/RNMBXSymbolLayerNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXTerrainNativeComponent.js create mode 100644 lib/module/specs/RNMBXTerrainNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXVectorSourceNativeComponent.js create mode 100644 lib/module/specs/RNMBXVectorSourceNativeComponent.js.map create mode 100644 lib/module/specs/RNMBXViewportNativeComponent.js create mode 100644 lib/module/specs/RNMBXViewportNativeComponent.js.map create mode 100644 lib/module/specs/codegenUtils.js create mode 100644 lib/module/specs/codegenUtils.js.map create mode 100644 lib/module/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts create mode 100644 lib/module/types/BaseProps.js create mode 100644 lib/module/types/BaseProps.js.map create mode 100644 lib/module/types/OnPressEvent.js create mode 100644 lib/module/types/OnPressEvent.js.map create mode 100644 lib/module/types/Position.js create mode 100644 lib/module/types/Position.js.map create mode 100644 lib/module/types/index.js create mode 100644 lib/module/types/index.js.map create mode 100644 lib/module/utils/BridgeValue.js create mode 100644 lib/module/utils/BridgeValue.js.map create mode 100644 lib/module/utils/Logger.js create mode 100644 lib/module/utils/Logger.js.map create mode 100644 lib/module/utils/MapboxStyles.d.js create mode 100644 lib/module/utils/MapboxStyles.d.js.map create mode 100644 lib/module/utils/StyleValue.js create mode 100644 lib/module/utils/StyleValue.js.map create mode 100644 lib/module/utils/animated/Animated.js create mode 100644 lib/module/utils/animated/Animated.js.map create mode 100644 lib/module/utils/checkRequiredProps.js create mode 100644 lib/module/utils/checkRequiredProps.js.map create mode 100644 lib/module/utils/deprecation.js create mode 100644 lib/module/utils/deprecation.js.map create mode 100644 lib/module/utils/filterUtils.js create mode 100644 lib/module/utils/filterUtils.js.map create mode 100644 lib/module/utils/geoUtils.js create mode 100644 lib/module/utils/geoUtils.js.map create mode 100644 lib/module/utils/getAnnotationsLayerID.js create mode 100644 lib/module/utils/getAnnotationsLayerID.js.map create mode 100644 lib/module/utils/index.js create mode 100644 lib/module/utils/index.js.map create mode 100644 lib/module/utils/nativeRef.js create mode 100644 lib/module/utils/nativeRef.js.map create mode 100644 lib/module/utils/styleMap.js create mode 100644 lib/module/utils/styleMap.js.map create mode 100644 lib/module/web/MapContext.js create mode 100644 lib/module/web/MapContext.js.map create mode 100644 lib/module/web/MapboxModule.js create mode 100644 lib/module/web/MapboxModule.js.map create mode 100644 lib/module/web/UnimplementedComponent.js create mode 100644 lib/module/web/UnimplementedComponent.js.map create mode 100644 lib/module/web/components/Camera.js create mode 100644 lib/module/web/components/Camera.js.map create mode 100644 lib/module/web/components/MapView.js create mode 100644 lib/module/web/components/MapView.js.map create mode 100644 lib/module/web/index.js create mode 100644 lib/module/web/index.js.map create mode 100644 lib/module/web/install.md create mode 100644 lib/module/web/utils/Logger.js create mode 100644 lib/module/web/utils/Logger.js.map create mode 100644 lib/typescript/jest.config.d.ts create mode 100644 lib/typescript/jest.config.d.ts.map create mode 100644 lib/typescript/src/Mapbox.d.ts create mode 100644 lib/typescript/src/Mapbox.d.ts.map create mode 100644 lib/typescript/src/RNMBXModule.d.ts create mode 100644 lib/typescript/src/RNMBXModule.d.ts.map create mode 100644 lib/typescript/src/components/AbstractLayer.d.ts create mode 100644 lib/typescript/src/components/AbstractLayer.d.ts.map create mode 100644 lib/typescript/src/components/AbstractSource.d.ts create mode 100644 lib/typescript/src/components/AbstractSource.d.ts.map create mode 100644 lib/typescript/src/components/Annotation.d.ts create mode 100644 lib/typescript/src/components/Annotation.d.ts.map create mode 100644 lib/typescript/src/components/Atmosphere.d.ts create mode 100644 lib/typescript/src/components/Atmosphere.d.ts.map create mode 100644 lib/typescript/src/components/BackgroundLayer.d.ts create mode 100644 lib/typescript/src/components/BackgroundLayer.d.ts.map create mode 100644 lib/typescript/src/components/Callout.d.ts create mode 100644 lib/typescript/src/components/Callout.d.ts.map create mode 100644 lib/typescript/src/components/Camera.d.ts create mode 100644 lib/typescript/src/components/Camera.d.ts.map create mode 100644 lib/typescript/src/components/CircleLayer.d.ts create mode 100644 lib/typescript/src/components/CircleLayer.d.ts.map create mode 100644 lib/typescript/src/components/CustomLocationProvider.d.ts create mode 100644 lib/typescript/src/components/CustomLocationProvider.d.ts.map create mode 100644 lib/typescript/src/components/FillExtrusionLayer.d.ts create mode 100644 lib/typescript/src/components/FillExtrusionLayer.d.ts.map create mode 100644 lib/typescript/src/components/FillLayer.d.ts create mode 100644 lib/typescript/src/components/FillLayer.d.ts.map create mode 100644 lib/typescript/src/components/HeadingIndicator.d.ts create mode 100644 lib/typescript/src/components/HeadingIndicator.d.ts.map create mode 100644 lib/typescript/src/components/HeatmapLayer.d.ts create mode 100644 lib/typescript/src/components/HeatmapLayer.d.ts.map create mode 100644 lib/typescript/src/components/Image.d.ts create mode 100644 lib/typescript/src/components/Image.d.ts.map create mode 100644 lib/typescript/src/components/ImageSource.d.ts create mode 100644 lib/typescript/src/components/ImageSource.d.ts.map create mode 100644 lib/typescript/src/components/Images.d.ts create mode 100644 lib/typescript/src/components/Images.d.ts.map create mode 100644 lib/typescript/src/components/Light.d.ts create mode 100644 lib/typescript/src/components/Light.d.ts.map create mode 100644 lib/typescript/src/components/LineLayer.d.ts create mode 100644 lib/typescript/src/components/LineLayer.d.ts.map create mode 100644 lib/typescript/src/components/LocationPuck.d.ts create mode 100644 lib/typescript/src/components/LocationPuck.d.ts.map create mode 100644 lib/typescript/src/components/MapView.d.ts create mode 100644 lib/typescript/src/components/MapView.d.ts.map create mode 100644 lib/typescript/src/components/MarkerView.d.ts create mode 100644 lib/typescript/src/components/MarkerView.d.ts.map create mode 100644 lib/typescript/src/components/ModelLayer.d.ts create mode 100644 lib/typescript/src/components/ModelLayer.d.ts.map create mode 100644 lib/typescript/src/components/Models.d.ts create mode 100644 lib/typescript/src/components/Models.d.ts.map create mode 100644 lib/typescript/src/components/NativeBridgeComponent.d.ts create mode 100644 lib/typescript/src/components/NativeBridgeComponent.d.ts.map create mode 100644 lib/typescript/src/components/PointAnnotation.d.ts create mode 100644 lib/typescript/src/components/PointAnnotation.d.ts.map create mode 100644 lib/typescript/src/components/RasterDemSource.d.ts create mode 100644 lib/typescript/src/components/RasterDemSource.d.ts.map create mode 100644 lib/typescript/src/components/RasterLayer.d.ts create mode 100644 lib/typescript/src/components/RasterLayer.d.ts.map create mode 100644 lib/typescript/src/components/RasterSource.d.ts create mode 100644 lib/typescript/src/components/RasterSource.d.ts.map create mode 100644 lib/typescript/src/components/ShapeSource.d.ts create mode 100644 lib/typescript/src/components/ShapeSource.d.ts.map create mode 100644 lib/typescript/src/components/SkyLayer.d.ts create mode 100644 lib/typescript/src/components/SkyLayer.d.ts.map create mode 100644 lib/typescript/src/components/Style.d.ts create mode 100644 lib/typescript/src/components/Style.d.ts.map create mode 100644 lib/typescript/src/components/StyleImport.d.ts create mode 100644 lib/typescript/src/components/StyleImport.d.ts.map create mode 100644 lib/typescript/src/components/SymbolLayer.d.ts create mode 100644 lib/typescript/src/components/SymbolLayer.d.ts.map create mode 100644 lib/typescript/src/components/Terrain.d.ts create mode 100644 lib/typescript/src/components/Terrain.d.ts.map create mode 100644 lib/typescript/src/components/UserLocation.d.ts create mode 100644 lib/typescript/src/components/UserLocation.d.ts.map create mode 100644 lib/typescript/src/components/VectorSource.d.ts create mode 100644 lib/typescript/src/components/VectorSource.d.ts.map create mode 100644 lib/typescript/src/components/Viewport.d.ts create mode 100644 lib/typescript/src/components/Viewport.d.ts.map create mode 100644 lib/typescript/src/index.d.ts create mode 100644 lib/typescript/src/index.d.ts.map create mode 100644 lib/typescript/src/modules/location/locationManager.d.ts create mode 100644 lib/typescript/src/modules/location/locationManager.d.ts.map create mode 100644 lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts create mode 100644 lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts.map create mode 100644 lib/typescript/src/modules/offline/OfflinePack.d.ts create mode 100644 lib/typescript/src/modules/offline/OfflinePack.d.ts.map create mode 100644 lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts create mode 100644 lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts.map create mode 100644 lib/typescript/src/modules/offline/TileStore.d.ts create mode 100644 lib/typescript/src/modules/offline/TileStore.d.ts.map create mode 100644 lib/typescript/src/modules/offline/offlineManager.d.ts create mode 100644 lib/typescript/src/modules/offline/offlineManager.d.ts.map create mode 100644 lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts create mode 100644 lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts.map create mode 100644 lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts create mode 100644 lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts.map create mode 100644 lib/typescript/src/modules/snapshot/snapshotManager.d.ts create mode 100644 lib/typescript/src/modules/snapshot/snapshotManager.d.ts.map create mode 100644 lib/typescript/src/requestAndroidLocationPermissions.d.ts create mode 100644 lib/typescript/src/requestAndroidLocationPermissions.d.ts.map create mode 100644 lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts create mode 100644 lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts.map create mode 100644 lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts create mode 100644 lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts.map create mode 100644 lib/typescript/src/specs/NativeMapViewModule.d.ts create mode 100644 lib/typescript/src/specs/NativeMapViewModule.d.ts.map create mode 100644 lib/typescript/src/specs/NativeRNMBXImageModule.d.ts create mode 100644 lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map create mode 100644 lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts create mode 100644 lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts.map create mode 100644 lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts create mode 100644 lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map create mode 100644 lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts create mode 100644 lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts.map create mode 100644 lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts create mode 100644 lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts.map create mode 100644 lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts create mode 100644 lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts create mode 100644 lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts.map create mode 100644 lib/typescript/src/specs/codegenUtils.d.ts create mode 100644 lib/typescript/src/specs/codegenUtils.d.ts.map create mode 100644 lib/typescript/src/types/BaseProps.d.ts create mode 100644 lib/typescript/src/types/BaseProps.d.ts.map create mode 100644 lib/typescript/src/types/OnPressEvent.d.ts create mode 100644 lib/typescript/src/types/OnPressEvent.d.ts.map create mode 100644 lib/typescript/src/types/Position.d.ts create mode 100644 lib/typescript/src/types/Position.d.ts.map create mode 100644 lib/typescript/src/types/index.d.ts create mode 100644 lib/typescript/src/types/index.d.ts.map create mode 100644 lib/typescript/src/utils/BridgeValue.d.ts create mode 100644 lib/typescript/src/utils/BridgeValue.d.ts.map create mode 100644 lib/typescript/src/utils/Logger.d.ts create mode 100644 lib/typescript/src/utils/Logger.d.ts.map create mode 100644 lib/typescript/src/utils/StyleValue.d.ts create mode 100644 lib/typescript/src/utils/StyleValue.d.ts.map create mode 100644 lib/typescript/src/utils/animated/Animated.d.ts create mode 100644 lib/typescript/src/utils/animated/Animated.d.ts.map create mode 100644 lib/typescript/src/utils/checkRequiredProps.d.ts create mode 100644 lib/typescript/src/utils/checkRequiredProps.d.ts.map create mode 100644 lib/typescript/src/utils/deprecation.d.ts create mode 100644 lib/typescript/src/utils/deprecation.d.ts.map create mode 100644 lib/typescript/src/utils/filterUtils.d.ts create mode 100644 lib/typescript/src/utils/filterUtils.d.ts.map create mode 100644 lib/typescript/src/utils/geoUtils.d.ts create mode 100644 lib/typescript/src/utils/geoUtils.d.ts.map create mode 100644 lib/typescript/src/utils/getAnnotationsLayerID.d.ts create mode 100644 lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map create mode 100644 lib/typescript/src/utils/index.d.ts create mode 100644 lib/typescript/src/utils/index.d.ts.map create mode 100644 lib/typescript/src/utils/nativeRef.d.ts create mode 100644 lib/typescript/src/utils/nativeRef.d.ts.map create mode 100644 lib/typescript/src/utils/styleMap.d.ts create mode 100644 lib/typescript/src/utils/styleMap.d.ts.map create mode 100644 lib/typescript/src/web/MapContext.d.ts create mode 100644 lib/typescript/src/web/MapContext.d.ts.map create mode 100644 lib/typescript/src/web/components/Camera.d.ts create mode 100644 lib/typescript/src/web/components/Camera.d.ts.map create mode 100644 lib/typescript/src/web/components/MapView.d.ts create mode 100644 lib/typescript/src/web/components/MapView.d.ts.map create mode 100644 lib/typescript/src/web/utils/Logger.d.ts create mode 100644 lib/typescript/src/web/utils/Logger.d.ts.map diff --git a/.gitignore b/.gitignore index 1028eefc1..8ae78ecf4 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,4 @@ coverage rnmapbox-maps.tgz # generated by bob -lib/ +# lib/ diff --git a/docs/Camera.md b/docs/Camera.md index 34d0bed9d..0d9b7f5d7 100644 --- a/docs/Camera.md +++ b/docs/Camera.md @@ -287,9 +287,9 @@ Set the camera position to enclose the provided bounds, with optional
paddin #### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | -| `ne` | `Array` | `Yes` | Northeast coordinate of bounding box | -| `sw` | `Array` | `Yes` | Southwest coordinate of bounding box | -| `paddingConfig` | `Array \| number \| undefined` | `Yes` | The viewport padding, specified as a number (all sides equal), a 2-item array ([vertical, horizontal]), or a 4-item array ([top, right, bottom, left]) | +| `ne` | `Position` | `Yes` | Northeast coordinate of bounding box | +| `sw` | `Position` | `Yes` | Southwest coordinate of bounding box | +| `paddingConfig` | `number \| Array` | `Yes` | The viewport padding, specified as a number (all sides equal), a 2-item array ([vertical, horizontal]), or a 4-item array ([top, right, bottom, left]) | | `_animationDuration` | `n/a` | `No` | undefined | @@ -307,7 +307,7 @@ Sets the camera to center around the provided coordinate using a realistic 'trav #### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | -| `_centerCoordinate` | `Array` | `Yes` | undefined | +| `_centerCoordinate` | `n/a` | `Yes` | undefined | | `_animationDuration` | `n/a` | `No` | undefined | @@ -325,7 +325,7 @@ Sets the camera to center around the provided coordinate, with optional duration #### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | -| `_centerCoordinate` | `Array` | `Yes` | undefined | +| `_centerCoordinate` | `n/a` | `Yes` | undefined | | `_animationDuration` | `n/a` | `No` | undefined | @@ -343,7 +343,7 @@ Zooms the camera to the provided level, with optional duration. #### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | -| `_zoomLevel` | `number` | `Yes` | undefined | +| `_zoomLevel` | `n/a` | `Yes` | undefined | | `_animationDuration` | `n/a` | `No` | undefined | diff --git a/docs/OfflineManager.md b/docs/OfflineManager.md index 1c3dfcb0d..70ae472e0 100644 --- a/docs/OfflineManager.md +++ b/docs/OfflineManager.md @@ -1,316 +1,348 @@ + + ```tsx import { offlineManager } from '@rnmapbox/maps'; -offlineManager; -``` +offlineManager +``` OfflineManager implements a singleton (shared object) that manages offline packs. All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. The shared object maintains a canonical collection of offline packs. -## methods -### createPack(options[, progressListener][, errorlistener]) + +## methods +### createPack(options[, progressListener][, errorListener]) Creates and registers an offline pack that downloads the resources needed to use the given region offline. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `options` | `OfflineCreatePackOptions` | `Yes` | Create options for a offline pack that specifices zoom levels, style url, and the region to download. | +| `progressListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | +| `errorListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | + -| Name | Type | Required | Description | -| ------------------ | :------------------------: | :------: | :---------------------------------------------------------------------------------------------------: | -| `options` | `OfflineCreatePackOptions` | `Yes` | Create options for a offline pack that specifices zoom levels, style url, and the region to download. | -| `progressListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | -| `errorListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | ```javascript -const progressListener = (offlineRegion, status) => - console.log(offlineRegion, status); +const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); -await Mapbox.offlineManager.createPack( - { - name: 'offlinePack', - styleURL: 'mapbox://...', - minZoom: 14, - maxZoom: 20, - bounds: [ - [neLng, neLat], - [swLng, swLat], - ], - }, - progressListener, - errorListener, -); +await Mapbox.offlineManager.createPack({ + name: 'offlinePack', + styleURL: 'mapbox://...', + minZoom: 14, + maxZoom: 20, + bounds: [[neLng, neLat], [swLng, swLat]] +}, progressListener, errorListener) ``` -### createPackLegacy(options[, progressListener][, errorlistener]) + +[Offline Example](../examples/Map/OfflineExample)### createPackLegacy(options[, progressListener][, errorListener]) Legacy Download Method - Creates and registers an offline pack that downloads the resources needed to use the given region offline. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `options` | `OfflineCreatePackOptions` | `Yes` | Create options for a offline pack that specifices zoom levels, style url, and the region to download. | +| `progressListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | +| `errorListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | + -| Name | Type | Required | Description | -| ------------------ | :------------------------: | :------: | :---------------------------------------------------------------------------------------------------: | -| `options` | `OfflineCreatePackOptions` | `Yes` | Create options for a offline pack that specifices zoom levels, style url, and the region to download. | -| `progressListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | -| `errorListener` | `Callback` | `No` | Callback that listens for status events while downloading the offline resource. | ```javascript -const progressListener = (offlineRegion, status) => - console.log(offlineRegion, status); +const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); -await MapboxGL.offlineManager.createPack( - { - name: 'offlinePack', - styleURL: 'mapbox://...', - minZoom: 14, - maxZoom: 20, - bounds: [ - [neLng, neLat], - [swLng, swLat], - ], - }, - progressListener, - errorListener, -); +await MapboxGL.offlineManager.createPackLegacy({ + name: 'offlinePack', + styleURL: 'mapbox://...', + minZoom: 14, + maxZoom: 20, + bounds: [[neLng, neLat], [swLng, swLat]] +}, progressListener, errorListener) ``` + ### invalidatePack(name) Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated.This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `name` | `String` | `Yes` | Name of the offline pack. | + -| Name | Type | Required | Description | -| ------ | :------: | :------: | :-----------------------: | -| `name` | `String` | `Yes` | Name of the offline pack. | ```javascript -await Mapbox.offlineManager.invalidatePack('packName'); +await Mapbox.offlineManager.invalidatePack('packName') ``` + ### deletePack(name) Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `name` | `String` | `Yes` | Name of the offline pack. | + -| Name | Type | Required | Description | -| ------ | :------: | :------: | :-----------------------: | -| `name` | `String` | `Yes` | Name of the offline pack. | ```javascript -await Mapbox.offlineManager.deletePack('packName'); +await Mapbox.offlineManager.deletePack('packName') ``` + ### deletePackLegacy(name) Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `name` | `String` | `Yes` | Name of the offline pack. | + -| Name | Type | Required | Description | -| ------ | :------: | :------: | :-----------------------: | -| `name` | `String` | `Yes` | Name of the offline pack. | ```javascript -await MapboxGL.offlineManager.deletePackLegacy('packName'); +await MapboxGL.offlineManager.deletePackLegacy('packName') ``` + ### invalidateAmbientCache() Forces a revalidation of the tiles in the ambient cache and downloads a fresh version of the tiles from the tile server.
This is the recommend method for clearing the cache.
This is the most efficient method because tiles in the ambient cache are re-downloaded to remove outdated data from a device.
It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | + + -| Name | Type | Required | Description | -| ---- | :--: | :------: | :---------: | ```javascript await Mapbox.offlineManager.invalidateAmbientCache(); ``` + ### clearAmbientCache() Erases resources from the ambient cache.
This method clears the cache and decreases the amount of space that map resources take up on the device. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | + + -| Name | Type | Required | Description | -| ---- | :--: | :------: | :---------: | ```javascript await Mapbox.offlineManager.clearAmbientCache(); ``` + ### migrateOfflineCache() Migrates the offline cache from pre-v10 SDKs to the new v10 cache location #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | + + -| Name | Type | Required | Description | -| ---- | :--: | :------: | :---------: | ```javascript -await Mapbox.offlineManager.migrateOfflineCache(); +await Mapbox.offlineManager.migrateOfflineCache() ``` + ### setMaximumAmbientCacheSize(size) Sets the maximum size of the ambient cache in bytes. Disables the ambient cache if set to 0.
This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `size` | `Number` | `Yes` | Size of ambient cache. | + -| Name | Type | Required | Description | -| ------ | :------: | :------: | :--------------------: | -| `size` | `Number` | `Yes` | Size of ambient cache. | ```javascript await Mapbox.offlineManager.setMaximumAmbientCacheSize(5000000); ``` + ### resetDatabase() Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | + + -| Name | Type | Required | Description | -| ---- | :--: | :------: | :---------: | ```javascript await Mapbox.offlineManager.resetDatabase(); ``` + ### getPacks() Retrieves all the current offline packs that are stored in the database. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | + + -| Name | Type | Required | Description | -| ---- | :--: | :------: | :---------: | ```javascript const offlinePacks = await Mapbox.offlineManager.getPacks(); ``` -### getPacksLegacy() + +[Offline Example](../examples/Map/OfflineExample)### getPacksLegacy() Retrieves all the current offline legacy packs that are stored in the database. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | + + -| Name | Type | Required | Description | -| ---- | :--: | :------: | :---------: | ```javascript const offlinePacks = await MapboxGL.offlineManager.getPacksLegacy(); ``` + ### getPack(name) Retrieves an offline pack that is stored in the database by name. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `name` | `String` | `Yes` | Name of the offline pack. | + -| Name | Type | Required | Description | -| ------ | :------: | :------: | :-----------------------: | -| `name` | `String` | `Yes` | Name of the offline pack. | ```javascript const offlinePack = await Mapbox.offlineManager.getPack(); ``` + [Offline Example](../examples/Map/OfflineExample)### mergeOfflineRegions(path) Sideloads offline db #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `path` | `String` | `Yes` | Path to offline tile db on file system. | + -| Name | Type | Required | Description | -| ------ | :------: | :------: | :-------------------------------------: | -| `path` | `String` | `Yes` | Path to offline tile db on file system. | ```javascript await Mapbox.offlineManager.mergeOfflineRegions(path); ``` + ### setTileCountLimit(limit) Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device.
The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `limit` | `Number` | `Yes` | Map tile limit count. | + -| Name | Type | Required | Description | -| ------- | :------: | :------: | :-------------------: | -| `limit` | `Number` | `Yes` | Map tile limit count. | ```javascript Mapbox.offlineManager.setTileCountLimit(1000); ``` + ### setTileCountLimitLegacy(limit) Legacy Download Method - Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device.
The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `limit` | `Number` | `Yes` | Map tile limit count. | + -| Name | Type | Required | Description | -| ------- | :------: | :------: | :-------------------: | -| `limit` | `Number` | `Yes` | Map tile limit count. | ```javascript -MapboxGL.offlineManager.setTileCountLimit(1000); +MapboxGL.offlineManager.setTileCountLimitLegacy(1000); ``` + ### setProgressEventThrottle(throttleValue) Sets the period at which download status events will be sent over the React Native bridge.
The default is 300ms. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `throttleValue` | `Number` | `Yes` | event throttle value in ms. | + -| Name | Type | Required | Description | -| --------------- | :------: | :------: | :-------------------------: | -| `throttleValue` | `Number` | `Yes` | event throttle value in ms. | ```javascript Mapbox.offlineManager.setProgressEventThrottle(500); ``` + ### subscribe(packName, progressListener, errorListener) Subscribe to download status/error events for the requested offline pack.
Note that createPack calls this internally if listeners are provided. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `packName` | `String` | `Yes` | Name of the offline pack. | +| `progressListener` | `Callback` | `Yes` | Callback that listens for status events while downloading the offline resource. | +| `errorListener` | `Callback` | `Yes` | Callback that listens for status events while downloading the offline resource. | + -| Name | Type | Required | Description | -| ------------------ | :--------: | :------: | :-----------------------------------------------------------------------------: | -| `packName` | `String` | `Yes` | Name of the offline pack. | -| `progressListener` | `Callback` | `Yes` | Callback that listens for status events while downloading the offline resource. | -| `errorListener` | `Callback` | `Yes` | Callback that listens for status events while downloading the offline resource. | ```javascript -const progressListener = (offlinePack, status) => - console.log(offlinePack, status); -const errorListener = (offlinePack, err) => console.log(offlinePack, err); -Mapbox.offlineManager.subscribe('packName', progressListener, errorListener); +const progressListener = (offlinePack, status) => console.log(offlinePack, status) +const errorListener = (offlinePack, err) => console.log(offlinePack, err) +Mapbox.offlineManager.subscribe('packName', progressListener, errorListener) ``` + ### unsubscribe(packName) Unsubscribes any listeners associated with the offline pack.
It's a good idea to call this on componentWillUnmount. #### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `packName` | `String` | `Yes` | Name of the offline pack. | + -| Name | Type | Required | Description | -| ---------- | :------: | :------: | :-----------------------: | -| `packName` | `String` | `Yes` | Name of the offline pack. | ```javascript -Mapbox.offlineManager.unsubscribe('packName'); +Mapbox.offlineManager.unsubscribe('packName') ``` + + + diff --git a/docs/docs.json b/docs/docs.json index 3f49bb50e..f10ad6491 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -606,7 +606,7 @@ "name": "ne", "description": "Northeast coordinate of bounding box", "type": { - "name": "Array" + "name": "Position" }, "optional": false }, @@ -614,7 +614,7 @@ "name": "sw", "description": "Southwest coordinate of bounding box", "type": { - "name": "Array" + "name": "Position" }, "optional": false }, @@ -622,7 +622,7 @@ "name": "paddingConfig", "description": "The viewport padding, specified as a number (all sides equal), a 2-item array ([vertical, horizontal]), or a 4-item array ([top, right, bottom, left])", "type": { - "name": "Array \\| number \\| undefined" + "name": "number \\| Array" }, "optional": false }, @@ -649,7 +649,7 @@ "name": "_centerCoordinate", "optional": false, "type": { - "name": "Array" + "name": null } }, { @@ -675,7 +675,7 @@ "name": "_centerCoordinate", "optional": false, "type": { - "name": "Array" + "name": null } }, { @@ -701,7 +701,7 @@ "name": "_zoomLevel", "optional": false, "type": { - "name": "number" + "name": null } }, { @@ -8041,7 +8041,7 @@ } ], "examples": [ - "const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);\nconst errorListener = (offlineRegion, err) => console.log(offlineRegion, err);\n\nawait MapboxGL.offlineManager.createPack({\n name: 'offlinePack',\n styleURL: 'mapbox://...',\n minZoom: 14,\n maxZoom: 20,\n bounds: [[neLng, neLat], [swLng, swLat]]\n}, progressListener, errorListener)" + "const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);\nconst errorListener = (offlineRegion, err) => console.log(offlineRegion, err);\n\nawait MapboxGL.offlineManager.createPackLegacy({\n name: 'offlinePack',\n styleURL: 'mapbox://...',\n minZoom: 14,\n maxZoom: 20,\n bounds: [[neLng, neLat], [swLng, swLat]]\n}, progressListener, errorListener)" ], "returns": { "description": "", @@ -8309,7 +8309,7 @@ } ], "examples": [ - "MapboxGL.offlineManager.setTileCountLimit(1000);" + "MapboxGL.offlineManager.setTileCountLimitLegacy(1000);" ], "returns": { "description": "", diff --git a/lib/commonjs/Mapbox.js b/lib/commonjs/Mapbox.js new file mode 100644 index 000000000..ec8ad2595 --- /dev/null +++ b/lib/commonjs/Mapbox.js @@ -0,0 +1,459 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + AnimatedMapPoint: true, + NativeUserLocation: true, + StyleURL: true, + UserTrackingModes: true, + __experimental: true, + Camera: true, + UserTrackingMode: true, + Atmosphere: true, + MapView: true, + Light: true, + PointAnnotation: true, + Annotation: true, + Callout: true, + StyleImport: true, + UserLocation: true, + UserLocationRenderMode: true, + LocationPuck: true, + VectorSource: true, + ShapeSource: true, + RasterSource: true, + RasterDemSource: true, + ImageSource: true, + Viewport: true, + Models: true, + Images: true, + Image: true, + FillLayer: true, + FillExtrusionLayer: true, + HeatmapLayer: true, + LineLayer: true, + CircleLayer: true, + SkyLayer: true, + ModelLayer: true, + SymbolLayer: true, + RasterLayer: true, + BackgroundLayer: true, + CustomLocationProvider: true, + Terrain: true, + locationManager: true, + offlineManager: true, + OfflineCreatePackOptions: true, + offlineManagerLegacy: true, + TileStore: true, + snapshotManager: true, + MarkerView: true, + Animated: true, + AnimatedCoordinatesArray: true, + AnimatedExtractCoordinateFromArray: true, + AnimatedPoint: true, + AnimatedRouteCoordinatesArray: true, + AnimatedShape: true, + Style: true, + Logger: true, + requestAndroidLocationPermissions: true, + getAnnotationsLayerID: true +}; +Object.defineProperty(exports, "Animated", { + enumerable: true, + get: function () { + return _Animated.default; + } +}); +Object.defineProperty(exports, "AnimatedCoordinatesArray", { + enumerable: true, + get: function () { + return _classes.AnimatedCoordinatesArray; + } +}); +Object.defineProperty(exports, "AnimatedExtractCoordinateFromArray", { + enumerable: true, + get: function () { + return _classes.AnimatedExtractCoordinateFromArray; + } +}); +exports.AnimatedMapPoint = void 0; +Object.defineProperty(exports, "AnimatedPoint", { + enumerable: true, + get: function () { + return _classes.AnimatedPoint; + } +}); +Object.defineProperty(exports, "AnimatedRouteCoordinatesArray", { + enumerable: true, + get: function () { + return _classes.AnimatedRouteCoordinatesArray; + } +}); +Object.defineProperty(exports, "AnimatedShape", { + enumerable: true, + get: function () { + return _classes.AnimatedShape; + } +}); +Object.defineProperty(exports, "Annotation", { + enumerable: true, + get: function () { + return _Annotation.default; + } +}); +Object.defineProperty(exports, "Atmosphere", { + enumerable: true, + get: function () { + return _Atmosphere.Atmosphere; + } +}); +Object.defineProperty(exports, "BackgroundLayer", { + enumerable: true, + get: function () { + return _BackgroundLayer.default; + } +}); +Object.defineProperty(exports, "Callout", { + enumerable: true, + get: function () { + return _Callout.default; + } +}); +Object.defineProperty(exports, "Camera", { + enumerable: true, + get: function () { + return _Camera.Camera; + } +}); +Object.defineProperty(exports, "CircleLayer", { + enumerable: true, + get: function () { + return _CircleLayer.default; + } +}); +Object.defineProperty(exports, "CustomLocationProvider", { + enumerable: true, + get: function () { + return _CustomLocationProvider.default; + } +}); +Object.defineProperty(exports, "FillExtrusionLayer", { + enumerable: true, + get: function () { + return _FillExtrusionLayer.default; + } +}); +Object.defineProperty(exports, "FillLayer", { + enumerable: true, + get: function () { + return _FillLayer.default; + } +}); +Object.defineProperty(exports, "HeatmapLayer", { + enumerable: true, + get: function () { + return _HeatmapLayer.default; + } +}); +Object.defineProperty(exports, "Image", { + enumerable: true, + get: function () { + return _Image.default; + } +}); +Object.defineProperty(exports, "ImageSource", { + enumerable: true, + get: function () { + return _ImageSource.default; + } +}); +Object.defineProperty(exports, "Images", { + enumerable: true, + get: function () { + return _Images.default; + } +}); +Object.defineProperty(exports, "Light", { + enumerable: true, + get: function () { + return _Light.default; + } +}); +Object.defineProperty(exports, "LineLayer", { + enumerable: true, + get: function () { + return _LineLayer.default; + } +}); +Object.defineProperty(exports, "LocationPuck", { + enumerable: true, + get: function () { + return _LocationPuck.default; + } +}); +Object.defineProperty(exports, "Logger", { + enumerable: true, + get: function () { + return _Logger.default; + } +}); +Object.defineProperty(exports, "MapView", { + enumerable: true, + get: function () { + return _MapView.default; + } +}); +Object.defineProperty(exports, "MarkerView", { + enumerable: true, + get: function () { + return _MarkerView.default; + } +}); +Object.defineProperty(exports, "ModelLayer", { + enumerable: true, + get: function () { + return _ModelLayer.default; + } +}); +Object.defineProperty(exports, "Models", { + enumerable: true, + get: function () { + return _Models.default; + } +}); +exports.NativeUserLocation = void 0; +Object.defineProperty(exports, "OfflineCreatePackOptions", { + enumerable: true, + get: function () { + return _offlineManager.OfflineCreatePackOptions; + } +}); +Object.defineProperty(exports, "PointAnnotation", { + enumerable: true, + get: function () { + return _PointAnnotation.default; + } +}); +Object.defineProperty(exports, "RasterDemSource", { + enumerable: true, + get: function () { + return _RasterDemSource.default; + } +}); +Object.defineProperty(exports, "RasterLayer", { + enumerable: true, + get: function () { + return _RasterLayer.default; + } +}); +Object.defineProperty(exports, "RasterSource", { + enumerable: true, + get: function () { + return _RasterSource.default; + } +}); +Object.defineProperty(exports, "ShapeSource", { + enumerable: true, + get: function () { + return _ShapeSource.ShapeSource; + } +}); +Object.defineProperty(exports, "SkyLayer", { + enumerable: true, + get: function () { + return _SkyLayer.default; + } +}); +Object.defineProperty(exports, "Style", { + enumerable: true, + get: function () { + return _Style.default; + } +}); +Object.defineProperty(exports, "StyleImport", { + enumerable: true, + get: function () { + return _StyleImport.default; + } +}); +exports.StyleURL = void 0; +Object.defineProperty(exports, "SymbolLayer", { + enumerable: true, + get: function () { + return _SymbolLayer.SymbolLayer; + } +}); +Object.defineProperty(exports, "Terrain", { + enumerable: true, + get: function () { + return _Terrain.Terrain; + } +}); +Object.defineProperty(exports, "TileStore", { + enumerable: true, + get: function () { + return _TileStore.default; + } +}); +Object.defineProperty(exports, "UserLocation", { + enumerable: true, + get: function () { + return _UserLocation.default; + } +}); +Object.defineProperty(exports, "UserLocationRenderMode", { + enumerable: true, + get: function () { + return _UserLocation.UserLocationRenderMode; + } +}); +Object.defineProperty(exports, "UserTrackingMode", { + enumerable: true, + get: function () { + return _Camera.UserTrackingMode; + } +}); +exports.UserTrackingModes = void 0; +Object.defineProperty(exports, "VectorSource", { + enumerable: true, + get: function () { + return _VectorSource.default; + } +}); +Object.defineProperty(exports, "Viewport", { + enumerable: true, + get: function () { + return _Viewport.Viewport; + } +}); +exports.__experimental = void 0; +Object.defineProperty(exports, "getAnnotationsLayerID", { + enumerable: true, + get: function () { + return _getAnnotationsLayerID.getAnnotationsLayerID; + } +}); +Object.defineProperty(exports, "locationManager", { + enumerable: true, + get: function () { + return _locationManager.default; + } +}); +Object.defineProperty(exports, "offlineManager", { + enumerable: true, + get: function () { + return _offlineManager.default; + } +}); +Object.defineProperty(exports, "offlineManagerLegacy", { + enumerable: true, + get: function () { + return _offlineManagerLegacy.default; + } +}); +Object.defineProperty(exports, "requestAndroidLocationPermissions", { + enumerable: true, + get: function () { + return _requestAndroidLocationPermissions.requestAndroidLocationPermissions; + } +}); +Object.defineProperty(exports, "snapshotManager", { + enumerable: true, + get: function () { + return _snapshotManager.default; + } +}); +var _RNMBXModule = require("./RNMBXModule"); +Object.keys(_RNMBXModule).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _RNMBXModule[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RNMBXModule[key]; + } + }); +}); +var _Camera = require("./components/Camera"); +var _Atmosphere = require("./components/Atmosphere"); +var _MapView = _interopRequireDefault(require("./components/MapView")); +var _Light = _interopRequireDefault(require("./components/Light")); +var _PointAnnotation = _interopRequireDefault(require("./components/PointAnnotation")); +var _Annotation = _interopRequireDefault(require("./components/Annotation")); +var _Callout = _interopRequireDefault(require("./components/Callout")); +var _StyleImport = _interopRequireDefault(require("./components/StyleImport")); +var _UserLocation = _interopRequireWildcard(require("./components/UserLocation")); +var _LocationPuck = _interopRequireDefault(require("./components/LocationPuck")); +var _VectorSource = _interopRequireDefault(require("./components/VectorSource")); +var _ShapeSource = require("./components/ShapeSource"); +var _RasterSource = _interopRequireDefault(require("./components/RasterSource")); +var _RasterDemSource = _interopRequireDefault(require("./components/RasterDemSource")); +var _ImageSource = _interopRequireDefault(require("./components/ImageSource")); +var _Viewport = require("./components/Viewport"); +var _Models = _interopRequireDefault(require("./components/Models")); +var _Images = _interopRequireDefault(require("./components/Images")); +var _Image = _interopRequireDefault(require("./components/Image")); +var _FillLayer = _interopRequireDefault(require("./components/FillLayer")); +var _FillExtrusionLayer = _interopRequireDefault(require("./components/FillExtrusionLayer")); +var _HeatmapLayer = _interopRequireDefault(require("./components/HeatmapLayer")); +var _LineLayer = _interopRequireDefault(require("./components/LineLayer")); +var _CircleLayer = _interopRequireDefault(require("./components/CircleLayer")); +var _SkyLayer = _interopRequireDefault(require("./components/SkyLayer")); +var _ModelLayer = _interopRequireDefault(require("./components/ModelLayer")); +var _SymbolLayer = require("./components/SymbolLayer"); +var _RasterLayer = _interopRequireDefault(require("./components/RasterLayer")); +var _BackgroundLayer = _interopRequireDefault(require("./components/BackgroundLayer")); +var _CustomLocationProvider = _interopRequireDefault(require("./components/CustomLocationProvider")); +var _Terrain = require("./components/Terrain"); +var _locationManager = _interopRequireDefault(require("./modules/location/locationManager")); +var _offlineManager = _interopRequireWildcard(require("./modules/offline/offlineManager")); +var _offlineManagerLegacy = _interopRequireDefault(require("./modules/offline/offlineManagerLegacy")); +var _TileStore = _interopRequireDefault(require("./modules/offline/TileStore")); +var _snapshotManager = _interopRequireDefault(require("./modules/snapshot/snapshotManager")); +var _MarkerView = _interopRequireDefault(require("./components/MarkerView")); +var _Animated = _interopRequireDefault(require("./utils/animated/Animated")); +var _classes = require("./classes"); +var _Style = _interopRequireDefault(require("./components/Style")); +var _Logger = _interopRequireDefault(require("./utils/Logger")); +var _requestAndroidLocationPermissions = require("./requestAndroidLocationPermissions"); +var _getAnnotationsLayerID = require("./utils/getAnnotationsLayerID"); +var _deprecation = require("./utils/deprecation"); +var _MovePointShapeAnimator = _interopRequireDefault(require("./shape_animators/MovePointShapeAnimator")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */ + +const AnimatedMapPoint = (0, _deprecation.deprecatedClass)(_classes.AnimatedPoint, 'AnimatedMapPoint is deprecated please use AnimatedPoint'); + +/** @deprecated NativeUserLocation will be removed in future release. Use `LocationPuck` instead. */ +exports.AnimatedMapPoint = AnimatedMapPoint; +const NativeUserLocation = _LocationPuck.default; + +// types: +exports.NativeUserLocation = NativeUserLocation; +let StyleURL; +/** @deprecated UserTrackingModes is deprecated use UserTrackingMode */ +exports.StyleURL = StyleURL; +(function (StyleURL) { + StyleURL["Street"] = "mapbox://styles/mapbox/streets-v11"; + StyleURL["Dark"] = "mapbox://styles/mapbox/dark-v10"; + StyleURL["Light"] = "mapbox://styles/mapbox/light-v10"; + StyleURL["Outdoors"] = "mapbox://styles/mapbox/outdoors-v11"; + StyleURL["Satellite"] = "mapbox://styles/mapbox/satellite-v9"; + StyleURL["SatelliteStreet"] = "mapbox://styles/mapbox/satellite-streets-v11"; + StyleURL["TrafficDay"] = "mapbox://styles/mapbox/navigation-preview-day-v4"; + StyleURL["TrafficNight"] = "mapbox://styles/mapbox/navigation-preview-night-v4"; +})(StyleURL || (exports.StyleURL = StyleURL = {})); +const UserTrackingModes = _Camera.UserTrackingMode; + +/** @experimental */ +exports.UserTrackingModes = UserTrackingModes; +const __experimental = { + MovePointShapeAnimator: _MovePointShapeAnimator.default +}; +exports.__experimental = __experimental; +//# sourceMappingURL=Mapbox.js.map \ No newline at end of file diff --git a/lib/commonjs/Mapbox.js.map b/lib/commonjs/Mapbox.js.map new file mode 100644 index 000000000..87204485e --- /dev/null +++ b/lib/commonjs/Mapbox.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AnimatedMapPoint","deprecatedClass","AnimatedPoint","NativeUserLocation","LocationPuck","StyleURL","UserTrackingModes","UserTrackingMode","__experimental","MovePointShapeAnimator"],"sourceRoot":"../../src","sources":["Mapbox.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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11886bdb --- /dev/null +++ b/lib/commonjs/RNMBXModule.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setWellKnownTileServer = exports.setTelemetryEnabled = exports.setConnected = exports.setAccessToken = exports.removeCustomHeader = exports.getAccessToken = exports.clearData = exports.addCustomHeader = exports.TileServers = exports.StyleURL = exports.StyleSource = exports.OfflinePackDownloadState = exports.LineJoin = void 0; +var _reactNative = require("react-native"); +const RNMBXModule = { + ..._reactNative.NativeModules.RNMBXModule +}; +if (_reactNative.NativeModules.RNMBXModule == null) { + if (global.expo != null) { + // global.expo.modules.ExponentConstants; + throw new Error('@rnmapbox/maps native code not available. Make sure you have linked the library and rebuild your app. See https://rnmapbox.github.io/docs/install?rebuild=expo#rebuild'); + } else { + throw new Error('@rnmapbox/maps native code not available. Make sure you have linked the library and rebuild your app. See https://rnmapbox.github.io/docs/install'); + } +} +const { + StyleURL, + OfflinePackDownloadState, + LineJoin, + StyleSource, + TileServers, + removeCustomHeader, + addCustomHeader, + setAccessToken, + setWellKnownTileServer, + clearData, + getAccessToken, + setTelemetryEnabled, + setConnected +} = RNMBXModule; +exports.setConnected = setConnected; +exports.setTelemetryEnabled = setTelemetryEnabled; +exports.getAccessToken = getAccessToken; +exports.clearData = clearData; +exports.setWellKnownTileServer = setWellKnownTileServer; +exports.setAccessToken = setAccessToken; +exports.addCustomHeader = addCustomHeader; +exports.removeCustomHeader = removeCustomHeader; +exports.TileServers = TileServers; +exports.StyleSource = StyleSource; +exports.LineJoin = LineJoin; +exports.OfflinePackDownloadState = OfflinePackDownloadState; +exports.StyleURL = StyleURL; +//# sourceMappingURL=RNMBXModule.js.map \ No newline at end of file diff --git a/lib/commonjs/RNMBXModule.js.map b/lib/commonjs/RNMBXModule.js.map new file mode 100644 index 000000000..d6864f316 --- /dev/null +++ b/lib/commonjs/RNMBXModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["RNMBXModule","NativeModules","global","expo","Error","StyleURL","OfflinePackDownloadState","LineJoin","StyleSource","TileServers","removeCustomHeader","addCustomHeader","setAccessToken","setWellKnownTileServer","clearData","getAccessToken","setTelemetryEnabled","setConnected"],"sourceRoot":"../../src","sources":["RNMBXModule.ts"],"mappings":";;;;;;AAAA;AAuCA,MAAMA,WAAwB,GAAG;EAAE,GAAGC,0BAAa,CAACD;AAAY,CAAC;AACjE,IAAIC,0BAAa,CAACD,WAAW,IAAI,IAAI,EAAE;EACrC,IAAKE,MAAM,CAAwBC,IAAI,IAAI,IAAI,EAAE;IAC/C;IACA,MAAM,IAAIC,KAAK,CACb,wKAAwK,CACzK;EACH,CAAC,MAAM;IACL,MAAM,IAAIA,KAAK,CACb,mJAAmJ,CACpJ;EACH;AACF;AAEO,MAAM;EACXC,QAAQ;EACRC,wBAAwB;EACxBC,QAAQ;EACRC,WAAW;EACXC,WAAW;EACXC,kBAAkB;EAClBC,eAAe;EACfC,cAAc;EACdC,sBAAsB;EACtBC,SAAS;EACTC,cAAc;EACdC,mBAAmB;EACnBC;AACF,CAAC,GAAGjB,WAAW;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"} diff --git a/lib/commonjs/assets/heading.png b/lib/commonjs/assets/heading.png new file mode 100644 index 0000000000000000000000000000000000000000..9980c385e0782054ec30130e44ea704d62319f5a GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%C&rs6b?Si}&H|6fVg?3o zVGw3ym^DWNC}Vv@_I12J22UKFoioX?c=b!UvE%xzTN-d63Zzp00i_>zopr E09_tgKmY&$ literal 0 HcmV?d00001 diff --git a/lib/commonjs/assets/heading@2x.png b/lib/commonjs/assets/heading@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f3bce8761acd8f35b5c58095b3d75c8e51202e77 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofvPP)Tsw@I14-?iy0WW zg+Z8+Vb&Z8pkP#hPlzj!Hs1P_7HHO1y?&tSawS22!3>-o+W%Mip2-(_Khb1!*tH7j zAG2)t#xvb-R9WJ-T`qsiYoN+io-U3d6?5L6cjr57z~d4)z3~0sXaBDE1W(v;Vxx=h z;qA|A8rnY2&Ww|Z*{HL3FYk>gM)rb|Z+c?u+zwQ;*!;S8e6s&t_J`U6Y)2egws&mn z|0p<_>7@CDfNz>%K~4(M>_%T}`+8$a4OJ9uuwK-*&J^ z{j9y-%~Y!{E8$X|FyU_hBU=M6wq=_SsBE8~zdY@xxl&caoiVrT6#p%7K9tJwv|VeZ&zU^IcN2^^hh8n0`aa7h-#q_^0We@>tYw6r(>%CD`G`Oz7B^L&p}OMHT|bR&Ur{$C9sfj&0F<=D_g35_U&qc#qh#Kg#>XS>w6mg?jLP=9NpD8%^pw zPJcJHm@FuNVjh3W(%+UbCph_^=(B&?^!HGzyoSfO?xn9Ag8~Z{)ZAr1RrL4NTDt&2 z=@s|nR(O5Q-u~OcH)Fv&(}3wO&G-Cra9(sjr;>lmEGFjM_jVVy-G6`QHM8t%=DWX{ zV{iYx_t);i=G*W2<#>61g|WBw|2l9Xt^Ugn{vI8^o=~=9-+l>CwKLdgW)LbpC5@UwY51-pqV{e^Nn12PXKpS-iPRGjvtVnR~#vV(@hJb6Mw< G&;$U=mP-5p literal 0 HcmV?d00001 diff --git a/lib/commonjs/classes/AnimatedCoordinatesArray.js b/lib/commonjs/classes/AnimatedCoordinatesArray.js new file mode 100644 index 000000000..39182f359 --- /dev/null +++ b/lib/commonjs/classes/AnimatedCoordinatesArray.js @@ -0,0 +1,165 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.AnimatedCoordinatesArray = void 0; +var _reactNative = require("react-native"); +// see +// https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedWithChildren.js +const AnimatedWithChildren = Object.getPrototypeOf(_reactNative.Animated.ValueXY); +if (__DEV__) { + if (AnimatedWithChildren.name !== 'AnimatedWithChildren') { + console.error('AnimatedCoordinatesArray could not obtain AnimatedWithChildren base class'); + } +} +const defaultConfig = { + useNativeDriver: false +}; +class AnimatedCoordinatesArray extends AnimatedWithChildren { + constructor() { + super(); + this.state = this.onInitialState(...arguments); + } + + /** + * Subclasses can override to calculate initial state + * + * @param {*} args - to value from animate + * @returns {object} - the state object + */ + onInitialState(coordinatesArray) { + return { + coords: coordinatesArray.map(coord => [coord[0], coord[1]]) + }; + } + + /** + * Subclasses can override getValue to calculate value from state. + * Value is typically coordinates array, but can be anything + * + * @param {object} state - either state from initialState and/or from calculate + * @returns {object} + */ + onGetValue(state) { + return state.coords; + } + + /** + * Calculates state based on startingState and progress, returns a new state + * + * @param {object} state - state object from initialState and/or from calculate + * @param {number} progress - value between 0 and 1 + * @returns {object} next state + */ + onCalculate(state, progress) { + const { + coords, + targetCoords + } = state; + const newF = progress; + const origF = 1.0 - newF; + + // common + const commonLen = Math.min(coords.length, targetCoords.length); + const common = coords.slice(0, commonLen).map((origCoord, i) => [origCoord[0] * origF + targetCoords[i][0] * newF, origCoord[1] * origF + targetCoords[i][1] * newF]); + if (targetCoords.length > coords.length) { + // only in new (adding) + const addingOrig = coords.length > 0 ? coords[coords.length - 1] : targetCoords[0]; + const adding = targetCoords.slice(commonLen, targetCoords.length).map(newCoord => [addingOrig[0] * origF + newCoord[0] * newF, addingOrig[1] * origF + newCoord[1] * newF]); + return { + coords: [...common, ...adding], + targetCoords + }; + } + if (coords.length > targetCoords.length) { + // only in orig (dissapearing) + const dissapearingNew = targetCoords.length > 0 ? targetCoords[targetCoords.length - 1] : coords[0]; + const dissapearing = coords.slice(commonLen, coords.length).map(origCoord => [origCoord[0] * origF + dissapearingNew[0] * newF, origCoord[1] * origF + dissapearingNew[1] * newF]); + return { + coords: [...common, ...dissapearing], + targetCoords + }; + } + return { + coords: common, + targetCoords + }; + } + + /** + * Subclasses can override to start a new animation + * + * @param {*} toValue - to value from animate + * @param {*} actCoords - the current coordinates array to start from + * @returns {object} The state + */ + onStart(state, toValue) { + const targetCoords = toValue.map(coord => [coord[0], coord[1]]); + return { + ...state, + targetCoords + }; + } + animate(progressValue, progressAnimation, config) { + const { + toValue + } = config; + const onAnimationStart = animation => { + if (this.animation) { + // there was a started but not finsihed animation + const actProgress = this.progressValue.__getValue(); + this.animation.stop(); + this.state = this.onCalculate(this.state, actProgress); + this.progressValue.__removeChild(this); + this.progressValue = null; + this.animation = null; + } + this.progressValue = progressValue; + this.progressValue.__addChild(this); + this.animation = animation; + this.state = this.onStart(this.state, toValue); + }; + const origAnimationStart = progressAnimation.start; + const newAnimation = progressAnimation; + newAnimation.start = function start() { + onAnimationStart(progressAnimation); + origAnimationStart(...arguments); + }; + return newAnimation; + } + timing(config) { + const progressValue = new _reactNative.Animated.Value(0.0); + return this.animate(progressValue, _reactNative.Animated.timing(progressValue, { + ...defaultConfig, + ...config, + toValue: 1.0 + }), config); + } + spring(config) { + const progressValue = new _reactNative.Animated.Value(0.0); + return this.animate(progressValue, _reactNative.Animated.spring(progressValue, { + ...defaultConfig, + ...config, + toValue: 1.0 + }), config); + } + decay(config) { + const progressValue = new _reactNative.Animated.Value(0.0); + return this.animate(progressValue, _reactNative.Animated.decay(this.progressValue, { + ...defaultConfig, + ...config, + toValue: 1.0 + }), config); + } + __getValue() { + if (!this.progressValue) { + return this.onGetValue(this.state); + } + return this.onGetValue(this.onCalculate(this.state, this.progressValue.__getValue())); + } +} +exports.AnimatedCoordinatesArray = AnimatedCoordinatesArray; +var _default = AnimatedCoordinatesArray; +exports.default = _default; +//# sourceMappingURL=AnimatedCoordinatesArray.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/AnimatedCoordinatesArray.js.map b/lib/commonjs/classes/AnimatedCoordinatesArray.js.map new file mode 100644 index 000000000..54e010d75 --- /dev/null +++ b/lib/commonjs/classes/AnimatedCoordinatesArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AnimatedWithChildren","Object","getPrototypeOf","Animated","ValueXY","__DEV__","name","console","error","defaultConfig","useNativeDriver","AnimatedCoordinatesArray","constructor","state","onInitialState","coordinatesArray","coords","map","coord","onGetValue","onCalculate","progress","targetCoords","newF","origF","commonLen","Math","min","length","common","slice","origCoord","i","addingOrig","adding","newCoord","dissapearingNew","dissapearing","onStart","toValue","animate","progressValue","progressAnimation","config","onAnimationStart","animation","actProgress","__getValue","stop","__removeChild","__addChild","origAnimationStart","start","newAnimation","timing","Value","spring","decay"],"sourceRoot":"../../../src","sources":["classes/AnimatedCoordinatesArray.js"],"mappings":";;;;;;AAAA;AAEA;AACA;AACA,MAAMA,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACC,qBAAQ,CAACC,OAAO,CAAC;AACpE,IAAIC,OAAO,EAAE;EACX,IAAIL,oBAAoB,CAACM,IAAI,KAAK,sBAAsB,EAAE;IACxDC,OAAO,CAACC,KAAK,CACX,2EAA2E,CAC5E;EACH;AACF;AAEA,MAAMC,aAAa,GAAG;EACpBC,eAAe,EAAE;AACnB,CAAC;AAEM,MAAMC,wBAAwB,SAASX,oBAAoB,CAAC;EACjEY,WAAW,GAAU;IACnB,KAAK,EAAE;IAEP,IAAI,CAACC,KAAK,GAAG,IAAI,CAACC,cAAc,CAAC,YAAO,CAAC;EAC3C;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEA,cAAc,CAACC,gBAAgB,EAAE;IAC/B,OAAO;MAAEC,MAAM,EAAED,gBAAgB,CAACE,GAAG,CAAEC,KAAK,IAAK,CAACA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,CAAC;IAAE,CAAC;EAC1E;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,CAACN,KAAK,EAAE;IAChB,OAAOA,KAAK,CAACG,MAAM;EACrB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,WAAW,CAACP,KAAK,EAAEQ,QAAQ,EAAE;IAC3B,MAAM;MAAEL,MAAM;MAAE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GkC,MAAM;MACTJ,OAAO,EAAE;IACX,CAAC,CAAC,EACFI,MAAM,CACP;EACH;EAEAc,KAAK,CAACd,MAAM,EAAE;IACZ,MAAMF,aAAa,GAAG,IAAItC,qBAAQ,CAACoD,KAAK,CAAC,GAAG,CAAC;IAC7C,OAAO,IAAI,CAACf,OAAO,CACjBC,aAAa,EACbtC,qBAAQ,CAACsD,KAAK,CAAC,IAAI,CAAChB,aAAa,EAAE;MACjC,GAAGhC,aAAa;MAChB,GAAGkC,MAAM;MACTJ,OAAO,EAAE;IACX,CAAC,CAAC,EACFI,MAAM,CACP;EACH;EAEAI,UAAU,GAAG;IACX,IAAI,CAAC,IAAI,CAACN,aAAa,EAAE;MACvB,OAAO,IAAI,CAACtB,UAAU,CAAC,IAAI,CAACN,KAAK,CAAC;IACpC;IACA,OAAO,IAAI,CAACM,UAAU,CACpB,IAAI,CAACC,WAAW,CAAC,IAAI,CAACP,KAAK,EAAE,IAAI,CAAC4B,aAAa,CAACM,UAAU,EAAE,CAAC,CAC9D;EACH;AACF;AAAC;AAAA,eAEcpC,wBAAwB;AAAA"} diff --git a/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js b/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js new file mode 100644 index 000000000..608ad7cc6 --- /dev/null +++ b/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.AnimatedExtractCoordinateFromArray = void 0; +var _reactNative = require("react-native"); +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +// see +// https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedWithChildren.js +const AnimatedWithChildren = Object.getPrototypeOf(_reactNative.Animated.ValueXY); +if (__DEV__) { + if (AnimatedWithChildren.name !== 'AnimatedWithChildren') { + console.error('AnimatedCoordinatesArray could not obtain AnimatedWithChildren base class'); + } +} +class AnimatedExtractCoordinateFromArray extends AnimatedWithChildren { + constructor(array, index) { + super(); + _defineProperty(this, "_array", null); + _defineProperty(this, "_index", 0); + this._array = array; + this._index = index; + } + __getValue() { + const actArray = this._array.__getValue(); + let index = this._index; + if (index < 0) { + index += actArray.length; + } + return actArray[index]; + } + __attach() { + this._array.__addChild(this); + } + __detach() { + this._array.__removeChild(this); + super.__detach(); + } +} +exports.AnimatedExtractCoordinateFromArray = AnimatedExtractCoordinateFromArray; +var _default = AnimatedExtractCoordinateFromArray; +exports.default = _default; +//# sourceMappingURL=AnimatedExtractCoordinateFromArray.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js.map b/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js.map new file mode 100644 index 000000000..35ee01e3d --- /dev/null +++ b/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AnimatedWithChildren","Object","getPrototypeOf","Animated","ValueXY","__DEV__","name","console","error","AnimatedExtractCoordinateFromArray","constructor","array","index","_array","_index","__getValue","actArray","length","__attach","__addChild","__detach","__removeChild"],"sourceRoot":"../../../src","sources":["classes/AnimatedExtractCoordinateFromArray.js"],"mappings":";;;;;;AAAA;AAAwC;AAExC;AACA;AACA,MAAMA,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACC,qBAAQ,CAACC,OAAO,CAAC;AACpE,IAAIC,OAAO,EAAE;EACX,IAAIL,oBAAoB,CAACM,IAAI,KAAK,sBAAsB,EAAE;IACxDC,OAAO,CAACC,KAAK,CACX,2EAA2E,CAC5E;EACH;AACF;AAEO,MAAMC,kCAAkC,SAAST,oBAAoB,CAAC;EAK3EU,WAAW,CAACC,KAAK,EAAEC,KAAK,EAAE;IACxB,KAAK,EAAE;IAAC,gCALD,IAAI;IAAA,gCAEJ,CAAC;IAIR,IAAI,CAACC,MAAM,GAAGF,KAAK;IACnB,IAAI,CAACG,MAAM,GAAGF,KAAK;EACrB;EAEAG,UAAU,GAAG;IACX,MAAMC,QAAQ,GAAG,IAAI,CAACH,MAAM,CAACE,UAAU,EAAE;IACzC,IAAIH,KAAK,GAAG,IAAI,CAACE,MAAM;IAEvB,IAAIF,KAAK,GAAG,CAAC,EAAE;MACbA,KAAK,IAAII,QAAQ,CAACC,MAAM;IAC1B;IACA,OAAOD,QAAQ,CAACJ,KAAK,CAAC;EACxB;EAEAM,QAAQ,GAAG;IACT,IAAI,CAACL,MAAM,CAACM,UAAU,CAAC,IAAI,CAAC;EAC9B;EAEAC,QAAQ,GAAG;IACT,IAAI,CAACP,MAAM,CAACQ,aAAa,CAAC,IAAI,CAAC;IAC/B,KAAK,CAACD,QAAQ,EAAE;EAClB;AACF;AAAC;AAAA,eAEcX,kCAAkC;AAAA"} diff --git a/lib/commonjs/classes/AnimatedPoint.js b/lib/commonjs/classes/AnimatedPoint.js new file mode 100644 index 000000000..3fe65bd84 --- /dev/null +++ b/lib/commonjs/classes/AnimatedPoint.js @@ -0,0 +1,117 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.AnimatedPoint = void 0; +var _reactNative = require("react-native"); +// Used react-native-maps as a reference +// https://github.com/react-community/react-native-maps/blob/master/lib/components/AnimatedRegion.js +const AnimatedWithChildren = Object.getPrototypeOf(_reactNative.Animated.ValueXY); +const DEFAULT_COORD = [0, 0]; +const DEFAULT_POINT = { + type: 'Point', + coordinates: DEFAULT_COORD +}; +let uniqueID = 0; +class AnimatedPoint extends AnimatedWithChildren { + constructor() { + let point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_POINT; + super(); + this.longitude = point.coordinates[0] || 0; + this.latitude = point.coordinates[1] || 0; + if (!(this.longitude instanceof _reactNative.Animated.Value)) { + this.longitude = new _reactNative.Animated.Value(this.longitude); + } + if (!(this.latitude instanceof _reactNative.Animated.Value)) { + this.latitude = new _reactNative.Animated.Value(this.latitude); + } + this._listeners = {}; + } + setValue() { + let point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_POINT; + this.longitude.setValue(point.coordinates[0]); + this.latitude.setValue(point.coordinates[1]); + } + setOffset() { + let point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_POINT; + this.longitude.setOffset(point.coordinates[0]); + this.latitude.setOffset(point.coordinates[1]); + } + flattenOffset() { + this.longitude.flattenOffset(); + this.latitude.flattenOffset(); + } + stopAnimation(cb) { + this.longitude.stopAnimation(); + this.latitude.stopAnimation(); + if (typeof cb === 'function') { + cb(this.__getValue()); + } + } + addListener(cb) { + uniqueID += 1; + const id = `${String(uniqueID)}-${String(Date.now())}`; + const completeCB = () => { + if (typeof cb === 'function') { + cb(this.__getValue()); + } + }; + this._listeners[id] = { + longitude: this.longitude.addListener(completeCB), + latitude: this.latitude.addListener(completeCB) + }; + return id; + } + removeListener(id) { + this.longitude.removeListener(this._listeners[id].longitude); + this.latitude.removeListener(this._listeners[id].latitude); + delete this._listeners[id]; + } + spring() { + let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + coordinates: DEFAULT_COORD + }; + return _reactNative.Animated.parallel([_reactNative.Animated.spring(this.longitude, { + ...config, + toValue: config.coordinates[0], + useNativeDriver: false + }), _reactNative.Animated.spring(this.latitude, { + ...config, + toValue: config.coordinates[1], + useNativeDriver: false + })]); + } + timing() { + let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + coordinates: DEFAULT_COORD + }; + return _reactNative.Animated.parallel([_reactNative.Animated.timing(this.longitude, { + ...config, + toValue: config.coordinates[0], + useNativeDriver: false + }), _reactNative.Animated.timing(this.latitude, { + ...config, + toValue: config.coordinates[1], + useNativeDriver: false + })]); + } + __getValue() { + return { + type: 'Point', + coordinates: [this.longitude.__getValue(), this.latitude.__getValue()] + }; + } + __attach() { + this.longitude.__addChild(this); + this.latitude.__addChild(this); + } + __detach() { + this.longitude.__removeChild(this); + this.latitude.__removeChild(this); + } +} +exports.AnimatedPoint = AnimatedPoint; +var _default = AnimatedPoint; +exports.default = _default; +//# sourceMappingURL=AnimatedPoint.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/AnimatedPoint.js.map b/lib/commonjs/classes/AnimatedPoint.js.map new file mode 100644 index 000000000..ba2a542e5 --- /dev/null +++ b/lib/commonjs/classes/AnimatedPoint.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AnimatedWithChildren","Object","getPrototypeOf","Animated","ValueXY","DEFAULT_COORD","DEFAULT_POINT","type","coordinates","uniqueID","AnimatedPoint","constructor","point","longitude","latitude","Value","_listeners","setValue","setOffset","flattenOffset","stopAnimation","cb","__getValue","addListener","id","String","Date","now","completeCB","removeListener","spring","config","parallel","toValue","useNativeDriver","timing","__attach","__addChild","__detach","__removeChild"],"sourceRoot":"../../../src","sources":["classes/AnimatedPoint.js"],"mappings":";;;;;;AAAA;AAEA;AACA;AACA,MAAMA,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACC,qBAAQ,CAACC,OAAO,CAAC;AAEpE,MAAMC,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5B,MAAMC,aAAa,GAAG;EAAEC,IAAI,EAAE,OAAO;EAAEC,WAAW,EAAEH;AAAc,CAAC;AAEnE,IAAII,QAAQ,GAAG,CAAC;AAET,MAAMC,aAAa,SAASV,oBAAoB,CAAC;EACtDW,WAAW,GAAwB;IAAA,IAAvBC,KAAK,uEAAGN,aAAa;IAC/B,KAAK,EAAE;IAEP,IAAI,CAACO,SAAS,GAAGD,KAAK,CAACJ,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,IAAI,CAACM,QAAQ,GAAGF,KAAK,CAACJ,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzC,IAAI,EAAE,IAAI,CAACK,SAAS,YAAYV,qBAAQ,CAACY,KAAK,CAAC,EAAE;MAC/C,IAAI,CAACF,SAAS,GAAG,IAAIV,qBAAQ,CAACY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W,EAAEH;IAAc,CAAC;IAC5C,OAAOF,qBAAQ,CAAC6B,QAAQ,CAAC,CACvB7B,qBAAQ,CAACgC,MAAM,CAAC,IAAI,CAACtB,SAAS,EAAE;MAC9B,GAAGkB,MAAM;MACTE,OAAO,EAAEF,MAAM,CAACvB,WAAW,CAAC,CAAC,CAAC;MAC9B0B,eAAe,EAAE;IACnB,CAAC,CAAC,EACF/B,qBAAQ,CAACgC,MAAM,CAAC,IAAI,CAACrB,QAAQ,EAAE;MAC7B,GAAGiB,MAAM;MACTE,OAAO,EAAEF,MAAM,CAACvB,WAAW,CAAC,CAAC,CAAC;MAC9B0B,eAAe,EAAE;IACnB,CAAC,CAAC,CACH,CAAC;EACJ;EAEAZ,UAAU,GAAG;IACX,OAAO;MACLf,IAAI,EAAE,OAAO;MACbC,WAAW,EAAE,CAAC,IAAI,CAACK,SAAS,CAACS,UAAU,EAAE,EAAE,IAAI,CAACR,QAAQ,CAACQ,UAAU,EAAE;IACvE,CAAC;EACH;EAEAc,QAAQ,GAAG;IACT,IAAI,CAACvB,SAAS,CAACwB,UAAU,CAAC,IAAI,CAAC;IAC/B,IAAI,CAACvB,QAAQ,CAACuB,UAAU,CAAC,IAAI,CAAC;EAChC;EAEAC,QAAQ,GAAG;IACT,IAAI,CAACzB,SAAS,CAAC0B,aAAa,CAAC,IAAI,CAAC;IAClC,IAAI,CAACzB,QAAQ,CAACyB,aAAa,CAAC,IAAI,CAAC;EACnC;AACF;AAAC;AAAA,eAEc7B,aAAa;AAAA"} diff --git a/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js b/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js new file mode 100644 index 000000000..99116cbc0 --- /dev/null +++ b/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js @@ -0,0 +1,155 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.AnimatedRouteCoordinatesArray = void 0; +var _helpers = require("@turf/helpers"); +var _distance = _interopRequireDefault(require("@turf/distance")); +var _nearestPointOnLine = _interopRequireDefault(require("@turf/nearest-point-on-line")); +var _length = _interopRequireDefault(require("@turf/length")); +var _AnimatedCoordinatesArray = _interopRequireDefault(require("./AnimatedCoordinatesArray")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const convertLength = _helpers.convertLength || _helpers.convertDistance; + +/** + * AnimatedRoutesCoordinatesArray - animates along route. + * By default start of route is start, and end of route animated from 100% of route to 0% or route. + * Eg we have full route to destination and as we're progressing the remaining route gets shorter and shorter. + */ +class AnimatedRouteCoordinatesArray extends _AnimatedCoordinatesArray.default { + /** + * Calculate initial state + * + * @param {*} args - to value from animate + * @param {{end?: {from?: number}}} options - options, example + * @returns {object} - the state object + */ + onInitialState(coordinatesArray) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let end = { + from: 0 + }; + if (options && options.end) { + end = options.end; + } + return { + fullRoute: coordinatesArray.map(coord => [coord[0], coord[1]]), + end + }; + } + + /** + * Calculate value from state. + * + * @param {object} state - either state from initialState and/or from calculate + * @returns {object} + */ + onGetValue(state) { + return state.actRoute || state.fullRoute; + } + + /** + * Calculates state based on startingState and progress, returns a new state + * + * @param {object} state - state object from initialState and/or from calculate + * @param {number} progress - value between 0 and 1 + * @returns {object} next state + */ + onCalculate(state, progress) { + const { + fullRoute, + end + } = state; + const currentEnd = end.from * (1.0 - progress) + progress * end.to; + let prevsum = 0; + let actsum = 0; + let i = fullRoute.length - 1; + while (actsum < currentEnd && i > 0) { + prevsum = actsum; + actsum += (0, _distance.default)((0, _helpers.point)(fullRoute[i]), (0, _helpers.point)(fullRoute[i - 1]), this.distconf); + i -= 1; + } + if (actsum <= currentEnd) { + const actRoute = [...fullRoute.slice(0, i + 1)]; + const minLineStringElements = 2; + if (actRoute.length < minLineStringElements) { + actRoute.push(actRoute[0]); + } + return { + fullRoute, + end: { + ...end, + current: currentEnd + }, + actRoute + }; + } + const r = (currentEnd - prevsum) / (actsum - prevsum); + const or = 1.0 - r; + + // console.log("i", i+1); + const actRoute = [...fullRoute.slice(0, i + 1), [fullRoute[i][0] * r + fullRoute[i + 1][0] * or, fullRoute[i][1] * r + fullRoute[i + 1][1] * or]]; + return { + fullRoute, + end: { + ...end, + current: currentEnd + }, + actRoute + }; + } + + /** + * Subclasses can override to start a new animation + * + * @param {*} toValue - to value from animate + * @param {*} actCoords - the current coordinates array to start from + * @returns {object} The state + */ + onStart(state, toValue) { + const { + fullRoute, + end + } = state; + let toDist; + if (!toValue.end) { + console.error('RouteCoordinatesArray: toValue should have end with either along or point'); + } + if (toValue.end.along != null) { + const { + units + } = toValue; + const ls = (0, _helpers.lineString)(fullRoute); + toDist = convertLength(toValue.end.along, units); + toDist = (0, _length.default)(ls) - toDist; + } + if (toDist != null) { + if (toValue.end.point) { + console.warn('RouteCoordinatesArray: toValue.end: has both along and point, point is ignored'); + } + } else if (toValue.end.point) { + const ls = (0, _helpers.lineString)(fullRoute); + const nearest = (0, _nearestPointOnLine.default)(ls, toValue.end.point); + toDist = (0, _length.default)(ls) - nearest.properties.location; + } else { + console.warn('RouteCoordinatesArray: toValue.end: should have either along or point'); + } + const result = { + fullRoute, + end: { + ...end, + from: end.current != null ? end.current : end.from, + to: toDist + } + }; + return result; + } + get originalRoute() { + return this.state.fullRoute; + } +} +exports.AnimatedRouteCoordinatesArray = AnimatedRouteCoordinatesArray; +var _default = AnimatedRouteCoordinatesArray; +exports.default = _default; +//# sourceMappingURL=AnimatedRouteCoordinatesArray.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js.map b/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js.map new file mode 100644 index 000000000..eb79c3fd7 --- /dev/null +++ b/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["convertLength","convertLengthFn","convertDistanceFn","AnimatedRouteCoordinatesArray","AnimatedCoordinatesArray","onInitialState","coordinatesArray","options","end","from","fullRoute","map","coord","onGetValue","state","actRoute","onCalculate","progress","currentEnd","to","prevsum","actsum","i","length","distance","point","distconf","slice","minLineStringElements","push","current","r","or","onStart","toValue","toDist","console","error","along","units","ls","lineString","warn","nearest","nearestPointOnLine","properties","location","result","originalRoute"],"sourceRoot":"../../../src","sources":["classes/AnimatedRouteCoordinatesArray.js"],"mappings":";;;;;;AAAA;AAMA;AACA;AACA;AAEA;AAAkE;AAElE,MAAMA,aAAa,GAAGC,sBAAe,IAAIC,wBAAiB;;AAE1D;AACA;AACA;AACA;AACA;AACO,MAAMC,6BAA6B,SAASC,iCAAwB,CAAC;EAC1E;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,cAAc,CAACC,gBAAgB,EAAkB;IAAA,IAAhBC,OAAO,uEAAG,IAAI;IAC7C,IAAIC,GAAG,GAAG;MAAEC,IAAI,EAAE;IAAE,CAAC;IACrB,IAAIF,OAAO,IAAIA,OAAO,CAACC,GAAG,EAAE;MAC1BA,GAAG,GAAGD,OAAO,CAACC,GAAG;IACnB;IACA,OAAO;MACLE,SAAS,EAAEJ,gBAAgB,CAACK,GAAG,CAAEC,KAAK,IAAK,CAACA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;MAChEJ;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEK,UAAU,CAACC,KAAK,EAAE;IAChB,OAAOA,KAAK,CAACC,QAAQ,IAAID,KAAK,CAACJ,SAAS;EAC1C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEM,WAAW,CAACF,KAAK,EAAEG,QAAQ,EAAE;IAC3B,MAAM;MAAEP,SAAS;MAAEF;IAAI,CAAC,GAAGM,KAAK;IAChC,MAAMI,UAAU,GAAGV,GAAG,CAACC,IAAI,IAAI,GAAG,GAAGQ,QAAQ,CAAC,GAAGA,QAAQ,GAAGT,GAAG,CAACW,EAAE;IAElE,IAAIC,OAAO,GAAG,CAAC;IACf,IAAIC,MAA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iB,EAAE,CAAC,GAAGG,OAAO,CAACE,UAAU,CAACC,QAAQ;IACnD,CAAC,MAAM;MACLV,OAAO,CAACM,IAAI,CACV,uEAAuE,CACxE;IACH;IAEA,MAAMK,MAAM,GAAG;MACbrC,SAAS;MACTF,GAAG,EAAE;QACH,GAAGA,GAAG;QACNC,IAAI,EAAED,GAAG,CAACsB,OAAO,IAAI,IAAI,GAAGtB,GAAG,CAACsB,OAAO,GAAGtB,GAAG,CAACC,IAAI;QAClDU,EAAE,EAAEgB;MACN;IACF,CAAC;IACD,OAAOY,MAAM;EACf;EAEA,IAAIC,aAAa,GAAG;IAClB,OAAO,IAAI,CAAClC,KAAK,CAACJ,SAAS;EAC7B;AACF;AAAC;AAAA,eAEcP,6BAA6B;AAAA"} diff --git a/lib/commonjs/classes/AnimatedShape.js b/lib/commonjs/classes/AnimatedShape.js new file mode 100644 index 000000000..a10a0f2db --- /dev/null +++ b/lib/commonjs/classes/AnimatedShape.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.AnimatedShape = void 0; +var _reactNative = require("react-native"); +// see +// https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedWithChildren.js +const AnimatedWithChildren = Object.getPrototypeOf(_reactNative.Animated.ValueXY); +if (__DEV__) { + if (AnimatedWithChildren.name !== 'AnimatedWithChildren') { + console.error('AnimatedShape could not obtain AnimatedWithChildren base class'); + } +} + +/** + * AnimatedShape can be used to display an animated LineString, FeatureCollection, Point, or other struture inside the shape property. + * @example + * const animatedLon = useRef(new Animated.Value(-73.984638)).current; + * const animatedLat = useRef(new Animated.Value(40.759211)).current; + * const animatedShape = new AnimatedShape({ + * type: 'LineString', + * coordinates: [animatedLon, animatedLat], + * }); + * return + */ +class AnimatedShape extends AnimatedWithChildren { + // equivalent of AnimatedStyle for shapes + // https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedStyle.js + + constructor(shape) { + super(); + this.shape = shape; + } + _walkShapeAndGetValues(value) { + if (Array.isArray(value)) { + return value.map(i => this._walkShapeAndGetValues(i)); + } + if (value instanceof _reactNative.Animated.Node) { + return value.__getValue(); + } + if (typeof value === 'object') { + const result = {}; + for (const key in value) { + result[key] = this._walkShapeAndGetValues(value[key]); + } + return result; + } + return value; + } + __getValue() { + const result = this._walkShapeAndGetValues(this.shape); + return result; + } + _walkAndProcess(value, cb) { + if (Array.isArray(value)) { + value.forEach(i => this._walkAndProcess(i, cb)); + } else if (value instanceof _reactNative.Animated.Node) { + cb(value); + } else if (typeof value === 'object') { + for (const key in value) { + this._walkAndProcess(value[key], cb); + } + } + } + __attach() { + this._walkAndProcess(this.shape, v => v.__addChild(this)); + } + __detach() { + this._walkAndProcess(this.shape, v => v.__removeChild(this)); + super.__detach(); + } +} +exports.AnimatedShape = AnimatedShape; +var _default = AnimatedShape; +exports.default = _default; +//# sourceMappingURL=AnimatedShape.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/AnimatedShape.js.map b/lib/commonjs/classes/AnimatedShape.js.map new file mode 100644 index 000000000..90a4d5df5 --- /dev/null +++ b/lib/commonjs/classes/AnimatedShape.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AnimatedWithChildren","Object","getPrototypeOf","Animated","ValueXY","__DEV__","name","console","error","AnimatedShape","constructor","shape","_walkShapeAndGetValues","value","Array","isArray","map","i","Node","__getValue","result","key","_walkAndProcess","cb","forEach","__attach","v","__addChild","__detach","__removeChild"],"sourceRoot":"../../../src","sources":["classes/AnimatedShape.js"],"mappings":";;;;;;AAAA;AAEA;AACA;AACA,MAAMA,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACC,qBAAQ,CAACC,OAAO,CAAC;AACpE,IAAIC,OAAO,EAAE;EACX,IAAIL,oBAAoB,CAACM,IAAI,KAAK,sBAAsB,EAAE;IACxDC,OAAO,CAACC,KAAK,CACX,gEAAgE,CACjE;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA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EAAE;QACvB,IAAI,CAACS,eAAe,CAACT,KAAK,CAACQ,GAAG,CAAC,EAAEE,EAAE,CAAC;MACtC;IACF;EACF;EAEAE,QAAQ,GAAG;IACT,IAAI,CAACH,eAAe,CAAC,IAAI,CAACX,KAAK,EAAGe,CAAC,IAAKA,CAAC,CAACC,UAAU,CAAC,IAAI,CAAC,CAAC;EAC7D;EAEAC,QAAQ,GAAG;IACT,IAAI,CAACN,eAAe,CAAC,IAAI,CAACX,KAAK,EAAGe,CAAC,IAAKA,CAAC,CAACG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC9D,KAAK,CAACD,QAAQ,EAAE;EAClB;AACF;AAAC;AAAA,eAEcnB,aAAa;AAAA"} diff --git a/lib/commonjs/classes/index.d.js b/lib/commonjs/classes/index.d.js new file mode 100644 index 000000000..532c3ec5a --- /dev/null +++ b/lib/commonjs/classes/index.d.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AnimatedShape = exports.AnimatedRouteCoordinatesArray = exports.AnimatedPoint = exports.AnimatedExtractCoordinateFromArray = exports.AnimatedCoordinatesArray = void 0; +var WithAnimatedObject = Animated.WithAnimatedObject; +class AnimatedCoordinatesArray {} +exports.AnimatedCoordinatesArray = AnimatedCoordinatesArray; +class AnimatedExtractCoordinateFromArray {} +exports.AnimatedExtractCoordinateFromArray = AnimatedExtractCoordinateFromArray; +class AnimatedPoint {} +exports.AnimatedPoint = AnimatedPoint; +class AnimatedRouteCoordinatesArray {} +exports.AnimatedRouteCoordinatesArray = AnimatedRouteCoordinatesArray; +class AnimatedShape {} +exports.AnimatedShape = AnimatedShape; +//# sourceMappingURL=index.d.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/index.d.js.map b/lib/commonjs/classes/index.d.js.map new file mode 100644 index 000000000..a0f9fca7f --- /dev/null +++ b/lib/commonjs/classes/index.d.js.map @@ -0,0 +1 @@ +{"version":3,"names":["WithAnimatedObject","Animated","AnimatedCoordinatesArray","AnimatedExtractCoordinateFromArray","AnimatedPoint","AnimatedRouteCoordinatesArray","AnimatedShape"],"sourceRoot":"../../../src","sources":["classes/index.d.ts"],"mappings":";;;;;;IAGOA,kBAAkB,GAAGC,QAAQ,CAACD,kBAAkB;AAEhD,MAAME,wBAAwB,CAAC;AAAE;AACjC,MAAMC,kCAAkC,CAAC;AAAE;AAC3C,MAAMC,aAAa,CAAsC;AAc/D;AACM,MAAMC,6BAA6B,CAAC;AAAE;AACtC,MAAMC,aAAa,CAAC;AAAE"} diff --git a/lib/commonjs/classes/index.js b/lib/commonjs/classes/index.js new file mode 100644 index 000000000..36e2594dc --- /dev/null +++ b/lib/commonjs/classes/index.js @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _AnimatedCoordinatesArray = require("./AnimatedCoordinatesArray"); +Object.keys(_AnimatedCoordinatesArray).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _AnimatedCoordinatesArray[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _AnimatedCoordinatesArray[key]; + } + }); +}); +var _AnimatedExtractCoordinateFromArray = require("./AnimatedExtractCoordinateFromArray"); +Object.keys(_AnimatedExtractCoordinateFromArray).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _AnimatedExtractCoordinateFromArray[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _AnimatedExtractCoordinateFromArray[key]; + } + }); +}); +var _AnimatedPoint = require("./AnimatedPoint"); +Object.keys(_AnimatedPoint).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _AnimatedPoint[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _AnimatedPoint[key]; + } + }); +}); +var _AnimatedRouteCoordinatesArray = require("./AnimatedRouteCoordinatesArray"); +Object.keys(_AnimatedRouteCoordinatesArray).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _AnimatedRouteCoordinatesArray[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _AnimatedRouteCoordinatesArray[key]; + } + }); +}); +var _AnimatedShape = require("./AnimatedShape"); +Object.keys(_AnimatedShape).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _AnimatedShape[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _AnimatedShape[key]; + } + }); +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/commonjs/classes/index.js.map b/lib/commonjs/classes/index.js.map new file mode 100644 index 000000000..1caa280bf --- /dev/null +++ b/lib/commonjs/classes/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["classes/index.js"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"} diff --git a/lib/commonjs/components/AbstractLayer.js b/lib/commonjs/components/AbstractLayer.js new file mode 100644 index 000000000..29c94fae7 --- /dev/null +++ b/lib/commonjs/components/AbstractLayer.js @@ -0,0 +1,62 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _filterUtils = require("../utils/filterUtils"); +var _StyleValue = require("../utils/StyleValue"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +class AbstractLayer extends _react.default.PureComponent { + constructor() { + super(...arguments); + _defineProperty(this, "nativeLayer", null); + _defineProperty(this, "setNativeLayer", instance => { + this.nativeLayer = instance; + }); + } + get baseProps() { + return { + ...this.props, + id: this.props.id, + existing: this.props.existing, + sourceID: this.props.sourceID, + reactStyle: this.getStyle(this.props.style), + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + aboveLayerID: this.props.aboveLayerID, + belowLayerID: this.props.belowLayerID, + layerIndex: this.props.layerIndex, + filter: (0, _filterUtils.getFilter)(this.props.filter), + style: undefined + }; + } + getStyleTypeFormatter(styleType) { + if (styleType === 'color') { + return _reactNative.processColor; + } + return undefined; + } + getStyle(style) { + return (0, _StyleValue.transformStyle)(style); + } + setNativeProps(props) { + if (this.nativeLayer) { + var _this$nativeLayer; + let propsToPass = props; + if (props.style) { + propsToPass = { + ...props, + reactStyle: this.getStyle(props.style) + }; + } + (_this$nativeLayer = this.nativeLayer) === null || _this$nativeLayer === void 0 ? void 0 : _this$nativeLayer.setNativeProps(propsToPass); + } + } +} +var _default = AbstractLayer; +exports.default = _default; +//# sourceMappingURL=AbstractLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/AbstractLayer.js.map b/lib/commonjs/components/AbstractLayer.js.map new file mode 100644 index 000000000..9aa7b06c1 --- /dev/null +++ b/lib/commonjs/components/AbstractLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AbstractLayer","React","PureComponent","instance","nativeLayer","baseProps","props","id","existing","sourceID","reactStyle","getStyle","style","minZoomLevel","maxZoomLevel","aboveLayerID","belowLayerID","layerIndex","filter","getFilter","undefined","getStyleTypeFormatter","styleType","processColor","transformStyle","setNativeProps","propsToPass"],"sourceRoot":"../../../src","sources":["components/AbstractLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AAEA;AAAiE;AAAA;AAgBjE,MAAMA,aAAa,SAGTC,cAAK,CAACC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KAAK,CAACM,KAAK;QACvC,CAAC;MACH;MACA,yBAAI,CAACR,WAAW,sDAAhB,kBAAkBqB,cAAc,CAACC,WAAW,CAAC;IAC/C;EACF;AACF;AAAC,eAEc1B,aAAa;AAAA"} diff --git a/lib/commonjs/components/AbstractSource.js b/lib/commonjs/components/AbstractSource.js new file mode 100644 index 000000000..f0add5719 --- /dev/null +++ b/lib/commonjs/components/AbstractSource.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +class AbstractSource extends _react.default.PureComponent { + constructor() { + super(...arguments); + _defineProperty(this, "setNativeRef", instance => { + this._nativeRef = instance; + }); + } + setNativeProps(props) { + if (this._nativeRef) { + this._nativeRef.setNativeProps(props); + } + } +} +var _default = AbstractSource; +exports.default = _default; +//# sourceMappingURL=AbstractSource.js.map \ No newline at end of file diff --git a/lib/commonjs/components/AbstractSource.js.map b/lib/commonjs/components/AbstractSource.js.map new file mode 100644 index 000000000..399b67355 --- /dev/null +++ b/lib/commonjs/components/AbstractSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["AbstractSource","React","PureComponent","instance","_nativeRef","setNativeProps","props"],"sourceRoot":"../../../src","sources":["components/AbstractSource.tsx"],"mappings":";;;;;;AAAA;AAA0B;AAAA;AAK1B,MAAMA,cAAc,SAGVC,cAAK,CAACC,aAAa,CAAwB;EAAA;IAAA;IAAA,sCAWtCC,QAAQ,IAAK;MACxB,IAAI,CAACC,UAAU,GAAGD,QAAQ;IAC5B,CAAC;EAAA;EAVDE,cAAc,CAACC,KAAsB,EAAE;IACrC,IAAI,IAAI,CAACF,UAAU,EAAE;MACnB,IAAI,CAACA,UAAU,CAACC,cAAc,CAACC,KAAK,CAAC;IACvC;EACF;AAOF;AAAC,eAEcN,cAAc;AAAA"} diff --git a/lib/commonjs/components/Annotation.js b/lib/commonjs/components/Annotation.js new file mode 100644 index 000000000..344b14f63 --- /dev/null +++ b/lib/commonjs/components/Annotation.js @@ -0,0 +1,101 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _Animated = _interopRequireDefault(require("../utils/animated/Animated")); +var _classes = require("../classes"); +var _SymbolLayer = require("./SymbolLayer"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +class Annotation extends _react.default.Component { + constructor(props) { + super(props); + const shape = this._getShapeFromProps(props); + this.state = { + shape: props.animated ? new _classes.AnimatedPoint(shape) : shape + }; + this.onPress = this.onPress.bind(this); + } + componentDidUpdate(prevProps) { + if (!Array.isArray(this.props.coordinates)) { + this.setState({ + shape: null + }); + return; + } + const haveCoordinatesChanged = prevProps.coordinates[0] !== this.props.coordinates[0] || prevProps.coordinates[1] !== this.props.coordinates[1]; + if (prevProps.animated !== this.props.animated || haveCoordinatesChanged && (!this.state.shape || !this.props.animated)) { + const shape = this._getShapeFromProps(this.props); + this.setState({ + shape: this.props.animated ? new _classes.AnimatedPoint(shape) : shape + }); + } else if (haveCoordinatesChanged && this.props.animated && this.state.shape) { + // flush current animations + this.state.shape.stopAnimation(); + this.state.shape.timing({ + coordinates: this.props.coordinates, + easing: this.props.animationEasingFunction, + duration: this.props.animationDuration + }).start(); + } + } + onPress(event) { + if (this.props.onPress) { + this.props.onPress(event); + } + } + _getShapeFromProps() { + var _props$coordinates, _props$coordinates2; + let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const lng = ((_props$coordinates = props.coordinates) === null || _props$coordinates === void 0 ? void 0 : _props$coordinates[0]) || 0; + const lat = ((_props$coordinates2 = props.coordinates) === null || _props$coordinates2 === void 0 ? void 0 : _props$coordinates2[1]) || 0; + return { + type: 'Point', + coordinates: [lng, lat] + }; + } + get symbolStyle() { + if (!this.props.icon) { + return undefined; + } + return Object.assign({}, this.props.style, { + iconImage: this.props.icon + }); + } + render() { + if (!this.props.coordinates) { + return null; + } + const children = []; + if (this.symbolStyle) { + children.push( /*#__PURE__*/_react.default.createElement(_SymbolLayer.SymbolLayer, { + id: `${this.props.id}-symbol`, + style: this.symbolStyle + })); + } + if (this.props.children) { + if (Array.isArray(this.props.children)) { + children.push(...this.props.children); + } else { + children.push(this.props.children); + } + } + return /*#__PURE__*/_react.default.createElement(_Animated.default.ShapeSource, { + id: this.props.id, + onPress: this.onPress, + shape: this.state.shape + }, children); + } +} +_defineProperty(Annotation, "defaultProps", { + animated: false, + animationDuration: 1000, + animationEasingFunction: _reactNative.Easing.linear +}); +var _default = Annotation; +exports.default = _default; +//# sourceMappingURL=Annotation.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Annotation.js.map b/lib/commonjs/components/Annotation.js.map new file mode 100644 index 000000000..dc9fa8ad4 --- /dev/null +++ b/lib/commonjs/components/Annotation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Annotation","React","Component","constructor","props","shape","_getShapeFromProps","state","animated","AnimatedPoint","onPress","bind","componentDidUpdate","prevProps","Array","isArray","coordinates","setState","haveCoordinatesChanged","stopAnimation","timing","easing","animationEasingFunction","duration","animationDuration","start","event","lng","lat","type","symbolStyle","icon","undefined","Object","assign","style","iconImage","render","children","push","id","Easing","linear"],"sourceRoot":"../../../src","sources":["components/Annotation.tsx"],"mappings":";;;;;;AAAA;AACA;AAGA;AACA;AAIA;AAA4C;AAAA;AAkB5C,MAAMA,UAAU,SAASC,cAAK,CAACC,SAAS,CAAyB;EAO/DC,WAAW,CAACC,KAAY,EAAE;IACxB,KAAK,CAACA,KAAK,CAAC;IAEZ,MAAMC,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AW,EAAE;MACpBQ,QAAQ,CAACC,IAAI,eACX,6BAAC,wBAAW;QACV,EAAE,EAAG,GAAE,IAAI,CAACnC,KAAK,CAACoC,EAAG,SAAS;QAC9B,KAAK,EAAE,IAAI,CAACV;MAAgC,EAC5C,CACH;IACH;IAEA,IAAI,IAAI,CAAC1B,KAAK,CAACkC,QAAQ,EAAE;MACvB,IAAIxB,KAAK,CAACC,OAAO,CAAC,IAAI,CAACX,KAAK,CAACkC,QAAQ,CAAC,EAAE;QACtCA,QAAQ,CAACC,IAAI,CAAC,GAAG,IAAI,CAACnC,KAAK,CAACkC,QAAQ,CAAC;MACvC,CAAC,MAAM;QACLA,QAAQ,CAACC,IAAI,CAAC,IAAI,CAACnC,KAAK,CAACkC,QAAQ,CAAC;MACpC;IACF;IAEA,oBACE,6BAAC,iBAAQ,CAAC,WAAW;MACnB,EAAE,EAAE,IAAI,CAAClC,KAAK,CAACoC,EAAG;MAClB,OAAO,EAAE,IAAI,CAAC9B,OAAQ;MACtB,KAAK,EAAE,IAAI,CAACH,KAAK,CAACF;IAA8C,GAE/DiC,QAAQ,CACY;EAE3B;AACF;AAAC,gBA/GKtC,UAAU,kBACQ;EACpBQ,QAAQ,EAAE,KAAK;EACfgB,iBAAiB,EAAE,IAAI;EACvBF,uBAAuB,EAAEmB,mBAAM,CAACC;AAClC,CAAC;AAAA,eA4GY1C,UAAU;AAAA"} diff --git a/lib/commonjs/components/Atmosphere.js b/lib/commonjs/components/Atmosphere.js new file mode 100644 index 000000000..6e5cc65cd --- /dev/null +++ b/lib/commonjs/components/Atmosphere.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Atmosphere = void 0; +var _react = _interopRequireWildcard(require("react")); +var _StyleValue = require("../utils/StyleValue"); +var _RNMBXAtmosphereNativeComponent = _interopRequireDefault(require("../specs/RNMBXAtmosphereNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const Atmosphere = /*#__PURE__*/(0, _react.memo)(props => { + const baseProps = (0, _react.useMemo)(() => { + return { + ...props, + reactStyle: (0, _StyleValue.transformStyle)(props.style), + style: undefined + }; + }, [props]); + return /*#__PURE__*/_react.default.createElement(_RNMBXAtmosphereNativeComponent.default, baseProps); +}); +exports.Atmosphere = Atmosphere; +//# sourceMappingURL=Atmosphere.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Atmosphere.js.map b/lib/commonjs/components/Atmosphere.js.map new file mode 100644 index 000000000..e0b564389 --- /dev/null +++ b/lib/commonjs/components/Atmosphere.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Atmosphere","memo","props","baseProps","useMemo","reactStyle","transformStyle","style","undefined"],"sourceRoot":"../../../src","sources":["components/Atmosphere.tsx"],"mappings":";;;;;;AAAA;AAGA;AAEA;AAAqF;AAAA;AAAA;AAM9E,MAAMA,UAAU,gBAAG,IAAAC,WAAI,EAAEC,KAAY,IAAK;EAC/C,MAAMC,SAAS,GAAG,IAAAC,cAAO,EAAC,MAAM;IAC9B,OAAO;MACL,GAAGF,KAAK;MACRG,UAAU,EAAE,IAAAC,0BAAc,EAACJ,KAAK,CAACK,KAAK,CAAC;MACvCA,KAAK,EAAEC;IACT,CAAC;EACH,CAAC,EAAE,CAACN,KAAK,CAAC,CAAC;EAEX,oBAAO,6BAAC,uCAA8B,EAAKC,SAAS,CAAI;AAC1D,CAAC,CAAC;AAAC"} diff --git a/lib/commonjs/components/BackgroundLayer.js b/lib/commonjs/components/BackgroundLayer.js new file mode 100644 index 000000000..212032059 --- /dev/null +++ b/lib/commonjs/components/BackgroundLayer.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXBackgroundLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXBackgroundLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +class BackgroundLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return /*#__PURE__*/_react.default.createElement(_RNMBXBackgroundLayerNativeComponent.default + // @ts-expect-error just codegen stuff + , _extends({ + ref: this.setNativeLayer + }, props)); + } +} +_defineProperty(BackgroundLayer, "defaultProps", { + sourceID: MapboxGL.StyleSource.DefaultSourceID +}); +var _default = BackgroundLayer; +exports.default = _default; +//# sourceMappingURL=BackgroundLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/BackgroundLayer.js.map b/lib/commonjs/components/BackgroundLayer.js.map new file mode 100644 index 000000000..3232dec82 --- /dev/null +++ b/lib/commonjs/components/BackgroundLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","BackgroundLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/BackgroundLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAOA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,QAAQ,GAAGC,0BAAa,CAACC,WAAW;AAiE1C,MAAMC,eAAe,SAASC,sBAAa,CAAyB;EAKlEC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD,oBACE,6BAAC;IACC;IAAA;MACA,GAAG,EAAE,IAAI,CAACC;IAAe,GACrBH,KAAK,EACT;EAEN;AACF;AAAC,gBAlBKH,eAAe,kBACG;EACpBO,QAAQ,EAAEV,QAAQ,CAACW,WAAW,CAACC;AACjC,CAAC;AAAA,eAiBYT,eAAe;AAAA"} diff --git a/lib/commonjs/components/Callout.js b/lib/commonjs/components/Callout.js new file mode 100644 index 000000000..8f4589be6 --- /dev/null +++ b/lib/commonjs/components/Callout.js @@ -0,0 +1,90 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXCalloutNativeComponent = _interopRequireDefault(require("../specs/RNMBXCalloutNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +const styles = _reactNative.StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'center', + width: 180, + zIndex: 9999999 + }, + tip: { + zIndex: 1000, + marginTop: -2, + elevation: 0, + backgroundColor: 'transparent', + borderTopWidth: 16, + borderRightWidth: 8, + borderBottomWidth: 0, + borderLeftWidth: 8, + borderTopColor: 'white', + borderRightColor: 'transparent', + borderBottomColor: 'transparent', + borderLeftColor: 'transparent' + }, + content: { + position: 'relative', + padding: 8, + flex: 1, + borderRadius: 3, + borderWidth: 1, + borderColor: 'rgba(0, 0, 0, 0.2)', + backgroundColor: 'white' + }, + title: { + color: 'black', + textAlign: 'center' + } +}); +/** + * Callout that displays information about a selected annotation near the annotation. + */ +class Callout extends _react.default.PureComponent { + get _containerStyle() { + const style = [{ + position: 'absolute', + zIndex: 999, + backgroundColor: 'transparent' + }]; + if (this.props.containerStyle) { + style.push(this.props.containerStyle); + } + return style; + } + get _hasChildren() { + return _react.default.Children.count(this.props.children) > 0; + } + _renderDefaultCallout() { + return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, { + style: [styles.container, this.props.style] + }, /*#__PURE__*/_react.default.createElement(_reactNative.View, { + style: [styles.content, this.props.contentStyle] + }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, { + style: [styles.title, this.props.textStyle] + }, this.props.title)), /*#__PURE__*/_react.default.createElement(_reactNative.View, { + style: [styles.tip, this.props.tipStyle] + })); + } + _renderCustomCallout() { + return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, _extends({}, this.props, { + style: this.props.style + }), this.props.children); + } + render() { + const calloutContent = this._hasChildren ? this._renderCustomCallout() : this._renderDefaultCallout(); + return /*#__PURE__*/_react.default.createElement(_RNMBXCalloutNativeComponent.default, { + style: this._containerStyle + }, calloutContent); + } +} +var _default = Callout; +exports.default = _default; +//# sourceMappingURL=Callout.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Callout.js.map b/lib/commonjs/components/Callout.js.map new file mode 100644 index 000000000..5222985b3 --- /dev/null +++ b/lib/commonjs/components/Callout.js.map @@ -0,0 +1 @@ +{"version":3,"names":["styles","StyleSheet","create","container","alignItems","justifyContent","width","zIndex","tip","marginTop","elevation","backgroundColor","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","content","position","padding","flex","borderRadius","borderWidth","borderColor","title","color","textAlign","Callout","React","PureComponent","_containerStyle","style","props","containerStyle","push","_hasChildren","Children","count","children","_renderDefaultCallout","contentStyle","textStyle","tipStyle","_renderCustomCallout","render","calloutContent"],"sourceRoot":"../../../src","sources":["components/Callout.tsx"],"mappings":";;;;;;AAAA;AACA;AASA;AAA+E;AAAA;AAE/E,MAAMA,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHD,MAAM,EAAE,IAAI;IACZE,SAAS,EAAE,CAAC,CAAC;IACbC,SAAS,EAAE,CAAC;IACZC,eAAe,EAAE,aAAa;IAC9BC,cAAc,EAAE,EAAE;IAClBC,gBAAgB,EAAE,CAAC;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,eAAe,EAAE,CAAC;IAClBC,cAAc,EAAE,OAAO;IACvBC,gBAAgB,EAAE,aAAa;IAC/BC,iBAAiB,EAAE,aAAa;IAChCC,eAAe,EAAE;EACnB,CAAC;EACDC,OAAO,EAAE;IACPC,QAAQ,EAAE,UAAU;IACpBC,OAAO,EAAE,CAAC;IACVC,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,oBAAoB;IACjCf,eAAe,EAAE;EACnB,CAAC;EACDgB,KAAK,EAAE;IACLC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D,IAAI,CAACC,KAAK,CAACM,QAAQ,CACN;EAEpB;EAEAM,MAAM,GAAG;IACP,MAAMC,cAAc,GAAG,IAAI,CAACV,YAAY,GACpC,IAAI,CAACQ,oBAAoB,EAAE,GAC3B,IAAI,CAACJ,qBAAqB,EAAE;IAChC,oBACE,6BAAC,oCAA2B;MAAC,KAAK,EAAE,IAAI,CAACT;IAAgB,GACtDe,cAAc,CACa;EAElC;AACF;AAAC,eAEclB,OAAO;AAAA"} diff --git a/lib/commonjs/components/Camera.js b/lib/commonjs/components/Camera.js new file mode 100644 index 000000000..dd7a2e9b2 --- /dev/null +++ b/lib/commonjs/components/Camera.js @@ -0,0 +1,369 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.UserTrackingMode = exports.Camera = void 0; +var _react = _interopRequireWildcard(require("react")); +var _reactNative = require("react-native"); +var _geoUtils = require("../utils/geoUtils"); +var _RNMBXCameraNativeComponent = _interopRequireDefault(require("../specs/RNMBXCameraNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const NativeModule = _reactNative.NativeModules.RNMBXModule; +let UserTrackingMode; +exports.UserTrackingMode = UserTrackingMode; +(function (UserTrackingMode) { + UserTrackingMode["Follow"] = "normal"; + UserTrackingMode["FollowWithHeading"] = "compass"; + UserTrackingMode["FollowWithCourse"] = "course"; +})(UserTrackingMode || (exports.UserTrackingMode = UserTrackingMode = {})); +/** + * Converts the provided React Native animation mode into the corresponding native enum value. + */ +const nativeAnimationMode = mode => { + const NativeCameraModes = NativeModule.CameraModes; + switch (mode) { + case 'flyTo': + return NativeCameraModes.Flight; + case 'easeTo': + return NativeCameraModes.Ease; + case 'linearTo': + return NativeCameraModes.Linear; + case 'moveTo': + return NativeCameraModes.Move; + case 'none': + return NativeCameraModes.None; + default: + return NativeCameraModes.Ease; + } +}; + +// Native module types. + +/** + * Controls the perspective from which the user sees the map. + * + * To use imperative methods, pass in a ref object: + * + * ```tsx + * const camera = useRef(null); + * + * useEffect(() => { + * camera.current?.setCamera({ + * centerCoordinate: [lon, lat], + * }); + * }, []); + * + * return ( + * + * ); + * ``` + */ +const Camera = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)((props, ref) => { + const { + centerCoordinate, + bounds, + heading, + pitch, + zoomLevel, + padding, + animationDuration, + animationMode, + minZoomLevel, + maxZoomLevel, + maxBounds, + followUserLocation, + followUserMode, + followZoomLevel, + followPitch, + followHeading, + followPadding, + defaultSettings, + allowUpdates = true, + onUserTrackingModeChange + } = props; + const nativeCamera = (0, _react.useRef)(null); + const buildNativeStop = (0, _react.useCallback)(function (stop) { + var _stop$padding, _stop$bounds, _stop$padding2, _stop$bounds2, _stop$padding3, _stop$bounds3, _stop$padding4, _stop$bounds4; + let ignoreFollowUserLocation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + stop = { + ...stop, + type: 'CameraStop' + }; + if (followUserLocation && !ignoreFollowUserLocation) { + return null; + } + const _nativeStop = {}; + if (stop.pitch !== undefined) _nativeStop.pitch = stop.pitch; + if (stop.heading !== undefined) _nativeStop.heading = stop.heading; + if (stop.zoomLevel !== undefined) _nativeStop.zoom = stop.zoomLevel; + if (stop.animationMode !== undefined) _nativeStop.mode = nativeAnimationMode(stop.animationMode); + if (stop.animationDuration !== undefined || animationDuration !== undefined) _nativeStop.duration = stop.animationDuration ?? animationDuration; + if (stop.centerCoordinate) { + _nativeStop.centerCoordinate = JSON.stringify((0, _geoUtils.makePoint)(stop.centerCoordinate)); + } + if (stop.bounds && stop.bounds.ne && stop.bounds.sw) { + const { + ne, + sw + } = stop.bounds; + _nativeStop.bounds = JSON.stringify((0, _geoUtils.makeLatLngBounds)(ne, sw)); + } + const paddingTop = ((_stop$padding = stop.padding) === null || _stop$padding === void 0 ? void 0 : _stop$padding.paddingTop) ?? ((_stop$bounds = stop.bounds) === null || _stop$bounds === void 0 ? void 0 : _stop$bounds.paddingTop); + if (paddingTop !== undefined) { + _nativeStop.paddingTop = paddingTop; + } + const paddingRight = ((_stop$padding2 = stop.padding) === null || _stop$padding2 === void 0 ? void 0 : _stop$padding2.paddingRight) ?? ((_stop$bounds2 = stop.bounds) === null || _stop$bounds2 === void 0 ? void 0 : _stop$bounds2.paddingRight); + if (paddingRight !== undefined) { + _nativeStop.paddingRight = paddingRight; + } + const paddingBottom = ((_stop$padding3 = stop.padding) === null || _stop$padding3 === void 0 ? void 0 : _stop$padding3.paddingBottom) ?? ((_stop$bounds3 = stop.bounds) === null || _stop$bounds3 === void 0 ? void 0 : _stop$bounds3.paddingBottom); + if (paddingBottom != undefined) { + _nativeStop.paddingBottom = paddingBottom; + } + const paddingLeft = ((_stop$padding4 = stop.padding) === null || _stop$padding4 === void 0 ? void 0 : _stop$padding4.paddingLeft) ?? ((_stop$bounds4 = stop.bounds) === null || _stop$bounds4 === void 0 ? void 0 : _stop$bounds4.paddingLeft); + if (paddingLeft !== undefined) { + _nativeStop.paddingLeft = paddingLeft; + } + return _nativeStop; + }, [animationDuration, followUserLocation]); + + // since codegen uses `payload` name in cpp code for creating payload for event, + // we rename it to `payloadRenamed` to avoid name collision there on new arch + const _onUserTrackingModeChange = (0, _react.useCallback)(event => { + if (onUserTrackingModeChange) { + if (!event.nativeEvent.payload) { + // @ts-expect-error see the comment above + event.nativeEvent.payload = event.nativeEvent.payloadRenamed; + } + onUserTrackingModeChange(event); + } + }, [onUserTrackingModeChange]); + const nativeDefaultStop = (0, _react.useMemo)(() => { + if (!defaultSettings) { + return null; + } + return buildNativeStop(defaultSettings); + }, [defaultSettings, buildNativeStop]); + const nativeStop = (0, _react.useMemo)(() => { + return buildNativeStop({ + type: 'CameraStop', + centerCoordinate, + bounds, + heading, + pitch, + zoomLevel, + padding, + animationDuration, + animationMode + }); + }, [centerCoordinate, bounds, heading, pitch, zoomLevel, padding, animationDuration, animationMode, buildNativeStop]); + const nativeMaxBounds = (0, _react.useMemo)(() => { + if (!(maxBounds !== null && maxBounds !== void 0 && maxBounds.ne) || !(maxBounds !== null && maxBounds !== void 0 && maxBounds.sw)) { + return null; + } + return JSON.stringify((0, _geoUtils.makeLatLngBounds)(maxBounds.ne, maxBounds.sw)); + }, [maxBounds]); + const setCamera = function (config) { + let ignoreFollowUserLocation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (!allowUpdates) { + return; + } + lastTS += 1; + if (!config.type) + // @ts-expect-error The compiler doesn't understand that the `config` union type is guaranteed + // to be an object type. + config = { + ...config, + // @ts-expect-error Allows JS files to pass in an invalid config (lacking the `type` property), + // which would raise a compilation error in TS files. + type: config.stops ? 'CameraStops' : 'CameraStop' + }; + if (config.type === 'CameraStops') { + for (const _stop of config.stops) { + var _nativeCamera$current; + let _nativeStops = []; + const _nativeStop = buildNativeStop(_stop, ignoreFollowUserLocation); + if (_nativeStop) { + _nativeStops = [..._nativeStops, _nativeStop]; + } + (_nativeCamera$current = nativeCamera.current) === null || _nativeCamera$current === void 0 ? void 0 : _nativeCamera$current.setNativeProps({ + stop: { + stops: _nativeStops, + __updateTS: lastTS + } + }); + } + } else if (config.type === 'CameraStop') { + const _nativeStop = buildNativeStop(config, ignoreFollowUserLocation); + if (_nativeStop) { + var _nativeCamera$current2; + (_nativeCamera$current2 = nativeCamera.current) === null || _nativeCamera$current2 === void 0 ? void 0 : _nativeCamera$current2.setNativeProps({ + stop: { + __updateTS: lastTS, + ..._nativeStop + } + }); + } + } + }; + const fitBounds = function (ne, sw, paddingConfig) { + let _animationDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + let _padding = { + paddingTop: 0, + paddingBottom: 0, + paddingLeft: 0, + paddingRight: 0 + }; + if (typeof paddingConfig === 'object') { + if (paddingConfig.length === 2) { + _padding = { + paddingTop: paddingConfig[0], + paddingBottom: paddingConfig[0], + paddingLeft: paddingConfig[1], + paddingRight: paddingConfig[1] + }; + } else if (paddingConfig.length === 4) { + _padding = { + paddingTop: paddingConfig[0], + paddingBottom: paddingConfig[2], + paddingLeft: paddingConfig[3], + paddingRight: paddingConfig[1] + }; + } + } else if (typeof paddingConfig === 'number') { + _padding = { + paddingTop: paddingConfig, + paddingBottom: paddingConfig, + paddingLeft: paddingConfig, + paddingRight: paddingConfig + }; + } + setCamera({ + type: 'CameraStop', + bounds: { + ne, + sw + }, + padding: _padding, + animationDuration: _animationDuration, + animationMode: 'easeTo' + }); + }; + const flyTo = function (_centerCoordinate) { + let _animationDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000; + setCamera({ + type: 'CameraStop', + centerCoordinate: _centerCoordinate, + animationDuration: _animationDuration + }); + }; + const moveTo = function (_centerCoordinate) { + let _animationDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + setCamera({ + type: 'CameraStop', + centerCoordinate: _centerCoordinate, + animationDuration: _animationDuration, + animationMode: 'easeTo' + }); + }; + const zoomTo = function (_zoomLevel) { + let _animationDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000; + setCamera({ + type: 'CameraStop', + zoomLevel: _zoomLevel, + animationDuration: _animationDuration, + animationMode: 'flyTo' + }); + }; + (0, _react.useImperativeHandle)(ref, () => ({ + /** + * Sets any camera properties, with default fallbacks if unspecified. + * + * @example + * camera.current?.setCamera({ + * centerCoordinate: [lon, lat], + * }); + * + * @param {CameraStop | CameraStops} config + * @param {boolean} ignoreFollowUserLocation + */ + setCamera, + /** + * Set the camera position to enclose the provided bounds, with optional + * padding and duration. + * + * @example + * camera.fitBounds([lon, lat], [lon, lat]); + * camera.fitBounds([lon, lat], [lon, lat], [20, 0], 1000); + * + * @param {Position} ne Northeast coordinate of bounding box + * @param {Position} sw Southwest coordinate of bounding box + * @param {number | number[]} paddingConfig The viewport padding, specified as a number (all sides equal), a 2-item array ([vertical, horizontal]), or a 4-item array ([top, right, bottom, left]) + * @param {number} animationDuration The transition duration + */ + fitBounds, + /** + * Sets the camera to center around the provided coordinate using a realistic 'travel' + * animation, with optional duration. + * + * @example + * camera.flyTo([lon, lat]); + * camera.flyTo([lon, lat], 12000); + * + * @param {Position} centerCoordinate The coordinate to center in the view + * @param {number} animationDuration The transition duration + */ + flyTo, + /** + * Sets the camera to center around the provided coordinate, with optional duration. + * + * @example + * camera.moveTo([lon, lat], 200); + * camera.moveTo([lon, lat]); + * + * @param {Position} centerCoordinate The coordinate to center in the view + * @param {number} animationDuration The transition duration + */ + moveTo, + /** + * Zooms the camera to the provided level, with optional duration. + * + * @example + * camera.zoomTo(16); + * camera.zoomTo(16, 100); + * + * @param {number} zoomLevel The target zoom + * @param {number} animationDuration The transition duration + */ + zoomTo + })); + return /*#__PURE__*/_react.default.createElement(RNMBXCamera, { + testID: 'Camera' + // @ts-expect-error just codegen stuff + , + ref: nativeCamera, + stop: nativeStop, + animationDuration: animationDuration, + animationMode: animationMode, + defaultStop: nativeDefaultStop, + followUserLocation: followUserLocation, + followUserMode: followUserMode, + followZoomLevel: followZoomLevel, + followPitch: followPitch, + followHeading: followHeading, + followPadding: followPadding, + minZoomLevel: minZoomLevel, + maxZoomLevel: maxZoomLevel, + maxBounds: nativeMaxBounds + // @ts-expect-error just codegen stuff + , + onUserTrackingModeChange: _onUserTrackingModeChange + }); +})); +exports.Camera = Camera; +let lastTS = 0; +const RNMBXCamera = _RNMBXCameraNativeComponent.default; +//# sourceMappingURL=Camera.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Camera.js.map b/lib/commonjs/components/Camera.js.map new file mode 100644 index 000000000..f4786bdfe --- /dev/null +++ b/lib/commonjs/components/Camera.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModule","NativeModules","RNMBXModule","UserTrackingMode","nativeAnimationMode","mode","NativeCameraModes","CameraModes","Flight","Ease","Linear","Move","None","Camera","memo","forwardRef","props","ref","centerCoordinate","bounds","heading","pitch","zoomLevel","padding","animationDuration","animationMode","minZoomLevel","maxZoomLevel","maxBounds","followUserLocation","followUserMode","followZoomLevel","followPitch","followHeading","followPadding","defaultSettings","allowUpdates","onUserTrackingModeChange","nativeCamera","useRef","buildNativeStop","useCallback","stop","ignoreFollowUserLocation","type","_nativeStop","undefined","zoom","duration","JSON","stringify","makePoint","ne","sw","makeLatLngBounds","paddingTop","paddingRight","paddingBottom","paddingLeft","_onUserTrackingModeChange","event","nativeEvent","payload","payloadRenamed","nativeDefaultStop","useMemo","nativeStop","nativeMaxBounds","setCamera","config","lastTS","stops","_stop","_nativeStops","current","setNativeProps","__updateTS","fitBounds","paddingConfig","_animationDuration","_padding","length","flyTo","_centerCoordinate","moveTo","zoomTo","_zoomLevel","useImperativeHandle","RNMBXCamera","NativeCameraView"],"sourceRoot":"../../../src","sources":["components/Camera.tsx"],"mappings":";;;;;;AAAA;AAQA;AAIA;AAEA;AAAmE;AAAA;AAAA;AAEnE,MAAMA,YAAY,GAAGC,0BAAa,CAACC,WAAW;AAAC,IAEnCC,gBAAgB;AAAA;AAAA,WAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,gCAAhBA,g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;IAAA,IADHP,kBAAkB,uEAAG,IAAI;IAEzBX,SAAS,CAAC;MACRxB,IAAI,EAAE,YAAY;MAClBtB,SAAS,EAAEgE,UAAU;MACrB9D,iBAAiB,EAAEuD,kBAAkB;MACrCtD,aAAa,EAAE;IACjB,CAAC,CAAC;EACJ,CAAC;EAED,IAAA8D,0BAAmB,EAACtE,GAAG,EAAE,OAAO;IAC9B;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQmD,SAAS;IACT;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQS,SAAS;IACT;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQK,KAAK;IACL;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQE,MAAM;IACN;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQC;EACF,CAAC,CAAC,CAAC;EAEH,oBACE,6BAAC,WAAW;IACV,MAAM,EAAE;IACR;IAAA;IACA,GAAG,EAAE/C,YAAa;IAClB,IAAI,EAAE4B,UAAW;IACjB,iBAAiB,EAAE1C,iBAAkB;IACrC,aAAa,EAAEC,aAAc;IAC7B,WAAW,EAAEuC,iBAAkB;IAC/B,kBAAkB,EAAEnC,kBAAmB;IACvC,cAAc,EAAEC,cAAe;IAC/B,eAAe,EAAEC,eAAgB;IACjC,WAAW,EAAEC,WAAY;IACzB,aAAa,EAAEC,aAAc;IAC7B,aAAa,EAAEC,aAAc;IAC7B,YAAY,EAAER,YAAa;IAC3B,YAAY,EAAEC,YAAa;IAC3B,SAAS,EAAEwC;IACX;IAAA;IACA,wBAAwB,EAAER;EAA0B,EACpD;AAEN,CAAC,CACF,CACF;AAAC;AAEF,IAAIW,MAAM,GAAG,CAAC;AAEd,MAAMkB,WAAW,GAAGC,mCAAgB"} diff --git a/lib/commonjs/components/CircleLayer.js b/lib/commonjs/components/CircleLayer.js new file mode 100644 index 000000000..07e35e265 --- /dev/null +++ b/lib/commonjs/components/CircleLayer.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXCircleLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXCircleLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * CircleLayer is a style layer that renders one or more filled circles on the map. + */ +class CircleLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.props, + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXCircleLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(CircleLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = CircleLayer; +exports.default = _default; +//# sourceMappingURL=CircleLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/CircleLayer.js.map b/lib/commonjs/components/CircleLayer.js.map new file mode 100644 index 000000000..650eec4bd --- /dev/null +++ b/lib/commonjs/components/CircleLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","CircleLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/CircleLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAIA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,WAAW,SAASC,sBAAa,CAAyB;EAK9DC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACb,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,6BAAC,wCAA+B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE5E;AACF;AAAC,gBAhBKH,WAAW,kBACO;EACpBO,QAAQ,EAAEV,MAAM,CAACW,WAAW,CAACC;AAC/B,CAAC;AAAA,eAeYT,WAAW;AAAA"} diff --git a/lib/commonjs/components/CustomLocationProvider.js b/lib/commonjs/components/CustomLocationProvider.js new file mode 100644 index 000000000..a5778b446 --- /dev/null +++ b/lib/commonjs/components/CustomLocationProvider.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireWildcard(require("react")); +var _RNMBXCustomLocationProviderNativeComponent = _interopRequireDefault(require("../specs/RNMBXCustomLocationProviderNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const CustomLocationProvider = /*#__PURE__*/(0, _react.memo)(props => { + return /*#__PURE__*/_react.default.createElement(_RNMBXCustomLocationProviderNativeComponent.default, props); +}); +var _default = CustomLocationProvider; +exports.default = _default; +//# sourceMappingURL=CustomLocationProvider.js.map \ No newline at end of file diff --git a/lib/commonjs/components/CustomLocationProvider.js.map b/lib/commonjs/components/CustomLocationProvider.js.map new file mode 100644 index 000000000..b2f55dbc0 --- /dev/null +++ b/lib/commonjs/components/CustomLocationProvider.js.map @@ -0,0 +1 @@ +{"version":3,"names":["CustomLocationProvider","memo","props"],"sourceRoot":"../../../src","sources":["components/CustomLocationProvider.tsx"],"mappings":";;;;;;AAAA;AAEA;AAA8F;AAAA;AAAA;AAe9F,MAAMA,sBAAsB,gBAAG,IAAAC,WAAI,EAAEC,KAAY,IAAK;EACpD,oBAAO,6BAAC,mDAA2B,EAAKA,KAAK,CAAI;AACnD,CAAC,CAAC;AAAC,eAEYF,sBAAsB;AAAA"} diff --git a/lib/commonjs/components/FillExtrusionLayer.js b/lib/commonjs/components/FillExtrusionLayer.js new file mode 100644 index 000000000..8519aa041 --- /dev/null +++ b/lib/commonjs/components/FillExtrusionLayer.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXFillExtrusionLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXFillExtrusionLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +/** + * FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map. + */ +class FillExtrusionLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.props, + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return /*#__PURE__*/_react.default.createElement(_RNMBXFillExtrusionLayerNativeComponent.default + // @ts-expect-error just codegen stuff + , _extends({ + ref: this.setNativeLayer + }, props)); + } +} +_defineProperty(FillExtrusionLayer, "defaultProps", { + sourceID: MapboxGL.StyleSource.DefaultSourceID +}); +var _default = FillExtrusionLayer; +exports.default = _default; +//# sourceMappingURL=FillExtrusionLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/FillExtrusionLayer.js.map b/lib/commonjs/components/FillExtrusionLayer.js.map new file mode 100644 index 000000000..7e66cfbd8 --- /dev/null +++ b/lib/commonjs/components/FillExtrusionLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","FillExtrusionLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/FillExtrusionLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAOA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,QAAQ,GAAGC,0BAAa,CAACC,WAAW;AAiE1C;AACA;AACA;AACA,MAAMC,kBAAkB,SAASC,sBAAa,CAAyB;EAKrEC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACb,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD,oBACE,6BAAC;IACC;IAAA;MACA,GAAG,EAAE,IAAI,CAACC;IAAe,GACrBH,KAAK,EACT;EAEN;AACF;AAAC,gBAnBKH,kBAAkB,kBACA;EACpBO,QAAQ,EAAEV,QAAQ,CAACW,WAAW,CAACC;AACjC,CAAC;AAAA,eAkBYT,kBAAkB;AAAA"} diff --git a/lib/commonjs/components/FillLayer.js b/lib/commonjs/components/FillLayer.js new file mode 100644 index 000000000..4b98ab33a --- /dev/null +++ b/lib/commonjs/components/FillLayer.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXFillLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXFillLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map. + */ +class FillLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXFillLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(FillLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = FillLayer; +exports.default = _default; +//# sourceMappingURL=FillLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/FillLayer.js.map b/lib/commonjs/components/FillLayer.js.map new file mode 100644 index 000000000..ff9b42d82 --- /dev/null +++ b/lib/commonjs/components/FillLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","FillLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/FillLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAIA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,SAAS,SAASC,sBAAa,CAAyB;EAK5DC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,6BAAC,sCAA6B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE1E;AACF;AAAC,gBAfKH,SAAS,kBACS;EACpBO,QAAQ,EAAEV,MAAM,CAACW,WAAW,CAACC;AAC/B,CAAC;AAAA,eAcYT,SAAS;AAAA"} diff --git a/lib/commonjs/components/HeadingIndicator.js b/lib/commonjs/components/HeadingIndicator.js new file mode 100644 index 000000000..b97d8fa2a --- /dev/null +++ b/lib/commonjs/components/HeadingIndicator.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _heading = _interopRequireDefault(require("../assets/heading.png")); +var _SymbolLayer = require("./SymbolLayer"); +var _Images = _interopRequireDefault(require("./Images")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const style = { + iconImage: 'userLocationHeading', + iconAllowOverlap: true, + iconPitchAlignment: 'map', + iconRotationAlignment: 'map' +}; +const HeadingIndicator = _ref => { + let { + heading + } = _ref; + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { + key: "mapboxUserLocationHeadingIndicatorWrapper" + }, /*#__PURE__*/_react.default.createElement(_Images.default, { + images: { + userLocationHeading: _heading.default + }, + key: "mapboxUserLocationHeadingImages" + }), /*#__PURE__*/_react.default.createElement(_SymbolLayer.SymbolLayer, { + key: "mapboxUserLocationHeadingIndicator", + id: "mapboxUserLocationHeadingIndicator", + sourceID: "mapboxUserLocation", + belowLayerID: "mapboxUserLocationWhiteCircle", + style: { + iconRotate: heading, + ...style + } + })); +}; +var _default = HeadingIndicator; +exports.default = _default; +//# sourceMappingURL=HeadingIndicator.js.map \ No newline at end of file diff --git a/lib/commonjs/components/HeadingIndicator.js.map b/lib/commonjs/components/HeadingIndicator.js.map new file mode 100644 index 000000000..37bb36346 --- /dev/null +++ b/lib/commonjs/components/HeadingIndicator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["style","iconImage","iconAllowOverlap","iconPitchAlignment","iconRotationAlignment","HeadingIndicator","heading","userLocationHeading","headingIcon","iconRotate"],"sourceRoot":"../../../src","sources":["components/HeadingIndicator.tsx"],"mappings":";;;;;;AAAA;AAEA;AAGA;AACA;AAA8B;AAE9B,MAAMA,KAAK,GAAG;EACZC,SAAS,EAAE,qBAAqB;EAChCC,gBAAgB,EAAE,IAAI;EACtBC,kBAAkB,EAAE,KAAK;EACzBC,qBAAqB,EAAE;AACzB,CAAU;AAMV,MAAMC,gBAAgB,GAAG,QAAwB;EAAA,IAAvB;IAAEC;EAAe,CAAC;EAC1C,oBACE,6BAAC,cAAK,CAAC,QAAQ;IAAC,GAAG,EAAC;EAA2C,gBAC7D,6BAAC,eAAM;IACL,MAAM,EAAE;MAAEC,mBAAmB,EAAEC;IAAY,CAAE;IAC7C,GAAG,EAAC;EAAiC,EACrC,eACF,6BAAC,wBAAW;IACV,GAAG,EAAC,oCAAoC;IACxC,EAAE,EAAC,oCAAoC;IACvC,QAAQ,EAAC,oBAAoB;IAC7B,YAAY,EAAC,+BAA+B;IAC5C,KAAK,EAAE;MACLC,UAAU,EAAEH,OAAO;MACnB,GAAGN;IACL;EAAE,EACF,CACa;AAErB,CAAC;AAAC,eAEaK,gBAAgB;AAAA"} diff --git a/lib/commonjs/components/HeatmapLayer.js b/lib/commonjs/components/HeatmapLayer.js new file mode 100644 index 000000000..c45b03427 --- /dev/null +++ b/lib/commonjs/components/HeatmapLayer.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXHeatmapLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXHeatmapLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * HeatmapLayer is a style layer that renders one or more filled circles on the map. + */ +class HeatmapLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.props, + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXHeatmapLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(HeatmapLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = HeatmapLayer; +exports.default = _default; +//# sourceMappingURL=HeatmapLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/HeatmapLayer.js.map b/lib/commonjs/components/HeatmapLayer.js.map new file mode 100644 index 000000000..4a4f520d8 --- /dev/null +++ b/lib/commonjs/components/HeatmapLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","HeatmapLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/HeatmapLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAOA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,YAAY,SAASC,sBAAa,CAAyB;EAK/DC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACb,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,6BAAC,yCAAgC;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE7E;AACF;AAAC,gBAhBKH,YAAY,kBACM;EACpBO,QAAQ,EAAEV,MAAM,CAACW,WAAW,CAACC;AAC/B,CAAC;AAAA,eAeYT,YAAY;AAAA"} diff --git a/lib/commonjs/components/Image.js b/lib/commonjs/components/Image.js new file mode 100644 index 000000000..071406321 --- /dev/null +++ b/lib/commonjs/components/Image.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireWildcard(require("react")); +var _reactNative = require("react-native"); +var _RNMBXImageNativeComponent = _interopRequireDefault(require("../specs/RNMBXImageNativeComponent")); +var _NativeRNMBXImageModule = _interopRequireDefault(require("../specs/NativeRNMBXImageModule")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +const Image = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Image(_ref, ref) { + let { + name, + sdf, + stretchX, + stretchY, + children + } = _ref; + const nativeProps = { + name, + sdf, + stretchX, + stretchY, + children + }; + const imageRef = _react.default.useRef(null); + const refresh = () => { + const handle = (0, _reactNative.findNodeHandle)(imageRef.current); + _NativeRNMBXImageModule.default.refresh(handle); + }; + _react.default.useImperativeHandle(ref, () => { + return { + refresh + }; + }); + + // @ts-expect-error just codegen stuff + return /*#__PURE__*/_react.default.createElement(_RNMBXImageNativeComponent.default, _extends({}, nativeProps, { + ref: imageRef + })); +})); +Image.displayName = 'Image'; +var _default = Image; +exports.default = _default; +//# sourceMappingURL=Image.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Image.js.map b/lib/commonjs/components/Image.js.map new file mode 100644 index 000000000..8fd6b5956 --- /dev/null +++ b/lib/commonjs/components/Image.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Image","memo","forwardRef","ref","name","sdf","stretchX","stretchY","children","nativeProps","imageRef","React","useRef","refresh","handle","findNodeHandle","current","NativeRNMBXImageModule","useImperativeHandle","displayName"],"sourceRoot":"../../../src","sources":["components/Image.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AAAqE;AAAA;AAAA;AAAA;AA+BrE,MAAMA,KAAK,gBAAG,IAAAC,WAAI,gBAChB,IAAAC,iBAAU,EAAa,SAASF,KAAK,OAEnCG,GAA4B,EAC5B;EAAA,IAFA;IAAEC,IAAI;IAAEC,GAAG;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC;EAAgB,CAAC;EAGlD,MAAMC,WAAW,GAAG;IAClBL,IAAI;IACJC,GAAG;IACHC,QAAQ;IACRC,QAAQ;IACRC;EACF,CAAC;EAED,MAAME,QAAQ,GAAGC,cAAK,CAACC,MAAM,CAAC,IAAI,CAAC;EAEnC,MAAMC,OAAO,GAAG,MAAM;IACpB,MAAMC,MAAM,GAAG,IAAAC,2BAAc,EAACL,QAAQ,CAACM,OAAO,CAAQ;IACtDC,+BAAsB,CAACJ,OAAO,CAACC,MAAM,CAAC;EACxC,CAAC;EAEDH,cAAK,CAACO,mBAAmB,CAACf,GAAG,EAAE,MAAM;IACnC,OAAO;MAAEU;IAAQ,CAAC;EACpB,CAAC,CAAC;;EAEF;EACA,oBAAO,6BAAC,kCAAyB,eAAKJ,WAAW;IAAE,GAAG,EAAEC;EAAS,GAAG;AACtE,CAAC,CAAC,CACH;AAEDV,KAAK,CAACmB,WAAW,GAAG,OAAO;AAAC,eAEbnB,KAAK;AAAA"} diff --git a/lib/commonjs/components/ImageSource.js b/lib/commonjs/components/ImageSource.js new file mode 100644 index 000000000..da09cdf3f --- /dev/null +++ b/lib/commonjs/components/ImageSource.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.NATIVE_MODULE_NAME = void 0; +var _react = _interopRequireDefault(require("react")); +var _utils = require("../utils"); +var _RNMBXImageSourceNativeComponent = _interopRequireDefault(require("../specs/RNMBXImageSourceNativeComponent")); +var _AbstractSource = _interopRequireDefault(require("./AbstractSource")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +const NATIVE_MODULE_NAME = 'RNMBXImageSource'; +exports.NATIVE_MODULE_NAME = NATIVE_MODULE_NAME; +/** + * ImageSource is a content source that is used for a georeferenced raster image to be shown on the map. + * The georeferenced image scales and rotates as the user zooms and rotates the map + */ +class ImageSource extends _AbstractSource.default { + _getURL() { + const { + url + } = this.props; + if ((0, _utils.isNumber)(url)) { + return (0, _utils.resolveImagePath)(url); + } else { + return url; + } + } + render() { + if (!this.props.url || !this.props.coordinates || !this.props.coordinates.length) { + return null; + } + const props = { + ...this.props, + url: this._getURL() + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXImageSourceNativeComponent.default, _extends({ + ref: this.setNativeRef + }, props), (0, _utils.cloneReactChildrenWithProps)(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +var _default = ImageSource; +exports.default = _default; +//# sourceMappingURL=ImageSource.js.map \ No newline at end of file diff --git a/lib/commonjs/components/ImageSource.js.map b/lib/commonjs/components/ImageSource.js.map new file mode 100644 index 000000000..f45612a61 --- /dev/null +++ b/lib/commonjs/components/ImageSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NATIVE_MODULE_NAME","ImageSource","AbstractSource","_getURL","url","props","isNumber","resolveImagePath","render","coordinates","length","setNativeRef","cloneReactChildrenWithProps","children","sourceID","id"],"sourceRoot":"../../../src","sources":["components/ImageSource.tsx"],"mappings":";;;;;;AAAA;AAEA;AAMA;AAEA;AAA8C;AAAA;AAEvC,MAAMA,kBAAkB,GAAG,kBAAkB;AAAC;AA+BrD;AACA;AACA;AACA;AACA,MAAMC,WAAW,SAASC,uBAAc,CAAqB;EAC3DC,OAAO,GAAuB;IAC5B,MAAM;MAAEC;IAAI,CAAC,GAAG,IAAI,CAACC,KAAK;IAE1B,IAAI,IAAAC,eAAQ,EAACF,GAAG,CAAC,EAAE;MACjB,OAAO,IAAAG,uBAAgB,EAACH,GAAG,CAAC;IAC9B,CAAC,MAAM;MACL,OAAOA,GAAG;IACZ;EACF;EAEAI,MAAM,GAAG;IACP,IACE,CAAC,IAAI,CAACH,KAAK,CAACD,GAAG,IACf,CAAC,IAAI,CAACC,KAAK,CAACI,WAAW,IACvB,CAAC,IAAI,CAACJ,KAAK,CAACI,WAAW,CAACC,MAAM,EAC9B;MACA,OAAO,IAAI;IACb;IAEA,MAAML,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACbD,GAAG,EAAE,IAAI,CAACD,OAAO;IACnB,CAAC;IAED;MAAA;MACE;MACA,6BAAC,wCAA+B;QAAC,GAAG,EAAE,IAAI,CAACQ;MAAa,GAAKN,KAAK,GAC/D,IAAAO,kCAA2B,EAAC,IAAI,CAACP,KAAK,CAACQ,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAACT,KAAK,CAACU;MACvB,CAAC,CAAC;IAC8B;EAEtC;AACF;AAAC,eAEcd,WAAW;AAAA"} diff --git a/lib/commonjs/components/Images.js b/lib/commonjs/components/Images.js new file mode 100644 index 000000000..e81a245fd --- /dev/null +++ b/lib/commonjs/components/Images.js @@ -0,0 +1,102 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.NATIVE_MODULE_NAME = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXImagesNativeComponent = _interopRequireDefault(require("../specs/RNMBXImagesNativeComponent")); +var _ShapeSource = require("./ShapeSource"); +var _Image = _interopRequireDefault(require("./Image")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const NATIVE_MODULE_NAME = 'RNMBXImages'; +exports.NATIVE_MODULE_NAME = NATIVE_MODULE_NAME; +function _isUrlOrPath(value) { + return (typeof value === 'string' || value instanceof String) && (value.startsWith('file://') || value.startsWith('http://') || value.startsWith('https://') || value.startsWith('data:') || value.startsWith('asset://') || value.startsWith('/')); +} +function isImageSourcePropType(value) { + if (typeof value === 'number' || value instanceof Number) { + return true; + } + const valueAsSource = value; + return !!valueAsSource.uri && typeof valueAsSource.uri === 'string'; +} +const isChildAnImage = child => { + return /*#__PURE__*/_react.default.isValidElement(child) && child.type === _Image.default; +}; +/** + * Images defines the images used in Symbol etc. layers. + */ +class Images extends _react.default.PureComponent { + _getImages() { + if (!this.props.images && !this.props.nativeAssetImages) { + return {}; + } + const images = {}; + let nativeImages = []; + if (this.props.images) { + const imageNames = Object.keys(this.props.images); + for (const imageName of imageNames) { + const value = this.props.images[imageName]; + if (imageName === _ShapeSource.ShapeSource.NATIVE_ASSETS_KEY && Array.isArray(value)) { + console.error(`Use of ${_ShapeSource.ShapeSource.NATIVE_ASSETS_KEY} in Images#images is not supported use Images#nativeAssetImages`); + } else if (_isUrlOrPath(value)) { + images[imageName] = value; + } else if (isImageSourcePropType(value)) { + const res = _reactNative.Image.resolveAssetSource(value); + if (res && res.uri) { + images[imageName] = res; + } + } else { + let imageEntry = value; + if (imageEntry.image) { + imageEntry = { + ...imageEntry, + resolvedImage: _reactNative.Image.resolveAssetSource(imageEntry.image) + }; + } + images[imageName] = imageEntry; + } + } + } + const { + children + } = this.props; + if (children) { + const childrenWithWrongType = _react.default.Children.toArray(children).find(child => !isChildAnImage(child)); + if (childrenWithWrongType) { + console.error(`Images component on accepts Image a children passed in: ${childrenWithWrongType.type || 'n/a'}`); + } + } + if (this.props.nativeAssetImages) { + nativeImages = this.props.nativeAssetImages; + } + return { + images, + nativeImages + }; + } + _onImageMissing(event) { + if (this.props.onImageMissing) { + this.props.onImageMissing(event.nativeEvent.payload.imageKey); + } + } + render() { + const props = { + hasOnImageMissing: !!this.props.onImageMissing, + onImageMissing: this._onImageMissing.bind(this), + ...this._getImages() + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXImagesNativeComponent.default, props, this.props.children) + ); + } +} +_defineProperty(Images, "NATIVE_ASSETS_KEY", 'assets'); +var _default = Images; +exports.default = _default; +//# sourceMappingURL=Images.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Images.js.map b/lib/commonjs/components/Images.js.map new file mode 100644 index 000000000..084a30693 --- /dev/null +++ b/lib/commonjs/components/Images.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NATIVE_MODULE_NAME","_isUrlOrPath","value","String","startsWith","isImageSourcePropType","Number","valueAsSource","uri","isChildAnImage","child","React","isValidElement","type","Image","Images","PureComponent","_getImages","props","images","nativeAssetImages","nativeImages","imageNames","Object","keys","imageName","ShapeSource","NATIVE_ASSETS_KEY","Array","isArray","console","error","res","RNImage","resolveAssetSource","imageEntry","image","resolvedImage","children","childrenWithWrongType","Children","toArray","find","_onImageMissing","event","onImageMissing","nativeEvent","payload","imageKey","render","hasOnImageMissing","bind"],"sourceRoot":"../../../src","sources":["components/Images.tsx"],"mappings":";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EAAE;QACzBT,OAAO,CAACC,KAAK,CACV,2DACEQ,qBAAqB,CAAS1B,IAAI,IAAI,KACxC,EAAC,CACH;MACH;IACF;IAEA,IAAI,IAAI,CAACK,KAAK,CAACE,iBAAiB,EAAE;MAChCC,YAAY,GAAG,IAAI,CAACH,KAAK,CAACE,iBAAiB;IAC7C;IAEA,OAAO;MACLD,MAAM;MACNE;IACF,CAAC;EACH;EAEAsB,eAAe,CAACC,KAA+C,EAAE;IAC/D,IAAI,IAAI,CAAC1B,KAAK,CAAC2B,cAAc,EAAE;MAC7B,IAAI,CAAC3B,KAAK,CAAC2B,cAAc,CAACD,KAAK,CAACE,WAAW,CAACC,OAAO,CAACC,QAAQ,CAAC;IAC/D;EACF;EAEAC,MAAM,GAAG;IACP,MAAM/B,KAAK,GAAG;MACZgC,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAChC,KAAK,CAAC2B,cAAc;MAC9CA,cAAc,EAAE,IAAI,CAACF,eAAe,CAACQ,IAAI,CAAC,IAAI,CAAC;MAC/C,GAAG,IAAI,CAAClC,UAAU;IACpB,CAAC;IAED;MAAA;MACE;MACA,6BAAC,mCAA0B,EAAKC,KAAK,EAClC,IAAI,CAACA,KAAK,CAACoB,QAAQ;IACO;EAEjC;AACF;AAAC,gBAxFKvB,MAAM,uBACiB,QAAQ;AAAA,eAyFtBA,MAAM;AAAA"} diff --git a/lib/commonjs/components/Light.js b/lib/commonjs/components/Light.js new file mode 100644 index 000000000..c4f65b1c4 --- /dev/null +++ b/lib/commonjs/components/Light.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireWildcard(require("react")); +var _RNMBXLightNativeComponent = _interopRequireDefault(require("../specs/RNMBXLightNativeComponent")); +var _StyleValue = require("../utils/StyleValue"); +var _nativeRef = _interopRequireDefault(require("../utils/nativeRef")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +/** + * Light represents the light source for extruded geometries + */ +function Light(props, ref) { + const { + style, + ...propWithoutStyle + } = props; + const nativeLightRef = (0, _nativeRef.default)((0, _react.useRef)(null)); + (0, _react.useImperativeHandle)(ref, () => ({ + setNativeProps(_props) { + var _nativeLightRef$curre; + let propsToPass = _props; + if (_props.style) { + propsToPass = { + ..._props, + reactStyle: (0, _StyleValue.transformStyle)(_props.style) + }; + } + (_nativeLightRef$curre = nativeLightRef.current) === null || _nativeLightRef$curre === void 0 ? void 0 : _nativeLightRef$curre.setNativeProps(propsToPass); + } + })); + return /*#__PURE__*/_react.default.createElement(_RNMBXLightNativeComponent.default + // @ts-expect-error just codegen stuff + , _extends({ + ref: nativeLightRef, + testID: "RNMBXLight" + }, propWithoutStyle, { + reactStyle: (0, _StyleValue.transformStyle)(style) + })); +} +var _default = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(Light)); +exports.default = _default; +//# sourceMappingURL=Light.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Light.js.map b/lib/commonjs/components/Light.js.map new file mode 100644 index 000000000..e49c58338 --- /dev/null +++ b/lib/commonjs/components/Light.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Light","props","ref","style","propWithoutStyle","nativeLightRef","nativeRef","useRef","useImperativeHandle","setNativeProps","_props","propsToPass","reactStyle","transformStyle","current","memo","forwardRef"],"sourceRoot":"../../../src","sources":["components/Light.tsx"],"mappings":";;;;;;AAAA;AAEA;AAGA;AACA;AAA2C;AAAA;AAAA;AAAA;AAa3C;AACA;AACA;AACA,SAASA,KAAK,CAACC,KAAY,EAAEC,GAAqC,EAAE;EAClE,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAiB,CAAC,GAAGH,KAAK;EAE5C,MAAMI,cAAc,GAAG,IAAAC,kBAAS,EAAC,IAAAC,aAAM,EAAC,IAAI,CAAC,CAAC;EAE9C,IAAAC,0BAAmB,EAACN,GAAG,EAAE,OAAO;IAC9BO,cAAc,CAACC,MAAkC,EAAE;MAAA;MACjD,IAAIC,WAAW,GAAGD,MAAM;MACxB,IAAIA,MAAM,CAACP,KAAK,EAAE;QAChBQ,WAAW,GAAG;UACZ,GAAGD,MAAM;UACTE,UAAU,EAAE,IAAAC,0BAAc,EAACH,MAAM,CAACP,KAAK;QACzC,CAAC;MACH;MACA,yBAAAE,cAAc,CAACS,OAAO,0DAAtB,sBAAwBL,cAAc,CAACE,WAAW,CAAC;IACrD;EACF,CAAC,CAAC,CAAC;EAEH,oBACE,6BAAC;EACC;EAAA;IACA,GAAG,EAAEN,cAAe;IACpB,MAAM,EAAC;EAAY,GACfD,gBAAgB;IACpB,UAAU,EAAE,IAAAS,0BAAc,EAACV,KAAK;EAAE,GAClC;AAEN;AAAC,4BAEc,IAAAY,WAAI,gBAAC,IAAAC,iBAAU,EAAChB,KAAK,CAAC,CAAC;AAAA"} diff --git a/lib/commonjs/components/LineLayer.js b/lib/commonjs/components/LineLayer.js new file mode 100644 index 000000000..8c754da09 --- /dev/null +++ b/lib/commonjs/components/LineLayer.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXLineLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXLineLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * LineLayer is a style layer that renders one or more stroked polylines on the map. + */ +class LineLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXLineLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(LineLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = LineLayer; +exports.default = _default; +//# sourceMappingURL=LineLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/LineLayer.js.map b/lib/commonjs/components/LineLayer.js.map new file mode 100644 index 000000000..d7714fc85 --- /dev/null +++ b/lib/commonjs/components/LineLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","LineLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/LineLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAIA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,SAAS,SAASC,sBAAa,CAAyB;EAK5DC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,6BAAC,sCAA6B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE1E;AACF;AAAC,gBAfKH,SAAS,kBACS;EACpBO,QAAQ,EAAEV,MAAM,CAACW,WAAW,CAACC;AAC/B,CAAC;AAAA,eAcYT,SAAS;AAAA"} diff --git a/lib/commonjs/components/LocationPuck.js b/lib/commonjs/components/LocationPuck.js new file mode 100644 index 000000000..a42a54eac --- /dev/null +++ b/lib/commonjs/components/LocationPuck.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireWildcard(require("react")); +var _reactNative = require("react-native"); +var _RNMBXNativeUserLocationNativeComponent = _interopRequireDefault(require("../specs/RNMBXNativeUserLocationNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const defaultProps = { + visible: true +}; + +/** + * Renders a puck on the map that shows the device's current location. + */ +const LocationPuck = /*#__PURE__*/(0, _react.memo)(props => { + const { + iosShowsUserHeadingIndicator, + pulsing, + ...rest + } = props; + const nativePulsing = pulsing ? _pulsingToNative(pulsing) : undefined; + let baseProps = { + ...defaultProps, + pulsing: nativePulsing + }; + if (iosShowsUserHeadingIndicator) { + console.warn('LocationPuck: iosShowsUserHeadingIndicator is deprecated, use puckBearingEnabled={true} puckBearing="heading" instead'); + baseProps = { + ...baseProps, + puckBearingEnabled: true, + puckBearing: 'heading' + }; + } + const actualProps = { + ...baseProps, + ...rest + }; + return /*#__PURE__*/_react.default.createElement(_RNMBXNativeUserLocationNativeComponent.default, actualProps); +}); +function _pulsingToNative(pulsing) { + if (pulsing === 'default') { + return { + kind: 'default' + }; + } + if (pulsing == null) { + return undefined; + } + const { + color, + isEnabled, + radius + } = pulsing; + return { + color: (0, _reactNative.processColor)(color), + isEnabled, + radius + }; +} +var _default = LocationPuck; +exports.default = _default; +//# sourceMappingURL=LocationPuck.js.map \ No newline at end of file diff --git a/lib/commonjs/components/LocationPuck.js.map b/lib/commonjs/components/LocationPuck.js.map new file mode 100644 index 000000000..b843c3113 --- /dev/null +++ b/lib/commonjs/components/LocationPuck.js.map @@ -0,0 +1 @@ +{"version":3,"names":["defaultProps","visible","LocationPuck","memo","props","iosShowsUserHeadingIndicator","pulsing","rest","nativePulsing","_pulsingToNative","undefined","baseProps","console","warn","puckBearingEnabled","puckBearing","actualProps","kind","color","isEnabled","radius","processColor"],"sourceRoot":"../../../src","sources":["components/LocationPuck.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AAEyD;AAAA;AAAA;AA8FzD,MAAMA,YAAY,GAAG;EACnBC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA,MAAMC,YAAY,gBAAG,IAAAC,WAAI,EAAEC,KAAY,IAAK;EAC1C,MAAM;IAAEC,4BAA4B;IAAEC,OAAO;IAAE,GAAGC;EAAK,CAAC,GAAGH,KAAK;EAChE,MAAMI,aAAa,GAAGF,OAAO,GAAGG,gBAAgB,CAACH,OAAO,CAAC,GAAGI,SAAS;EACrE,IAAIC,SAAsB,GAAG;IAAE,GAAGX,YAAY;IAAEM,OAAO,EAAEE;EAAc,CAAC;EACxE,IAAIH,4BAA4B,EAAE;IAChCO,OAAO,CAACC,IAAI,CACV,uHAAuH,CACxH;IAEDF,SAAS,GAAG;MACV,GAAGA,SAAS;MACZG,kBAAkB,EAAE,IAAI;MACxBC,WAAW,EAAE;IACf,CAAC;EACH;EACA,MAAMC,WAAW,GAAG;IAAE,GAAGL,SAAS;IAAE,GAAGJ;EAAK,CAAC;EAC7C,oBAAO,6BAAC,+CAAuB,EAAKS,WAAW,CAAI;AACrD,CAAC,CAAC;AAEF,SAASP,gBAAgB,CACvBH,OAAyB,EACW;EACpC,IAAIA,OAAO,KAAK,SAAS,EAAE;IACzB,OAAO;MAAEW,IAAI,EAAE;IAAU,CAAC;EAC5B;EACA,IAAIX,OAAO,IAAI,IAAI,EAAE;IACnB,OAAOI,SAAS;EAClB;EACA,MAAM;IAAEQ,KAAK;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGd,OAAO;EAC5C,OAAO;IACLY,KAAK,EAAE,IAAAG,yBAAY,EAACH,KAAK,CAAC;IAC1BC,SAAS;IACTC;EACF,CAAC;AACH;AAAC,eAEclB,YAAY;AAAA"} diff --git a/lib/commonjs/components/MapView.js b/lib/commonjs/components/MapView.js new file mode 100644 index 000000000..d166f95fb --- /dev/null +++ b/lib/commonjs/components/MapView.js @@ -0,0 +1,582 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _debounce = require("debounce"); +var _RNMBXMapViewNativeComponent = _interopRequireDefault(require("../specs/RNMBXMapViewNativeComponent")); +var _NativeMapViewModule = _interopRequireDefault(require("../specs/NativeMapViewModule")); +var _utils = require("../utils"); +var _filterUtils = require("../utils/filterUtils"); +var _Logger = _interopRequireDefault(require("../utils/Logger")); +var _NativeBridgeComponent = _interopRequireDefault(require("./NativeBridgeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const { + RNMBXModule +} = _reactNative.NativeModules; +const { + EventTypes +} = RNMBXModule; +if (RNMBXModule == null) { + console.error('Native part of Mapbox React Native libraries were not registered properly, double check our native installation guides.'); +} +if (!RNMBXModule.MapboxV10) { + console.warn('@rnmapbox/maps: Non v10 implementations are deprecated and will be removed in next version - see https://github.com/rnmapbox/maps/wiki/Deprecated-RNMapboxImpl-Maplibre'); +} +const styles = _reactNative.StyleSheet.create({ + matchParent: { + flex: 1 + } +}); +const defaultStyleURL = RNMBXModule.StyleURL.Street; +/** + * MapView backed by Mapbox Native GL + */ +class MapView extends (0, _NativeBridgeComponent.default)(_react.default.PureComponent, _NativeMapViewModule.default) { + constructor(props) { + super(props); + _defineProperty(this, "deprecationLogged", { + contentInset: false, + regionDidChange: false, + regionIsChanging: false + }); + this.logger = _Logger.default.sharedInstance(); + this.logger.start(); + this.state = { + isReady: null, + region: null, + width: 0, + height: 0, + isUserInteraction: false + }; + this._onPress = this._onPress.bind(this); + this._onLongPress = this._onLongPress.bind(this); + this._onChange = this._onChange.bind(this); + this._onLayout = this._onLayout.bind(this); + this._onCameraChanged = this._onCameraChanged.bind(this); + + // debounced map change methods + this._onDebouncedRegionWillChange = (0, _debounce.debounce)(this._onRegionWillChange.bind(this), props.regionWillChangeDebounceTime, true); + this._onDebouncedRegionDidChange = (0, _debounce.debounce)(this._onRegionDidChange.bind(this), props.regionDidChangeDebounceTime); + } + componentDidMount() { + this._setHandledMapChangedEvents(this.props); + } + componentWillUnmount() { + this._onDebouncedRegionWillChange.clear(); + this._onDebouncedRegionDidChange.clear(); + this.logger.stop(); + } + UNSAFE_componentWillReceiveProps(nextProps) { + this._setHandledMapChangedEvents(nextProps); + } + _setHandledMapChangedEvents(props) { + if ((0, _utils.isAndroid)() || RNMBXModule.MapboxV10) { + const events = []; + function addIfHasHandler(name) { + if (props[`on${name}`] != null) { + if (EventTypes[name] == null) { + if (name === 'DidFailLoadingMap') { + console.warn(`rnmapbox maps: on${name} is deprecated, please use onMapLoadingError`); + } else { + console.warn(`rnmapbox maps: ${name} is not supported`); + } + } else { + events.push(EventTypes[name]); + return true; + } + } + return false; + } + addIfHasHandler('RegionWillChange'); + addIfHasHandler('RegionIsChanging'); + addIfHasHandler('RegionDidChange'); + addIfHasHandler('UserLocationUpdate'); + addIfHasHandler('WillStartLoadingMap'); + addIfHasHandler('DidFinishLoadingMap'); + addIfHasHandler('MapLoadingError'); + addIfHasHandler('DidFailLoadingMap'); + addIfHasHandler('WillStartRenderingFrame'); + addIfHasHandler('DidFinishRenderingFrame'); + addIfHasHandler('DidFinishRenderingFrameFully'); + addIfHasHandler('WillStartRenderingMap'); + addIfHasHandler('DidFinishRenderingMap'); + addIfHasHandler('DidFinishRenderingMapFully'); + addIfHasHandler('DidFinishLoadingStyle'); + addIfHasHandler('CameraChanged'); + addIfHasHandler('MapIdle'); + if (addIfHasHandler('RegionDidChange')) { + if (!this.deprecationLogged.regionDidChange) { + console.warn('onRegionDidChange is deprecated and will be removed in next release - please use onMapIdle. https://github.com/rnmapbox/maps/wiki/Deprecated-RegionIsDidChange'); + this.deprecationLogged.regionDidChange = true; + } + if (props.onMapIdle) { + console.warn('rnmapbox/maps: only one of MapView.onRegionDidChange or onMapIdle is supported'); + } + } + if (addIfHasHandler('RegionIsChanging')) { + if (!this.deprecationLogged.regionIsChanging) { + console.warn('onRegionIsChanging is deprecated and will be removed in next release - please use onCameraChanged. https://github.com/rnmapbox/maps/wiki/Deprecated-RegionIsDidChange'); + this.deprecationLogged.regionIsChanging = true; + } + if (props.onCameraChanged) { + console.warn('rnmapbox/maps: only one of MapView.onRegionIsChanging or onCameraChanged is supported'); + } + } + if (props.onRegionWillChange) { + console.warn('onRegionWillChange is deprecated and will be removed in v10 - please use onRegionIsChanging'); + } + this._runNativeMethod('setHandledMapChangedEvents', this._nativeRef, [events]); + } + } + + /** + * Converts a geographic coordinate to a point in the given view’s coordinate system. + * + * @example + * const pointInView = await this._map.getPointInView([-37.817070, 144.949901]); + * + * @param {Array} coordinate - A point expressed in the map view's coordinate system. + * @return {Array} + */ + async getPointInView(coordinate) { + const res = await this._runNative('getPointInView', [coordinate]); + return res.pointInView; + } + + /** + * Converts a point in the given view’s coordinate system to a geographic coordinate. + * + * @example + * const coordinate = await this._map.getCoordinateFromView([100, 100]); + * + * @param {Array} point - A point expressed in the given view’s coordinate system. + * @return {Array} + */ + async getCoordinateFromView(point) { + const res = await this._runNative('getCoordinateFromView', [point]); + return res.coordinateFromView; + } + + /** + * The coordinate bounds (ne, sw) visible in the user’s viewport. + * + * @example + * const visibleBounds = await this._map.getVisibleBounds(); + * + * @return {Array} + */ + async getVisibleBounds() { + const res = await this._runNative('getVisibleBounds'); + return res.visibleBounds; + } + + /** + * Returns an array of rendered map features that intersect with a given point. + * + * @example + * this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2']) + * + * @param {Array} coordinate - A point expressed in the map view’s coordinate system. + * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. + * @param {Array=} layerIDs - A array of layer id's to filter the features by + * @return {FeatureCollection} + */ + + async queryRenderedFeaturesAtPoint(coordinate) { + let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + if (!coordinate || coordinate.length < 2) { + throw new Error('Must pass in valid coordinate[lng, lat]'); + } + const res = await this._runNative('queryRenderedFeaturesAtPoint', [coordinate, (0, _filterUtils.getFilter)(filter), layerIDs]); + if ((0, _utils.isAndroid)()) { + return JSON.parse(res.data); + } + return res.data; + } + + /** + * Returns an array of rendered map features that intersect with the given rectangle, + * restricted to the given style layers and filtered by the given predicate. In v10, + * passing an empty array will query the entire visible bounds of the map. + * + * @example + * this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2']) + * + * @param {Array} bbox - A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area. + * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. + * @param {Array=} layerIDs - A array of layer id's to filter the features by + * @return {FeatureCollection} + */ + async queryRenderedFeaturesInRect(bbox) { + let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + if (bbox != null && (bbox.length === 4 || RNMBXModule.MapboxV10 && bbox.length === 0)) { + const res = await this._runNative('queryRenderedFeaturesInRect', [bbox, (0, _filterUtils.getFilter)(filter), layerIDs]); + if ((0, _utils.isAndroid)()) { + return JSON.parse(res.data); + } + return res.data; + } else { + throw new Error('Must pass in a valid bounding box: [top, right, bottom, left]. An empty array [] is also acceptable in v10.'); + } + } + + /** + * Returns an array of GeoJSON Feature objects representing features within the specified vector tile or GeoJSON source that satisfy the query parameters. + * + * @example + * this._map.querySourceFeatures('your-source-id', [], ['your-source-layer']) + * + * @param {String} sourceId - Style source identifier used to query for source features. + * @param {Array=} filter - A filter to limit query results. + * @param {Array=} sourceLayerIDs - The name of the source layers to query. For vector tile sources, this parameter is required. For GeoJSON sources, it is ignored. + * @return {FeatureCollection} + */ + async querySourceFeatures(sourceId) { + let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let sourceLayerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + const args = [sourceId, (0, _filterUtils.getFilter)(filter), sourceLayerIDs]; + const res = await this._runNative('querySourceFeatures', args); + if ((0, _utils.isAndroid)()) { + return JSON.parse(res.data); + } + return res.data; + } + + /** + * Map camera will perform updates based on provided config. Deprecated use Camera#setCamera. + * @deprecated use Camera#setCamera + */ + setCamera() { + console.warn('MapView.setCamera is deprecated - please use Camera#setCamera'); + } + _runNative(methodName) { + let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + return super._runNativeMethod(methodName, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore TODO: fix types + this._nativeRef, args); + } + + /** + * Takes snapshot of map with current tiles and returns a URI to the image + * @param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64 + * @return {String} + */ + async takeSnap() { + let writeToDisk = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + const res = await this._runNative('takeSnap', [writeToDisk]); + return res.uri; + } + + /** + * Returns the current zoom of the map view. + * + * @example + * const zoom = await this._map.getZoom(); + * + * @return {Number} + */ + + async getZoom() { + const res = await this._runNative('getZoom'); + return res.zoom; + } + + /** + * Returns the map's geographical centerpoint + * + * @example + * const center = await this._map.getCenter(); + * + * @return {Array} Coordinates + */ + async getCenter() { + const res = await this._runNative('getCenter'); + return res.center; + } + + /** + * + * Clears temporary map data from the data path defined in the given resource + * options. Useful to reduce the disk usage or in case the disk cache contains + * invalid data. + * + * v10 only + */ + async clearData() { + if (!RNMBXModule.MapboxV10) { + console.warn('RNMapbox: clearData is only implemented in v10 implementation or later'); + return; + } + await this._runNative('clearData'); + } + + /** + * Queries the currently loaded data for elevation at a geographical location. + * The elevation is returned in meters relative to mean sea-level. + * Returns null if terrain is disabled or if terrain data for the location hasn't been loaded yet. + * + * @param {Array} coordinate - the coordinates to query elevation at + * @return {Number} + */ + async queryTerrainElevation(coordinate) { + const res = await this._runNative('queryTerrainElevation', [coordinate]); + return res.data; + } + + /** + * Sets the visibility of all the layers referencing the specified `sourceLayerId` and/or `sourceId` + * + * @example + * await this._map.setSourceVisibility(false, 'composite', 'building') + * + * @param {boolean} visible - Visibility of the layers + * @param {String} sourceId - Identifier of the target source (e.g. 'composite') + * @param {String=} sourceLayerId - Identifier of the target source-layer (e.g. 'building') + */ + setSourceVisibility(visible, sourceId) { + let sourceLayerId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + this._runNative('setSourceVisibility', [visible, sourceId, sourceLayerId]); + } + _decodePayload(payload) { + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + _onPress(e) { + if ((0, _utils.isFunction)(this.props.onPress)) { + this.props.onPress(this._decodePayload(e.nativeEvent.payload)); + } + } + _onLongPress(e) { + if ((0, _utils.isFunction)(this.props.onLongPress)) { + this.props.onLongPress(this._decodePayload(e.nativeEvent.payload)); + } + } + _onRegionWillChange(payload) { + if ((0, _utils.isFunction)(this.props.onRegionWillChange)) { + this.props.onRegionWillChange(payload); + } + this.setState({ + isUserInteraction: payload.properties.isUserInteraction, + isAnimatingFromUserInteraction: payload.properties.isAnimatingFromUserInteraction + }); + } + _onRegionDidChange(payload) { + if ((0, _utils.isFunction)(this.props.onRegionDidChange)) { + this.props.onRegionDidChange(payload); + } + this.setState({ + region: payload + }); + } + _onCameraChanged(e) { + var _this$props$onCameraC, _this$props; + (_this$props$onCameraC = (_this$props = this.props).onCameraChanged) === null || _this$props$onCameraC === void 0 ? void 0 : _this$props$onCameraC.call(_this$props, this._decodePayload(e.nativeEvent.payload)); + } + _onChange(e) { + const { + regionWillChangeDebounceTime, + regionDidChangeDebounceTime + } = this.props; + const { + type + } = e.nativeEvent; + const payload = this._decodePayload(e.nativeEvent.payload); + let propName = ''; + let deprecatedPropName = ''; + switch (type) { + case EventTypes.RegionWillChange: + if (regionWillChangeDebounceTime && regionWillChangeDebounceTime > 0) { + this._onDebouncedRegionWillChange(payload); + } else { + propName = 'onRegionWillChange'; + } + break; + case EventTypes.RegionIsChanging: + propName = 'onRegionIsChanging'; + break; + case EventTypes.RegionDidChange: + if (regionDidChangeDebounceTime && regionDidChangeDebounceTime > 0) { + this._onDebouncedRegionDidChange(payload); + } else { + propName = 'onRegionDidChange'; + } + break; + case EventTypes.CameraChanged: + propName = 'onCameraChanged'; + break; + case EventTypes.MapIdle: + propName = 'onMapIdle'; + break; + case EventTypes.UserLocationUpdated: + propName = 'onUserLocationUpdate'; + break; + case EventTypes.WillStartLoadingMap: + propName = 'onWillStartLoadingMap'; + break; + case EventTypes.DidFinishLoadingMap: + propName = 'onDidFinishLoadingMap'; + break; + case EventTypes.DidFailLoadingMap: + propName = 'onDidFailLoadingMap'; + break; + case EventTypes.MapLoadingError: + propName = 'onMapLoadingError'; + deprecatedPropName = 'onDidFailLoadingMap'; + break; + case EventTypes.WillStartRenderingFrame: + propName = 'onWillStartRenderingFrame'; + break; + case EventTypes.DidFinishRenderingFrame: + propName = 'onDidFinishRenderingFrame'; + break; + case EventTypes.DidFinishRenderingFrameFully: + propName = 'onDidFinishRenderingFrameFully'; + break; + case EventTypes.WillStartRenderingMap: + propName = 'onWillStartRenderingMap'; + break; + case EventTypes.DidFinishRenderingMap: + propName = 'onDidFinishRenderingMap'; + break; + case EventTypes.DidFinishRenderingMapFully: + propName = 'onDidFinishRenderingMapFully'; + break; + case EventTypes.DidFinishLoadingStyle: + propName = 'onDidFinishLoadingStyle'; + break; + default: + console.warn('Unhandled event callback type', type); + } + if (propName !== '') { + this._handleOnChange(propName, payload); + } + if (deprecatedPropName !== '') { + this._handleOnChange(deprecatedPropName, payload); + } + } + _onLayout(e) { + this.setState({ + isReady: true, + width: e.nativeEvent.layout.width, + height: e.nativeEvent.layout.height + }); + } + _handleOnChange(propName, payload) { + const func = this.props[propName]; + if (func && (0, _utils.isFunction)(func)) { + func(payload); + } + } + _getContentInset() { + if (!this.props.contentInset) { + return; + } + if (RNMBXModule.MapboxV10) { + if (!this.deprecationLogged.contentInset) { + console.warn('@rnmapbox/maps: contentInset is deprecated, use Camera padding instead.'); + this.deprecationLogged.contentInset = true; + } + } + if (!Array.isArray(this.props.contentInset)) { + return [this.props.contentInset]; + } + return this.props.contentInset; + } + _setNativeRef(nativeRef) { + if (nativeRef != null) { + this._nativeRef = nativeRef; + super._runPendingNativeMethods(nativeRef); + } + } + setNativeProps(props) { + if (this._nativeRef) { + this._nativeRef.setNativeProps(props); + } + } + _setStyleURL(props) { + // user set a styleURL, no need to alter props + if (props.styleURL) { + return; + } + + // user set styleJSON pass it to styleURL + if (props.styleJSON && !props.styleURL) { + props.styleURL = props.styleJSON; + } + + // user neither set styleJSON nor styleURL + // set defaultStyleUrl + if (!props.styleJSON || !props.styleURL) { + props.styleURL = defaultStyleURL; + } + } + _setLocalizeLabels(props) { + if (!RNMBXModule.MapboxV10) { + return; + } + if (typeof props.localizeLabels === 'boolean') { + props.localizeLabels = { + locale: 'current' + }; + } + } + render() { + const props = { + ...this.props, + contentInset: this._getContentInset(), + style: styles.matchParent + }; + this._setStyleURL(props); + this._setLocalizeLabels(props); + const callbacks = { + ref: nativeRef => this._setNativeRef(nativeRef), + onPress: this._onPress, + onLongPress: this._onLongPress, + onMapChange: this._onChange, + onCameraChanged: this._onCameraChanged + }; + let mapView = null; + if (this.state.isReady) { + if (props._nativeImpl) { + mapView = /*#__PURE__*/_react.default.createElement(props._nativeImpl, _extends({}, props, callbacks)); + } else { + mapView = /*#__PURE__*/_react.default.createElement(RNMBXMapView, _extends({}, props, callbacks), this.props.children); + } + } + return /*#__PURE__*/_react.default.createElement(_reactNative.View, { + onLayout: this._onLayout, + style: this.props.style, + testID: mapView ? undefined : this.props.testID + }, mapView); + } +} +_defineProperty(MapView, "defaultProps", { + scrollEnabled: true, + pitchEnabled: true, + rotateEnabled: true, + attributionEnabled: true, + compassEnabled: false, + compassFadeWhenNorth: false, + logoEnabled: true, + scaleBarEnabled: true, + surfaceView: RNMBXModule.MapboxV10 ? true : false, + requestDisallowInterceptTouchEvent: false, + regionWillChangeDebounceTime: 10, + regionDidChangeDebounceTime: 500 +}); +const RNMBXMapView = _RNMBXMapViewNativeComponent.default; +var _default = MapView; +exports.default = _default; +//# sourceMappingURL=MapView.js.map \ No newline at end of file diff --git a/lib/commonjs/components/MapView.js.map b/lib/commonjs/components/MapView.js.map new file mode 100644 index 000000000..9897f48a7 --- /dev/null +++ b/lib/commonjs/components/MapView.js.map @@ -0,0 +1 @@ +{"version":3,"names":["RNMBXModule","NativeModules","EventTypes","console","error","MapboxV10","warn","styles","StyleSheet","create","matchParent","flex","defaultStyleURL","StyleURL","Street","MapView","NativeBridgeComponent","React","PureComponent","NativeMapViewModule","constructor","props","contentInset","regionDidChange","regionIsChanging","logger","Logger","sharedInstance","start","state","isReady","region","width","height","isUserInteraction","_onPress","bind","_onLongPress","_onChange","_onLayout","_onCameraChanged","_onDebouncedRegionWillChange","debounce","_onRegionWillChange","regionWillChangeDebounceTime","_onDebouncedRegionDidChange","_onRegionDidChange","regionDidChangeDebounceTime","componentDidMount","_setHandledMapChangedEvents","componentWillUnmount","clear","stop","UNSAFE_componentWillReceiveProps","nextProps","isAndroid","events","addIfHasHandler","name","push","deprecationLogged","onMapIdle","onCameraChanged","onRegionWillChange","_runNativeMethod","_nativeRef","getPointInView","coordinate","res","_runNative","pointInView","getCoordinateFromView","point","coordinateFromView","getVisibleBounds","visibleBounds","queryRenderedFeaturesAtPoint","filter","layerIDs","length","Error","getFilter","JSON","parse","data","queryRenderedFeaturesInRect","bbox","querySourceFeatures","sourceId","sourceLayerIDs","args","setCamera","methodName","takeSnap","writeToDisk","uri","getZoom","zoom","getCenter","center","clearData","queryTerrainElevation","setSourceVisibility","visible","sourceLayerId","_decodePayload","payload","e","isFunction","onPress","nativeEvent","onLongPress","setState","properties","isAnimatingFromUserInteraction","onRegionDidChange","type","propName","deprecatedPropName","RegionWillChange","RegionIsChanging","RegionDidChange","CameraChanged","MapIdle","UserLocationUpdated","WillStartLoadingMap","DidFinishLoadingMap","DidFailLoadingMap","MapLoadingError","WillStartRenderingFrame","DidFinishRenderingFrame","DidFinishRenderingFrameFully","WillStartRenderingMap","DidFinishRenderingMap","DidFinishRenderingMapFully","DidFinishLoadingStyle","_handleOnChange","layout","func","_getContentInset","Array","isArray","_setNativeRef","nativeRef","_runPendingNativeMethods","setNativeProps","_setStyleURL","styleURL","styleJSON","_setLocalizeLabels","localizeLabels","locale","render","style","callbacks","ref","onMapChange","mapView","_nativeImpl","children","undefined","testID","scrollEnabled","pitchEnabled","rotateEnabled","attributionEnabled","compassEnabled","compassFadeWhenNorth","logoEnabled","scaleBarEnabled","surfaceView","requestDisallowInterceptTouchEvent","RNMBXMapView","NativeMapView"],"sourceRoot":"../../../src","sources":["components/MapView.tsx"],"mappings":";;;;;;AAAA;AACA;AAUA;AAEA;AAGA;AACA;AAMA;AACA;AAKA;AAA4D;AAAA;AAAA;AAE5D,MAAM;EAAEA;AAAY,CAAC,GAAGC,0BAAa;AACrC,MAAM;EAAEC;AAAW,CAAC,GAAGF,WAAW;AAElC,IAAIA,WAAW,IAAI,IAAI,EAAE;EACvBG,OAAO,CAACC,KAAK,CACX,yHAAyH,CAC1H;AACH;AACA,IAAI,CAACJ,WAAW,CAACK,SAAS,EAAE;EAC1BF,OAAO,CAACG,IAAI,CACV,yKAAyK,CAC1K;AACH;AAEA,MAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAA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BwB,eAAe,EAAE,IAAI,CAACtB;IACxB,CAAC;IAED,IAAIqH,OAAO,GAAG,IAAI;IAClB,IAAI,IAAI,CAAChI,KAAK,CAACC,OAAO,EAAE;MACtB,IAAIT,KAAK,CAACyI,WAAW,EAAE;QACrBD,OAAO,gBAAG,6BAAC,KAAK,CAAC,WAAW,eAAKxI,KAAK,EAAMqI,SAAS,EAAI;MAC3D,CAAC,MAAM;QACLG,OAAO,gBACL,6BAAC,YAAY,eAAKxI,KAAK,EAAMqI,SAAS,GACnC,IAAI,CAACrI,KAAK,CAAC0I,QAAQ,CAEvB;MACH;IACF;IAEA,oBACE,6BAAC,iBAAI;MACH,QAAQ,EAAE,IAAI,CAACxH,SAAU;MACzB,KAAK,EAAE,IAAI,CAAClB,KAAK,CAACoI,KAAM;MACxB,MAAM,EAAEI,OAAO,GAAGG,SAAS,GAAG,IAAI,CAAC3I,KAAK,CAAC4I;IAAO,GAE/CJ,OAAO,CACH;EAEX;AACF;AAAC,gBApsBK9I,OAAO,kBAIkB;EAC3BmJ,aAAa,EAAE,IAAI;EACnBC,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBC,kBAAkB,EAAE,IAAI;EACxBC,cAAc,EAAE,KAAK;EACrBC,oBAAoB,EAAE,KAAK;EAC3BC,WAAW,EAAE,IAAI;EACjBC,eAAe,EAAE,IAAI;EACrBC,WAAW,EAAE1K,WAAW,CAACK,SAAS,GAAG,IAAI,GAAG,KAAK;EACjDsK,kCAAkC,EAAE,KAAK;EACzC/H,4BAA4B,EAAE,EAAE;EAChCG,2BAA2B,EAAE;AAC/B,CAAC;AAssBH,MAAM6H,YAAY,GAAGC,oCAAoC;AAAC,eAE3C9J,OAAO;AAAA"} diff --git a/lib/commonjs/components/MarkerView.js b/lib/commonjs/components/MarkerView.js new file mode 100644 index 000000000..cacfe2311 --- /dev/null +++ b/lib/commonjs/components/MarkerView.js @@ -0,0 +1,100 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXMarkerViewContentNativeComponent = _interopRequireDefault(require("../specs/RNMBXMarkerViewContentNativeComponent")); +var _RNMBXMarkerViewNativeComponent = _interopRequireDefault(require("../specs/RNMBXMarkerViewNativeComponent")); +var _utils = require("../utils"); +var _geoUtils = require("../utils/geoUtils"); +var _PointAnnotation = _interopRequireDefault(require("./PointAnnotation")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; +/** + * MarkerView represents an interactive React Native marker on the map. + * + * If you have static views, consider using PointAnnotation or SymbolLayer to display + * an image, as they'll offer much better performance. Mapbox suggests using this + * component for a maximum of around 100 views displayed at one time. + * + * This is implemented with view annotations on [Android](https://docs.mapbox.com/android/maps/guides/annotations/view-annotations/) + * and [iOS](https://docs.mapbox.com/ios/maps/guides/annotations/view-annotations). + * + * This component has no dedicated `onPress` method. Instead, you should handle gestures + * with the React views passed in as `children`. + */ +class MarkerView extends _react.default.PureComponent { + _idForPointAnnotation() { + if (this.__idForPointAnnotation === undefined) { + MarkerView.lastId = MarkerView.lastId + 1; + this.__idForPointAnnotation = `MV-${MarkerView.lastId}`; + } + return this.__idForPointAnnotation; + } + _getCoordinate(coordinate) { + if (!coordinate) { + return undefined; + } + return (0, _utils.toJSONString)((0, _geoUtils.makePoint)(coordinate)); + } + render() { + if (this.props.anchor.x < 0 || this.props.anchor.y < 0 || this.props.anchor.x > 1 || this.props.anchor.y > 1) { + console.warn(`[MarkerView] Anchor with value (${this.props.anchor.x}, ${this.props.anchor.y}) should not be outside the range [(0, 0), (1, 1)]`); + } + if (_reactNative.Platform.OS === 'ios' && !Mapbox.MapboxV10) { + return /*#__PURE__*/_react.default.createElement(_PointAnnotation.default, _extends({ + id: this._idForPointAnnotation() + }, this.props)); + } + const { + anchor = { + x: 0.5, + y: 0.5 + } + } = this.props; + return /*#__PURE__*/_react.default.createElement(RNMBXMarkerView, { + style: [{ + flex: 0, + alignSelf: 'flex-start' + }, this.props.style], + coordinate: [Number(this.props.coordinate[0]), Number(this.props.coordinate[1])], + anchor: anchor, + allowOverlap: this.props.allowOverlap, + allowOverlapWithPuck: this.props.allowOverlapWithPuck, + isSelected: this.props.isSelected, + onTouchEnd: e => { + e.stopPropagation(); + } + }, /*#__PURE__*/_react.default.createElement(_RNMBXMarkerViewContentNativeComponent.default, { + style: { + flex: 0, + alignSelf: 'flex-start' + }, + onStartShouldSetResponder: _event => { + return true; + }, + onTouchEnd: e => { + e.stopPropagation(); + } + }, this.props.children)); + } +} +_defineProperty(MarkerView, "defaultProps", { + anchor: { + x: 0.5, + y: 0.5 + }, + allowOverlap: false, + allowOverlapWithPuck: false, + isSelected: false +}); +_defineProperty(MarkerView, "lastId", 0); +const RNMBXMarkerView = _RNMBXMarkerViewNativeComponent.default; +var _default = MarkerView; +exports.default = _default; +//# sourceMappingURL=MarkerView.js.map \ No newline at end of file diff --git a/lib/commonjs/components/MarkerView.js.map b/lib/commonjs/components/MarkerView.js.map new file mode 100644 index 000000000..d69ddd0cd --- /dev/null +++ b/lib/commonjs/components/MarkerView.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","MarkerView","React","PureComponent","_idForPointAnnotation","__idForPointAnnotation","undefined","lastId","_getCoordinate","coordinate","toJSONString","makePoint","render","props","anchor","x","y","console","warn","Platform","OS","MapboxV10","flex","alignSelf","style","Number","allowOverlap","allowOverlapWithPuck","isSelected","e","stopPropagation","_event","children","RNMBXMarkerView","NativeMarkerViewComponent"],"sourceRoot":"../../../src","sources":["components/MarkerView.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAAgD;AAAA;AAAA;AAEhD,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;AAuCxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,SAASC,cAAK,CAACC,aAAa,CAAQ;EAWlDC,qBAAqB,GAAW;IAC9B,IAAI,IAAI,CAACC,sBAAsB,KAAKC,SAAS,EAAE;MAC7CL,UAAU,CAACM,MAAM,GAAGN,UAAU,CAACM,MAAM,GAAG,CAAC;MACzC,IAAI,CAACF,sBAAsB,GAAI,MAAKJ,UAAU,CAACM,MAAO,EAAC;IACzD;IACA,OAAO,IAAI,CAACF,sBAAsB;EACpC;EAEAG,cAAc,CAACC,UAAoB,EAAsB;IACvD,IAAI,CAACA,UAAU,EAAE;MACf,OAAOH,SAAS;IAClB;IACA,OAAO,IAAAI,mBAAY,EAAC,IAAAC,mBAAS,EAACF,UAAU,CAAC,CAAC;EAC5C;EAEAG,MAAM,GAAG;IACP,IACE,IAAI,CAACC,KAAK,CAACC,MAAM,CAACC,CAAC,GAAG,CAAC,IACvB,IAAI,CAACF,KAAK,CAACC,MAAM,CAACE,CAAC,GAAG,CAAC,IACvB,IAAI,CAACH,KAAK,CAACC,MAAM,CAACC,CAAC,GAAG,CAAC,IACvB,IAAI,CAACF,KAAK,CAACC,MAAM,CAACE,CAAC,GAAG,CAAC,EACvB;MACAC,OAAO,CAACC,IAAI,CACT,mCAAkC,IAAI,CAACL,KAAK,CAACC,MAAM,CAACC,CAAE,KAAI,IAAI,CAACF,KAAK,CAACC,MAAM,CAACE,CAAE,oDAAmD,CACnI;IACH;IAEA,IAAIG,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI,CAACtB,MAAM,CAACuB,SAAS,EAAE;MAC9C,oBACE,6BAAC,wBA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AAU,EAAE;AACd,CAAC;AAAA,gBANG3B,UAAU,YAQE,CAAC;AA2EnB,MAAMgC,eAAe,GAAGC,uCAAyB;AAAC,eAEnCjC,UAAU;AAAA"} diff --git a/lib/commonjs/components/ModelLayer.js b/lib/commonjs/components/ModelLayer.js new file mode 100644 index 000000000..8d0ed0370 --- /dev/null +++ b/lib/commonjs/components/ModelLayer.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXModelLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXModelLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * ModelLayer is a style layer that renders one or more stroked polylines on the map. + */ +class ModelLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return /*#__PURE__*/_react.default.createElement(_RNMBXModelLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props)); + } +} +_defineProperty(ModelLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = ModelLayer; +exports.default = _default; +//# sourceMappingURL=ModelLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/ModelLayer.js.map b/lib/commonjs/components/ModelLayer.js.map new file mode 100644 index 000000000..ca4c8555f --- /dev/null +++ b/lib/commonjs/components/ModelLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","ModelLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/ModelLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAIA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,UAAU,SAASC,sBAAa,CAAyB;EAK7DC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD,oBACE,6BAAC,uCAA8B;MAAC,GAAG,EAAE,IAAI,CAACC;IAAe,GAAKH,KAAK,EAAI;EAE3E;AACF;AAAC,gBAdKH,UAAU,kBACQ;EACpBO,QAAQ,EAAEV,MAAM,CAACW,WAAW,CAACC;AAC/B,CAAC;AAAA,eAaYT,UAAU;AAAA"} diff --git a/lib/commonjs/components/Models.js b/lib/commonjs/components/Models.js new file mode 100644 index 000000000..84fdb435b --- /dev/null +++ b/lib/commonjs/components/Models.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = Models; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXModelsNativeComponent = _interopRequireDefault(require("../specs/RNMBXModelsNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _resolveAssets(models) { + const resolvedModels = {}; + Object.keys(models).forEach(key => { + const model = models[key]; + if (typeof model === 'string') { + resolvedModels[key] = { + url: model + }; + } else { + const asset = _reactNative.Image.resolveAssetSource(model); + if (!asset) { + throw new Error(`Could not resolve model asset: ${model}`); + } + resolvedModels[key] = asset; + } + }); + return resolvedModels; +} + +/** + * Name of 3D model assets to be used in the map + */ +function Models(props) { + const { + models, + ...restOfProps + } = props; + return /*#__PURE__*/_react.default.createElement(_RNMBXModelsNativeComponent.default, _extends({}, restOfProps, { + models: _resolveAssets(models) + })); +} +//# sourceMappingURL=Models.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Models.js.map b/lib/commonjs/components/Models.js.map new file mode 100644 index 000000000..46e7aa33b --- /dev/null +++ b/lib/commonjs/components/Models.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_resolveAssets","models","resolvedModels","Object","keys","forEach","key","model","url","asset","Image","resolveAssetSource","Error","Models","props","restOfProps"],"sourceRoot":"../../../src","sources":["components/Models.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AAA+D;AAAA;AAe/D,SAASA,cAAc,CAACC,MAAuB,EAE7C;EACA,MAAMC,cAAwC,GAAG,CAAC,CAAC;EACnDC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,CAACI,OAAO,CAAEC,GAAG,IAAK;IACnC,MAAMC,KAAK,GAAGN,MAAM,CAACK,GAAG,CAAC;IACzB,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC7BL,cAAc,CAACI,GAAG,CAAC,GAAG;QAAEE,GAAG,EAAED;MAAM,CAAC;IACtC,CAAC,MAAM;MACL,MAAME,KAAK,GAAGC,kBAAK,CAACC,kBAAkB,CAACJ,KAAK,CAAC;MAC7C,IAAI,CAACE,KAAK,EAAE;QACV,MAAM,IAAIG,KAAK,CAAE,kCAAiCL,KAAM,EAAC,CAAC;MAC5D;MACAL,cAAc,CAACI,GAAG,CAAC,GAAGG,KAAK;IAC7B;EACF,CAAC,CAAC;EACF,OAAOP,cAAc;AACvB;;AAEA;AACA;AACA;AACe,SAASW,MAAM,CAACC,KAAY,EAAE;EAC3C,MAAM;IAAEb,MAAM;IAAE,GAAGc;EAAY,CAAC,GAAGD,KAAK;EACxC,oBAAO,6BAAC,mCAAY,eAAKC,WAAW;IAAE,MAAM,EAAEf,cAAc,CAACC,MAAM;EAAE,GAAG;AAC1E"} diff --git a/lib/commonjs/components/NativeBridgeComponent.js b/lib/commonjs/components/NativeBridgeComponent.js new file mode 100644 index 000000000..2fdcd7e35 --- /dev/null +++ b/lib/commonjs/components/NativeBridgeComponent.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _utils = require("../utils"); +const NativeBridgeComponent = (Base, turboModule) => class extends Base { + constructor() { + super(...arguments); + this._turboModule = turboModule; + this._preRefMapMethodQueue = []; + } + async _runPendingNativeMethods(nativeRef) { + if (nativeRef) { + while (this._preRefMapMethodQueue.length > 0) { + const item = this._preRefMapMethodQueue.pop(); + if (item && item.method && item.resolver) { + const res = await this._runNativeMethod(item.method.name, nativeRef, item.method.args); + item.resolver(res); + } + } + } + } + _runNativeMethod(methodName, nativeRef) { + let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + if (!nativeRef) { + return new Promise(resolve => { + this._preRefMapMethodQueue.push({ + method: { + name: methodName, + args + }, + resolver: resolve + }); + }); + } + return (0, _utils.runNativeMethod)(this._turboModule, methodName, nativeRef, args); + } +}; +var _default = NativeBridgeComponent; +exports.default = _default; +//# sourceMappingURL=NativeBridgeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/components/NativeBridgeComponent.js.map b/lib/commonjs/components/NativeBridgeComponent.js.map new file mode 100644 index 000000000..404397685 --- /dev/null +++ b/lib/commonjs/components/NativeBridgeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeBridgeComponent","Base","turboModule","constructor","_turboModule","_preRefMapMethodQueue","_runPendingNativeMethods","nativeRef","length","item","pop","method","resolver","res","_runNativeMethod","name","args","methodName","Promise","resolve","push","runNativeMethod"],"sourceRoot":"../../../src","sources":["components/NativeBridgeComponent.tsx"],"mappings":";;;;;;AAGA;AAOA,MAAMA,qBAAqB,GAAG,CAI5BC,IAAmB,EACnBC,WAAwB,KAExB,cAAcD,IAAI,CAAC;EAOjBE,WAAW,GAAiB;IAC1B,KAAK,CAAC,YAAO,CAAC;IAEd,IAAI,CAACC,YAAY,GAAGF,WAAW;IAC/B,IAAI,CAACG,qBAAqB,GAAG,EAAE;EACjC;EAEA,MAAMC,wBAAwB,CAAUC,SAAkB,EAAE;IAC1D,IAAIA,SAAS,EAAE;MACb,OAAO,IAAI,CAACF,qBAAqB,CAACG,MAAM,GAAG,CAAC,EAAE;QAC5C,MAAMC,IAAI,GAAG,IAAI,CAACJ,qBAAqB,CAACK,GAAG,EAAE;QAE7C,IAAID,IAAI,IAAIA,IAAI,CAACE,MAAM,IAAIF,IAAI,CAACG,QAAQ,EAAE;UACxC,MAAMC,GAAG,GAAG,MAAM,IAAI,CAACC,gBAAgB,CACrCL,IAAI,CAACE,MAAM,CAACI,IAAI,EAChBR,SAAS,EACTE,IAAI,CAACE,MAAM,CAACK,IAAI,CACjB;UACDP,IAAI,CAACG,QAAQ,CAACC,GAAG,CAAC;QACpB;MACF;IACF;EACF;EAEAC,gBAAgB,CACdG,UAAkB,EAClBV,SAA8B,EAET;IAAA,IADrBS,IAAiB,uEAAG,EAAE;IAEtB,IAAI,CAACT,SAAS,EAAE;MACd,OAAO,IAAIW,OAAO,CAAcC,OAAO,IAAK;QAC1C,IAAI,CAACd,qBAAqB,CAACe,IAAI,CAAC;UAC9BT,MAAM,EAAE;YAAEI,IAAI,EAAEE,UAAU;YAAED;UAAK,CAAC;UAClCJ,QAAQ,EAAEO;QACZ,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAO,IAAAE,sBAAe,EAAC,IAAI,CAACjB,YAAY,EAAEa,UAAU,EAAEV,SAAS,EAAES,IAAI,CAAC;EACxE;AACF,CAAC;AAAC,eAEWhB,qBAAqB;AAAA"} diff --git a/lib/commonjs/components/PointAnnotation.js b/lib/commonjs/components/PointAnnotation.js new file mode 100644 index 000000000..11c5a2601 --- /dev/null +++ b/lib/commonjs/components/PointAnnotation.js @@ -0,0 +1,139 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.NATIVE_MODULE_NAME = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _utils = require("../utils"); +var _checkRequiredProps = _interopRequireDefault(require("../utils/checkRequiredProps")); +var _geoUtils = require("../utils/geoUtils"); +var _RNMBXPointAnnotationNativeComponent = _interopRequireDefault(require("../specs/RNMBXPointAnnotationNativeComponent")); +var _NativeRNMBXPointAnnotationModule = _interopRequireDefault(require("../specs/NativeRNMBXPointAnnotationModule")); +var _NativeBridgeComponent = _interopRequireDefault(require("./NativeBridgeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const NATIVE_MODULE_NAME = 'RNMBXPointAnnotation'; +exports.NATIVE_MODULE_NAME = NATIVE_MODULE_NAME; +const styles = _reactNative.StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'center', + position: 'absolute' + } +}); +/** + * PointAnnotation represents a one-dimensional shape located at a single geographical coordinate. + * + * Consider using ShapeSource and SymbolLayer instead, if you have many points and static images, + * they'll offer much better performance. + * + * If you need interactive views please use MarkerView because PointAnnotation will render children onto a bitmap. + * Also disable any kind of animations like `fadeDuration` of `Image`. + * Otherwise, the bitmap might be rendered at an unknown state of the animation. + */ +class PointAnnotation extends (0, _NativeBridgeComponent.default)(_react.default.PureComponent, _NativeRNMBXPointAnnotationModule.default) { + constructor(props) { + super(props); + _defineProperty(this, "_nativeRef", null); + (0, _checkRequiredProps.default)('PointAnnotation', props, ['id', 'coordinate']); + this._onSelected = this._onSelected.bind(this); + this._onDeselected = this._onDeselected.bind(this); + this._onDragStart = this._onDragStart.bind(this); + this._onDrag = this._onDrag.bind(this); + this._onDragEnd = this._onDragEnd.bind(this); + } + _decodePayload(payload) { + // we check whether the payload is a string, since the strict type safety is enforced only on iOS on the new arch + // on Android, on both archs, the payload is an object + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + _onSelected(e) { + if ((0, _utils.isFunction)(this.props.onSelected)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onSelected(payload); + } + } + _onDeselected(e) { + if ((0, _utils.isFunction)(this.props.onDeselected)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDeselected(payload); + } + } + _onDragStart(e) { + if ((0, _utils.isFunction)(this.props.onDragStart)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDragStart(payload); + } + } + _onDrag(e) { + if ((0, _utils.isFunction)(this.props.onDrag)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDrag(payload); + } + } + _onDragEnd(e) { + if ((0, _utils.isFunction)(this.props.onDragEnd)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDragEnd(payload); + } + } + _getCoordinate() { + if (!this.props.coordinate) { + return undefined; + } + return (0, _utils.toJSONString)((0, _geoUtils.makePoint)(this.props.coordinate)); + } + + /** + * On v10 and pre v10 android point annotation is rendered offscreen with a canvas into an image. + * To rerender the image from the current state of the view call refresh. + * Call this for example from Image#onLoad. + */ + refresh() { + this._runNativeMethod('refresh', this._nativeRef, []); + } + _setNativeRef(nativeRef) { + this._nativeRef = nativeRef; + super._runPendingNativeMethods(nativeRef); + } + render() { + const props = { + ...this.props, + ref: nativeRef => this._setNativeRef(nativeRef), + id: this.props.id, + title: this.props.title, + snippet: this.props.snippet, + anchor: this.props.anchor, + selected: this.props.selected, + draggable: this.props.draggable, + style: [this.props.style, styles.container], + onMapboxPointAnnotationSelected: this._onSelected, + onMapboxPointAnnotationDeselected: this._onDeselected, + onMapboxPointAnnotationDragStart: this._onDragStart, + onMapboxPointAnnotationDrag: this._onDrag, + onMapboxPointAnnotationDragEnd: this._onDragEnd, + coordinate: this._getCoordinate() + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXPointAnnotationNativeComponent.default, props, this.props.children) + ); + } +} +_defineProperty(PointAnnotation, "defaultProps", { + anchor: { + x: 0.5, + y: 0.5 + }, + draggable: false +}); +var _default = PointAnnotation; +exports.default = _default; +//# sourceMappingURL=PointAnnotation.js.map \ No newline at end of file diff --git a/lib/commonjs/components/PointAnnotation.js.map b/lib/commonjs/components/PointAnnotation.js.map new file mode 100644 index 000000000..8e12d0317 --- /dev/null +++ b/lib/commonjs/components/PointAnnotation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NATIVE_MODULE_NAME","styles","StyleSheet","create","container","alignItems","justifyContent","position","PointAnnotation","NativeBridgeComponent","React","PureComponent","NativeRNMBXPointAnnotationModule","constructor","props","checkRequiredProps","_onSelected","bind","_onDeselected","_onDragStart","_onDrag","_onDragEnd","_decodePayload","payload","JSON","parse","e","isFunction","onSelected","nativeEvent","onDeselected","onDragStart","onDrag","onDragEnd","_getCoordinate","coordinate","undefined","toJSONString","makePoint","refresh","_runNativeMethod","_nativeRef","_setNativeRef","nativeRef","_runPendingNativeMethods","render","ref","id","title","snippet","anchor","selected","draggable","style","onMapboxPointAnnotationSelected","onMapboxPointAnnotationDeselected","onMapboxPointAnnotationDragStart","onMapboxPointAnnotationDrag","onMapboxPointAnnotationDragEnd","children","x","y"],"sourceRoot":"../../../src","sources":["components/PointAnnotation.tsx"],"mappings":";;;;;;AAAA;AACA;AAGA;AACA;AACA;AAGA;AACA;AAEA;AAAgF;AAAA;AAEzE,MAAMA,kBAAkB,GAAG,sBAAsB;AAAC;AAEzD,MAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE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kBAIG;EACpB0C,MAAM,EAAE;IAAEU,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAI,CAAC;EAC1BT,SAAS,EAAE;AACb,CAAC;AAAA,eAoHY5C,eAAe;AAAA"} diff --git a/lib/commonjs/components/RasterDemSource.js b/lib/commonjs/components/RasterDemSource.js new file mode 100644 index 000000000..7283487c5 --- /dev/null +++ b/lib/commonjs/components/RasterDemSource.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXRasterDemSourceNativeComponent = _interopRequireDefault(require("../specs/RNMBXRasterDemSourceNativeComponent")); +var _utils = require("../utils"); +var _AbstractSource = _interopRequireDefault(require("./AbstractSource")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const isTileTemplateUrl = url => !!url && (url.includes('{z}') || url.includes('{bbox-') || url.includes('{quadkey}')); +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +class RasterDemSource extends _AbstractSource.default { + constructor(props) { + super(props); + if (isTileTemplateUrl(props.url)) { + console.warn(`RasterDemSource 'url' property contains a Tile URL Template, but is intended for a StyleJSON URL. Please migrate your VectorSource to use: \`tileUrlTemplates=["${props.url}"]\` instead.`); + } + } + render() { + let { + url + } = this.props; + let { + tileUrlTemplates + } = this.props; + + // Swapping url for tileUrlTemplates to provide backward compatibility + // when RasterSource supported only tile url as url prop + if (isTileTemplateUrl(url)) { + tileUrlTemplates = [url]; + url = undefined; + } + const props = { + ...this.props, + id: this.props.id, + existing: this.props.existing, + url, + tileUrlTemplates, + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + tileSize: this.props.tileSize + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXRasterDemSourceNativeComponent.default, _extends({ + ref: this.setNativeRef + }, props), (0, _utils.cloneReactChildrenWithProps)(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(RasterDemSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +var _default = RasterDemSource; +exports.default = _default; +//# sourceMappingURL=RasterDemSource.js.map \ No newline at end of file diff --git a/lib/commonjs/components/RasterDemSource.js.map b/lib/commonjs/components/RasterDemSource.js.map new file mode 100644 index 000000000..24011bb4d --- /dev/null +++ b/lib/commonjs/components/RasterDemSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isTileTemplateUrl","url","includes","MapboxGL","NativeModules","RNMBXModule","RasterDemSource","AbstractSource","constructor","props","console","warn","render","tileUrlTemplates","undefined","id","existing","minZoomLevel","maxZoomLevel","tileSize","setNativeRef","cloneReactChildrenWithProps","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/RasterDemSource.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AAEA;AAA8C;AAAA;AAAA;AAE9C,MAAMA,iBAAiB,GAAIC,GAAY,IACrC,CAAC,CAACA,GAAG,KACJA,GAAG,CAACC,QAAQ,CAAC,KAAK,CAAC,IAAID,GAAG,CAACC,QAAQ,CAAC,QAAQ,CAAC,IAAID,GAAG,CAACC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE9E,MAAMC,QAAQ,GAAGC,0BAAa,CAACC,WAAW;AAiD1C,MAAMC,eAAe,SAASC,uBAAc,CAAqB;EAK/DC,WAAW,CAACC,KAAY,EAAE;IACxB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAIT,iBAAiB,CAACS,KAAK,CAACR,GAAG,CAAC,EAAE;MAChCS,OAAO,CAACC,IAAI,CACT,mKAAkKF,KAAK,CAACR,GAAI,eAAc,CAC5L;IACH;EACF;EAEAW,MAAM,GAAG;IACP,IAAI;MAAEX;IAAI,CAAC,GAAG,IAAI,CAACQ,KAAK;IACxB,IAAI;MAAEI;IAAiB,CAAC,GAAG,IAAI,CAACJ,KAAK;;IAErC;IACA;IACA,IAAIT,iBAAiB,CAACC,GAAG,CAAC,EAAE;MAC1BY,gBAAgB,GAAG,CAACZ,GAAG,CAAC;MACxBA,GAAG,GAAGa,SAAS;IACjB;IAEA,MAAML,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACbM,EAAE,EAAE,IAAI,CAACN,KAAK,CAACM,EAAE;MACjBC,QAAQ,EAAE,IAAI,CAACP,KAAK,CAACO,QAAQ;MAC7Bf,GAAG;MACHY,gBAAgB;MAChBI,YAAY,EAAE,IAAI,CAACR,KAAK,CAACQ,YAAY;MACrCC,YAAY,EAAE,IAAI,CAACT,KAAK,CAACS,YAAY;MACrCC,QAAQ,EAAE,IAAI,CAACV,KAAK,CAACU;IACvB,CAAC;IACD;MAAA;MACE;MACA,6BAAC,4CAAmC;QAAC,GAAG,EAAE,IAAI,CAACC;MAAa,GAAKX,KAAK,GACnE,IAAAY,kCAA2B,EAAC,IAAI,CAACZ,KAAK,CAACa,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAACd,KAAK,CAACM;MACvB,CAAC,CAAC;IACkC;EAE1C;AACF;AAAC,gBA5CKT,eAAe,kBACG;EACpBS,EAAE,EAAEZ,QAAQ,CAACqB,WAAW,CAACC;AAC3B,CAAC;AAAA,eA2CYnB,eAAe;AAAA"} diff --git a/lib/commonjs/components/RasterLayer.js b/lib/commonjs/components/RasterLayer.js new file mode 100644 index 000000000..8440ab1ca --- /dev/null +++ b/lib/commonjs/components/RasterLayer.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXRasterLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXRasterLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +class RasterLayer extends _AbstractLayer.default { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXRasterLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(RasterLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = RasterLayer; +exports.default = _default; +//# sourceMappingURL=RasterLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/RasterLayer.js.map b/lib/commonjs/components/RasterLayer.js.map new file mode 100644 index 000000000..2328c0828 --- /dev/null +++ b/lib/commonjs/components/RasterLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","RasterLayer","AbstractLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/RasterLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAIA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AA4EA,MAAMC,WAAW,SAASC,sBAAa,CAAyB;EAK9DC,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,6BAAC,wCAA+B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE5E;AACF;AAAC,gBAfKH,WAAW,kBACO;EACpBO,QAAQ,EAAEV,MAAM,CAACW,WAAW,CAACC;AAC/B,CAAC;AAAA,eAcYT,WAAW;AAAA"} diff --git a/lib/commonjs/components/RasterSource.js b/lib/commonjs/components/RasterSource.js new file mode 100644 index 000000000..2a4cc86e9 --- /dev/null +++ b/lib/commonjs/components/RasterSource.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _utils = require("../utils"); +var _RNMBXRasterSourceNativeComponent = _interopRequireDefault(require("../specs/RNMBXRasterSourceNativeComponent")); +var _AbstractSource = _interopRequireDefault(require("./AbstractSource")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +const isTileTemplateUrl = url => !!url && (url.includes('{z}') || url.includes('{bbox-') || url.includes('{quadkey}')); +/** + * RasterSource is a map content source that supplies raster image tiles to be shown on the map. + * The location of and metadata about the tiles are defined either by an option dictionary + * or by an external file that conforms to the TileJSON specification. + */ +class RasterSource extends _AbstractSource.default { + constructor(props) { + super(props); + if (isTileTemplateUrl(props.url)) { + console.warn(`RasterSource 'url' property contains a Tile URL Template, but is intended for a StyleJSON URL. Please migrate your VectorSource to use: \`tileUrlTemplates=["${props.url}"]\` instead.`); + } + } + render() { + let { + url + } = this.props; + let { + tileUrlTemplates + } = this.props; + + // Swapping url for tileUrlTemplates to provide backward compatibility + // when RasterSource supported only tile url as url prop + if (isTileTemplateUrl(url)) { + tileUrlTemplates = [url]; + url = undefined; + } + const props = { + ...this.props, + id: this.props.id, + existing: this.props.existing, + url, + tileUrlTemplates, + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + tileSize: this.props.tileSize, + tms: this.props.tms, + attribution: this.props.attribution + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXRasterSourceNativeComponent.default, _extends({ + ref: this.setNativeRef + }, props), (0, _utils.cloneReactChildrenWithProps)(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(RasterSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +var _default = RasterSource; +exports.default = _default; +//# sourceMappingURL=RasterSource.js.map \ No newline at end of file diff --git a/lib/commonjs/components/RasterSource.js.map b/lib/commonjs/components/RasterSource.js.map new file mode 100644 index 000000000..49a66bd62 --- /dev/null +++ b/lib/commonjs/components/RasterSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","isTileTemplateUrl","url","includes","RasterSource","AbstractSource","constructor","props","console","warn","render","tileUrlTemplates","undefined","id","existing","minZoomLevel","maxZoomLevel","tileSize","tms","attribution","setNativeRef","cloneReactChildrenWithProps","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/RasterSource.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AAEA;AAEA;AAA8C;AAAA;AAAA;AAE9C,MAAMA,QAA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C;QAAC,GAAG,EAAE,IAAI,CAACC;MAAa,GAAKb,KAAK,GAChE,IAAAc,kCAA2B,EAAC,IAAI,CAACd,KAAK,CAACe,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAAChB,KAAK,CAACM;MACvB,CAAC,CAAC;IAC+B;EAEvC;AACF;AAAC,gBA9CKT,YAAY,kBACa;EAC3BS,EAAE,EAAEf,QAAQ,CAAC0B,WAAW,CAACC;AAC3B,CAAC;AAAA,eA6CYrB,YAAY;AAAA"} diff --git a/lib/commonjs/components/ShapeSource.js b/lib/commonjs/components/ShapeSource.js new file mode 100644 index 000000000..3b767bd1b --- /dev/null +++ b/lib/commonjs/components/ShapeSource.js @@ -0,0 +1,161 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ShapeSource = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXShapeSourceNativeComponent = _interopRequireDefault(require("../specs/RNMBXShapeSourceNativeComponent")); +var _NativeRNMBXShapeSourceModule = _interopRequireDefault(require("../specs/NativeRNMBXShapeSourceModule")); +var _utils = require("../utils"); +var _deprecation = require("../utils/deprecation"); +var _AbstractSource = _interopRequireDefault(require("./AbstractSource")); +var _NativeBridgeComponent = _interopRequireDefault(require("./NativeBridgeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +/** + * ShapeSource is a map content source that supplies vector shapes to be shown on the map. + * The shape may be an url or a GeoJSON object + */ +class ShapeSource extends (0, _NativeBridgeComponent.default)(_AbstractSource.default, _NativeRNMBXShapeSourceModule.default) { + constructor(props) { + super(props); + } + _setNativeRef(nativeRef) { + this.setNativeRef(nativeRef); + super._runPendingNativeMethods(nativeRef); + } + + /** + * Returns the zoom needed to expand the cluster. + * + * @example + * const zoom = await shapeSource.getClusterExpansionZoom(clusterId); + * + * @param {Feature} feature - The feature cluster to expand. + * @return {number} + */ + async getClusterExpansionZoom(feature) { + const res = await this._runNativeMethod('getClusterExpansionZoom', this._nativeRef, [JSON.stringify(feature)]); + return res.data; + } + + /** + * Returns the FeatureCollection from the cluster. + * + * @example + * const collection = await shapeSource.getClusterLeaves(clusterId, limit, offset); + * + * @param {GeoJSON.Feature} feature - The feature cluster to expand. + * @param {number} limit - The number of points to return. + * @param {number} offset - The amount of points to skip (for pagination). + * @return {FeatureCollection} + */ + async getClusterLeaves(feature, limit, offset) { + const res = await this._runNativeMethod('getClusterLeaves', this._nativeRef, [JSON.stringify(feature), limit, offset]); + if ((0, _utils.isAndroid)()) { + return JSON.parse(res.data); + } + return res.data; + } + + /** + * Returns the FeatureCollection from the cluster (on the next zoom level). + * + * @example + * const collection = await shapeSource.getClusterChildren(clusterId); + * + * @param {GeoJSON.Feature} feature - The feature cluster to expand. + * @return {FeatureCollection} + */ + async getClusterChildren(feature) { + const res = await this._runNativeMethod('getClusterChildren', this._nativeRef, [JSON.stringify(feature)]); + if ((0, _utils.isAndroid)()) { + return JSON.parse(res.data); + } + return res.data; + } + setNativeProps(props) { + const shallowProps = Object.assign({}, props); + + // Adds support for Animated + if (shallowProps.shape && typeof shallowProps.shape !== 'string') { + shallowProps.shape = JSON.stringify(shallowProps.shape); + } + super.setNativeProps(shallowProps); + } + _getShape() { + if (!this.props.shape) { + return; + } + return (0, _utils.toJSONString)(this.props.shape); + } + _decodePayload(payload) { + // we check whether the payload is a string, since the strict type safety is enforced only on iOS on the new arch + // on Android, on both archs, the payload is an object + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + onPress(event) { + var _this$props$onPress, _this$props; + const payload = this._decodePayload(event.nativeEvent.payload); + const { + features, + coordinates, + point + } = payload; + let newEvent = { + features, + coordinates, + point + }; + newEvent = (0, _deprecation.copyPropertiesAsDeprecated)(event, newEvent, key => { + console.warn(`event.${key} is deprecated on ShapeSource#onPress, please use event.features`); + }, { + nativeEvent: origNativeEvent => ({ + ...origNativeEvent, + payload: features[0] + }) + }); + (_this$props$onPress = (_this$props = this.props).onPress) === null || _this$props$onPress === void 0 ? void 0 : _this$props$onPress.call(_this$props, newEvent); + } + render() { + const props = { + id: this.props.id, + existing: this.props.existing, + url: this.props.url, + shape: this._getShape(), + hitbox: this.props.hitbox, + hasPressListener: (0, _utils.isFunction)(this.props.onPress), + onMapboxShapeSourcePress: this.onPress.bind(this), + cluster: this.props.cluster ? 1 : 0, + clusterRadius: this.props.clusterRadius, + clusterMaxZoomLevel: this.props.clusterMaxZoomLevel, + clusterProperties: this.props.clusterProperties, + maxZoomLevel: this.props.maxZoomLevel, + buffer: this.props.buffer, + tolerance: this.props.tolerance, + lineMetrics: this.props.lineMetrics, + onPress: undefined, + ref: nativeRef => this._setNativeRef(nativeRef) + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXShapeSourceNativeComponent.default, props, (0, _utils.cloneReactChildrenWithProps)(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +exports.ShapeSource = ShapeSource; +_defineProperty(ShapeSource, "NATIVE_ASSETS_KEY", 'assets'); +_defineProperty(ShapeSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +//# sourceMappingURL=ShapeSource.js.map \ No newline at end of file diff --git a/lib/commonjs/components/ShapeSource.js.map b/lib/commonjs/components/ShapeSource.js.map new file mode 100644 index 000000000..a236ffc1c --- /dev/null +++ b/lib/commonjs/components/ShapeSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","ShapeSource","NativeBridgeComponent","AbstractSource","NativeRNMBXShapeSourceModule","constructor","props","_setNativeRef","nativeRef","setNativeRef","_runPendingNativeMethods","getClusterExpansionZoom","feature","res","_runNativeMethod","_nativeRef","JSON","stringify","data","getClusterLeaves","limit","offset","isAndroid","parse","getClusterChildren","setNativeProps","shallowProps","Object","assign","shape","_getShape","toJSONString","_decodePayload","payload","onPress","event","nativeEvent","features","coordinates","point","newEvent","copyPropertiesAsDeprecated","key","console","warn","origNativeEvent","render","id","existing","url","hitbox","hasPressListener","isFunction","onMapboxShapeSourcePress","bind","cluster","clusterRadius","clusterMaxZoomLevel","clusterProperties","maxZoomLevel","buffer","tolerance","lineMetrics","undefined","ref","cloneReactChildrenWithProps","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/ShapeSource.tsx"],"mappings":";;;;;;AAAA;AACA;AAMA;AACA;AACA;AAMA;AAGA;AACA;AAA4D;AAAA;AAE5D,MAAMA,QAAQ,GAAGC,0BAAa,CAACC,WAAW;AA2H1C;AACA;AACA;AACA;AACO,MAAMC,WAAW,SAAS,IAAAC,8BAAqB,EACpDC,uBAAc,EACdC,qCAA4B,CAC7B,CAAC;EAOAC,WAAW,CAACC,KAAY,EAAE;IACxB,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,aAAa,CACXC,SAAiE,EACjE;IACA,IAAI,CAACC,YAAY,CAACD,SAAS,CAAC;IAC5B,KAAK,CAACE,wBAAwB,CAACF,SAAS,CAAC;EAC3C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMG,uBAAuB,CAC3BC,OAAiC,EAChB;IACjB,MAAMC,GAAqB,GAAG,MAAM,IAAI,CAACC,gBAAgB,CACvD,yBAAyB,EACzB,IAAI,CAACC,UAAU,EACf,CAACC,IAAI,CAACC,SAAS,CAACL,OAAO,CAAC,CAAC,CAC1B;IACD,OAAOC,GAAG,CAACK,IAAI;EACjB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,gBAAgB,CACpBP,OAAiC,EACjCQ,KAAa,EACbC,MAAc,EACd;IACA,MAAMR,GAAqB,GAAG,MAAM,IAAI,CAACC,gBAAgB,CACvD,kBAAkB,EAClB,IAAI,CAACC,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MACnCC,aAAa,EAAE,IAAI,CAAClD,KAAK,CAACkD,aAAa;MACvCC,mBAAmB,EAAE,IAAI,CAACnD,KAAK,CAACmD,mBAAmB;MACnDC,iBAAiB,EAAE,IAAI,CAACpD,KAAK,CAACoD,iBAAiB;MAC/CC,YAAY,EAAE,IAAI,CAACrD,KAAK,CAACqD,YAAY;MACrCC,MAAM,EAAE,IAAI,CAACtD,KAAK,CAACsD,MAAM;MACzBC,SAAS,EAAE,IAAI,CAACvD,KAAK,CAACuD,SAAS;MAC/BC,WAAW,EAAE,IAAI,CAACxD,KAAK,CAACwD,WAAW;MACnC5B,OAAO,EAAE6B,SAAS;MAClBC,GAAG,EACDxD,SAAiE,IAC9D,IAAI,CAACD,aAAa,CAACC,SAAS;IACnC,CAAC;IAED;MAAA;MACE;MACA,6BAAC,wCAA+B,EAAKF,KAAK,EACvC,IAAA2D,kCAA2B,EAAC,IAAI,CAAC3D,KAAK,CAAC4D,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAAC7D,KAAK,CAACyC;MACvB,CAAC,CAAC;IAC8B;EAEtC;AACF;AAAC;AAAA,gBAtLY9C,WAAW,uBAIK,QAAQ;AAAA,gBAJxBA,WAAW,kBAMA;EACpB8C,EAAE,EAAEjD,QAAQ,CAACsE,WAAW,CAACC;AAC3B,CAAC"} diff --git a/lib/commonjs/components/SkyLayer.js b/lib/commonjs/components/SkyLayer.js new file mode 100644 index 000000000..5ef519a4d --- /dev/null +++ b/lib/commonjs/components/SkyLayer.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXSkyLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXSkyLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const Mapbox = _reactNative.NativeModules.RNMBXModule; +/** + * SkyLayer is a spherical dome around the map that is always rendered behind all other layers + */ +class SkyLayer extends _AbstractLayer.default { + render() { + return /*#__PURE__*/_react.default.createElement(_RNMBXSkyLayerNativeComponent.default + // @ts-expect-error just codegen stuff + , _extends({ + ref: this.setNativeLayer + }, this.baseProps)); + } +} +_defineProperty(SkyLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +var _default = SkyLayer; +exports.default = _default; +//# sourceMappingURL=SkyLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/SkyLayer.js.map b/lib/commonjs/components/SkyLayer.js.map new file mode 100644 index 000000000..e04984dac --- /dev/null +++ b/lib/commonjs/components/SkyLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox","NativeModules","RNMBXModule","SkyLayer","AbstractLayer","render","setNativeLayer","baseProps","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/SkyLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAIA;AAEA;AAA4C;AAAA;AAAA;AAE5C,MAAMA,MAAM,GAAGC,0BAAa,CAACC,WAAW;AAgDxC;AACA;AACA;AACA,MAAMC,QAAQ,SAASC,sBAAa,CAAyB;EAK3DC,MAAM,GAAG;IACP,oBACE,6BAAC;IACC;IAAA;MACA,GAAG,EAAE,IAAI,CAACC;IAAe,GACrB,IAAI,CAACC,SAAS,EAClB;EAEN;AACF;AAAC,gBAdKJ,QAAQ,kBACU;EACpBK,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAAA,eAaYP,QAAQ;AAAA"} diff --git a/lib/commonjs/components/Style.js b/lib/commonjs/components/Style.js new file mode 100644 index 000000000..af3ffc6f3 --- /dev/null +++ b/lib/commonjs/components/Style.js @@ -0,0 +1,265 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireWildcard(require("react")); +var _CircleLayer = _interopRequireDefault(require("./CircleLayer")); +var _RasterLayer = _interopRequireDefault(require("./RasterLayer")); +var _SymbolLayer = require("./SymbolLayer"); +var _LineLayer = _interopRequireDefault(require("./LineLayer")); +var _FillLayer = _interopRequireDefault(require("./FillLayer")); +var _FillExtrusionLayer = _interopRequireDefault(require("./FillExtrusionLayer")); +var _BackgroundLayer = _interopRequireDefault(require("./BackgroundLayer")); +var _HeatmapLayer = _interopRequireDefault(require("./HeatmapLayer")); +var _VectorSource = _interopRequireDefault(require("./VectorSource")); +var _RasterSource = _interopRequireDefault(require("./RasterSource")); +var _ImageSource = _interopRequireDefault(require("./ImageSource")); +var _ShapeSource = require("./ShapeSource"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function toCamelCase(s) { + return s.replace(/([-_][a-z])/gi, $1 => { + return $1.toUpperCase().replace('-', '').replace('_', ''); + }); +} + +// Patches the Mapbox Style Specification keys into the style props attributes: +// icon-allow-overlap -> iconAllowOverlap +function toCamelCaseKeys(oldObj) { + if (!oldObj) { + return {}; + } + const newObj = {}; + Object.keys(oldObj).forEach(key => { + const value = oldObj[key]; + if (key.includes('-')) { + newObj[toCamelCase(key)] = value; + } else { + newObj[key] = value; + } + }); + return newObj; +} +function getLayerComponentType(layer) { + const { + type + } = layer; + switch (type) { + case 'circle': + return _CircleLayer.default; + case 'symbol': + return _SymbolLayer.SymbolLayer; + case 'raster': + return _RasterLayer.default; + case 'line': + return _LineLayer.default; + case 'fill': + return _FillLayer.default; + case 'fill-extrusion': + return _FillExtrusionLayer.default; + case 'background': + return _BackgroundLayer.default; + case 'heatmap': + return _HeatmapLayer.default; + } + console.warn(`Mapbox layer type '${type}' is not supported/`); + return null; +} +function asLayerComponent(layer) { + const LayerComponent = getLayerComponentType(layer); + if (!LayerComponent) { + return null; + } + const style = { + ...toCamelCaseKeys(layer.paint), + ...toCamelCaseKeys(layer.layout) + }; + const layerProps = {}; + if (layer.source) { + layerProps.sourceID = layer.source; + } + if (layer['source-layer']) { + layerProps.sourceLayerID = layer['source-layer']; + } + if (layer.minzoom) { + layerProps.minZoomLevel = layer.minzoom; + } + if (layer.maxzoom) { + layerProps.maxZoomLevel = layer.maxzoom; + } + if (layer.filter) { + layerProps.filter = layer.filter; + } + if (Object.keys(style).length) { + layerProps.style = style; + } + return /*#__PURE__*/_react.default.createElement(LayerComponent, _extends({ + key: layer.id, + id: layer.id + }, layerProps)); +} +function getTileSourceProps(source) { + const sourceProps = {}; + if (source.url) { + sourceProps.url = source.url; + } + if (source.tiles) { + sourceProps.tileUrlTemplates = source.tiles; + } + if (source.minzoom !== undefined) { + sourceProps.minZoomLevel = source.minzoom; + } + if (source.maxzoom !== undefined) { + sourceProps.maxZoomLevel = source.maxzoom; + } + if (source.attribution) { + sourceProps.attribution = source.attribution; + } + if (source.scheme && source.scheme === 'tms') { + sourceProps.tms = true; + } + return sourceProps; +} +function getVectorSource(id, source) { + const sourceProps = { + ...getTileSourceProps(source) + }; + return /*#__PURE__*/_react.default.createElement(_VectorSource.default, _extends({ + key: id, + id: id + }, sourceProps)); +} +function getRasterSource(id, source) { + const sourceProps = { + ...getTileSourceProps(source) + }; + if (source.tileSize) { + sourceProps.tileSize = source.tileSize; + } + return /*#__PURE__*/_react.default.createElement(_RasterSource.default, _extends({ + key: id, + id: id + }, sourceProps)); +} +function getImageSource(id, source) { + const sourceProps = { + url: source.url, + coordinates: source.coordinates + }; + return /*#__PURE__*/_react.default.createElement(_ImageSource.default, _extends({ + key: id, + id: id + }, sourceProps)); +} +function getShapeSource(id, source) { + const sourceProps = {}; + if (source.data && typeof source.data === 'string') { + sourceProps.url = source.data; + } else if (source.data && typeof source.data === 'object') { + sourceProps.shape = source.data; + } + if (source.cluster !== undefined) { + sourceProps.cluster = source.cluster; + } + if (source.clusterRadius !== undefined) { + sourceProps.clusterRadius = source.clusterRadius; + } + if (source.maxzoom !== undefined) { + sourceProps.maxZoomLevel = source.maxzoom; + } + if (source.clusterMaxZoom !== undefined) { + sourceProps.clusterMaxZoomLevel = source.clusterMaxZoom; + } + if (source.clusterProperties !== undefined) { + sourceProps.clusterProperties = source.clusterProperties; + } + if (source.buffer !== undefined) { + sourceProps.buffer = source.buffer; + } + if (source.tolerance !== undefined) { + sourceProps.tolerance = source.tolerance; + } + if (source.lineMetrics !== undefined) { + sourceProps.lineMetrics = source.lineMetrics; + } + return /*#__PURE__*/_react.default.createElement(_ShapeSource.ShapeSource, _extends({ + key: id, + id: id + }, sourceProps)); +} +function asSourceComponent(id, source) { + switch (source.type) { + case 'vector': + return getVectorSource(id, source); + case 'raster': + return getRasterSource(id, source); + case 'image': + return getImageSource(id, source); + case 'geojson': + return getShapeSource(id, source); + } + console.warn(`Mapbox source type '${source.type}' is not supported/`); + return null; +} +/** + * Style is a component that automatically adds sources / layers to the map using Mapbox GL Style Spec. + * Only [`sources`](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources) & [`layers`](https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/) are supported. + * Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/rnmapbox/maps/tree/main/docs. + */ +const Style = props => { + const [fetchedJson, setFetchedJson] = (0, _react.useState)({}); + const json = typeof props.json === 'object' ? props.json : fetchedJson; + + // Fetch style when props.json is a URL + (0, _react.useEffect)(() => { + const abortController = new AbortController(); + const fetchStyleJson = async json => { + try { + const response = await fetch(json, { + signal: abortController.signal + }); + const responseJson = await response.json(); + setFetchedJson(responseJson); + } catch (error) { + const e = error; + if (e.name === 'AbortError') { + return; + } + throw e; + } + }; + if (typeof props.json === 'string') { + fetchStyleJson(props.json); + } + return function cleanup() { + abortController.abort(); + }; + }, [props.json]); + + // Extract layer components from json + const layerComponents = (0, _react.useMemo)(() => { + if (!json.layers) { + return []; + } + return json.layers.map(asLayerComponent).filter(x => !!x); + }, [json.layers]); + + // Extract source components from json + const { + sources + } = json; + const sourceComponents = (0, _react.useMemo)(() => { + if (!sources || !Object.keys(sources)) { + return []; + } + return Object.keys(sources).map(id => asSourceComponent(id, sources[id])).filter(x => !!x); + }, [sources]); + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sourceComponents, layerComponents); +}; +var _default = Style; +exports.default = _default; +//# sourceMappingURL=Style.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Style.js.map b/lib/commonjs/components/Style.js.map new file mode 100644 index 000000000..3a9b84c18 --- /dev/null +++ b/lib/commonjs/components/Style.js.map @@ -0,0 +1 @@ +{"version":3,"names":["toCamelCase","s","replace","$1","toUpperCase","toCamelCaseKeys","oldObj","newObj","Object","keys","forEach","key","value","includes","getLayerComponentType","layer","type","CircleLayer","SymbolLayer","RasterLayer","LineLayer","FillLayer","FillExtrusionLayer","BackgroundLayer","HeatmapLayer","console","warn","asLayerComponent","LayerComponent","style","paint","layout","layerProps","source","sourceID","sourceLayerID","minzoom","minZoomLevel","maxzoom","maxZoomLevel","filter","length","id","getTileSourceProps","sourceProps","url","tiles","tileUrlTemplates","undefined","attribution","scheme","tms","getVectorSource","getRasterSource","tileSize","getImageSource","coordinates","getShapeSource","data","shape","cluster","clusterRadius","clusterMaxZoom","clusterMaxZoomLevel","clusterProperties","buffer","tolerance","lineMetrics","asSourceComponent","Style","props","fetchedJson","setFetchedJson","useState","json","useEffect","abortController","AbortController","fetchStyleJson","response","fetch","signal","responseJson","error","e","name","cleanup","abort","layerComponents","useMemo","layers","map","x","sources","sourceComponents"],"sourceRoot":"../../../src","sources":["components/Style.tsx"],"mappings":";;;;;;AAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA4C;AAAA;AAAA;AAAA;AAE5C,SAASA,WAAW,CAACC,CAAS,EAAU;EACtC,OAAOA,CAAC,CAACC,OAAO,CAAC,eAAe,EAAGC,EAAE,IAAK;IACxC,OAAOA,EAAE,CAACC,WAAW,EAAE,CAACF,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAACA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3D,CAAC,CAAC;AACJ;;AAEA;AACA;AACA,SAASG,eAAe,CAACC,MAAmC,EAE1D;EACA,IAAI,CAACA,MAAM,EAAE;IACX,OAAO,CAAC,CAAC;EACX;EACA,MAAMC,MAAkC,GAAG,CAAC,CAAC;EAC7CC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,CAACI,OAAO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AK,CAACI,IAAI,CAAC;IAC5B;IACA,OAAO,SAASY,OAAO,GAAG;MACxBV,eAAe,CAACW,KAAK,EAAE;IACzB,CAAC;EACH,CAAC,EAAE,CAACjB,KAAK,CAACI,IAAI,CAAC,CAAC;;EAEhB;EACA,MAAMc,eAAe,GAAG,IAAAC,cAAO,EAAC,MAAM;IACpC,IAAI,CAACf,IAAI,CAACgB,MAAM,EAAE;MAChB,OAAO,EAAE;IACX;IACA,OAAOhB,IAAI,CAACgB,MAAM,CAACC,GAAG,CAAChE,gBAAgB,CAAC,CAACa,MAAM,CAAEoD,CAAC,IAAK,CAAC,CAACA,CAAC,CAAC;EAC7D,CAAC,EAAE,CAAClB,IAAI,CAACgB,MAAM,CAAC,CAAC;;EAEjB;EACA,MAAM;IAAEG;EAAQ,CAAC,GAAGnB,IAAI;EACxB,MAAMoB,gBAAgB,GAAG,IAAAL,cAAO,EAAC,MAAM;IACrC,IAAI,CAACI,OAAO,IAAI,CAACrF,MAAM,CAACC,IAAI,CAACoF,OAAO,CAAC,EAAE;MACrC,OAAO,EAAE;IACX;IACA,OAAOrF,MAAM,CAACC,IAAI,CAACoF,OAAO,CAAC,CACxBF,GAAG,CAAEjD,EAAE,IAAK0B,iBAAiB,CAAC1B,EAAE,EAAEmD,OAAO,CAACnD,EAAE,CAAC,CAAC,CAAC,CAC/CF,MAAM,CAAEoD,CAAC,IAAK,CAAC,CAACA,CAAC,CAAC;EACvB,CAAC,EAAE,CAACC,OAAO,CAAC,CAAC;EAEb,oBACE,4DACGC,gBAAgB,EAChBN,eAAe,CACf;AAEP,CAAC;AAAC,eAEanB,KAAK;AAAA"} diff --git a/lib/commonjs/components/StyleImport.js b/lib/commonjs/components/StyleImport.js new file mode 100644 index 000000000..526e655b4 --- /dev/null +++ b/lib/commonjs/components/StyleImport.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireWildcard(require("react")); +var _RNMBXStyleImportNativeComponent = _interopRequireDefault(require("../specs/RNMBXStyleImportNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +/** + * Use StyleImport to set configuration options on the new standard style. **V11 only.** + * + * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style + */ +var _default = /*#__PURE__*/(0, _react.memo)(props => { + return /*#__PURE__*/_react.default.createElement(_RNMBXStyleImportNativeComponent.default, props); +}); +exports.default = _default; +//# sourceMappingURL=StyleImport.js.map \ No newline at end of file diff --git a/lib/commonjs/components/StyleImport.js.map b/lib/commonjs/components/StyleImport.js.map new file mode 100644 index 000000000..d17c9c41b --- /dev/null +++ b/lib/commonjs/components/StyleImport.js.map @@ -0,0 +1 @@ +{"version":3,"names":["memo","props"],"sourceRoot":"../../../src","sources":["components/StyleImport.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAyE;AAAA;AAAA;AAuBzE;AACA;AACA;AACA;AACA;AAJA,4BAKe,IAAAA,WAAI,EAAEC,KAAY,IAAK;EACpC,oBAAO,6BAAC,wCAAiB,EAAKA,KAAK,CAAI;AACzC,CAAC,CAAC;AAAA"} diff --git a/lib/commonjs/components/SymbolLayer.js b/lib/commonjs/components/SymbolLayer.js new file mode 100644 index 000000000..43555cb09 --- /dev/null +++ b/lib/commonjs/components/SymbolLayer.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SymbolLayer = exports.NATIVE_MODULE_NAME = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXSymbolLayerNativeComponent = _interopRequireDefault(require("../specs/RNMBXSymbolLayerNativeComponent")); +var _AbstractLayer = _interopRequireDefault(require("./AbstractLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const NATIVE_MODULE_NAME = 'RNMBXSymbolLayer'; +exports.NATIVE_MODULE_NAME = NATIVE_MODULE_NAME; +const Mapbox = _reactNative.NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * SymbolLayer is a style layer that renders icon and text labels at points or along lines on the map. + */ +class SymbolLayer extends _AbstractLayer.default { + constructor() { + super(...arguments); + _defineProperty(this, "deprecationLogged", { + snapshot: false + }); + } + _shouldSnapshot() { + let isSnapshot = false; + if (_react.default.Children.count(this.baseProps.children) <= 0) { + return isSnapshot; + } + _react.default.Children.forEach(this.baseProps.children, child => { + if ((child === null || child === void 0 ? void 0 : child.type) === _reactNative.View) { + isSnapshot = true; + } + }); + if (isSnapshot && !this.deprecationLogged.snapshot) { + console.warn('SymbolLayer: passing children for symbol layer is deprecated, please use @rnmapbox/maps Image component instead. https://github.com/rnmapbox/maps/wiki/Deprecated-SymbolLayerChildren'); + this.deprecationLogged.snapshot = true; + } + return isSnapshot; + } + render() { + const props = { + ...this.baseProps, + snapshot: this._shouldSnapshot(), + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXSymbolLayerNativeComponent.default, _extends({ + ref: this.setNativeLayer + }, props), this.props.children) + ); + } +} +exports.SymbolLayer = SymbolLayer; +_defineProperty(SymbolLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +//# sourceMappingURL=SymbolLayer.js.map \ No newline at end of file diff --git a/lib/commonjs/components/SymbolLayer.js.map b/lib/commonjs/components/SymbolLayer.js.map new file mode 100644 index 000000000..2ebaa142f --- /dev/null +++ b/lib/commonjs/components/SymbolLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NATIVE_MODULE_NAME","Mapbox","NativeModules","RNMBXModule","SymbolLayer","AbstractLayer","snapshot","_shouldSnapshot","isSnapshot","React","Children","count","baseProps","children","forEach","child","type","View","deprecationLogged","console","warn","render","props","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/SymbolLayer.tsx"],"mappings":";;;;;;AAAA;AACA;AAOA;AAEA;AAA4C;AAAA;AAAA;AAErC,MAAMA,kBAAkB,GAAG,kBAAkB;AAAC;AAErD,MAAMC,MAAM,GAAGC,0BAAa,CAACC,WAAW;;AAExC;;AAmFA;AACA;AACA;AACO,MAAMC,WAAW,SAASC,sBAAa,CAAyB;EAAA;IAAA;IAAA,2CAI1B;MAAEC,QAAQ,EAAE;IAAM,CAAC;EAAA;EAE9DC,eAAe,GAAG;IAChB,IAAIC,UAAU,GAAG,KAAK;IAEtB,IAAIC,cAAK,CAACC,QAAQ,CAACC,KAAK,CAAC,IAAI,CAACC,SAAS,CAACC,QAAQ,CAAC,IAAI,CAAC,EAAE;MACtD,OAAOL,UAAU;IACnB;IAEAC,cAAK,CAACC,QAAQ,CAACI,OAAO,CAAC,IAAI,CAACF,SAAS,CAACC,QAAQ,EAAGE,KAAK,IAAK;MACzD,IAAI,CAAAA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,IAAI,MAAKC,iBAAI,EAAE;QACxBT,UAAU,GAAG,IAAI;MACnB;IACF,CAAC,CAAC;IACF,IAAIA,UAAU,IAAI,CAAC,IAAI,CAACU,iBAAiB,CAACZ,QAAQ,EAAE;MAClDa,OAAO,CAACC,IAAI,CACV,uLAAuL,CACxL;MACD,IAAI,CAACF,iBAAiB,CAACZ,QAAQ,GAAG,IAAI;IACxC;IAEA,OAAOE,UAAU;EACnB;EAEAa,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACV,SAAS;MACjBN,QAAQ,EAAE,IAAI,CAACC,eAAe,EAAE;MAChCgB,aAAa,EAAE,IAAI,CAACD,KAAK,CAACC;IAC5B,CAAC;IAED;MAAA;MACE;MACA,6BAAC,wCAA+B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKF,KAAK,GACjE,IAAI,CAACA,KAAK,CAACT,QAAQ;IACY;EAEtC;AACF;AAAC;AAAA,gBA1CYT,WAAW,kBACA;EACpBqB,QAAQ,EAAExB,MAAM,CAACyB,WAAW,CAACC;AAC/B,CAAC"} diff --git a/lib/commonjs/components/Terrain.js b/lib/commonjs/components/Terrain.js new file mode 100644 index 000000000..dc3f42089 --- /dev/null +++ b/lib/commonjs/components/Terrain.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Terrain = void 0; +var _react = _interopRequireWildcard(require("react")); +var _StyleValue = require("../utils/StyleValue"); +var _RNMBXTerrainNativeComponent = _interopRequireDefault(require("../specs/RNMBXTerrainNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const Terrain = /*#__PURE__*/(0, _react.memo)(props => { + let { + style = {} + } = props; + if (props.exaggeration) { + console.warn(`Terrain: exaggeration property is deprecated pls use style.exaggeration instead!`); + style = { + exaggeration: props.exaggeration, + ...style + }; + } + const baseProps = (0, _react.useMemo)(() => { + return { + ...props, + reactStyle: (0, _StyleValue.transformStyle)(style), + style: undefined + }; + }, [props, style]); + return /*#__PURE__*/_react.default.createElement(_RNMBXTerrainNativeComponent.default, baseProps); +}); +exports.Terrain = Terrain; +//# sourceMappingURL=Terrain.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Terrain.js.map b/lib/commonjs/components/Terrain.js.map new file mode 100644 index 000000000..270a08d61 --- /dev/null +++ b/lib/commonjs/components/Terrain.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Terrain","memo","props","style","exaggeration","console","warn","baseProps","useMemo","reactStyle","transformStyle","undefined"],"sourceRoot":"../../../src","sources":["components/Terrain.tsx"],"mappings":";;;;;;AAAA;AAGA;AAEA;AAAgF;AAAA;AAAA;AAmBzE,MAAMA,OAAO,gBAAG,IAAAC,WAAI,EAAEC,KAAY,IAAK;EAC5C,IAAI;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGD,KAAK;EAE1B,IAAIA,KAAK,CAACE,YAAY,EAAE;IACtBC,OAAO,CAACC,IAAI,CACT,kFAAiF,CACnF;IACDH,KAAK,GAAG;MAAEC,YAAY,EAAEF,KAAK,CAACE,YAAY;MAAE,GAAGD;IAAM,CAAC;EACxD;EAEA,MAAMI,SAAS,GAAG,IAAAC,cAAO,EAAC,MAAM;IAC9B,OAAO;MACL,GAAGN,KAAK;MACRO,UAAU,EAAE,IAAAC,0BAAc,EAACP,KAAK,CAAC;MACjCA,KAAK,EAAEQ;IACT,CAAC;EACH,CAAC,EAAE,CAACT,KAAK,EAAEC,KAAK,CAAC,CAAC;EAElB,oBAAO,6BAAC,oCAA4B,EAAKI,SAAS,CAAI;AACxD,CAAC,CAAC;AAAC"} diff --git a/lib/commonjs/components/UserLocation.js b/lib/commonjs/components/UserLocation.js new file mode 100644 index 000000000..7defc1cbe --- /dev/null +++ b/lib/commonjs/components/UserLocation.js @@ -0,0 +1,215 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.UserLocationRenderMode = void 0; +var _react = _interopRequireDefault(require("react")); +var _locationManager = _interopRequireDefault(require("../modules/location/locationManager")); +var _Annotation = _interopRequireDefault(require("./Annotation")); +var _CircleLayer = _interopRequireDefault(require("./CircleLayer")); +var _HeadingIndicator = _interopRequireDefault(require("./HeadingIndicator")); +var _LocationPuck = _interopRequireDefault(require("./LocationPuck")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const mapboxBlue = 'rgba(51, 181, 229, 100)'; +const layerStyles = { + normal: { + pulse: { + circleRadius: 15, + circleColor: mapboxBlue, + circleOpacity: 0.2, + circlePitchAlignment: 'map' + }, + background: { + circleRadius: 9, + circleColor: '#fff', + circlePitchAlignment: 'map' + }, + foreground: { + circleRadius: 6, + circleColor: mapboxBlue, + circlePitchAlignment: 'map' + } + } +}; +const normalIcon = (showsUserHeadingIndicator, heading) => [/*#__PURE__*/_react.default.createElement(_CircleLayer.default, { + key: "mapboxUserLocationPulseCircle", + id: "mapboxUserLocationPulseCircle", + style: layerStyles.normal.pulse +}), /*#__PURE__*/_react.default.createElement(_CircleLayer.default, { + key: "mapboxUserLocationWhiteCircle", + id: "mapboxUserLocationWhiteCircle", + style: layerStyles.normal.background +}), /*#__PURE__*/_react.default.createElement(_CircleLayer.default, { + key: "mapboxUserLocationBlueCircle", + id: "mapboxUserLocationBlueCircle", + aboveLayerID: "mapboxUserLocationWhiteCircle", + style: layerStyles.normal.foreground +}), ...(showsUserHeadingIndicator && typeof heading === 'number' ? [(0, _HeadingIndicator.default)({ + heading, + key: 'mapboxUserLocationHeadingIndicator' +})] : [])]; +let UserLocationRenderMode; +exports.UserLocationRenderMode = UserLocationRenderMode; +(function (UserLocationRenderMode) { + UserLocationRenderMode["Native"] = "native"; + UserLocationRenderMode["Normal"] = "normal"; +})(UserLocationRenderMode || (exports.UserLocationRenderMode = UserLocationRenderMode = {})); +class UserLocation extends _react.default.Component { + constructor(props) { + super(props); + _defineProperty(this, "_isMounted", undefined); + _defineProperty(this, "locationManagerRunning", false); + this.state = { + shouldShowUserLocation: false, + coordinates: null, + heading: null + }; + this._onLocationUpdate = this._onLocationUpdate.bind(this); + } + + // required as #setLocationManager attempts to setState + // after component unmount + + async componentDidMount() { + this._isMounted = true; + _locationManager.default.setMinDisplacement(this.props.minDisplacement || 0); + await this.setLocationManager({ + running: this.needsLocationManagerRunning() + }); + if (this.props.renderMode === UserLocationRenderMode.Native) { + return; + } + } + async componentDidUpdate(prevProps) { + await this.setLocationManager({ + running: this.needsLocationManagerRunning() + }); + if (this.props.minDisplacement !== prevProps.minDisplacement) { + _locationManager.default.setMinDisplacement(this.props.minDisplacement || 0); + } + if (this.props.requestsAlwaysUse !== prevProps.requestsAlwaysUse) { + _locationManager.default.setRequestsAlwaysUse(this.props.requestsAlwaysUse || false); + } + } + async componentWillUnmount() { + this._isMounted = false; + await this.setLocationManager({ + running: false + }); + } + + /** + * Whether to start or stop listening to the locationManager + * + * Notice, that listening will start automatically when + * either `onUpdate` or `visible` are set + * + * @async + * @param {Object} running - Object with key `running` and `boolean` value + * @return {Promise} + */ + async setLocationManager(_ref) { + let { + running + } = _ref; + if (this.locationManagerRunning !== running) { + this.locationManagerRunning = running; + if (running) { + _locationManager.default.addListener(this._onLocationUpdate); + const location = await _locationManager.default.getLastKnownLocation(); + this._onLocationUpdate(location); + } else { + _locationManager.default.removeListener(this._onLocationUpdate); + } + } + } + + /** + * + * If locationManager should be running + * + * @return {boolean} + */ + needsLocationManagerRunning() { + return !!this.props.onUpdate || this.props.renderMode === UserLocationRenderMode.Normal && this.props.visible; + } + _onLocationUpdate(location) { + if (!this._isMounted || !location) { + return; + } + let coordinates = null; + let heading = null; + if (location && location.coords) { + const { + longitude, + latitude + } = location.coords; + ({ + heading + } = location.coords); + coordinates = [longitude, latitude]; + } + this.setState({ + coordinates, + heading: heading ?? null + }); + if (this.props.onUpdate) { + this.props.onUpdate(location); + } + } + _renderNative() { + const { + androidRenderMode, + showsUserHeadingIndicator + } = this.props; + const props = { + androidRenderMode, + iosShowsUserHeadingIndicator: showsUserHeadingIndicator + }; + return /*#__PURE__*/_react.default.createElement(_LocationPuck.default, props); + } + render() { + const { + heading, + coordinates + } = this.state; + const { + children, + visible, + showsUserHeadingIndicator, + onPress, + animated + } = this.props; + if (!visible) { + return null; + } + if (this.props.renderMode === UserLocationRenderMode.Native) { + return this._renderNative(); + } + if (!coordinates) { + return null; + } + return /*#__PURE__*/_react.default.createElement(_Annotation.default, { + id: "mapboxUserLocation", + animated: animated, + onPress: onPress, + coordinates: coordinates, + style: { + iconRotate: heading + } + }, children || normalIcon(showsUserHeadingIndicator, heading)); + } +} +_defineProperty(UserLocation, "defaultProps", { + animated: true, + visible: true, + showsUserHeadingIndicator: false, + requestsAlwaysUse: false, + minDisplacement: 0, + renderMode: UserLocationRenderMode.Normal +}); +var _default = UserLocation; +exports.default = _default; +//# sourceMappingURL=UserLocation.js.map \ No newline at end of file diff --git a/lib/commonjs/components/UserLocation.js.map b/lib/commonjs/components/UserLocation.js.map new file mode 100644 index 000000000..091f07588 --- /dev/null +++ b/lib/commonjs/components/UserLocation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["mapboxBlue","layerStyles","normal","pulse","circleRadius","circleColor","circleOpacity","circlePitchAlignment","background","foreground","normalIcon","showsUserHeadingIndicator","heading","HeadingIndicator","key","UserLocationRenderMode","UserLocation","React","Component","constructor","props","undefined","state","shouldShowUserLocation","coordinates","_onLocationUpdate","bind","componentDidMount","_isMounted","locationManager","setMinDisplacement","minDisplacement","setLocationManager","running","needsLocationManagerRunning","renderMode","Native","componentDidUpdate","prevProps","requestsAlwaysUse","setRequestsAlwaysUse","componentWillUnmount","locationManagerRunning","addListener","location","getLastKnownLocation","removeListener","onUpdate","Normal","visible","coords","longitude","latitude","setState","_renderNative","androidRenderMode","iosShowsUserHeadingIndicator","render","children","onPress","animated","iconRotate"],"sourceRoot":"../../../src","sources":["components/UserLocation.tsx"],"mappings":";;;;;;AAAA;AAEA;AAIA;AACA;AACA;AACA;AAAgD;AAAA;AAEhD,MAAMA,UAAU,GAAG,yBAAyB;AAE5C,MAAMC,WAA+D,GAAG;EACtEC,MAAM,EAAE;IACNC,KAAK,EAAE;MACLC,YAAY,EAAE,EAAE;MAChBC,WAAW,EAAEL,UAAU;MACvBM,aAAa,EAAE,GAAG;MAClBC,oBAAoB,EAAE;IACxB,CAAC;IACDC,UAAU,EAAE;MACVJ,YAAY,EAAE,CAAC;MACfC,WAAW,EAAE,MAAM;M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AACS,KAAK;IAEnE,MAAMA,KAAK,GAAG;MACZmC,iBAAiB;MACjBC,4BAA4B,EAAE7C;IAChC,CAAC;IACD,oBAAO,6BAAC,qBAAkB,EAAKS,KAAK,CAAI;EAC1C;EAEAqC,MAAM,GAAG;IACP,MAAM;MAAE7C,OAAO;MAAEY;IAAY,CAAC,GAAG,IAAI,CAACF,KAAK;IAC3C,MAAM;MAAEoC,QAAQ;MAAET,OAAO;MAAEtC,yBAAyB;MAAEgD,OAAO;MAAEC;IAAS,CAAC,GACvE,IAAI,CAACxC,KAAK;IAEZ,IAAI,CAAC6B,OAAO,EAAE;MACZ,OAAO,IAAI;IACb;IAEA,IAAI,IAAI,CAAC7B,KAAK,CAACe,UAAU,KAAKpB,sBAAsB,CAACqB,MAAM,EAAE;MAC3D,OAAO,IAAI,CAACkB,aAAa,EAAE;IAC7B;IAEA,IAAI,CAAC9B,WAAW,EAAE;MAChB,OAAO,IAAI;IACb;IAEA,oBACE,6BAAC,mBAAU;MACT,EAAE,EAAC,oBAAoB;MACvB,QAAQ,EAAEoC,QAAS;MACnB,OAAO,EAAED,OAAQ;MACjB,WAAW,EAAEnC,WAAY;MACzB,KAAK,EAAE;QACLqC,UAAU,EAAEjD;MACd;IAAE,GAED8C,QAAQ,IAAIhD,UAAU,CAACC,yBAAyB,EAAEC,OAAO,CAAC,CAChD;EAEjB;AACF;AAAC,gBAnKKI,YAAY,kBACM;EACpB4C,QAAQ,EAAE,IAAI;EACdX,OAAO,EAAE,IAAI;EACbtC,yBAAyB,EAAE,KAAK;EAChC4B,iBAAiB,EAAE,KAAK;EACxBR,eAAe,EAAE,CAAC;EAClBI,UAAU,EAAEpB,sBAAsB,CAACiC;AACrC,CAAC;AAAA,eA6JYhC,YAAY;AAAA"} diff --git a/lib/commonjs/components/VectorSource.js b/lib/commonjs/components/VectorSource.js new file mode 100644 index 000000000..4d09c10e5 --- /dev/null +++ b/lib/commonjs/components/VectorSource.js @@ -0,0 +1,95 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.NATIVE_MODULE_NAME = void 0; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +var _RNMBXVectorSourceNativeComponent = _interopRequireDefault(require("../specs/RNMBXVectorSourceNativeComponent")); +var _utils = require("../utils"); +var _deprecation = require("../utils/deprecation"); +var _AbstractSource = _interopRequireDefault(require("./AbstractSource")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +const NATIVE_MODULE_NAME = 'RNMBXVectorSource'; +exports.NATIVE_MODULE_NAME = NATIVE_MODULE_NAME; +// Omit; +/** + * VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map. + * The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. + */ +class VectorSource extends _AbstractSource.default { + constructor(props) { + super(props); + } + _decodePayload(payload) { + // we check whether the payload is a string, since the strict type safety is enforced only on iOS on the new arch + // on Android, on both archs, the payload is an object + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + onPress(event) { + const payload = this._decodePayload(event.nativeEvent.payload); + const { + features, + coordinates, + point + } = payload; + let newEvent = { + features, + coordinates, + point + }; + newEvent = (0, _deprecation.copyPropertiesAsDeprecated)(event, newEvent, key => { + console.warn(`event.${key} is deprecated on VectorSource#onPress, please use event.features`); + }, { + nativeEvent: origNativeEvent => ({ + ...origNativeEvent, + payload: features[0] + }) + }); + const { + onPress + } = this.props; + if (onPress) { + onPress(newEvent); + } + } + render() { + const props = { + id: this.props.id, + existing: this.props.existing, + url: this.props.url, + tileUrlTemplates: this.props.tileUrlTemplates, + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + tms: this.props.tms, + attribution: this.props.attribution, + hitbox: this.props.hitbox, + hasPressListener: (0, _utils.isFunction)(this.props.onPress), + onMapboxVectorSourcePress: this.onPress.bind(this), + onPress: undefined + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + _react.default.createElement(_RNMBXVectorSourceNativeComponent.default, _extends({ + ref: this.setNativeRef + }, props), (0, _utils.cloneReactChildrenWithProps)(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(VectorSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +var _default = VectorSource; +exports.default = _default; +//# sourceMappingURL=VectorSource.js.map \ No newline at end of file diff --git a/lib/commonjs/components/VectorSource.js.map b/lib/commonjs/components/VectorSource.js.map new file mode 100644 index 000000000..2302a1fed --- /dev/null +++ b/lib/commonjs/components/VectorSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","NATIVE_MODULE_NAME","VectorSource","AbstractSource","constructor","props","_decodePayload","payload","JSON","parse","onPress","event","nativeEvent","features","coordinates","point","newEvent","copyPropertiesAsDeprecated","key","console","warn","origNativeEvent","render","id","existing","url","tileUrlTemplates","minZoomLevel","maxZoomLevel","tms","attribution","hitbox","hasPressListener","isFunction","onMapboxVectorSourcePress","bind","undefined","setNativeRef","cloneReactChildrenWithProps","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/VectorSource.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AAGA;AAA8C;AAAA;AAAA;AAE9C,MAAMA,QAAQ,GAAGC,0BAAa,CAACC,WAAW;AAEnC,MAAMC,kBAAkB,GAAG,mBAAmB;AAAC;AA8E5B;AAC1B;AACA;AACA;AACA;AACA,MAAMC,YAAY,SA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B,YAAY;MACrCC,YAAY,EAAE,IAAI,CAACvB,KAAK,CAACuB,YAAY;MACrCC,GAAG,EAAE,IAAI,CAACxB,KAAK,CAACwB,GAAG;MACnBC,WAAW,EAAE,IAAI,CAACzB,KAAK,CAACyB,WAAW;MACnCC,MAAM,EAAE,IAAI,CAAC1B,KAAK,CAAC0B,MAAM;MACzBC,gBAAgB,EAAE,IAAAC,iBAAU,EAAC,IAAI,CAAC5B,KAAK,CAACK,OAAO,CAAC;MAChDwB,yBAAyB,EAAE,IAAI,CAACxB,OAAO,CAACyB,IAAI,CAAC,IAAI,CAAC;MAClDzB,OAAO,EAAE0B;IACX,CAAC;IACD;MAAA;MACE;MACA,6BAAC,yCAAgC;QAAC,GAAG,EAAE,IAAI,CAACC;MAAa,GAAKhC,KAAK,GAChE,IAAAiC,kCAA2B,EAAC,IAAI,CAACjC,KAAK,CAACkC,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAACnC,KAAK,CAACkB;MACvB,CAAC,CAAC;IAC+B;EAEvC;AACF;AAAC,gBA5EKrB,YAAY,kBACM;EACpBqB,EAAE,EAAEzB,QAAQ,CAAC2C,WAAW,CAACC;AAC3B,CAAC;AAAA,eA2EYxC,YAAY;AAAA"} diff --git a/lib/commonjs/components/Viewport.js b/lib/commonjs/components/Viewport.js new file mode 100644 index 000000000..e1de093de --- /dev/null +++ b/lib/commonjs/components/Viewport.js @@ -0,0 +1,106 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Viewport = void 0; +var _react = _interopRequireWildcard(require("react")); +var _reactNative = require("react-native"); +var _RNMBXViewportNativeComponent = _interopRequireDefault(require("../specs/RNMBXViewportNativeComponent")); +var _NativeRNMBXViewportModule = _interopRequireDefault(require("../specs/NativeRNMBXViewportModule")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +/** + * provides a structured approach to organizing camera management logic into states and transitions between them. + * + * At any given time, the viewport is either: + * - idle + * - in a state (camera is being managed by a ViewportState) + * - transitioning between states + * + * See [android](https://docs.mapbox.com/android/maps/api/${ANDROID_SDK_VERSION}/mapbox-maps-android/com.mapbox.maps.plugin.viewport/viewport.html), + * [ios](https://docs.mapbox.com/ios/maps/api/${IOS_SDK_VERSION}/Viewport.html#/s:10MapboxMaps8ViewportC) + */ +const Viewport = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)((props, ref) => { + const commands = (0, _react.useMemo)(() => new NativeCommands(_NativeRNMBXViewportModule.default), []); + const nativeViewport = (0, _react.useRef)(null); + (0, _react.useEffect)(() => { + if (nativeViewport.current) { + commands.setNativeRef(nativeViewport.current); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [commands, nativeViewport.current]); + (0, _react.useImperativeHandle)(ref, () => ({ + getState() { + console.log(' => calling getState'); + return commands.call('getState', []); + }, + async idle() { + return commands.call('idle', []); + }, + transitionTo(state, transition) { + return commands.call('transitionTo', [state, transition]); + } + })); + const onStatusChangedNative = (0, _react.useMemo)(() => { + const propsOnStatusChanged = props.onStatusChanged; + if (propsOnStatusChanged != null) { + return event => { + propsOnStatusChanged(event.nativeEvent.payload); + }; + } else { + return undefined; + } + }, [props.onStatusChanged]); + return /*#__PURE__*/_react.default.createElement(RNMBXViewport, _extends({}, props, { + hasStatusChanged: props.onStatusChanged != null, + onStatusChanged: onStatusChangedNative, + ref: nativeViewport + })); +})); +exports.Viewport = Viewport; +const RNMBXViewport = _RNMBXViewportNativeComponent.default; +class NativeCommands { + constructor(module) { + this.module = module; + this.preRefMethodQueue = []; + } + async setNativeRef(nativeRef) { + if (nativeRef) { + this.nativeRef = nativeRef; + while (this.preRefMethodQueue.length > 0) { + const item = this.preRefMethodQueue.pop(); + if (item && item.method && item.resolver) { + const res = await this._call(item.method.name, nativeRef, item.method.args); + item.resolver(res); + } + } + } + } + call(name, args) { + if (this.nativeRef) { + return this._call(name, this.nativeRef, args); + } else { + return new Promise(resolve => { + this.preRefMethodQueue.push({ + method: { + name, + args + }, + resolver: resolve + }); + }); + } + } + _call(name, nativeRef, args) { + const handle = (0, _reactNative.findNodeHandle)(nativeRef); + if (handle) { + return this.module[name](handle, ...args); + } else { + throw new Error(`Could not find handle for native ref ${module} when trying to invoke ${String(name)}`); + } + } +} +//# sourceMappingURL=Viewport.js.map \ No newline at end of file diff --git a/lib/commonjs/components/Viewport.js.map b/lib/commonjs/components/Viewport.js.map new file mode 100644 index 000000000..3ae28e9eb --- /dev/null +++ b/lib/commonjs/components/Viewport.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Viewport","memo","forwardRef","props","ref","commands","useMemo","NativeCommands","RNMBXViewportModule","nativeViewport","useRef","useEffect","current","setNativeRef","useImperativeHandle","getState","console","log","call","idle","transitionTo","state","transition","onStatusChangedNative","propsOnStatusChanged","onStatusChanged","event","nativeEvent","payload","undefined","RNMBXViewport","NativeViewport","constructor","module","preRefMethodQueue","nativeRef","length","item","pop","method","resolver","res","_call","name","args","Promise","resolve","push","handle","findNodeHandle","Error","String"],"sourceRoot":"../../../src","sources":["components/Viewport.tsx"],"mappings":";;;;;;AAAA;AASA;AAOA;AAIA;AAAqE;AAAA;AAAA;AAAA;AAuJrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,gBAAG,IAAAC,WAAI,gBAC1B,IAAAC,iBAAU,EAAa,CAACC,KAAY,EAAEC,GAA4B,KAAK;EACrE,MAAMC,QAAQ,GAAG,IAAAC,cAAO,EAAC,MAAM,IAAIC,cAAc,CAACC,kCAAmB,CAAC,EAAE,EAAE,CAAC;EAC3E,MAAMC,cAAc,GAAG,IAAAC,aAAM,EAAuB,IAAI,CAAC;EACzD,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIF,cAAc,CAACG,OAAO,EAAE;MAC1BP,QAAQ,CAACQ,YAAY,CAACJ,cAAc,CAACG,OAAO,CAAC;IAC/C;IACA;EACF,CAAC,EAAE,CAACP,QAAQ,EAAEI,cAAc,CAACG,OAAO,CAAC,CAAC;EAEtC,IAAAE,0BAAmB,EAACV,GAAG,EAAE,OAAO;IAC9BW,QAAQ,GAAG;MACTC,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;MACnC,OAAOZ,QAAQ,CAACa,IAAI,CAAS,UAAU,EAAE,EAAE,CAAC;IAC9C,CAAC;IACD,MAAMC,IAAI,GAAG;MACX,OAAOd,QAAQ,CAACa,IAAI,CAAO,MAAM,EAAE,EAAE,CAAC;IACxC,CAAC;IACDE,YAAY,CAACC,KAAK,EAAEC,UAAU,EAAE;MAC9B,OAAOjB,QAAQ,CAACa,IAAI,CAAU,cAAc,EAAE,CAACG,KAAK,EAAEC,UAAU,CAAC,CAAC;IACpE;EACF,CAAC,CAAC,CAAC;E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yB,IAAwB,EAAEC,IAAiB,EAAc;IAC/D,IAAI,IAAI,CAACT,SAAS,EAAE;MAClB,OAAO,IAAI,CAACO,KAAK,CAACC,IAAI,EAAE,IAAI,CAACR,SAAS,EAAES,IAAI,CAAC;IAC/C,CAAC,MAAM;MACL,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;QAC9B,IAAI,CAACZ,iBAAiB,CAACa,IAAI,CAAC;UAC1BR,MAAM,EAAE;YAAEI,IAAI;YAAEC;UAAK,CAAC;UACtBJ,QAAQ,EAAEM;QACZ,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF;EAEAJ,KAAK,CACHC,IAAwB,EACxBR,SAAkB,EAClBS,IAAiB,EACL;IACZ,MAAMI,MAAM,GAAG,IAAAC,2BAAc,EAACd,SAAS,CAAC;IACxC,IAAIa,MAAM,EAAE;MACV,OACE,IAAI,CAACf,MAAM,CAACU,IAAI,CAAC,CAIjBK,MAAM,EAAE,GAAGJ,IAAI,CAAC;IACpB,CAAC,MAAM;MACL,MAAM,IAAIM,KAAK,CACZ,wCAAuCjB,MAAO,0BAAyBkB,MAAM,CAC5ER,IAAI,CACJ,EAAC,CACJ;IACH;EACF;AACF"} diff --git a/lib/commonjs/components/codeparts/LayerPropsCommon.codepart-tsx b/lib/commonjs/components/codeparts/LayerPropsCommon.codepart-tsx new file mode 100644 index 000000000..545326fb8 --- /dev/null +++ b/lib/commonjs/components/codeparts/LayerPropsCommon.codepart-tsx @@ -0,0 +1,62 @@ +type Slot = 'bottom' | 'middle' | 'top'; + +type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; diff --git a/lib/commonjs/global.d.js b/lib/commonjs/global.d.js new file mode 100644 index 000000000..83ec1a715 --- /dev/null +++ b/lib/commonjs/global.d.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=global.d.js.map \ No newline at end of file diff --git a/lib/commonjs/global.d.js.map b/lib/commonjs/global.d.js.map new file mode 100644 index 000000000..23edb4a28 --- /dev/null +++ b/lib/commonjs/global.d.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../src","sources":["global.d.ts"],"mappings":""} diff --git a/lib/commonjs/index.js b/lib/commonjs/index.js new file mode 100644 index 000000000..b4dbdd152 --- /dev/null +++ b/lib/commonjs/index.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = {}; +exports.default = void 0; +var Mapbox = _interopRequireWildcard(require("./Mapbox")); +Object.keys(Mapbox).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === Mapbox[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return Mapbox[key]; + } + }); +}); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +var _default = Mapbox; +exports.default = _default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/commonjs/index.js.map b/lib/commonjs/index.js.map new file mode 100644 index 000000000..49a4e1e63 --- /dev/null +++ b/lib/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAAyB;AAAA;AAAA,eAGVA,MAAM;AAAA"} diff --git a/lib/commonjs/index.web.js b/lib/commonjs/index.web.js new file mode 100644 index 000000000..808c087b8 --- /dev/null +++ b/lib/commonjs/index.web.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = {}; +Object.defineProperty(exports, "default", { + enumerable: true, + get: function () { + return _web.default; + } +}); +var _web = _interopRequireWildcard(require("./web")); +Object.keys(_web).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _web[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _web[key]; + } + }); +}); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +//# sourceMappingURL=index.web.js.map \ No newline at end of file diff --git a/lib/commonjs/index.web.js.map b/lib/commonjs/index.web.js.map new file mode 100644 index 000000000..7df0736a1 --- /dev/null +++ b/lib/commonjs/index.web.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.web.js"],"mappings":";;;;;;;;;;;;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAAsB;AAAA"} diff --git a/lib/commonjs/modules/location/locationManager.js b/lib/commonjs/modules/location/locationManager.js new file mode 100644 index 000000000..be40e41f1 --- /dev/null +++ b/lib/commonjs/modules/location/locationManager.js @@ -0,0 +1,138 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.LocationModuleEventEmitter = exports.LocationManager = void 0; +var _reactNative = require("react-native"); +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +const MapboxGLLocationManager = _reactNative.NativeModules.RNMBXLocationModule; +const LocationModuleEventEmitter = new _reactNative.NativeEventEmitter(MapboxGLLocationManager); + +/** + * Location sent by locationManager + */ +exports.LocationModuleEventEmitter = LocationModuleEventEmitter; +/** + * LocationManager is a singleton, see `locationManager` + */ +class LocationManager { + constructor() { + this._listeners = []; + this._lastKnownLocation = null; + this._isListening = false; + this._requestsAlwaysUse = false; + this._onUpdate = this._onUpdate.bind(this); + this.subscription = null; + this._appStateListener = _reactNative.AppState.addEventListener('change', this._handleAppStateChange.bind(this)); + } + async getLastKnownLocation() { + if (!this._lastKnownLocation) { + let lastKnownLocation; + + // as location can be brittle it might happen, + // that we get an exception from native land + // let's silently catch it and simply log out + // instead of throwing an exception + try { + lastKnownLocation = await MapboxGLLocationManager.getLastKnownLocation(); + } catch (error) { + console.warn('locationManager Error: ', error); + } + if (!this._lastKnownLocation && lastKnownLocation) { + this._lastKnownLocation = lastKnownLocation; + } + } + return this._lastKnownLocation; + } + addListener(listener) { + if (!this._isListening) { + this.start(); + } + if (!this._listeners.includes(listener)) { + this._listeners.push(listener); + if (this._lastKnownLocation) { + listener(this._lastKnownLocation); + } + } + } + removeListener(listener) { + this._listeners = this._listeners.filter(l => l !== listener); + if (this._listeners.length === 0) { + this.stop(); + } + } + removeAllListeners() { + this._listeners = []; + this.stop(); + } + _handleAppStateChange(appState) { + if (!this._requestsAlwaysUse) { + if (appState === 'background') { + this.stop(); + } else if (appState === 'active') { + if (this._listeners.length > 0) { + this.start(); + } + } + } + } + start() { + let displacement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + let validDisplacement = 1; + if (displacement === -1 || displacement === null || displacement === undefined) { + validDisplacement = this._minDisplacement || -1; + } else { + validDisplacement = displacement; + } + if (!this._isListening) { + MapboxGLLocationManager.start(validDisplacement); + this.subscription = LocationModuleEventEmitter.addListener(MapboxGL.LocationCallbackName.Update, this._onUpdate); + this._isListening = true; + } + } + stop() { + MapboxGLLocationManager.stop(); + if (this._isListening && this.subscription) { + this.subscription.remove(); + } + this._isListening = false; + } + setMinDisplacement(minDisplacement) { + this._minDisplacement = minDisplacement; + MapboxGLLocationManager.setMinDisplacement(minDisplacement); + } + setRequestsAlwaysUse(requestsAlwaysUse) { + MapboxGLLocationManager.setRequestsAlwaysUse(requestsAlwaysUse); + this._requestsAlwaysUse = requestsAlwaysUse; + } + _onUpdate(location) { + this._lastKnownLocation = location; + this._listeners.forEach(l => l(location)); + } + + /** + * simulates location updates, experimental [V10, iOS only] + */ + _simulateHeading(changesPerSecond, increment) { + MapboxGLLocationManager.simulateHeading(changesPerSecond, increment); + } + + /** + * Sets the period at which location events will be sent over the React Native bridge. + * The default is 0, aka no limit. [V10, iOS only] + * + * @example + * locationManager.setLocationEventThrottle(500); + * + * @param {Number} throttleValue event throttle value in ms. + * @return {void} + */ + setLocationEventThrottle(throttleValue) { + MapboxGLLocationManager.setLocationEventThrottle(throttleValue); + } +} +exports.LocationManager = LocationManager; +var _default = new LocationManager(); +exports.default = _default; +//# sourceMappingURL=locationManager.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/location/locationManager.js.map b/lib/commonjs/modules/location/locationManager.js.map new file mode 100644 index 000000000..2213e3a23 --- /dev/null +++ b/lib/commonjs/modules/location/locationManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","MapboxGLLocationManager","RNMBXLocationModule","LocationModuleEventEmitter","NativeEventEmitter","LocationManager","constructor","_listeners","_lastKnownLocation","_isListening","_requestsAlwaysUse","_onUpdate","bind","subscription","_appStateListener","AppState","addEventListener","_handleAppStateChange","getLastKnownLocation","lastKnownLocation","error","console","warn","addListener","listener","start","includes","push","removeListener","filter","l","length","stop","removeAllListeners","appState","displacement","validDisplacement","undefined","_minDisplacement","LocationCallbackName","Update","remove","setMinDisplacement","minDisplacement","setRequestsAlwaysUse","requestsAlwaysUse","location","forEach","_simulateHeading","changesPerSecond","increment","simulateHeading","setLocationEventThrottle","throttleValue"],"sourceRoot":"../../../../src","sources":["modules/location/locationManager.ts"],"mappings":";;;;;;AAAA;AASA,MAAMA,QAA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reatePackOptions.js b/lib/commonjs/modules/offline/OfflineCreatePackOptions.js new file mode 100644 index 000000000..cefb6a861 --- /dev/null +++ b/lib/commonjs/modules/offline/OfflineCreatePackOptions.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _geoUtils = require("../../utils/geoUtils"); +var _utils = require("../../utils"); +class OfflineCreatePackOptions { + constructor(options) { + this._assert(options); + this.name = options.name; + this.styleURL = options.styleURL; + this.bounds = this._makeLatLngBounds(options.bounds); + this.minZoom = options.minZoom; + this.maxZoom = options.maxZoom; + this.metadata = this._makeMetadata(options.metadata); + } + _assert(options) { + if (!options.styleURL) { + throw new Error('Style URL must be provided for creating an offline pack'); + } + if (!options.name) { + throw new Error('Name must be provided for creating an offline pack'); + } + if (!options.bounds) { + throw new Error('Bounds must be provided for creating an offline pack'); + } + } + _makeLatLngBounds(bounds) { + const [ne, sw] = bounds; + return (0, _utils.toJSONString)((0, _geoUtils.makeLatLngBounds)(ne, sw)); + } + _makeMetadata(metadata) { + return JSON.stringify({ + ...metadata, + name: this.name + }); + } +} +var _default = OfflineCreatePackOptions; +exports.default = _default; +//# sourceMappingURL=OfflineCreatePackOptions.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map b/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map new file mode 100644 index 000000000..06852a570 --- /dev/null +++ b/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["OfflineCreatePackOptions","constructor","options","_assert","name","styleURL","bounds","_makeLatLngBounds","minZoom","maxZoom","metadata","_makeMetadata","Error","ne","sw","toJSONString","makeLatLngBounds","JSON","stringify"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflineCreatePackOptions.ts"],"mappings":";;;;;;AAAA;AACA;AAWA,MAAMA,wBAAwB,CAAC;EAQ7BC,WAAW,CAACC,OAAqC,EAAE;IACjD,IAAI,CAACC,OAAO,CAACD,OAAO,CAAC;IAErB,IAAI,CAACE,IAAI,GAAGF,OAAO,CAACE,IAAI;IACxB,IAAI,CAACC,QAAQ,GAAGH,OAAO,CAACG,QAAQ;IAChC,IAAI,CAACC,MAAM,GAAG,IAAI,CAACC,iBAAiB,CAACL,OAAO,CAACI,MAAM,CAAC;IACpD,IAAI,CAACE,OAAO,GAAGN,OAAO,CAACM,OAAO;IAC9B,IAAI,CAACC,OAAO,GAAGP,OAAO,CAACO,OAAO;IAC9B,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACC,aAAa,CAACT,OAAO,CAACQ,QAAQ,CAAC;EACtD;EAEAP,OAAO,CAACD,OAAqC,EAAE;IAC7C,IAAI,CAACA,OAAO,CAACG,QAAQ,EAAE;MACrB,MAAM,IAAIO,KAAK,CACb,yDAAyD,CAC1D;IACH;IAEA,IAAI,CAACV,OAAO,CAACE,IAAI,EAAE;MACjB,MAAM,IAAIQ,KAAK,CAAC,oDAAoD,CAAC;IACvE;IAEA,IAAI,CAACV,OAAO,CAACI,MAAM,EAAE;MACnB,MAAM,IAAIM,KAAK,CAAC,sDAAsD,CAAC;IACzE;EACF;EAEAL,iBAAiB,CAACD,MAA4C,EAAU;IACtE,MAAM,CAACO,EAAE,EAAEC,EAAE,CAAC,GAAGR,MAAM;IACvB,OAAO,IAAAS,mBAAY,EAAC,IAAAC,0BAAgB,EAACH,EAAE,EAAEC,EAAE,CAAC,CAAC;EAC/C;EAEAH,aAAa,CAACD,QAA6C,EAAE;IAC3D,OAAOO,IAAI,CAACC,SAAS,CAAC;MACpB,GAAGR,QAAQ;MACXN,IAAI,EAAE,IAAI,CAACA;IACb,CAAC,CAAC;EACJ;AACF;AAAC,eAEcJ,wBAAwB;AAAA"} diff --git a/lib/commonjs/modules/offline/OfflinePack.js b/lib/commonjs/modules/offline/OfflinePack.js new file mode 100644 index 000000000..dd8963a23 --- /dev/null +++ b/lib/commonjs/modules/offline/OfflinePack.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +const MapboxGLOfflineManager = _reactNative.NativeModules.RNMBXOfflineModule; +class OfflinePack { + constructor(pack) { + this.pack = pack; + this._metadata = null; + } + get name() { + const { + metadata + } = this; + return metadata && metadata.name; + } + get bounds() { + return this.pack.bounds; + } + get metadata() { + if (!this._metadata && this.pack.metadata) { + this._metadata = JSON.parse(this.pack.metadata); + } + return this._metadata; + } + status() { + return MapboxGLOfflineManager.getPackStatus(this.name); + } + resume() { + return MapboxGLOfflineManager.resumePackDownload(this.name); + } + pause() { + return MapboxGLOfflineManager.pausePackDownload(this.name); + } +} +var _default = OfflinePack; +exports.default = _default; +//# sourceMappingURL=OfflinePack.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/offline/OfflinePack.js.map b/lib/commonjs/modules/offline/OfflinePack.js.map new file mode 100644 index 000000000..0896fcd80 --- /dev/null +++ b/lib/commonjs/modules/offline/OfflinePack.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGLOfflineManager","NativeModules","RNMBXOfflineModule","OfflinePack","constructor","pack","_metadata","name","metadata","bounds","JSON","parse","status","getPackStatus","resume","resumePackDownload","pause","pausePackDownload"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflinePack.ts"],"mappings":";;;;;;AAAA;AAIA,MAAMA,sBAAsB,GAAGC,0BAAa,CAACC,kBAAkB;AAa/D,MAAMC,WAAW,CAAC;EAGhBC,WAAW,CAACC,IAA8B,EAAE;IAC1C,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,SAAS,GAAG,IAAI;EACvB;EAEA,IAAIC,IAAI,GAAG;IACT,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI;IACzB,OAAOA,QAAQ,IAAIA,QAAQ,CAACD,IAAI;EAClC;EAEA,IAAIE,MAAM,GAAG;IACX,OAAO,IAAI,CAACJ,IAAI,CAACI,MAAM;EACzB;EAEA,IAAID,QAAQ,GAAG;IACb,IAAI,CAAC,IAAI,CAACF,SAAS,IAAI,IAAI,CAACD,IAAI,CAACG,QAAQ,EAAE;MACzC,IAAI,CAACF,SAAS,GAAGI,IAAI,CAACC,KAAK,CAAC,IAAI,CAACN,IAAI,CAACG,QAAQ,CAAC;IACjD;IACA,OAAO,IAAI,CAACF,SAAS;EACvB;EAEAM,MAAM,GAA+B;IACnC,OAAOZ,sBAAsB,CAACa,aAAa,CAAC,IAAI,CAACN,IAAI,CAAC;EACxD;EAEAO,MAAM,GAAkB;IACtB,OAAOd,sBAAsB,CAACe,kBAAkB,CAAC,IAAI,CAACR,IAAI,CAAC;EAC7D;EAEAS,KAAK,GAAkB;IACrB,OAAOhB,sBAAsB,CAACiB,iBAAiB,CAAC,IAAI,CAACV,IAAI,CAAC;EAC5D;AACF;AAAC,eAEcJ,WAAW;AAAA"} diff --git a/lib/commonjs/modules/offline/OfflinePackLegacy.js b/lib/commonjs/modules/offline/OfflinePackLegacy.js new file mode 100644 index 000000000..99e2fd4df --- /dev/null +++ b/lib/commonjs/modules/offline/OfflinePackLegacy.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +const MapboxGLOfflineManager = _reactNative.NativeModules.RNMBXOfflineModuleLegacy; +class OfflinePackLegacy { + constructor(pack) { + this.pack = pack; + this._metadata = null; + } + get name() { + const { + metadata + } = this; + return metadata && metadata.name; + } + get bounds() { + return this.pack.bounds; + } + get metadata() { + if (!this._metadata && this.pack.metadata) { + this._metadata = JSON.parse(this.pack.metadata); + } + return this._metadata; + } + status() { + return MapboxGLOfflineManager.getPackStatus(this.name); + } + resume() { + return MapboxGLOfflineManager.resumePackDownload(this.name); + } + pause() { + return MapboxGLOfflineManager.pausePackDownload(this.name); + } +} +var _default = OfflinePackLegacy; +exports.default = _default; +//# sourceMappingURL=OfflinePackLegacy.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/offline/OfflinePackLegacy.js.map b/lib/commonjs/modules/offline/OfflinePackLegacy.js.map new file mode 100644 index 000000000..280f5300e --- /dev/null +++ b/lib/commonjs/modules/offline/OfflinePackLegacy.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGLOfflineManager","NativeModules","RNMBXOfflineModuleLegacy","OfflinePackLegacy","constructor","pack","_metadata","name","metadata","bounds","JSON","parse","status","getPackStatus","resume","resumePackDownload","pause","pausePackDownload"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflinePackLegacy.ts"],"mappings":";;;;;;AAAA;AAIA,MAAMA,sBAAsB,GAAGC,0BAAa,CAACC,wBAAwB;AAarE,MAAMC,iBAAiB,CAAC;EAGtBC,WAAW,CAACC,IAA8B,EAAE;IAC1C,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,SAAS,GAAG,IAAI;EACvB;EAEA,IAAIC,IAAI,GAAG;IACT,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI;IACzB,OAAOA,QAAQ,IAAIA,QAAQ,CAACD,IAAI;EAClC;EAEA,IAAIE,MAAM,GAAG;IACX,OAAO,IAAI,CAACJ,IAAI,CAACI,MAAM;EACzB;EAEA,IAAID,QAAQ,GAAG;IACb,IAAI,CAAC,IAAI,CAACF,SAAS,IAAI,IAAI,CAACD,IAAI,CAACG,QAAQ,EAAE;MACzC,IAAI,CAACF,SAAS,GAAGI,IAAI,CAACC,KAAK,CAAC,IAAI,CAACN,IAAI,CAACG,QAAQ,CAAC;IACjD;IACA,OAAO,IAAI,CAACF,SAAS;EACvB;EAEAM,MAAM,GAA+B;IACnC,OAAOZ,sBAAsB,CAACa,aAAa,CAAC,IAAI,CAACN,IAAI,CAAC;EACxD;EAEAO,MAAM,GAAkB;IACtB,OAAOd,sBAAsB,CAACe,kBAAkB,CAAC,IAAI,CAACR,IAAI,CAAC;EAC7D;EAEAS,KAAK,GAAkB;IACrB,OAAOhB,sBAAsB,CAACiB,iBAAiB,CAAC,IAAI,CAACV,IAAI,CAAC;EAC5D;AACF;AAAC,eAEcJ,iBAAiB;AAAA"} diff --git a/lib/commonjs/modules/offline/TileStore.js b/lib/commonjs/modules/offline/TileStore.js new file mode 100644 index 000000000..1c953e194 --- /dev/null +++ b/lib/commonjs/modules/offline/TileStore.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _NativeRNMBXTileStoreModule = _interopRequireDefault(require("../../specs/NativeRNMBXTileStoreModule")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * TileStore manages downloads and storage for requests to tile-related API endpoints, + * enforcing a disk usage quota: tiles available on disk may be deleted to make room for a new download. + * This interface can be used by an app developer to set the disk quota. + */ + +class TileStore { + /** + * Creates a TileStore instance for the given storage path. The returned instance exists as long as it is retained by the client. + * If the tile store instance already exists for the given path this method will return it without creating a new instance, + * thus making sure that there is only one tile store instance for a path at a time. If the given path is empty, the tile + * store at the default location is returned. On iOS, this storage path is excluded from automatic cloud backup. On Android, + * please exclude the storage path in your Manifest. + * Please refer to the [Android Documentation](https://developer.android.com/guide/topics/data/autobackup.html#IncludingFiles) for detailed information. + * + * @param path The path on disk where tiles and metadata will be stored + */ + static async shared(path) { + const __nativeTag = await _NativeRNMBXTileStoreModule.default.shared(path); + return new TileStore(__nativeTag); + } + constructor(__nativeTag) { + this.__nativeTag = __nativeTag; + } + + /** + * Sets additional options for this instance that are specific to a data type. + Params: + key – The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions. domain – The data type this setting should be applied for. value – The value for the configuration option, or null if it should be reset. + */ + async setOption(key, domain, value) { + await _NativeRNMBXTileStoreModule.default.setOption(this.__nativeTag, key, domain, { + value + }); + } +} +exports.default = TileStore; +//# sourceMappingURL=TileStore.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/offline/TileStore.js.map b/lib/commonjs/modules/offline/TileStore.js.map new file mode 100644 index 000000000..d048d4d1a --- /dev/null +++ b/lib/commonjs/modules/offline/TileStore.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TileStore","shared","path","__nativeTag","NativeRNMBXTileStoreModule","constructor","setOption","key","domain","value"],"sourceRoot":"../../../../src","sources":["modules/offline/TileStore.ts"],"mappings":";;;;;;AAAA;AAAgF;AAKhF;AACA;AACA;AACA;AACA;;AAEe,MAAMA,SAAS,CAAC;EAE7B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,MAAM,CAACC,IAAa,EAAsB;IACrD,MAAMC,WAAW,GAAG,MAAMC,mCAA0B,CAACH,MAAM,CAACC,IAAI,CAAC;IACjE,OAAO,IAAIF,SAAS,CAACG,WAAW,CAAC;EACnC;EAEQE,WAAW,CAACF,WAAmB,EAAE;IACvC,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAMG,SAAS,CACbC,GAAW,EACXC,MAAsB,EACtBC,KAAoB,EACL;IACf,MAAML,mCAA0B,CAACE,SAAS,CAAC,IAAI,CAACH,WAAW,EAAEI,GAAG,EAAEC,MAAM,EAAE;MACxEC;IACF,CAAC,CAAC;EACJ;AACF;AAAC"} diff --git a/lib/commonjs/modules/offline/offlineManager.js b/lib/commonjs/modules/offline/offlineManager.js new file mode 100644 index 000000000..1d655f2ae --- /dev/null +++ b/lib/commonjs/modules/offline/offlineManager.js @@ -0,0 +1,449 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "OfflineCreatePackOptions", { + enumerable: true, + get: function () { + return _OfflineCreatePackOptions.default; + } +}); +exports.default = exports.OfflineModuleEventEmitter = void 0; +var _reactNative = require("react-native"); +var _utils = require("../../utils"); +var _OfflineCreatePackOptions = _interopRequireDefault(require("./OfflineCreatePackOptions")); +var _OfflinePack = _interopRequireDefault(require("./OfflinePack")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const { + RNMBXModule +} = _reactNative.NativeModules; +const MapboxOfflineManager = _reactNative.NativeModules.RNMBXOfflineModule; +const OfflineModuleEventEmitter = new _reactNative.NativeEventEmitter(MapboxOfflineManager); +exports.OfflineModuleEventEmitter = OfflineModuleEventEmitter; +/** + * OfflineManager implements a singleton (shared object) that manages offline packs. + * All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. + * The shared object maintains a canonical collection of offline packs. + */ +class OfflineManager { + constructor() { + this._hasInitialized = false; + this._offlinePacks = {}; + this._progressListeners = {}; + this._errorListeners = {}; + this._onProgress = this._onProgress.bind(this); + this._onError = this._onError.bind(this); + this.subscriptionProgress = null; + this.subscriptionError = null; + } + + /** + * Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); + * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); + * + * await Mapbox.offlineManager.createPack({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }, progressListener, errorListener) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @param {Callback=} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback=} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + async createPack(options, progressListener, errorListener) { + await this._initialize(); + const packOptions = new _OfflineCreatePackOptions.default(options); + if (this._offlinePacks[packOptions.name]) { + throw new Error(`Offline pack with name ${packOptions.name} already exists.`); + } + this.subscribe(packOptions.name, progressListener, errorListener); + const nativeOfflinePack = await MapboxOfflineManager.createPack(packOptions); + this._offlinePacks[packOptions.name] = new _OfflinePack.default(nativeOfflinePack); + } + + /** + * Legacy Download Method - Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); + * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); + * + * await MapboxGL.offlineManager.createPackLegacy({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }, progressListener, errorListener) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @param {Callback=} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback=} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + async createPackLegacy(options, progressListener, errorListener) { + const packOptions = new _OfflineCreatePackOptions.default(options); + this.subscribe(packOptions.name, progressListener, errorListener); + const nativeOfflinePack = await MapboxOfflineManager.createPackLegacy(packOptions); + this._offlinePacks[packOptions.name] = new _OfflinePack.default(nativeOfflinePack); + } + + /** + * Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated. + * + * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. + * + * @example + * await Mapbox.offlineManager.invalidatePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async invalidatePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.invalidatePack(name); + } + } + + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await Mapbox.offlineManager.deletePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async deletePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.deletePack(name); + delete this._offlinePacks[name]; + } + } + + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await MapboxGL.offlineManager.deletePackLegacy('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async deletePackLegacy(name) { + if (!name) { + return; + } + await MapboxOfflineManager.deletePackLegacy(name); + } + + /** + * Forces a revalidation of the tiles in the ambient cache and downloads a fresh version of the tiles from the tile server. + * This is the recommend method for clearing the cache. + * This is the most efficient method because tiles in the ambient cache are re-downloaded to remove outdated data from a device. + * It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects. + * + * @deprecated Not implemented in v10 + * + * @example + * await Mapbox.offlineManager.invalidateAmbientCache(); + * + * @return {void} + */ + async invalidateAmbientCache() { + if (RNMBXModule.MapboxV10) { + console.warn('RNMapbox: invalidateAmbientCache is not implemented on v10'); + return; + } + await this._initialize(); + await MapboxOfflineManager.invalidateAmbientCache(); + } + + /** + * Erases resources from the ambient cache. + * This method clears the cache and decreases the amount of space that map resources take up on the device. + * + * @deprecated Not implemented in v10 + * + * @example + * await Mapbox.offlineManager.clearAmbientCache(); + * + * @return {void} + */ + async clearAmbientCache() { + if (RNMBXModule.MapboxV10) { + console.warn('RNMapbox: clearAmbientCache is not implemented on v10'); + return; + } + await this._initialize(); + await MapboxOfflineManager.clearAmbientCache(); + } + + /** + * Migrates the offline cache from pre-v10 SDKs to the new v10 cache location + * + * @example + * await Mapbox.offlineManager.migrateOfflineCache() + * + * @return {void} + */ + async migrateOfflineCache() { + await MapboxOfflineManager.migrateOfflineCache(); + } + + /** + * Sets the maximum size of the ambient cache in bytes. Disables the ambient cache if set to 0. + * This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased. + * + * @example + * await Mapbox.offlineManager.setMaximumAmbientCacheSize(5000000); + * + * @param {Number} size Size of ambient cache. + * @return {void} + */ + async setMaximumAmbientCacheSize(size) { + await this._initialize(); + await MapboxOfflineManager.setMaximumAmbientCacheSize(size); + } + + /** + * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. + * + * @example + * await Mapbox.offlineManager.resetDatabase(); + * + * @return {void} + */ + async resetDatabase() { + await MapboxOfflineManager.resetDatabase(); + this._offlinePacks = {}; + await this._initialize(true); + } + + /** + * Retrieves all the current offline packs that are stored in the database. + * + * @example + * const offlinePacks = await Mapbox.offlineManager.getPacks(); + * + * @return {Array} + */ + async getPacks() { + await this._initialize(true); + return Object.keys(this._offlinePacks).map(name => this._offlinePacks[name]); + } + + /** + * Retrieves all the current offline legacy packs that are stored in the database. + * + * @example + * const offlinePacks = await MapboxGL.offlineManager.getPacksLegacy(); + * + * @return {Array} + */ + async getPacksLegacy() { + const packs = await MapboxOfflineManager.getPacksLegacy(); + return Object.keys(packs).map(name => ({ + ...packs[name], + metadata: typeof packs[name].metadata === 'string' ? JSON.parse(packs[name].metadata) : packs[name].metadata + })); + } + + /** + * Retrieves an offline pack that is stored in the database by name. + * + * @example + * const offlinePack = await Mapbox.offlineManager.getPack(); + * + * @param {String} name Name of the offline pack. + * @return {OfflinePack} + */ + async getPack(name) { + await this._initialize(true); + return this._offlinePacks[name]; + } + + /** + * Sideloads offline db + * + * @example + * await Mapbox.offlineManager.mergeOfflineRegions(path); + * + * @param {String} path Path to offline tile db on file system. + * @return {void} + */ + async mergeOfflineRegions(path) { + await this._initialize(); + return MapboxOfflineManager.mergeOfflineRegions(path); + } + + /** + * Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. + * + * @example + * Mapbox.offlineManager.setTileCountLimit(1000); + * + * @param {Number} limit Map tile limit count. + * @return {void} + */ + setTileCountLimit(limit) { + MapboxOfflineManager.setTileCountLimit(limit); + } + + /** + * Legacy Download Method - Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. + * + * @example + * MapboxGL.offlineManager.setTileCountLimitLegacy(1000); + * + * @param {Number} limit Map tile limit count. + * @return {void} + */ + setTileCountLimitLegacy(limit) { + MapboxOfflineManager.setTileCountLimitLegacy(limit); + } + + /** + * Sets the period at which download status events will be sent over the React Native bridge. + * The default is 300ms. + * + * @example + * Mapbox.offlineManager.setProgressEventThrottle(500); + * + * @param {Number} throttleValue event throttle value in ms. + * @return {void} + */ + setProgressEventThrottle(throttleValue) { + MapboxOfflineManager.setProgressEventThrottle(throttleValue); + } + + /** + * Subscribe to download status/error events for the requested offline pack. + * Note that createPack calls this internally if listeners are provided. + * + * @example + * const progressListener = (offlinePack, status) => console.log(offlinePack, status) + * const errorListener = (offlinePack, err) => console.log(offlinePack, err) + * Mapbox.offlineManager.subscribe('packName', progressListener, errorListener) + * + * @param {String} packName Name of the offline pack. + * @param {Callback} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + async subscribe(packName, progressListener, errorListener) { + const totalProgressListeners = Object.keys(this._progressListeners).length; + if ((0, _utils.isFunction)(progressListener)) { + if (totalProgressListeners === 0) { + this.subscriptionProgress = OfflineModuleEventEmitter.addListener(RNMBXModule.OfflineCallbackName.Progress, this._onProgress); + } + this._progressListeners[packName] = progressListener; + } + const totalErrorListeners = Object.keys(this._errorListeners).length; + if ((0, _utils.isFunction)(errorListener)) { + if (totalErrorListeners === 0) { + this.subscriptionError = OfflineModuleEventEmitter.addListener(RNMBXModule.OfflineCallbackName.Error, this._onError); + } + this._errorListeners[packName] = errorListener; + } + + // we need to manually set the pack observer on Android + // if we're resuming a pack download instead of going thru the create flow + if ((0, _utils.isAndroid)() && this._offlinePacks[packName]) { + try { + // manually set a listener, since listeners are only set on create flow + await MapboxOfflineManager.setPackObserver(packName); + } catch (e) { + console.log('Unable to set pack observer', e); + } + } + } + + /** + * Unsubscribes any listeners associated with the offline pack. + * It's a good idea to call this on componentWillUnmount. + * + * @example + * Mapbox.offlineManager.unsubscribe('packName') + * + * @param {String} packName Name of the offline pack. + * @return {void} + */ + unsubscribe(packName) { + delete this._progressListeners[packName]; + delete this._errorListeners[packName]; + if (Object.keys(this._progressListeners).length === 0 && this.subscriptionProgress) { + this.subscriptionProgress.remove(); + } + if (Object.keys(this._errorListeners).length === 0 && this.subscriptionError) { + this.subscriptionError.remove(); + } + } + async _initialize(forceInit) { + if (this._hasInitialized && !forceInit) { + return true; + } + const nativeOfflinePacks = await MapboxOfflineManager.getPacks(); + for (const nativeOfflinePack of nativeOfflinePacks) { + const offlinePack = new _OfflinePack.default(nativeOfflinePack); + this._offlinePacks[offlinePack.name] = offlinePack; + } + this._hasInitialized = true; + return true; + } + _onProgress(e) { + const { + name, + state + } = e.payload; + if (!this._hasListeners(name, this._progressListeners)) { + return; + } + const pack = this._offlinePacks[name]; + this._progressListeners[name](pack, e.payload); + + // cleanup listeners now that they are no longer needed + if (state === RNMBXModule.OfflinePackDownloadState.Complete) { + this.unsubscribe(name); + } + } + _onError(e) { + const { + name + } = e.payload; + if (!this._hasListeners(name, this._errorListeners)) { + return; + } + const pack = this._offlinePacks[name]; + this._errorListeners[name](pack, e.payload); + } + _hasListeners(name, listenerMap) { + return !(0, _utils.isUndefined)(this._offlinePacks[name]) && (0, _utils.isFunction)(listenerMap[name]); + } +} +const offlineManager = new OfflineManager(); +var _default = offlineManager; +exports.default = _default; +//# sourceMappingURL=offlineManager.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/offline/offlineManager.js.map b/lib/commonjs/modules/offline/offlineManager.js.map new file mode 100644 index 000000000..247e72381 --- /dev/null +++ b/lib/commonjs/modules/offline/offlineManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["RNMBXModule","NativeModules","MapboxOfflineManager","RNMBXOfflineModule","OfflineModuleEventEmitter","NativeEventEmitter","OfflineManager","constructor","_hasInitialized","_offlinePacks","_progressListeners","_errorListeners","_onProgress","bind","_onError","subscriptionProgress","subscriptionError","createPack","options","progressListener","errorListener","_initialize","packOptions","OfflineCreatePackOptions","name","Error","subscribe","nativeOfflinePack","OfflinePack","createPackLegacy","invalidatePack","offlinePack","deletePack","deletePackLegacy","invalidateAmbientCache","MapboxV10","console","warn","clearAmbientCache","migrateOfflineCache","setMaximumAmbientCacheSize","size","resetDatabase","getPacks","Object","keys","map","getPacksLegacy","packs","metadata","JSON","parse","getPack","mergeOfflineRegions","path","setTileCountLimit","limit","setTileCountLimitLegacy","setProgressEventThrottle","throttleValue","packName","totalProgressListeners","length","isFunction","addListener","OfflineCallbackName","Progress","totalErrorListeners","isAndroid","setPackObserver","e","log","unsubscribe","remove","forceInit","nativeOfflinePacks","state","payload","_hasListeners","pack","OfflinePackDownloadState","Complete","listenerMap","isUndefined","offlineManager"],"sourceRoot":"../../../../src","sources":["modules/offline/offlineManager.ts"],"mappings":";;;;;;;;;;;;AAAA;AAMA;AAEA;AAOA;AAAwC;AAExC,MAAM;EAAEA;AAAY,CAAC,GAAGC,0BAAa;AAErC,MAAMC,oBAAoB,GAAGD,0BAAa,CAACE,kBAAkB;AACtD,MAAMC,yBAAyB,GAAG,IAAIC,+BAAkB,CAC7DH,oBAAoB,CACrB;AAAC;AAgCF;AACA;AACA;AACA;AACA;AACA,MAAMI,cAAc,CAAC;EAQnBC,WAAW,GAAG;IACZ,IAAI,CAACC,eAAe,GAAG,KAAK;IAC5B,IAAI,CAACC,aAAa,GAAG,CAAC,CAAC;IAEvB,IAAI,CAACC,kBAAkB,GAAG,CAAC,CAAC;IAC5B,IAAI,CAACC,eAAe,GAAG,CAAC,CAAC;IAEzB,IAAI,CAACC,WAAW,GAAG,IAAI,CAACA,WAAW,CAACC,IAAI,CAAC,IAAI,CAAC;IAC9C,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACA,QAAQ,CAACD,IAAI,CAAC,IAAI,CAAC;IAExC,IAAI,CAACE,oBAAoB,GAAG,IAAI;IAChC,IAAI,CAACC,iBAAiB,GAAG,IAAI;EAC/B;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,UAAU,CACdC,OAAqC,EACrCC,gBAAkC,EAClCC,aAA6B,EACd;IACf,MAAM,IAAI,CAACC,WAAW,EAAE;IAExB,MAAMC,WAAW,GAAG,IAAIC,iCAAwB,CAACL,OAAO,CAAC;IAEzD,IAAI,IAAI,CAACT,aAAa,CAACa,WAAW,CA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IAAY,EACZ0D,WAEiC,EACxB;IACT,OACE,CAAC,IAAAC,kBAAW,EAAC,IAAI,CAAC1E,aAAa,CAACe,IAAI,CAAC,CAAC,IAAI,IAAAuC,iBAAU,EAACmB,WAAW,CAAC1D,IAAI,CAAC,CAAC;EAE3E;AACF;AAEA,MAAM4D,cAAc,GAAG,IAAI9E,cAAc,EAAE;AAAC,eAC7B8E,cAAc;AAAA"} diff --git a/lib/commonjs/modules/offline/offlineManagerLegacy.js b/lib/commonjs/modules/offline/offlineManagerLegacy.js new file mode 100644 index 000000000..afddffe35 --- /dev/null +++ b/lib/commonjs/modules/offline/offlineManagerLegacy.js @@ -0,0 +1,167 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "OfflineCreatePackOptions", { + enumerable: true, + get: function () { + return _OfflineCreatePackOptions.default; + } +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _OfflineCreatePackOptions = _interopRequireDefault(require("./OfflineCreatePackOptions")); +var _OfflinePackLegacy = _interopRequireDefault(require("./OfflinePackLegacy")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const MapboxOfflineManager = _reactNative.NativeModules.RNMBXOfflineModuleLegacy; + +/** + * OfflineManagerLegacy implements a singleton (shared object) that manages offline packs. + * All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. + * The shared object maintains a canonical collection of offline packs. + */ +class OfflineManagerLegacy { + constructor() { + this._hasInitialized = false; + this._offlinePacks = {}; + } + + /** + * Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * await Mapbox.offlineManager.createPack({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @return {void} + */ + async createPack(options) { + await this._initialize(); + const packOptions = new _OfflineCreatePackOptions.default(options); + if (this._offlinePacks[packOptions.name]) { + throw new Error(`Offline pack with name ${packOptions.name} already exists.`); + } + const nativeOfflinePack = await MapboxOfflineManager.createPack(packOptions); + this._offlinePacks[packOptions.name] = new _OfflinePackLegacy.default(nativeOfflinePack); + } + + /** + * Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated. + * + * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. + * + * @example + * await Mapbox.offlineManagerLegacy.invalidatePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async invalidatePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.invalidatePack(name); + } + } + + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await Mapbox.offlineManagerLegacy.deletePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async deletePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.deletePack(name); + delete this._offlinePacks[name]; + } + } + + /** + * Migrates the offline cache from pre-v10 SDKs to the new v10 cache location + * + * @example + * await Mapbox.offlineManager.migrateOfflineCache() + * + * @return {void} + */ + async migrateOfflineCache() { + await MapboxOfflineManager.migrateOfflineCache(); + } + + /** + * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. + * + * @example + * await Mapbox.offlineManager.resetDatabase(); + * + * @return {void} + */ + async resetDatabase() { + await MapboxOfflineManager.resetDatabase(); + this._offlinePacks = {}; + await this._initialize(true); + } + + /** + * Retrieves all the current offline packs that are stored in the database. + * + * @example + * const offlinePacks = await Mapbox.offlineManagerLegacy.getPacks(); + * + * @return {Array} + */ + async getPacks() { + await this._initialize(); + return Object.keys(this._offlinePacks).map(name => this._offlinePacks[name]); + } + + /** + * Retrieves an offline pack that is stored in the database by name. + * + * @example + * const offlinePack = await Mapbox.offlineManagerLegacy.getPack(); + * + * @param {String} name Name of the offline pack. + * @return {OfflinePack} + */ + async getPack(name) { + await this._initialize(); + return this._offlinePacks[name]; + } + async _initialize(forceInit) { + if (this._hasInitialized && !forceInit) { + return true; + } + const nativeOfflinePacks = await MapboxOfflineManager.getPacks(); + for (const nativeOfflinePack of nativeOfflinePacks) { + const offlinePack = new _OfflinePackLegacy.default(nativeOfflinePack); + this._offlinePacks[offlinePack.name] = offlinePack; + } + this._hasInitialized = true; + return true; + } +} +const offlineManagerLegacy = new OfflineManagerLegacy(); +var _default = offlineManagerLegacy; +exports.default = _default; +//# sourceMappingURL=offlineManagerLegacy.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/offline/offlineManagerLegacy.js.map b/lib/commonjs/modules/offline/offlineManagerLegacy.js.map new file mode 100644 index 000000000..622ef3a88 --- /dev/null +++ b/lib/commonjs/modules/offline/offlineManagerLegacy.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxOfflineManager","NativeModules","RNMBXOfflineModuleLegacy","OfflineManagerLegacy","constructor","_hasInitialized","_offlinePacks","createPack","options","_initialize","packOptions","OfflineCreatePackOptions","name","Error","nativeOfflinePack","OfflinePack","invalidatePack","offlinePack","deletePack","migrateOfflineCache","resetDatabase","getPacks","Object","keys","map","getPack","forceInit","nativeOfflinePacks","offlineManagerLegacy"],"sourceRoot":"../../../../src","sources":["modules/offline/offlineManagerLegacy.ts"],"mappings":";;;;;;;;;;;;AAAA;AAEA;AAOA;AAA8C;AAE9C,MAAMA,oBAAoB,GAAGC,0BAAa,CAACC,wBAAwB;;AAEnE;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,CAAC;EAIzBC,WAAW,GAAG;IACZ,IAAI,CAACC,eAAe,GAAG,KAAK;IAC5B,IAAI,CAACC,aAAa,GAAG,CAAC,CAAC;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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oB,CAACmB,mBAAmB,EAAE;EAClD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,aAAa,GAAkB;IACnC,MAAMpB,oBAAoB,CAACoB,aAAa,EAAE;IAC1C,IAAI,CAACd,aAAa,GAAG,CAAC,CAAC;IACvB,MAAM,IAAI,CAACG,WAAW,CAAC,IAAI,CAAC;EAC9B;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMY,QAAQ,GAA2B;IACvC,MAAM,IAAI,CAACZ,WAAW,EAAE;IACxB,OAAOa,MAAM,CAACC,IAAI,CAAC,IAAI,CAACjB,aAAa,CAAC,CAACkB,GAAG,CACvCZ,IAAI,IAAK,IAAI,CAACN,aAAa,CAACM,IAAI,CAAC,CACnC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMa,OAAO,CAACb,IAAY,EAAoC;IAC5D,MAAM,IAAI,CAACH,WAAW,EAAE;IACxB,OAAO,IAAI,CAACH,aAAa,CAACM,IAAI,CAAC;EACjC;EAEA,MAAMH,WAAW,CAACiB,SAAmB,EAAoB;IACvD,IAAI,IAAI,CAACrB,eAAe,IAAI,CAACqB,SAAS,EAAE;MACtC,OAAO,IAAI;IACb;IAEA,MAAMC,kBAAkB,GAAG,MAAM3B,oBAAoB,CAACqB,QAAQ,EAAE;IAEhE,KAAK,MAAMP,iBAAiB,IAAIa,kBAAkB,EAAE;MAClD,MAAMV,WAAW,GAAG,IAAIF,0BAAW,CAACD,iBAAiB,CAAC;MACtD,IAAI,CAACR,aAAa,CAACW,WAAW,CAACL,IAAI,CAAC,GAAGK,WAAW;IACpD;IAEA,IAAI,CAACZ,eAAe,GAAG,IAAI;IAC3B,OAAO,IAAI;EACb;AACF;AAEA,MAAMuB,oBAAoB,GAAG,IAAIzB,oBAAoB,EAAE;AAAC,eACzCyB,oBAAoB;AAAA"} diff --git a/lib/commonjs/modules/snapshot/SnapshotOptions.js b/lib/commonjs/modules/snapshot/SnapshotOptions.js new file mode 100644 index 000000000..63ed77a70 --- /dev/null +++ b/lib/commonjs/modules/snapshot/SnapshotOptions.js @@ -0,0 +1,60 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _utils = require("../../utils"); +var _geoUtils = require("../../utils/geoUtils"); +const MapboxGL = _reactNative.NativeModules.RNMBXModule; +class SnapshotOptions { + constructor() { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (!options.centerCoordinate && !options.bounds) { + throw new Error('Center coordinate or bounds must be supplied in order to take a snapshot'); + } + this.styleURL = options.styleURL || MapboxGL.StyleURL.Street; + this.heading = options.heading || 0.0; + this.pitch = options.pitch || 0.0; + this.zoomLevel = options.zoomLevel || 16.0; + this.width = options.width || 50.0; + this.height = options.height || 50.0; + this.writeToDisk = options.writeToDisk || false; + this.withLogo = options.withLogo === undefined ? true : options.withLogo; + if (options.centerCoordinate) { + this.centerCoordinate = this._createCenterCoordPoint(options.centerCoordinate); + } + if (options.bounds) { + this.bounds = this._createBoundsCollection(options.bounds); + } + } + toJSON() { + return { + styleURL: this.styleURL, + heading: this.heading, + pitch: this.pitch, + zoomLevel: this.zoomLevel, + width: this.width, + height: this.height, + writeToDisk: this.writeToDisk, + centerCoordinate: this.centerCoordinate, + bounds: this.bounds, + withLogo: this.withLogo + }; + } + _createCenterCoordPoint(centerCoordinate) { + const point = (0, _geoUtils.makePoint)(centerCoordinate); + return (0, _utils.toJSONString)(point); + } + _createBoundsCollection(bounds) { + const features = []; + for (const bound of bounds) { + features.push((0, _geoUtils.makePoint)(bound)); + } + return (0, _utils.toJSONString)((0, _geoUtils.makeFeatureCollection)(features)); + } +} +var _default = SnapshotOptions; +exports.default = _default; +//# sourceMappingURL=SnapshotOptions.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/snapshot/SnapshotOptions.js.map b/lib/commonjs/modules/snapshot/SnapshotOptions.js.map new file mode 100644 index 000000000..1050daea2 --- /dev/null +++ b/lib/commonjs/modules/snapshot/SnapshotOptions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGL","NativeModules","RNMBXModule","SnapshotOptions","constructor","options","centerCoordinate","bounds","Error","styleURL","StyleURL","Street","heading","pitch","zoomLevel","width","height","writeToDisk","withLogo","undefined","_createCenterCoordPoint","_createBoundsCollection","toJSON","point","makePoint","toJSONString","features","bound","push","makeFeatureCollection"],"sourceRoot":"../../../../src","sources":["modules/snapshot/SnapshotOptions.ts"],"mappings":";;;;;;AAAA;AAEA;AACA;AAEA,MAAMA,QAAQ,GAAGC,0BAAa,CAACC,WAAW;AAe1C,MAAMC,eAAe,CAAC;EAYpBC,WAAW,GAAoC;IAAA,IAAnCC,OAA4B,uEAAG,CAAC,CAAC;IAC3C,IAAI,CAACA,OAAO,CAACC,gBAAgB,IAAI,CAACD,OAAO,CAACE,MAAM,EAAE;MAChD,MAAM,IAAIC,KAAK,CACb,0EAA0E,CAC3E;IACH;IAEA,IAAI,CAACC,QAAQ,GAAGJ,OAAO,CAACI,QAAQ,IAAIT,QAAQ,CAACU,QAAQ,CAACC,MAAM;IAC5D,IAAI,CAACC,OAAO,GAAGP,OAAO,CAACO,OAAO,IAAI,GAAG;IACrC,IAAI,CAACC,KAAK,GAAGR,OAAO,CAACQ,KAAK,IAAI,GAAG;IACjC,IAAI,CAACC,SAAS,GAAGT,OAAO,CAACS,SAAS,IAAI,IAAI;IAC1C,IAAI,CAACC,KAAK,GAAGV,OAAO,CAACU,KAAK,IAAI,IAAI;IAClC,IAAI,CAACC,MAAM,GAAGX,OAAO,CAACW,MAAM,IAAI,IAAI;IACpC,IAAI,CAACC,WAAW,GAAGZ,OAAO,CAACY,WAAW,IAAI,KAAK;IAC/C,IAAI,CAACC,QAAQ,GAAGb,OAAO,CAACa,QAAQ,KAAKC,SAAS,GAAG,IAAI,GAAGd,OAAO,CAACa,QAAQ;IAExE,IAAIb,OAAO,CAACC,gBAAgB,EAAE;MAC5B,IAAI,CAACA,gBAAgB,GAAG,IAAI,CAACc,uBAAuB,CAClDf,OAAO,CAACC,gBAAgB,CACzB;IACH;IAEA,IAAID,OAAO,CAACE,MAAM,EAAE;MAClB,IAAI,CAACA,MAAM,GAAG,IAAI,CAACc,uBAAuB,CAAChB,OAAO,CAACE,MAAM,CAAC;IAC5D;EACF;EAEAe,MAAM,GAAG;IACP,OAAO;MACLb,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBG,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BX,gBAAgB,EAAE,IAAI,CAACA,gBAAgB;MACvCC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBW,QAAQ,EAAE,IAAI,CAACA;IACjB,CAAC;EACH;EAEAE,uBAAuB,CAACd,gBAA0B,EAAE;IAClD,MAAMiB,KAAK,GAAG,IAAAC,mBAAS,EAAClB,gBAAgB,CAAC;IACzC,OAAO,IAAAmB,mBAAY,EAACF,KAAK,CAAC;EAC5B;EAEAF,uBAAuB,CAACd,MAAkB,EAAE;IAC1C,MAAMmB,QAAQ,GAAG,EAAE;IAEnB,KAAK,MAAMC,KAAK,IAAIpB,MAAM,EAAE;MAC1BmB,QAAQ,CAACE,IAAI,CAAC,IAAAJ,mBAAS,EAACG,KAAK,CAAC,CAAC;IACjC;IAEA,OAAO,IAAAF,mBAAY,EAAC,IAAAI,+BAAqB,EAACH,QAAQ,CAAC,CAAC;EACtD;AACF;AAAC,eAEcvB,eAAe;AAAA"} diff --git a/lib/commonjs/modules/snapshot/snapshotManager.js b/lib/commonjs/modules/snapshot/snapshotManager.js new file mode 100644 index 000000000..34844df9a --- /dev/null +++ b/lib/commonjs/modules/snapshot/snapshotManager.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _SnapshotOptions = _interopRequireDefault(require("./SnapshotOptions")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const MapboxGLSnapshotManger = _reactNative.NativeModules.RNMBXSnapshotModule; + +/** + * The snapshotManager generates static raster images of the map. + * Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide. + * The snapshotter generates the snapshot asynchronous. + */ +class SnapshotManager { + /** + * Takes a snapshot of the base map using the provided Snapshot options. NOTE pitch, heading, zoomLevel only works when centerCoordinate is set! + * + * @example + * + * // creates a temp file png of base map + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * centerCoordinate: [-74.126410, 40.797968], + * width: width, + * height: height, + * zoomLevel: 12, + * pitch: 30, + * heading: 20, + * styleURL: MapboxGL.StyleURL.Dark, + * writeToDisk: true, // Create a temporary file + * }); + * + * // creates base64 png of base map without logo + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * centerCoordinate: [-74.126410, 40.797968], + * width: width, + * height: height, + * zoomLevel: 12, + * pitch: 30, + * heading: 20, + * styleURL: MapboxGL.StyleURL.Dark, + * withLogo: false, // Disable Mapbox logo (Android only) + * }); + * + * // creates snapshot with bounds + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * bounds: [[-74.126410, 40.797968], [-74.143727, 40.772177]], + * width: width, + * height: height, + * styleURL: MapboxGL.StyleURL.Dark, + * }); + * + * @param {SnapshotOptions} options Snapshot options for create a static image of the base map + * @return {Promise} + */ + async takeSnap() { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const snapshotOptions = new _SnapshotOptions.default(options); + const uri = await MapboxGLSnapshotManger.takeSnap(snapshotOptions); + return uri; + } +} +const snapshotManager = new SnapshotManager(); +var _default = snapshotManager; +exports.default = _default; +//# sourceMappingURL=snapshotManager.js.map \ No newline at end of file diff --git a/lib/commonjs/modules/snapshot/snapshotManager.js.map b/lib/commonjs/modules/snapshot/snapshotManager.js.map new file mode 100644 index 000000000..ace7f956d --- /dev/null +++ b/lib/commonjs/modules/snapshot/snapshotManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxGLSnapshotManger","NativeModules","RNMBXSnapshotModule","SnapshotManager","takeSnap","options","snapshotOptions","SnapshotOptions","uri","snapshotManager"],"sourceRoot":"../../../../src","sources":["modules/snapshot/snapshotManager.ts"],"mappings":";;;;;;AAAA;AAGA;AAAgD;AAEhD,MAAMA,sBAAsB,GAAGC,0BAAa,CAACC,mBAAmB;;AAEhE;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,CAAC;EACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,QAAQ,GAAgC;IAAA,IAA/BC,OAAO,uEAAG,CAAC,CAAC;IACzB,MAAMC,eAAe,GAAG,IAAIC,wBAAe,CAACF,OAAO,CAAC;IAEpD,MAAMG,GAAG,GAAG,MAAMR,sBAAsB,CAACI,QAAQ,CAACE,eAAe,CAAC;IAClE,OAAOE,GAAG;EACZ;AACF;AAEA,MAAMC,eAAe,GAAG,IAAIN,eAAe,EAAE;AAAC,eAC/BM,eAAe;AAAA"} diff --git a/lib/commonjs/requestAndroidLocationPermissions.js b/lib/commonjs/requestAndroidLocationPermissions.js new file mode 100644 index 000000000..c8d35eab7 --- /dev/null +++ b/lib/commonjs/requestAndroidLocationPermissions.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.requestAndroidLocationPermissions = requestAndroidLocationPermissions; +var _reactNative = require("react-native"); +var _utils = require("./utils"); +async function requestAndroidLocationPermissions() { + if ((0, _utils.isAndroid)()) { + const res = await _reactNative.PermissionsAndroid.requestMultiple([_reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, _reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]); + if (!res) { + return false; + } + const permissions = Object.keys(res); + for (const permission of permissions) { + if (res[permission] === _reactNative.PermissionsAndroid.RESULTS.GRANTED) { + return true; + } + } + return false; + } + throw new Error('You should only call this method on Android!'); +} +//# sourceMappingURL=requestAndroidLocationPermissions.js.map \ No newline at end of file diff --git a/lib/commonjs/requestAndroidLocationPermissions.js.map b/lib/commonjs/requestAndroidLocationPermissions.js.map new file mode 100644 index 000000000..d39ba072e --- /dev/null +++ b/lib/commonjs/requestAndroidLocationPermissions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["requestAndroidLocationPermissions","isAndroid","res","PermissionsAndroid","requestMultiple","PERMISSIONS","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","permissions","Object","keys","permission","RESULTS","GRANTED","Error"],"sourceRoot":"../../src","sources":["requestAndroidLocationPermissions.ts"],"mappings":";;;;;;AAAA;AAEA;AAEO,eAAeA,iCAAiC,GAAqB;EAC1E,IAAI,IAAAC,gBAAS,GAAE,EAAE;IACf,MAAMC,GAAG,GAAG,MAAMC,+BAAkB,CAACC,eAAe,CAAC,CACnDD,+BAAkB,CAACE,WAAW,CAACC,oBAAoB,EACnDH,+BAAkB,CAACE,WAAW,CAACE,sBAAsB,CACtD,CAAC;IAEF,IAAI,CAACL,GAAG,EAAE;MACR,OAAO,KAAK;IACd;IAEA,MAAMM,WAAqB,GAAGC,MAAM,CAACC,IAAI,CAACR,GAAG,CAAC;IAC9C,KAAK,MAAMS,UAAU,IAAIH,WAAW,EAAE;MACpC,IACEN,GAAG,CAACS,UAAU,CAAe,KAAKR,+BAAkB,CAACS,OAAO,CAACC,OAAO,EACpE;QACA,OAAO,IAAI;MACb;IACF;IAEA,OAAO,KAAK;EACd;EAEA,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;AACjE"} diff --git a/lib/commonjs/shape_animators/MovePointShapeAnimator.js b/lib/commonjs/shape_animators/MovePointShapeAnimator.js new file mode 100644 index 000000000..2fc6e82b8 --- /dev/null +++ b/lib/commonjs/shape_animators/MovePointShapeAnimator.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _NativeRNMBXMovePointShapeAnimatorModule = _interopRequireDefault(require("../specs/NativeRNMBXMovePointShapeAnimatorModule")); +var _ShapeAnimatorManager = _interopRequireDefault(require("./ShapeAnimatorManager")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +class MovePointShapeAnimator { + constructor(from) { + const tag = _ShapeAnimatorManager.default.nextTag(); + _NativeRNMBXMovePointShapeAnimatorModule.default.create(tag, [from[0], from[1]]); + this.__nativeTag = tag; + } + start() { + _NativeRNMBXMovePointShapeAnimatorModule.default.start(this.__nativeTag); + } +} +exports.default = MovePointShapeAnimator; +//# sourceMappingURL=MovePointShapeAnimator.js.map \ No newline at end of file diff --git a/lib/commonjs/shape_animators/MovePointShapeAnimator.js.map b/lib/commonjs/shape_animators/MovePointShapeAnimator.js.map new file mode 100644 index 000000000..75ec6dda8 --- /dev/null +++ b/lib/commonjs/shape_animators/MovePointShapeAnimator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MovePointShapeAnimator","constructor","from","tag","ShapeAnimatorManager","nextTag","NativeRNMBXMovePointShapeAnimatorModule","create","__nativeTag","start"],"sourceRoot":"../../../src","sources":["shape_animators/MovePointShapeAnimator.ts"],"mappings":";;;;;;AACA;AAEA;AAA0D;AAE3C,MAAMA,sBAAsB,CAAC;EAG1CC,WAAW,CAACC,IAAc,EAAE;IAC1B,MAAMC,GAAG,GAAGC,6BAAoB,CAACC,OAAO,EAAE;IAC1CC,gDAAuC,CAACC,MAAM,CAACJ,GAAG,EAAE,CAACD,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,IAAI,CAACM,WAAW,GAAGL,GAAG;EACxB;EAEAM,KAAK,GAAG;IACNH,gDAAuC,CAACG,KAAK,CAAC,IAAI,CAACD,WAAW,CAAC;EACjE;AACF;AAAC"} diff --git a/lib/commonjs/shape_animators/ShapeAnimatorManager.js b/lib/commonjs/shape_animators/ShapeAnimatorManager.js new file mode 100644 index 000000000..30da48124 --- /dev/null +++ b/lib/commonjs/shape_animators/ShapeAnimatorManager.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +class ShapeAnimatorManager { + static nextTag() { + this.tag += 1; + return this.tag; + } +} +exports.default = ShapeAnimatorManager; +_defineProperty(ShapeAnimatorManager, "tag", 42); +//# sourceMappingURL=ShapeAnimatorManager.js.map \ No newline at end of file diff --git a/lib/commonjs/shape_animators/ShapeAnimatorManager.js.map b/lib/commonjs/shape_animators/ShapeAnimatorManager.js.map new file mode 100644 index 000000000..e6189e821 --- /dev/null +++ b/lib/commonjs/shape_animators/ShapeAnimatorManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["ShapeAnimatorManager","nextTag","tag"],"sourceRoot":"../../../src","sources":["shape_animators/ShapeAnimatorManager.tsx"],"mappings":";;;;;;;AAAe,MAAMA,oBAAoB,CAAC;EAGxC,OAAOC,OAAO,GAAW;IACvB,IAAI,CAACC,GAAG,IAAI,CAAC;IACb,OAAO,IAAI,CAACA,GAAG;EACjB;AACF;AAAC;AAAA,gBAPoBF,oBAAoB,SAC1B,EAAE"} diff --git a/lib/commonjs/specs/NativeMapViewModule.js b/lib/commonjs/specs/NativeMapViewModule.js new file mode 100644 index 000000000..d90f6f772 --- /dev/null +++ b/lib/commonjs/specs/NativeMapViewModule.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +/* eslint-disable @typescript-eslint/ban-types */ +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXMapViewModule'); +exports.default = _default; +//# sourceMappingURL=NativeMapViewModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeMapViewModule.js.map b/lib/commonjs/specs/NativeMapViewModule.js.map new file mode 100644 index 000000000..d639b9df0 --- /dev/null +++ b/lib/commonjs/specs/NativeMapViewModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeMapViewModule.ts"],"mappings":";;;;;;AAGA;AAHA;AAAA,eAqDeA,gCAAmB,CAACC,YAAY,CAAO,oBAAoB,CAAC;AAAA"} diff --git a/lib/commonjs/specs/NativeRNMBXImageModule.js b/lib/commonjs/specs/NativeRNMBXImageModule.js new file mode 100644 index 000000000..66f6ca4b7 --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXImageModule.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +/* eslint-disable @typescript-eslint/ban-types */ +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXImageModule'); +exports.default = _default; +//# sourceMappingURL=NativeRNMBXImageModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeRNMBXImageModule.js.map b/lib/commonjs/specs/NativeRNMBXImageModule.js.map new file mode 100644 index 000000000..9ab67a00a --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXImageModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXImageModule.ts"],"mappings":";;;;;;AAGA;AAHA;AAAA,eASeA,gCAAmB,CAACC,YAAY,CAAO,kBAAkB,CAAC;AAAA"} diff --git a/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js b/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js new file mode 100644 index 000000000..d269e3c4f --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXMovePointShapeAnimatorModule'); +exports.default = _default; +//# sourceMappingURL=NativeRNMBXMovePointShapeAnimatorModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map b/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map new file mode 100644 index 000000000..cb8e4d33c --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXMovePointShapeAnimatorModule.ts"],"mappings":";;;;;;AAEA;AAAmD,eAWpCA,gCAAmB,CAACC,YAAY,CAC7C,mCAAmC,CACpC;AAAA"} diff --git a/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js b/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js new file mode 100644 index 000000000..db6816294 --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +/* eslint-disable @typescript-eslint/ban-types */ +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXPointAnnotationModule'); +exports.default = _default; +//# sourceMappingURL=NativeRNMBXPointAnnotationModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map b/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map new file mode 100644 index 000000000..d8804bfbd --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXPointAnnotationModule.ts"],"mappings":";;;;;;AAGA;AAHA;AAAA,eASeA,gCAAmB,CAACC,YAAY,CAC7C,4BAA4B,CAC7B;AAAA"} diff --git a/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js b/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js new file mode 100644 index 000000000..a73822128 --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +/* eslint-disable @typescript-eslint/ban-types */ +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXShapeSourceModule'); +exports.default = _default; +//# sourceMappingURL=NativeRNMBXShapeSourceModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map b/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map new file mode 100644 index 000000000..bd4f635c1 --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXShapeSourceModule.ts"],"mappings":";;;;;;AAGA;AAHA;AAAA,eAsBeA,gCAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC;AAAA"} diff --git a/lib/commonjs/specs/NativeRNMBXTileStoreModule.js b/lib/commonjs/specs/NativeRNMBXTileStoreModule.js new file mode 100644 index 000000000..adc60eae5 --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXTileStoreModule.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXTileStoreModule'); +exports.default = _default; +//# sourceMappingURL=NativeRNMBXTileStoreModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeRNMBXTileStoreModule.js.map b/lib/commonjs/specs/NativeRNMBXTileStoreModule.js.map new file mode 100644 index 000000000..dd3f6086d --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXTileStoreModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXTileStoreModule.ts"],"mappings":";;;;;;AAEA;AAAmD,eAwBpCA,gCAAmB,CAACC,YAAY,CAAO,sBAAsB,CAAC;AAAA"} diff --git a/lib/commonjs/specs/NativeRNMBXViewportModule.js b/lib/commonjs/specs/NativeRNMBXViewportModule.js new file mode 100644 index 000000000..3d8e500ac --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXViewportModule.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNMBXViewportModule'); +exports.default = _default; +//# sourceMappingURL=NativeRNMBXViewportModule.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/NativeRNMBXViewportModule.js.map b/lib/commonjs/specs/NativeRNMBXViewportModule.js.map new file mode 100644 index 000000000..b1c725fb4 --- /dev/null +++ b/lib/commonjs/specs/NativeRNMBXViewportModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXViewportModule.ts"],"mappings":";;;;;;AAEA;AAAmD,eAsCpCA,gCAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC;AAAA"} diff --git a/lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js b/lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js new file mode 100644 index 000000000..4f082f9c6 --- /dev/null +++ b/lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXAtmosphere'); +exports.default = _default; +//# sourceMappingURL=RNMBXAtmosphereNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js.map b/lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js.map new file mode 100644 index 000000000..2ab48e4fa --- /dev/null +++ b/lib/commonjs/specs/RNMBXAtmosphereNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXAtmosphereNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAQ9E,IAAAA,+BAAsB,EACnC,iBAAiB,CAClB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js b/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js new file mode 100644 index 000000000..7d17d9a30 --- /dev/null +++ b/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXBackgroundLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXBackgroundLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js.map new file mode 100644 index 000000000..e597364b4 --- /dev/null +++ b/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXBackgroundLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAuB9E,IAAAA,+BAAsB,EACnC,sBAAsB,CACvB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXCalloutNativeComponent.js b/lib/commonjs/specs/RNMBXCalloutNativeComponent.js new file mode 100644 index 000000000..2fb503098 --- /dev/null +++ b/lib/commonjs/specs/RNMBXCalloutNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXCallout'); +exports.default = _default; +//# sourceMappingURL=RNMBXCalloutNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map b/lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map new file mode 100644 index 000000000..b30352e7a --- /dev/null +++ b/lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCalloutNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAK9E,IAAAA,+BAAsB,EACnC,cAAc,CACf;AAAA"} diff --git a/lib/commonjs/specs/RNMBXCameraNativeComponent.js b/lib/commonjs/specs/RNMBXCameraNativeComponent.js new file mode 100644 index 000000000..872be95dd --- /dev/null +++ b/lib/commonjs/specs/RNMBXCameraNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXCamera'); +exports.default = _default; +//# sourceMappingURL=RNMBXCameraNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXCameraNativeComponent.js.map b/lib/commonjs/specs/RNMBXCameraNativeComponent.js.map new file mode 100644 index 000000000..8f0ea54ea --- /dev/null +++ b/lib/commonjs/specs/RNMBXCameraNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCameraNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eA0C9E,IAAAA,+BAAsB,EACnC,aAAa,CACd;AAAA"} diff --git a/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js b/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js new file mode 100644 index 000000000..f98c72b6a --- /dev/null +++ b/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXCircleLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXCircleLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js.map new file mode 100644 index 000000000..f3349cd45 --- /dev/null +++ b/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCircleLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiC9E,IAAAA,+BAAsB,EACnC,kBAAkB,CACnB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js b/lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js new file mode 100644 index 000000000..49388be3e --- /dev/null +++ b/lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXCustomLocationProvider'); +exports.default = _default; +//# sourceMappingURL=RNMBXCustomLocationProviderNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js.map b/lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js.map new file mode 100644 index 000000000..8c51da7a3 --- /dev/null +++ b/lib/commonjs/specs/RNMBXCustomLocationProviderNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCustomLocationProviderNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAe9E,IAAAA,+BAAsB,EACnC,6BAA6B,CAC9B;AAAA"} diff --git a/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js b/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js new file mode 100644 index 000000000..0fe4de122 --- /dev/null +++ b/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXFillExtrusionLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXFillExtrusionLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js.map new file mode 100644 index 000000000..084ed8b87 --- /dev/null +++ b/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXFillExtrusionLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAwB9E,IAAAA,+BAAsB,EACnC,yBAAyB,CAC1B;AAAA"} diff --git a/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js b/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js new file mode 100644 index 000000000..a8447cfcb --- /dev/null +++ b/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXFillLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXFillLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js.map new file mode 100644 index 000000000..5402232d4 --- /dev/null +++ b/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXFillLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiC9E,IAAAA,+BAAsB,EACnC,gBAAgB,CACjB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js b/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js new file mode 100644 index 000000000..c9bbee591 --- /dev/null +++ b/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXHeatmapLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXHeatmapLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js.map new file mode 100644 index 000000000..f5ac77d74 --- /dev/null +++ b/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXHeatmapLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiC9E,IAAAA,+BAAsB,EACnC,mBAAmB,CACpB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXImageNativeComponent.js b/lib/commonjs/specs/RNMBXImageNativeComponent.js new file mode 100644 index 000000000..e5baeeb1c --- /dev/null +++ b/lib/commonjs/specs/RNMBXImageNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXImage'); +exports.default = _default; +//# sourceMappingURL=RNMBXImageNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXImageNativeComponent.js.map b/lib/commonjs/specs/RNMBXImageNativeComponent.js.map new file mode 100644 index 000000000..ea75d1b64 --- /dev/null +++ b/lib/commonjs/specs/RNMBXImageNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXImageNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAc9E,IAAAA,+BAAsB,EACnC,YAAY,CACb;AAAA"} diff --git a/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js b/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js new file mode 100644 index 000000000..5d7b67dce --- /dev/null +++ b/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXImageSource'); +exports.default = _default; +//# sourceMappingURL=RNMBXImageSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js.map b/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js.map new file mode 100644 index 000000000..8d77b1de3 --- /dev/null +++ b/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXImageSourceNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAW9E,IAAAA,+BAAsB,EACnC,kBAAkB,CACnB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXImagesNativeComponent.js b/lib/commonjs/specs/RNMBXImagesNativeComponent.js new file mode 100644 index 000000000..1fda0703c --- /dev/null +++ b/lib/commonjs/specs/RNMBXImagesNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXImages'); +exports.default = _default; +//# sourceMappingURL=RNMBXImagesNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXImagesNativeComponent.js.map b/lib/commonjs/specs/RNMBXImagesNativeComponent.js.map new file mode 100644 index 000000000..d3ff426b6 --- /dev/null +++ b/lib/commonjs/specs/RNMBXImagesNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXImagesNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAc9E,IAAAA,+BAAsB,EACnC,aAAa,CACd;AAAA"} diff --git a/lib/commonjs/specs/RNMBXLightNativeComponent.js b/lib/commonjs/specs/RNMBXLightNativeComponent.js new file mode 100644 index 000000000..b2b3bd033 --- /dev/null +++ b/lib/commonjs/specs/RNMBXLightNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXLight'); +exports.default = _default; +//# sourceMappingURL=RNMBXLightNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXLightNativeComponent.js.map b/lib/commonjs/specs/RNMBXLightNativeComponent.js.map new file mode 100644 index 000000000..e3bddb83d --- /dev/null +++ b/lib/commonjs/specs/RNMBXLightNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXLightNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAQ9E,IAAAA,+BAAsB,EACnC,YAAY,CACb;AAAA"} diff --git a/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js b/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js new file mode 100644 index 000000000..847ffb14c --- /dev/null +++ b/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXLineLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXLineLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js.map new file mode 100644 index 000000000..f2ef13817 --- /dev/null +++ b/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXLineLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiC9E,IAAAA,+BAAsB,EACnC,gBAAgB,CACjB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXMapViewNativeComponent.js b/lib/commonjs/specs/RNMBXMapViewNativeComponent.js new file mode 100644 index 000000000..d4c426fc4 --- /dev/null +++ b/lib/commonjs/specs/RNMBXMapViewNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXMapView'); // The actually types for callbacks are sometwhat different due to codegen limitations: +exports.default = _default; +//# sourceMappingURL=RNMBXMapViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map b/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map new file mode 100644 index 000000000..280b0fd6e --- /dev/null +++ b/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMapViewNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiF9E,IAAAA,+BAAsB,EACnC,cAAc,CACf,EAED;AAAA"} diff --git a/lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js b/lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js new file mode 100644 index 000000000..b389b95ca --- /dev/null +++ b/lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXMarkerViewContent'); +exports.default = _default; +//# sourceMappingURL=RNMBXMarkerViewContentNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js.map b/lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js.map new file mode 100644 index 000000000..00301811a --- /dev/null +++ b/lib/commonjs/specs/RNMBXMarkerViewContentNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMarkerViewContentNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAK9E,IAAAA,+BAAsB,EACnC,wBAAwB,CACzB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js b/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js new file mode 100644 index 000000000..05b716cc3 --- /dev/null +++ b/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXMarkerView'); +exports.default = _default; +//# sourceMappingURL=RNMBXMarkerViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map b/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map new file mode 100644 index 000000000..5c4eaf511 --- /dev/null +++ b/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMarkerViewNativeComponent.ts"],"mappings":";;;;;;AAEA;AAA6F;AAAA,eAmB9E,IAAAA,+BAAsB,EACnC,iBAAiB,CAClB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXModelLayerNativeComponent.js b/lib/commonjs/specs/RNMBXModelLayerNativeComponent.js new file mode 100644 index 000000000..62546e65a --- /dev/null +++ b/lib/commonjs/specs/RNMBXModelLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXModelLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXModelLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXModelLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXModelLayerNativeComponent.js.map new file mode 100644 index 000000000..369561929 --- /dev/null +++ b/lib/commonjs/specs/RNMBXModelLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXModelLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAkC9E,IAAAA,+BAAsB,EACnC,iBAAiB,CAClB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXModelsNativeComponent.js b/lib/commonjs/specs/RNMBXModelsNativeComponent.js new file mode 100644 index 000000000..3a81fb6d0 --- /dev/null +++ b/lib/commonjs/specs/RNMBXModelsNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXModels'); +exports.default = _default; +//# sourceMappingURL=RNMBXModelsNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXModelsNativeComponent.js.map b/lib/commonjs/specs/RNMBXModelsNativeComponent.js.map new file mode 100644 index 000000000..525221597 --- /dev/null +++ b/lib/commonjs/specs/RNMBXModelsNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXModelsNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAc9E,IAAAA,+BAAsB,EACnC,aAAa,CACd;AAAA"} diff --git a/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js b/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js new file mode 100644 index 000000000..d9c28f854 --- /dev/null +++ b/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXNativeUserLocation'); +exports.default = _default; +//# sourceMappingURL=RNMBXNativeUserLocationNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map b/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map new file mode 100644 index 000000000..625786283 --- /dev/null +++ b/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXNativeUserLocationNativeComponent.ts"],"mappings":";;;;;;AAKA;AAA6F;AAAA,eA+B9E,IAAAA,+BAAsB,EACnC,yBAAyB,CAC1B;AAAA"} diff --git a/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js b/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js new file mode 100644 index 000000000..8a7d66ae1 --- /dev/null +++ b/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXPointAnnotation'); +exports.default = _default; +//# sourceMappingURL=RNMBXPointAnnotationNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map b/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map new file mode 100644 index 000000000..fd4202474 --- /dev/null +++ b/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXPointAnnotationNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAoC9E,IAAAA,+BAAsB,EACnC,sBAAsB,CACvB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js b/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js new file mode 100644 index 000000000..856437c26 --- /dev/null +++ b/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXRasterDemSource'); +exports.default = _default; +//# sourceMappingURL=RNMBXRasterDemSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js.map b/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js.map new file mode 100644 index 000000000..a474469fa --- /dev/null +++ b/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXRasterDemSourceNativeComponent.ts"],"mappings":";;;;;;AAEA;AAA6F;AAAA,eAc9E,IAAAA,+BAAsB,EACnC,sBAAsB,CACvB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js b/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js new file mode 100644 index 000000000..142c85830 --- /dev/null +++ b/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXRasterLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXRasterLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map new file mode 100644 index 000000000..6a4315570 --- /dev/null +++ b/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXRasterLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiC9E,IAAAA,+BAAsB,EACnC,kBAAkB,CACnB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js b/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js new file mode 100644 index 000000000..e45cef31d --- /dev/null +++ b/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXRasterSource'); +exports.default = _default; +//# sourceMappingURL=RNMBXRasterSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js.map b/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js.map new file mode 100644 index 000000000..c07f307fa --- /dev/null +++ b/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXRasterSourceNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiB9E,IAAAA,+BAAsB,EACnC,mBAAmB,CACpB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js b/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js new file mode 100644 index 000000000..78495702a --- /dev/null +++ b/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXShapeSource'); +exports.default = _default; +//# sourceMappingURL=RNMBXShapeSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map b/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map new file mode 100644 index 000000000..c02672950 --- /dev/null +++ b/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXShapeSourceNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eA6B9E,IAAAA,+BAAsB,EACnC,kBAAkB,CACnB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js b/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js new file mode 100644 index 000000000..39b7d833c --- /dev/null +++ b/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXSkyLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXSkyLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js.map new file mode 100644 index 000000000..ba3a27fc6 --- /dev/null +++ b/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXSkyLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAuB9E,IAAAA,+BAAsB,EACnC,eAAe,CAChB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXStyleImportNativeComponent.js b/lib/commonjs/specs/RNMBXStyleImportNativeComponent.js new file mode 100644 index 000000000..b86dcd47b --- /dev/null +++ b/lib/commonjs/specs/RNMBXStyleImportNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXStyleImport'); +exports.default = _default; +//# sourceMappingURL=RNMBXStyleImportNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXStyleImportNativeComponent.js.map b/lib/commonjs/specs/RNMBXStyleImportNativeComponent.js.map new file mode 100644 index 000000000..7c8324d1b --- /dev/null +++ b/lib/commonjs/specs/RNMBXStyleImportNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXStyleImportNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAU9E,IAAAA,+BAAsB,EACnC,kBAAkB,CACnB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js b/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js new file mode 100644 index 000000000..17fec868c --- /dev/null +++ b/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXSymbolLayer'); +exports.default = _default; +//# sourceMappingURL=RNMBXSymbolLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js.map b/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js.map new file mode 100644 index 000000000..0f9de8b0e --- /dev/null +++ b/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXSymbolLayerNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAiC9E,IAAAA,+BAAsB,EACnC,kBAAkB,CACnB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXTerrainNativeComponent.js b/lib/commonjs/specs/RNMBXTerrainNativeComponent.js new file mode 100644 index 000000000..d7691016f --- /dev/null +++ b/lib/commonjs/specs/RNMBXTerrainNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXTerrain'); +exports.default = _default; +//# sourceMappingURL=RNMBXTerrainNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map b/lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map new file mode 100644 index 000000000..b61147ed7 --- /dev/null +++ b/lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXTerrainNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAS9E,IAAAA,+BAAsB,EACnC,cAAc,CACf;AAAA"} diff --git a/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js b/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js new file mode 100644 index 000000000..992cdc329 --- /dev/null +++ b/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXVectorSource'); +exports.default = _default; +//# sourceMappingURL=RNMBXVectorSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js.map b/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js.map new file mode 100644 index 000000000..0a9250c33 --- /dev/null +++ b/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXVectorSourceNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eAwB9E,IAAAA,+BAAsB,EACnC,mBAAmB,CACpB;AAAA"} diff --git a/lib/commonjs/specs/RNMBXViewportNativeComponent.js b/lib/commonjs/specs/RNMBXViewportNativeComponent.js new file mode 100644 index 000000000..27b8899ba --- /dev/null +++ b/lib/commonjs/specs/RNMBXViewportNativeComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _default = (0, _codegenNativeComponent.default)('RNMBXViewport'); +exports.default = _default; +//# sourceMappingURL=RNMBXViewportNativeComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/RNMBXViewportNativeComponent.js.map b/lib/commonjs/specs/RNMBXViewportNativeComponent.js.map new file mode 100644 index 000000000..d97b8b2ba --- /dev/null +++ b/lib/commonjs/specs/RNMBXViewportNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXViewportNativeComponent.ts"],"mappings":";;;;;;AACA;AAA6F;AAAA,eA2G9E,IAAAA,+BAAsB,EACnC,eAAe,CAChB;AAAA"} diff --git a/lib/commonjs/specs/codegenUtils.js b/lib/commonjs/specs/codegenUtils.js new file mode 100644 index 000000000..726c84262 --- /dev/null +++ b/lib/commonjs/specs/codegenUtils.js @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=codegenUtils.js.map \ No newline at end of file diff --git a/lib/commonjs/specs/codegenUtils.js.map b/lib/commonjs/specs/codegenUtils.js.map new file mode 100644 index 000000000..208731b62 --- /dev/null +++ b/lib/commonjs/specs/codegenUtils.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/codegenUtils.ts"],"mappings":""} diff --git a/lib/commonjs/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts b/lib/commonjs/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts new file mode 100644 index 000000000..7717d2757 --- /dev/null +++ b/lib/commonjs/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts @@ -0,0 +1,18 @@ +// see https://github.com/rnmapbox/maps/wiki/FabricOptionalProp +type OptionalProp = UnsafeMixed; +type Slot = 'bottom' | 'middle' | 'top'; + +type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; diff --git a/lib/commonjs/types/BaseProps.js b/lib/commonjs/types/BaseProps.js new file mode 100644 index 000000000..052e07fb8 --- /dev/null +++ b/lib/commonjs/types/BaseProps.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=BaseProps.js.map \ No newline at end of file diff --git a/lib/commonjs/types/BaseProps.js.map b/lib/commonjs/types/BaseProps.js.map new file mode 100644 index 000000000..adbd1fbd9 --- /dev/null +++ b/lib/commonjs/types/BaseProps.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/BaseProps.ts"],"mappings":""} diff --git a/lib/commonjs/types/OnPressEvent.js b/lib/commonjs/types/OnPressEvent.js new file mode 100644 index 000000000..c41f15587 --- /dev/null +++ b/lib/commonjs/types/OnPressEvent.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=OnPressEvent.js.map \ No newline at end of file diff --git a/lib/commonjs/types/OnPressEvent.js.map b/lib/commonjs/types/OnPressEvent.js.map new file mode 100644 index 000000000..197dc88ce --- /dev/null +++ b/lib/commonjs/types/OnPressEvent.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/OnPressEvent.ts"],"mappings":""} diff --git a/lib/commonjs/types/Position.js b/lib/commonjs/types/Position.js new file mode 100644 index 000000000..e3abcd811 --- /dev/null +++ b/lib/commonjs/types/Position.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=Position.js.map \ No newline at end of file diff --git a/lib/commonjs/types/Position.js.map b/lib/commonjs/types/Position.js.map new file mode 100644 index 000000000..eda9b67cb --- /dev/null +++ b/lib/commonjs/types/Position.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Position.ts"],"mappings":""} diff --git a/lib/commonjs/types/index.js b/lib/commonjs/types/index.js new file mode 100644 index 000000000..951c783aa --- /dev/null +++ b/lib/commonjs/types/index.js @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/commonjs/types/index.js.map b/lib/commonjs/types/index.js.map new file mode 100644 index 000000000..010d2638c --- /dev/null +++ b/lib/commonjs/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":""} diff --git a/lib/commonjs/utils/BridgeValue.js b/lib/commonjs/utils/BridgeValue.js new file mode 100644 index 000000000..22dd8db80 --- /dev/null +++ b/lib/commonjs/utils/BridgeValue.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _index = require("./index"); +class BridgeValue { + constructor(rawValue) { + this.rawValue = rawValue; + } + get type() { + if (Array.isArray(this.rawValue)) { + return 'array'; + } + if ((0, _index.isBoolean)(this.rawValue)) { + return 'boolean'; + } + if ((0, _index.isNumber)(this.rawValue)) { + return 'number'; + } + if ((0, _index.isString)(this.rawValue)) { + return 'string'; + } + if (this.rawValue && typeof this.rawValue === 'object') { + return 'hashmap'; + } + throw new Error(`[type - ${this.rawValue}] BridgeValue must be a primitive/array/object`); + } + get value() { + const { + type + } = this; + let value; + if (type === 'array') { + value = []; + const rawValue = this.rawValue; + for (const innerRawValue of rawValue) { + const bridgeValue = new BridgeValue(innerRawValue); + value.push(bridgeValue.toJSON()); + } + } else if (type === 'hashmap') { + value = []; + const rawValue = this.rawValue; + const stringKeys = Object.keys(rawValue); + for (const stringKey of stringKeys) { + value.push([new BridgeValue(stringKey).toJSON(), new BridgeValue(rawValue[stringKey]).toJSON()]); + } + } else if (type === 'boolean' || type === 'number' || type === 'string') { + value = this.rawValue; + } else { + throw new Error(`[value - ${this.rawValue}] BridgeValue must be a primitive/array/object`); + } + return value; + } + toJSON(formatter) { + return { + type: this.type, + value: typeof formatter === 'function' ? formatter(this.value) : this.value + }; + } +} +exports.default = BridgeValue; +//# sourceMappingURL=BridgeValue.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/BridgeValue.js.map b/lib/commonjs/utils/BridgeValue.js.map new file mode 100644 index 000000000..60b86b3c4 --- /dev/null +++ b/lib/commonjs/utils/BridgeValue.js.map @@ -0,0 +1 @@ +{"version":3,"names":["BridgeValue","constructor","rawValue","type","Array","isArray","isBoolean","isNumber","isString","Error","value","innerRawValue","bridgeValue","push","toJSON","stringKeys","Object","keys","stringKey","formatter"],"sourceRoot":"../../../src","sources":["utils/BridgeValue.ts"],"mappings":";;;;;;AAAA;AAkBe,MAAMA,WAAW,CAAC;EAG/BC,WAAW,CAACC,QAAsB,EAAE;IAClC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAEA,IAAIC,IAAI,GAAoB;IAC1B,IAAIC,KAAK,CAACC,OAAO,CAAC,IAAI,CAACH,QAAQ,CAAC,EAAE;MAChC,OAAO,OAAO;IAChB;IACA,IAAI,IAAAI,gBAAS,EAAC,IAAI,CAACJ,QAAQ,CAAC,EAAE;MAC5B,OAAO,SAAS;IAClB;IACA,IAAI,IAAAK,eAAQ,EAAC,IAAI,CAACL,QAAQ,CAAC,EAAE;MAC3B,OAAO,QAAQ;IACjB;IACA,IAAI,IAAAM,eAAQ,EAAC,IAAI,CAACN,QAAQ,CAAC,EAAE;MAC3B,OAAO,QAAQ;IACjB;IACA,IAAI,IAAI,CAACA,QAAQ,IAAI,OAAO,IAAI,CAACA,QAAQ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AAI;MACfO,KAAK,EACH,OAAOS,SAAS,KAAK,UAAU,GAAGA,SAAS,CAAC,IAAI,CAACT,KAAK,CAAC,GAAG,IAAI,CAACA;IACnE,CAAC;EACH;AACF;AAAC"} diff --git a/lib/commonjs/utils/Logger.js b/lib/commonjs/utils/Logger.js new file mode 100644 index 000000000..81124157d --- /dev/null +++ b/lib/commonjs/utils/Logger.js @@ -0,0 +1,119 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +const { + RNMBXLogging +} = _reactNative.NativeModules; +class Logger { + static sharedInstance() { + if (this.instance === null) { + this.instance = new Logger(); + } + return this.instance; + } + constructor() { + this.loggerEmitter = new _reactNative.NativeEventEmitter(RNMBXLogging); + this.startedCount = 0; + this.logCallback = undefined; + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + static setLogCallback(logCallback) { + this.sharedInstance().setLogCallback(logCallback); + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + setLogCallback(logCallback) { + this.logCallback = logCallback; + } + + /** + * This callback is displayed as part of the Requester class. + * @callback Logger~logCallback + * @param {object} log + * @param {string} log.message - the message of the log + * @param {string} log.level - log level + * @param {string} log.tag - optional tag used on android + */ + + /** + * setLogLevel + * @param {LogLevel} level + */ + static setLogLevel(level) { + RNMBXLogging.setLogLevel(level); + } + + /** + * @type {('error'|'warning'|'info'|'debug'|'verbose')} LogLevel - Supported log levels + */ + start() { + if (this.startedCount === 0) { + this.subscribe(); + } + this.startedCount += 1; + } + stop() { + this.startedCount -= 1; + if (this.startedCount === 0) { + this.unsubscribe(); + } + } + subscribe() { + this.subscription = this.loggerEmitter.addListener('LogEvent', log => { + this.onLog(log); + }); + } + unsubscribe() { + var _this$subscription; + (_this$subscription = this.subscription) === null || _this$subscription === void 0 ? void 0 : _this$subscription.remove(); + this.subscription = undefined; + } + effectiveLevel(log) { + const { + level, + message, + tag + } = log; + if (level === 'warning') { + if (tag === 'Mbgl-HttpRequest' && message.startsWith('Request failed due to a permanent error: Canceled')) { + // this seems to happening too much to show a warning every time + return 'info'; + } + } + return level; + } + onLog(log) { + if (!this.logCallback || !this.logCallback(log)) { + const { + message + } = log; + const level = this.effectiveLevel(log); + if (level === 'error') { + console.error('Mapbox error', message, log); + } else if (level === 'warning') { + console.warn('Mapbox warning', message, log); + } else { + console.log(`Mapbox [${level}]`, message, log); + } + } + } +} +_defineProperty(Logger, "instance", null); +Logger.sharedInstance().start(); +var _default = Logger; +exports.default = _default; +//# sourceMappingURL=Logger.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/Logger.js.map b/lib/commonjs/utils/Logger.js.map new file mode 100644 index 000000000..e625832d3 --- /dev/null +++ b/lib/commonjs/utils/Logger.js.map @@ -0,0 +1 @@ +{"version":3,"names":["RNMBXLogging","NativeModules","Logger","sharedInstance","instance","constructor","loggerEmitter","NativeEventEmitter","startedCount","logCallback","undefined","setLogCallback","setLogLevel","level","start","subscribe","stop","unsubscribe","subscription","addListener","log","onLog","remove","effectiveLevel","message","tag","startsWith","console","error","warn"],"sourceRoot":"../../../src","sources":["utils/Logger.ts"],"mappings":";;;;;;AAAA;AAIsB;AACtB,MAAM;EAAEA;AAAa,CAAC,GAAGC,0BAAa;AAYtC,MAAMC,MAAM,CAAC;EAQX,OAAOC,cAAc,GAAG;IACtB,IAAI,IAAI,CAACC,QAAQ,KAAK,IAAI,EAAE;MAC1B,IAAI,CAACA,QAAQ,GAAG,IAAIF,MAAM,EAAE;IAC9B;IACA,OAAO,IAAI,CAACE,QAAQ;EACtB;EAEAC,WAAW,GAAG;IACZ,IAAI,CAACC,aAAa,GAAG,IAAIC,+BAAkB,CAACP,YAAY,CAAC;IAC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AAK,kBAAkB,IAC1BD,OAAO,CAACE,UAAU,CAAC,mDAAmD,CAAC,EACvE;QACA;QACA,OAAO,MAAM;MACf;IACF;IACA,OAAOb,KAAK;EACd;EAEAQ,KAAK,CAACD,GAAc,EAAE;IACpB,IAAI,CAAC,IAAI,CAACX,WAAW,IAAI,CAAC,IAAI,CAACA,WAAW,CAACW,GAAG,CAAC,EAAE;MAC/C,MAAM;QAAEI;MAAQ,CAAC,GAAGJ,GAAG;MACvB,MAAMP,KAAK,GAAG,IAAI,CAACU,cAAc,CAACH,GAAG,CAAC;MACtC,IAAIP,KAAK,KAAK,OAAO,EAAE;QACrBc,OAAO,CAACC,KAAK,CAAC,cAAc,EAAEJ,OAAO,EAAEJ,GAAG,CAAC;MAC7C,CAAC,MAAM,IAAIP,KAAK,KAAK,SAAS,EAAE;QAC9Bc,OAAO,CAACE,IAAI,CAAC,gBAAgB,EAAEL,OAAO,EAAEJ,GAAG,CAAC;MAC9C,CAAC,MAAM;QACLO,OAAO,CAACP,GAAG,CAAE,WAAUP,KAAM,GAAE,EAAEW,OAAO,EAAEJ,GAAG,CAAC;MAChD;IACF;EACF;AACF;AAAC,gBAhHKlB,MAAM,cACuB,IAAI;AAiHvCA,MAAM,CAACC,cAAc,EAAE,CAACW,KAAK,EAAE;AAAC,eAEjBZ,MAAM;AAAA"} diff --git a/lib/commonjs/utils/MapboxStyles.d.js b/lib/commonjs/utils/MapboxStyles.d.js new file mode 100644 index 000000000..4c6ec06f0 --- /dev/null +++ b/lib/commonjs/utils/MapboxStyles.d.js @@ -0,0 +1,188 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/* This file was generated from MapboxStyle.ts.ejs do not modify */ +/* TODO */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var VisibilityEnum; +(function (VisibilityEnum) { + VisibilityEnum["Visible"] = "visible"; + VisibilityEnum["None"] = "none"; +})(VisibilityEnum || (VisibilityEnum = {})); +var FillTranslateAnchorEnum; +(function (FillTranslateAnchorEnum) { + FillTranslateAnchorEnum["Map"] = "map"; + FillTranslateAnchorEnum["Viewport"] = "viewport"; +})(FillTranslateAnchorEnum || (FillTranslateAnchorEnum = {})); +var LineCapEnum; +(function (LineCapEnum) { + LineCapEnum["Butt"] = "butt"; + LineCapEnum["Round"] = "round"; + LineCapEnum["Square"] = "square"; +})(LineCapEnum || (LineCapEnum = {})); +var LineJoinEnum; +(function (LineJoinEnum) { + LineJoinEnum["Bevel"] = "bevel"; + LineJoinEnum["Round"] = "round"; + LineJoinEnum["Miter"] = "miter"; +})(LineJoinEnum || (LineJoinEnum = {})); +var LineTranslateAnchorEnum; +(function (LineTranslateAnchorEnum) { + LineTranslateAnchorEnum["Map"] = "map"; + LineTranslateAnchorEnum["Viewport"] = "viewport"; +})(LineTranslateAnchorEnum || (LineTranslateAnchorEnum = {})); +var SymbolPlacementEnum; +(function (SymbolPlacementEnum) { + SymbolPlacementEnum["Point"] = "point"; + SymbolPlacementEnum["Line"] = "line"; + SymbolPlacementEnum["LineCenter"] = "line-center"; +})(SymbolPlacementEnum || (SymbolPlacementEnum = {})); +var SymbolZOrderEnum; +(function (SymbolZOrderEnum) { + SymbolZOrderEnum["Auto"] = "auto"; + SymbolZOrderEnum["ViewportY"] = "viewport-y"; + SymbolZOrderEnum["Source"] = "source"; +})(SymbolZOrderEnum || (SymbolZOrderEnum = {})); +var IconRotationAlignmentEnum; +(function (IconRotationAlignmentEnum) { + IconRotationAlignmentEnum["Map"] = "map"; + IconRotationAlignmentEnum["Viewport"] = "viewport"; + IconRotationAlignmentEnum["Auto"] = "auto"; +})(IconRotationAlignmentEnum || (IconRotationAlignmentEnum = {})); +var IconTextFitEnum; +(function (IconTextFitEnum) { + IconTextFitEnum["None"] = "none"; + IconTextFitEnum["Width"] = "width"; + IconTextFitEnum["Height"] = "height"; + IconTextFitEnum["Both"] = "both"; +})(IconTextFitEnum || (IconTextFitEnum = {})); +var IconAnchorEnum; +(function (IconAnchorEnum) { + IconAnchorEnum["Center"] = "center"; + IconAnchorEnum["Left"] = "left"; + IconAnchorEnum["Right"] = "right"; + IconAnchorEnum["Top"] = "top"; + IconAnchorEnum["Bottom"] = "bottom"; + IconAnchorEnum["TopLeft"] = "top-left"; + IconAnchorEnum["TopRight"] = "top-right"; + IconAnchorEnum["BottomLeft"] = "bottom-left"; + IconAnchorEnum["BottomRight"] = "bottom-right"; +})(IconAnchorEnum || (IconAnchorEnum = {})); +var IconPitchAlignmentEnum; +(function (IconPitchAlignmentEnum) { + IconPitchAlignmentEnum["Map"] = "map"; + IconPitchAlignmentEnum["Viewport"] = "viewport"; + IconPitchAlignmentEnum["Auto"] = "auto"; +})(IconPitchAlignmentEnum || (IconPitchAlignmentEnum = {})); +var TextPitchAlignmentEnum; +(function (TextPitchAlignmentEnum) { + TextPitchAlignmentEnum["Map"] = "map"; + TextPitchAlignmentEnum["Viewport"] = "viewport"; + TextPitchAlignmentEnum["Auto"] = "auto"; +})(TextPitchAlignmentEnum || (TextPitchAlignmentEnum = {})); +var TextRotationAlignmentEnum; +(function (TextRotationAlignmentEnum) { + TextRotationAlignmentEnum["Map"] = "map"; + TextRotationAlignmentEnum["Viewport"] = "viewport"; + TextRotationAlignmentEnum["Auto"] = "auto"; +})(TextRotationAlignmentEnum || (TextRotationAlignmentEnum = {})); +var TextJustifyEnum; +(function (TextJustifyEnum) { + TextJustifyEnum["Auto"] = "auto"; + TextJustifyEnum["Left"] = "left"; + TextJustifyEnum["Center"] = "center"; + TextJustifyEnum["Right"] = "right"; +})(TextJustifyEnum || (TextJustifyEnum = {})); +var TextVariableAnchorEnum; +(function (TextVariableAnchorEnum) { + TextVariableAnchorEnum["Center"] = "center"; + TextVariableAnchorEnum["Left"] = "left"; + TextVariableAnchorEnum["Right"] = "right"; + TextVariableAnchorEnum["Top"] = "top"; + TextVariableAnchorEnum["Bottom"] = "bottom"; + TextVariableAnchorEnum["TopLeft"] = "top-left"; + TextVariableAnchorEnum["TopRight"] = "top-right"; + TextVariableAnchorEnum["BottomLeft"] = "bottom-left"; + TextVariableAnchorEnum["BottomRight"] = "bottom-right"; +})(TextVariableAnchorEnum || (TextVariableAnchorEnum = {})); +var TextAnchorEnum; +(function (TextAnchorEnum) { + TextAnchorEnum["Center"] = "center"; + TextAnchorEnum["Left"] = "left"; + TextAnchorEnum["Right"] = "right"; + TextAnchorEnum["Top"] = "top"; + TextAnchorEnum["Bottom"] = "bottom"; + TextAnchorEnum["TopLeft"] = "top-left"; + TextAnchorEnum["TopRight"] = "top-right"; + TextAnchorEnum["BottomLeft"] = "bottom-left"; + TextAnchorEnum["BottomRight"] = "bottom-right"; +})(TextAnchorEnum || (TextAnchorEnum = {})); +var TextWritingModeEnum; +(function (TextWritingModeEnum) { + TextWritingModeEnum["Horizontal"] = "horizontal"; + TextWritingModeEnum["Vertical"] = "vertical"; +})(TextWritingModeEnum || (TextWritingModeEnum = {})); +var TextTransformEnum; +(function (TextTransformEnum) { + TextTransformEnum["None"] = "none"; + TextTransformEnum["Uppercase"] = "uppercase"; + TextTransformEnum["Lowercase"] = "lowercase"; +})(TextTransformEnum || (TextTransformEnum = {})); +var IconTranslateAnchorEnum; +(function (IconTranslateAnchorEnum) { + IconTranslateAnchorEnum["Map"] = "map"; + IconTranslateAnchorEnum["Viewport"] = "viewport"; +})(IconTranslateAnchorEnum || (IconTranslateAnchorEnum = {})); +var TextTranslateAnchorEnum; +(function (TextTranslateAnchorEnum) { + TextTranslateAnchorEnum["Map"] = "map"; + TextTranslateAnchorEnum["Viewport"] = "viewport"; +})(TextTranslateAnchorEnum || (TextTranslateAnchorEnum = {})); +var CircleTranslateAnchorEnum; +(function (CircleTranslateAnchorEnum) { + CircleTranslateAnchorEnum["Map"] = "map"; + CircleTranslateAnchorEnum["Viewport"] = "viewport"; +})(CircleTranslateAnchorEnum || (CircleTranslateAnchorEnum = {})); +var CirclePitchScaleEnum; +(function (CirclePitchScaleEnum) { + CirclePitchScaleEnum["Map"] = "map"; + CirclePitchScaleEnum["Viewport"] = "viewport"; +})(CirclePitchScaleEnum || (CirclePitchScaleEnum = {})); +var CirclePitchAlignmentEnum; +(function (CirclePitchAlignmentEnum) { + CirclePitchAlignmentEnum["Map"] = "map"; + CirclePitchAlignmentEnum["Viewport"] = "viewport"; +})(CirclePitchAlignmentEnum || (CirclePitchAlignmentEnum = {})); +var FillExtrusionTranslateAnchorEnum; +(function (FillExtrusionTranslateAnchorEnum) { + FillExtrusionTranslateAnchorEnum["Map"] = "map"; + FillExtrusionTranslateAnchorEnum["Viewport"] = "viewport"; +})(FillExtrusionTranslateAnchorEnum || (FillExtrusionTranslateAnchorEnum = {})); +var RasterResamplingEnum; +(function (RasterResamplingEnum) { + RasterResamplingEnum["Linear"] = "linear"; + RasterResamplingEnum["Nearest"] = "nearest"; +})(RasterResamplingEnum || (RasterResamplingEnum = {})); +var HillshadeIlluminationAnchorEnum; +(function (HillshadeIlluminationAnchorEnum) { + HillshadeIlluminationAnchorEnum["Map"] = "map"; + HillshadeIlluminationAnchorEnum["Viewport"] = "viewport"; +})(HillshadeIlluminationAnchorEnum || (HillshadeIlluminationAnchorEnum = {})); +var ModelTypeEnum; +(function (ModelTypeEnum) { + ModelTypeEnum["Common3d"] = "common-3d"; + ModelTypeEnum["LocationIndicator"] = "location-indicator"; +})(ModelTypeEnum || (ModelTypeEnum = {})); +var SkyTypeEnum; +(function (SkyTypeEnum) { + SkyTypeEnum["Gradient"] = "gradient"; + SkyTypeEnum["Atmosphere"] = "atmosphere"; +})(SkyTypeEnum || (SkyTypeEnum = {})); +var AnchorEnum; +(function (AnchorEnum) { + AnchorEnum["Map"] = "map"; + AnchorEnum["Viewport"] = "viewport"; +})(AnchorEnum || (AnchorEnum = {})); +//# sourceMappingURL=MapboxStyles.d.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/MapboxStyles.d.js.map b/lib/commonjs/utils/MapboxStyles.d.js.map new file mode 100644 index 000000000..0271757b4 --- /dev/null +++ b/lib/commonjs/utils/MapboxStyles.d.js.map @@ -0,0 +1 @@ +{"version":3,"names":["VisibilityEnum","FillTranslateAnchorEnum","LineCapEnum","LineJoinEnum","LineTranslateAnchorEnum","SymbolPlacementEnum","SymbolZOrderEnum","IconRotationAlignmentEnum","IconTextFitEnum","IconAnchorEnum","IconPitchAlignmentEnum","TextPitchAlignmentEnum","TextRotationAlignmentEnum","TextJustifyEnum","TextVariableAnchorEnum","TextAnchorEnum","TextWritingModeEnum","TextTransformEnum","IconTranslateAnchorEnum","TextTranslateAnchorEnum","CircleTranslateAnchorEnum","CirclePitchScaleEnum","CirclePitchAlignmentEnum","FillExtrusionTranslateAnchorEnum","RasterResamplingEnum","HillshadeIlluminationAnchorEnum","ModelTypeEnum","SkyTypeEnum","AnchorEnum"],"sourceRoot":"../../../src","sources":["utils/MapboxStyles.d.ts"],"mappings":";;;;;AAAA;AAUsC;AAuHtC;AAAA,IAKKA,cAAc;AAAA,WAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAdA,cAAc;AAAA,IAOdC,uBAAuB;AAAA,WAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB;AAAA,IAOvBC,WAAW;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW;AAAA,IASXC,YAAY;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAAA,IASZC,uBAAuB;AAAA,WAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB;AAAA,IAOvBC,mBAAmB;AAAA,WAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;AAAA,GAAnBA,mBAAmB,KAAnBA,mBAAmB;AAAA,IASnBC,gBAAgB;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,KAAhCA,gCAAgC;AAAA,IAOhCC,oBAAoB;AAAA,WAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,KAApBA,oBAAoB;AAAA,IAOpBC,+BAA+B;AAAA,WAA/BA,+BAA+B;EAA/BA,+BAA+B;EAA/BA,+BAA+B;AAAA,GAA/BA,+BAA+B,KAA/BA,+BAA+B;AAAA,IAO/BC,aAAa;AAAA,WAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAAA,IAObC,WAAW;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW;AAAA,IAOXC,UAAU;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU"} diff --git a/lib/commonjs/utils/StyleValue.js b/lib/commonjs/utils/StyleValue.js new file mode 100644 index 000000000..e4e99b70a --- /dev/null +++ b/lib/commonjs/utils/StyleValue.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformStyle = transformStyle; +var _reactNative = require("react-native"); +var _BridgeValue = _interopRequireDefault(require("./BridgeValue")); +var _styleMap = require("./styleMap"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function transformStyle(style) { + if (!style) { + return; + } + const nativeStyle = {}; + const styleProps = Object.keys(style); + for (const styleProp of styleProps) { + const styleType = (0, _styleMap.getStyleType)(styleProp); + let rawStyle = style[styleProp]; + if (styleType === 'color' && typeof rawStyle === 'string') { + const color = (0, _reactNative.processColor)(rawStyle); + if (color === null || color === undefined || typeof color === 'symbol') { + console.error(`RNMapbox: Invalid color value: ${rawStyle} using red`); + rawStyle = 'ff0000'; + } else { + rawStyle = color; + } + } else if (styleType === 'image' && typeof rawStyle === 'number') { + rawStyle = _reactNative.Image.resolveAssetSource(rawStyle) || {}; + } + if (styleType === 'image' && !(Array.isArray(rawStyle) || typeof rawStyle === 'string' && !rawStyle.startsWith('http://') && !rawStyle.startsWith('https://'))) { + console.warn(`RNMapbox: Image or URL in ${styleProp} is deprecated, use Images component. See https://github.com/rnmapbox/maps/wiki/Deprecated-URLInIconImages`); + } + if (rawStyle !== undefined) { + const bridgeValue = new _BridgeValue.default(rawStyle); + nativeStyle[styleProp] = { + styletype: styleType, + stylevalue: bridgeValue.toJSON() + }; + } + } + return nativeStyle; +} +//# sourceMappingURL=StyleValue.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/StyleValue.js.map b/lib/commonjs/utils/StyleValue.js.map new file mode 100644 index 000000000..4c804047e --- /dev/null +++ b/lib/commonjs/utils/StyleValue.js.map @@ -0,0 +1 @@ +{"version":3,"names":["transformStyle","style","nativeStyle","styleProps","Object","keys","styleProp","styleType","getStyleType","rawStyle","color","processColor","undefined","console","error","Image","resolveAssetSource","Array","isArray","startsWith","warn","bridgeValue","BridgeValue","styletype","stylevalue","toJSON"],"sourceRoot":"../../../src","sources":["utils/StyleValue.ts"],"mappings":";;;;;;AAAA;AAEA;AAKA;AAA0C;AAOnC,SAASA,cAAc,CAC5BC,KAAqC,EACM;EAC3C,IAAI,CAACA,KAAK,EAAE;IACV;EACF;EAEA,MAAMC,WAA0C,GAAG,CAAC,CAAC;EACrD,MAAMC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAA8B;EAClE,KAAK,MAAMK,SAAS,IAAIH,UAAU,EAAE;IAClC,MAAMI,SAAS,GAAG,IAAAC,sBAAY,EAACF,SAAS,CAAC;IACzC,IAAIG,QAAkC,GAAGR,KAAK,CAACK,SAAS,CAAC;IAEzD,IAAIC,SAAS,KAAK,OAAO,IAAI,OAAOE,QAAQ,KAAK,QAAQ,EAAE;MACzD,MAAMC,KAAK,GAAG,IAAAC,yBAAY,EAACF,QAAQ,CAAC;MACpC,IAAIC,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKE,SAAS,IAAI,OAAOF,KAAK,KAAK,QAAQ,EAAE;QACtEG,OAAO,CAACC,KAAK,CAAE,kCAAiCL,QAAS,YAAW,CAAC;QACrEA,QAAQ,GAAG,QAAQ;MACrB,CAAC,MAAM;QACLA,QAAQ,GAAGC,KAAK;MAClB;IACF,CAAC,MAAM,IAAIH,SAAS,KAAK,OAAO,IAAI,OAAOE,QAAQ,KAAK,QAAQ,EAAE;MAChEA,QAAQ,GACLM,kBAAK,CAACC,kBAAkB,CAACP,QAAQ,CAAC,IAAgC,CAAC,CAAC;IACzE;IACA,IACEF,SAAS,KAAK,OAAO,IACrB,EACEU,KAAK,CAACC,OAAO,CAACT,QAAQ,CAAC,IACtB,OAAOA,QAAQ,KAAK,QAAQ,IAC3B,CAACA,QAAQ,CAACU,UAAU,CAAC,SAAS,CAAC,IAC/B,CAACV,QAAQ,CAACU,UAAU,CAAC,UAAU,CAAE,CACpC,EACD;MACAN,OAAO,CAACO,IAAI,CACT,6BAA4Bd,SAAU,4GAA2G,CACnJ;IACH;IAEA,IAAIG,QAAQ,KAAKG,SAAS,EAAE;MAC1B,MAAMS,WAAW,GAAG,IAAIC,oBAAW,CAACb,QAAQ,CAAC;MAC7CP,WAAW,CAACI,SAAS,CAAC,GAAG;QACvBiB,SAAS,EAAEhB,SAAS;QACpBiB,UAAU,EAAEH,WAAW,CAACI,MAAM;MAChC,CAAC;IACH;EACF;EAEA,OAAOvB,WAAW;AACpB"} diff --git a/lib/commonjs/utils/animated/Animated.js b/lib/commonjs/utils/animated/Animated.js new file mode 100644 index 000000000..6b8071e95 --- /dev/null +++ b/lib/commonjs/utils/animated/Animated.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _reactNative = require("react-native"); +var _ShapeSource = require("../../components/ShapeSource"); +var _ImageSource = _interopRequireDefault(require("../../components/ImageSource")); +var _FillLayer = _interopRequireDefault(require("../../components/FillLayer")); +var _FillExtrusionLayer = _interopRequireDefault(require("../../components/FillExtrusionLayer")); +var _LineLayer = _interopRequireDefault(require("../../components/LineLayer")); +var _CircleLayer = _interopRequireDefault(require("../../components/CircleLayer")); +var _SymbolLayer = require("../../components/SymbolLayer"); +var _RasterLayer = _interopRequireDefault(require("../../components/RasterLayer")); +var _BackgroundLayer = _interopRequireDefault(require("../../components/BackgroundLayer")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const Animated = { + // sources + ShapeSource: _reactNative.Animated.createAnimatedComponent(_ShapeSource.ShapeSource), + ImageSource: _reactNative.Animated.createAnimatedComponent(_ImageSource.default), + // layers + FillLayer: _reactNative.Animated.createAnimatedComponent(_FillLayer.default), + FillExtrusionLayer: _reactNative.Animated.createAnimatedComponent(_FillExtrusionLayer.default), + LineLayer: _reactNative.Animated.createAnimatedComponent(_LineLayer.default), + CircleLayer: _reactNative.Animated.createAnimatedComponent(_CircleLayer.default), + SymbolLayer: _reactNative.Animated.createAnimatedComponent(_SymbolLayer.SymbolLayer), + RasterLayer: _reactNative.Animated.createAnimatedComponent(_RasterLayer.default), + BackgroundLayer: _reactNative.Animated.createAnimatedComponent(_BackgroundLayer.default) +}; +var _default = Animated; +exports.default = _default; +//# sourceMappingURL=Animated.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/animated/Animated.js.map b/lib/commonjs/utils/animated/Animated.js.map new file mode 100644 index 000000000..48834c133 --- /dev/null +++ b/lib/commonjs/utils/animated/Animated.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Animated","ShapeSource","RNAnimated","createAnimatedComponent","ImageSource","FillLayer","FillExtrusionLayer","LineLayer","CircleLayer","SymbolLayer","RasterLayer","BackgroundLayer"],"sourceRoot":"../../../../src","sources":["utils/animated/Animated.ts"],"mappings":";;;;;;AAAC;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA+D;AAE/D,MAAMA,QAAQ,GAAG;EACf;EACAC,WAAW,EAAEC,qBAAU,CAACC,uBAAuB,CAACF,wBAAW,CAAC;EAC5DG,WAAW,EAAEF,qBAAU,CAACC,uBAAuB,CAACC,oBAAW,CAAC;EAE5D;EACAC,SAAS,EAAEH,qBAAU,CAACC,uBAAuB,CAACE,kBAAS,CAAC;EACxDC,kBAAkB,EAAEJ,qBAAU,CAACC,uBAAuB,CAACG,2BAAkB,CAAC;EAC1EC,SAAS,EAAEL,qBAAU,CAACC,uBAAuB,CAACI,kBAAS,CAAC;EACxDC,WAAW,EAAEN,qBAAU,CAACC,uBAAuB,CAACK,oBAAW,CAAC;EAC5DC,WAAW,EAAEP,qBAAU,CAACC,uBAAuB,CAACM,wBAAW,CAAC;EAC5DC,WAAW,EAAER,qBAAU,CAACC,uBAAuB,CAACO,oBAAW,CAAC;EAC5DC,eAAe,EAAET,qBAAU,CAACC,uBAAuB,CAACQ,wBAAe;AACrE,CAAC;AAAC,eAEaX,QAAQ;AAAA"} diff --git a/lib/commonjs/utils/checkRequiredProps.js b/lib/commonjs/utils/checkRequiredProps.js new file mode 100644 index 000000000..42fa52b02 --- /dev/null +++ b/lib/commonjs/utils/checkRequiredProps.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = checkRequiredProps; +function checkRequiredProps(tag, props, required) { + for (const key of required) { + if (props[key] === undefined) { + console.error(`Error: ${tag} property: ${key} is required but it was missing.`); + } + } +} +//# sourceMappingURL=checkRequiredProps.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/checkRequiredProps.js.map b/lib/commonjs/utils/checkRequiredProps.js.map new file mode 100644 index 000000000..6d7e26335 --- /dev/null +++ b/lib/commonjs/utils/checkRequiredProps.js.map @@ -0,0 +1 @@ +{"version":3,"names":["checkRequiredProps","tag","props","required","key","undefined","console","error"],"sourceRoot":"../../../src","sources":["utils/checkRequiredProps.ts"],"mappings":";;;;;;AAIe,SAASA,kBAAkB,CAExCC,GAAW,EAAEC,KAAY,EAAEC,QAA+B,EAAE;EAC5D,KAAK,MAAMC,GAAG,IAAID,QAAQ,EAAE;IAC1B,IAAID,KAAK,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC5BC,OAAO,CAACC,KAAK,CACV,UAASN,GAAI,cACZG,GACD,kCAAiC,CACnC;IACH;EACF;AACF"} diff --git a/lib/commonjs/utils/deprecation.js b/lib/commonjs/utils/deprecation.js new file mode 100644 index 000000000..b41ce9635 --- /dev/null +++ b/lib/commonjs/utils/deprecation.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.copyPropertiesAsDeprecated = copyPropertiesAsDeprecated; +exports.deprecatedClass = deprecatedClass; +/** + * deprecatedClass: creates a subclass of the class, which prints deprecated warning when called + */ +function deprecatedClass(origClass, deprecationMessage) { + const result = class extends origClass { + constructor() { + console.log(`Deprecated: ${deprecationMessage}`); + super(...arguments); + } + }; + return result; +} + +/** + * Copy properties from origObject to newObject, but only those which not exists in newObject. + * Calls onDeprecatedCalled callback in case a copied property is invoked. + */ +function copyPropertiesAsDeprecated(origObject, newObject, onDeprecatedCalled) { + let accessors = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + const result = newObject; + for (const [key, value] of Object.entries(origObject)) { + if (!newObject[key]) { + Object.defineProperty(result, key, { + get() { + onDeprecatedCalled(key); + return accessors[key] ? accessors[key](value) : value; + } + }); + } + } + return result; +} +//# sourceMappingURL=deprecation.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/deprecation.js.map b/lib/commonjs/utils/deprecation.js.map new file mode 100644 index 000000000..6e54801a4 --- /dev/null +++ b/lib/commonjs/utils/deprecation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["deprecatedClass","origClass","deprecationMessage","result","constructor","console","log","copyPropertiesAsDeprecated","origObject","newObject","onDeprecatedCalled","accessors","key","value","Object","entries","defineProperty","get"],"sourceRoot":"../../../src","sources":["utils/deprecation.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACO,SAASA,eAAe,CAC7BC,SAAY,EACZC,kBAA0B,EACvB;EACH,MAAMC,MAAM,GAAG,cAAcF,SAAS,CAAC;IACrCG,WAAW,GAAiB;MAC1BC,OAAO,CAACC,GAAG,CAAE,eAAcJ,kBAAmB,EAAC,CAAC;MAChD,KAAK,CAAC,YAAO,CAAC;IAChB;EACF,CAAC;EACD,OAAOC,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACO,SAASI,0BAA0B,CAIxCC,UAA0B,EAC1BC,SAA6B,EAC7BC,kBAAyC,EAErB;EAAA,IADpBC,SAAyD,uEAAG,CAAC,CAAC;EAE9D,MAAMR,MAAM,GAAGM,SAAS;EACxB,KAAK,MAAM,CAACG,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACP,UAAU,CAAC,EAAE;IACrD,IAAI,CAACC,SAAS,CAACG,GAAG,CAAC,EAAE;MACnBE,MAAM,CAACE,cAAc,CAACb,MAAM,EAAES,GAAG,EAAE;QACjCK,GAAG,GAAG;UACJP,kBAAkB,CAACE,GAAG,CAAC;UACvB,OAAOD,SAAS,CAACC,GAAG,CAAC,GAAGD,SAAS,CAACC,GAAG,CAAC,CAACC,KAAK,CAAC,GAAGA,KAAK;QACvD;MACF,CAAC,CAAC;IACJ;EACF;EACA,OAAOV,MAAM;AACf"} diff --git a/lib/commonjs/utils/filterUtils.js b/lib/commonjs/utils/filterUtils.js new file mode 100644 index 000000000..e89ed74d2 --- /dev/null +++ b/lib/commonjs/utils/filterUtils.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getFilter = getFilter; +function getFilter(filter) { + if (!Array.isArray(filter) || filter.length === 0) { + return []; + } + return filter; +} +//# sourceMappingURL=filterUtils.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/filterUtils.js.map b/lib/commonjs/utils/filterUtils.js.map new file mode 100644 index 000000000..4cbf408d4 --- /dev/null +++ b/lib/commonjs/utils/filterUtils.js.map @@ -0,0 +1 @@ +{"version":3,"names":["getFilter","filter","Array","isArray","length"],"sourceRoot":"../../../src","sources":["utils/filterUtils.ts"],"mappings":";;;;;;AAAO,SAASA,SAAS,CAACC,MAA0B,EAAY;EAC9D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,IAAIA,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;IACjD,OAAO,EAAE;EACX;EAEA,OAAOH,MAAM;AACf"} diff --git a/lib/commonjs/utils/geoUtils.js b/lib/commonjs/utils/geoUtils.js new file mode 100644 index 000000000..970f6b92d --- /dev/null +++ b/lib/commonjs/utils/geoUtils.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addToFeatureCollection = addToFeatureCollection; +exports.makeFeature = exports.calculateDistance = void 0; +exports.makeFeatureCollection = makeFeatureCollection; +exports.makeLatLngBounds = makeLatLngBounds; +exports.pointAlongLine = exports.makePoint = exports.makeLineString = void 0; +var _helpers = require("@turf/helpers"); +var _distance = _interopRequireDefault(require("@turf/distance")); +var _along = _interopRequireDefault(require("@turf/along")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const makePoint = _helpers.point; +exports.makePoint = makePoint; +const makeLineString = _helpers.lineString; +exports.makeLineString = makeLineString; +function makeLatLngBounds(northEastCoordinates, southWestCoordinates) { + return (0, _helpers.featureCollection)([(0, _helpers.point)(northEastCoordinates), (0, _helpers.point)(southWestCoordinates)]); +} +const makeFeature = _helpers.feature; +exports.makeFeature = makeFeature; +function makeFeatureCollection() { + let features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + let options = arguments.length > 1 ? arguments[1] : undefined; + return (0, _helpers.featureCollection)(features, options); +} +function addToFeatureCollection(newFeatureCollection, newFeature) { + return { + ...newFeatureCollection, + features: [...newFeatureCollection.features, newFeature] + }; +} +const calculateDistance = _distance.default; +exports.calculateDistance = calculateDistance; +const pointAlongLine = _along.default; +exports.pointAlongLine = pointAlongLine; +//# sourceMappingURL=geoUtils.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/geoUtils.js.map b/lib/commonjs/utils/geoUtils.js.map new file mode 100644 index 000000000..2abcad4b0 --- /dev/null +++ b/lib/commonjs/utils/geoUtils.js.map @@ -0,0 +1 @@ +{"version":3,"names":["makePoint","point","makeLineString","lineString","makeLatLngBounds","northEastCoordinates","southWestCoordinates","featureCollection","makeFeature","feature","makeFeatureCollection","features","options","addToFeatureCollection","newFeatureCollection","newFeature","calculateDistance","distance","pointAlongLine","along"],"sourceRoot":"../../../src","sources":["utils/geoUtils.ts"],"mappings":";;;;;;;;;;AAAA;AAcA;AACA;AAAgC;AAEzB,MAAMA,SAAS,GAAGC,cAAK;AAAC;AAExB,MAAMC,cAAc,GAAGC,mBAAU;AAAC;AAElC,SAASC,gBAAgB,CAC9BC,oBAA8B,EAC9BC,oBAA8B,EACJ;EAC1B,OAAO,IAAAC,0BAAiB,EAAC,CACvB,IAAAN,cAAK,EAACI,oBAAoB,CAAC,EAC3B,IAAAJ,cAAK,EAACK,oBAAoB,CAAC,CAC5B,CAAC;AACJ;AAEO,MAAME,WAAW,GAAGC,gBAAO;AAAC;AAE5B,SAASC,qBAAqB,GAMnC;EAAA,IALAC,QAA8B,uEAAG,EAAE;EAAA,IACnCC,OAGC;EAED,OAAO,IAAAL,0BAAiB,EAACI,QAAQ,EAAEC,OAAO,CAAC;AAC7C;AAEO,SAASC,sBAAsB,CACpCC,oBAAuC,EACvCC,UAAmB,EACA;EACnB,OAAO;IACL,GAAGD,oBAAoB;IACvBH,QAAQ,EAAE,CAAC,GAAGG,oBAAoB,CAACH,QAAQ,EAAEI,UAAU;EACzD,CAAC;AACH;AAEO,MAAMC,iBAAiB,GAAGC,iBAAQ;AAAC;AAEnC,MAAMC,cAAc,GAAGC,cAAK;AAAC"} diff --git a/lib/commonjs/utils/getAnnotationsLayerID.js b/lib/commonjs/utils/getAnnotationsLayerID.js new file mode 100644 index 000000000..fa9888b9f --- /dev/null +++ b/lib/commonjs/utils/getAnnotationsLayerID.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getAnnotationsLayerID = void 0; +var _reactNative = require("react-native"); +/* + * Retrieve the layer ids used for PointAnnotations and Callouts + */ +const getAnnotationsLayerID = type => { + return _reactNative.Platform.select({ + android: 'RNMBX-mapview-annotations', + ios: { + PointAnnotations: 'RNMBX-mapview-point-annotations', + Callouts: 'RNMBX-mapview-callouts' + }[type] + }); +}; +exports.getAnnotationsLayerID = getAnnotationsLayerID; +//# sourceMappingURL=getAnnotationsLayerID.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/getAnnotationsLayerID.js.map b/lib/commonjs/utils/getAnnotationsLayerID.js.map new file mode 100644 index 000000000..8ebb35d5e --- /dev/null +++ b/lib/commonjs/utils/getAnnotationsLayerID.js.map @@ -0,0 +1 @@ +{"version":3,"names":["getAnnotationsLayerID","type","Platform","select","android","ios","PointAnnotations","Callouts"],"sourceRoot":"../../../src","sources":["utils/getAnnotationsLayerID.ts"],"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AACO,MAAMA,qBAAqB,GAChCC,IAAqC,IAClC;EACH,OAAOC,qBAAQ,CAACC,MAAM,CAAC;IACrBC,OAAO,EAAE,2BAA2B;IACpCC,GAAG,EAAE;MACHC,gBAAgB,EAAE,iCAAiC;MACnDC,QAAQ,EAAE;IACZ,CAAC,CAACN,IAAI;EACR,CAAC,CAAC;AACJ,CAAC;AAAC"} diff --git a/lib/commonjs/utils/index.js b/lib/commonjs/utils/index.js new file mode 100644 index 000000000..b37ef4300 --- /dev/null +++ b/lib/commonjs/utils/index.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cloneReactChildrenWithProps = cloneReactChildrenWithProps; +exports.existenceChange = existenceChange; +exports.isAndroid = isAndroid; +exports.isBoolean = isBoolean; +exports.isFunction = isFunction; +exports.isNumber = isNumber; +exports.isPrimitive = isPrimitive; +exports.isString = isString; +exports.isUndefined = isUndefined; +exports.resolveImagePath = resolveImagePath; +exports.runNativeMethod = runNativeMethod; +exports.toJSONString = toJSONString; +var _react = _interopRequireDefault(require("react")); +var _reactNative = require("react-native"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* eslint-disable @typescript-eslint/no-explicit-any */ + +function isAndroid() { + return _reactNative.Platform.OS === 'android'; +} +function existenceChange(cur, next) { + if (!cur && !next) { + return false; + } + return !cur && next || cur && !next; +} +function isFunction(fn) { + return typeof fn === 'function'; +} +function isNumber(num) { + return typeof num === 'number' && !Number.isNaN(num); +} +function isUndefined(obj) { + return typeof obj === 'undefined'; +} +function isString(str) { + return typeof str === 'string'; +} +function isBoolean(bool) { + return typeof bool === 'boolean'; +} +function isPrimitive(value) { + return isString(value) || isNumber(value) || isBoolean(value); +} +function runNativeMethod(turboModule, name, nativeRef, args) { + const handle = (0, _reactNative.findNodeHandle)(nativeRef); + if (!handle) { + throw new Error(`Could not find handle for native ref ${module}.${name}`); + } + + // @ts-expect-error TS says that string cannot be used to index Turbomodules. + // It can, it's just not pretty. + return turboModule[name](handle, ...args); +} +function cloneReactChildrenWithProps(children) { + let propsToAdd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (!children) { + return null; + } + let foundChildren = null; + if (!Array.isArray(children)) { + foundChildren = [children]; + } else { + foundChildren = children; + } + const filteredChildren = foundChildren.filter(child => !!child); // filter out falsy children, since some can be null + return _react.default.Children.map(filteredChildren, child => /*#__PURE__*/_react.default.cloneElement(child, propsToAdd)); +} +function resolveImagePath(imageRef) { + const res = _reactNative.Image.resolveAssetSource(imageRef); + return res.uri; +} +function toJSONString() { + let json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + return JSON.stringify(json); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/index.js.map b/lib/commonjs/utils/index.js.map new file mode 100644 index 000000000..835be54e7 --- /dev/null +++ b/lib/commonjs/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isAndroid","Platform","OS","existenceChange","cur","next","isFunction","fn","isNumber","num","Number","isNaN","isUndefined","obj","isString","str","isBoolean","bool","isPrimitive","value","runNativeMethod","turboModule","name","nativeRef","args","handle","findNodeHandle","Error","module","cloneReactChildrenWithProps","children","propsToAdd","foundChildren","Array","isArray","filteredChildren","filter","child","React","Children","map","cloneElement","resolveImagePath","imageRef","res","Image","resolveAssetSource","uri","toJSONString","json","JSON","stringify"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AACA;AACA;AAMsB;AARtB;;AAUO,SAASA,SAAS,GAAY;EACnC,OAAOC,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAClC;AAEO,SAASC,eAAe,CAACC,GAAY,EAAEC,IAAa,EAAW;EACpE,IAAI,CAACD,GAAG,IAAI,CAACC,IAAI,EAAE;IACjB,OAAO,KAAK;EACd;EACA,OAAQ,CAACD,GAAG,IAAIC,IAAI,IAAMD,GAAG,IAAI,CAACC,IAAK;AACzC;AAEO,SAASC,UAAU,CAACC,EAAW,EAAiB;EACrD,OAAO,OAAOA,EAAE,KAAK,UAAU;AACjC;AAEO,SAASC,QAAQ,CAACC,GAAY,EAAiB;EACpD,OAAO,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACC,MAAM,CAACC,KAAK,CAACF,GAAG,CAAC;AACtD;AAEO,SAASG,WAAW,CAACC,GAAY,EAAoB;EAC1D,OAAO,OAAOA,GAAG,KAAK,WAAW;AACnC;AAEO,SAASC,QAAQ,CAACC,GAAY,EAAiB;EACpD,OAAO,OAAOA,GAAG,KAAK,QAAQ;AAChC;AAEO,SAASC,SAAS,CAACC,IAAa,EAAmB;EACxD,OAAO,OAAOA,IAAI,KAAK,SAAS;AAClC;AAEO,SAASC,WAAW,CACzBC,KAAc,EACsB;EACpC,OAAOL,QAAQ,CAACK,KAAK,CAAC,IAAIX,QAAQ,CAACW,KA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ativeRef.js b/lib/commonjs/utils/nativeRef.js new file mode 100644 index 000000000..3cd673cfd --- /dev/null +++ b/lib/commonjs/utils/nativeRef.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = nativeRef; +/** + * Helper for useRef and requireNativeComponent: + * @example + * RNMBXCamera = requireNativeComponent('RNMBXCamera'); + * const ref = useRef; + * ... + * + */ + +/** + * Helper for useRef and requireNativeComponent: + * @example + * RNMBXCamera = requireNativeComponent('RNMBXCamera'); + * const ref = nativeRef(useRef + */ +function nativeRef(c) { + return c; +} +//# sourceMappingURL=nativeRef.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/nativeRef.js.map b/lib/commonjs/utils/nativeRef.js.map new file mode 100644 index 000000000..b0a4539a9 --- /dev/null +++ b/lib/commonjs/utils/nativeRef.js.map @@ -0,0 +1 @@ +{"version":3,"names":["nativeRef","c"],"sourceRoot":"../../../src","sources":["utils/nativeRef.ts"],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,SAAS,CAC/BC,CAAqC,EAC8B;EACnE,OAAOA,CAAC;AACV"} diff --git a/lib/commonjs/utils/styleMap.js b/lib/commonjs/utils/styleMap.js new file mode 100644 index 000000000..1ce088f62 --- /dev/null +++ b/lib/commonjs/utils/styleMap.js @@ -0,0 +1,339 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.StyleTypes = void 0; +exports.getStyleType = getStyleType; +exports.styleExtras = void 0; +var _index = require("./index"); +// DO NOT MODIFY +// THIS FILE IS AUTOGENERATED + +const StyleTypes = { + Constant: 'constant', + Color: 'color', + Transition: 'transition', + Translation: 'translation', + Function: 'function', + Image: 'image', + Enum: 'enum' +}; +exports.StyleTypes = StyleTypes; +function getStyleType(styleProp) { + if (!(0, _index.isAndroid)() && styleExtras[styleProp]) { + return styleExtras[styleProp].iosType; + } + if (styleMap[styleProp]) { + return styleMap[styleProp]; + } + throw new Error(`${styleProp} is not a valid Mapbox layer style`); +} +const styleMap = { + fillSortKey: StyleTypes.Constant, + fillAntialias: StyleTypes.Constant, + fillOpacity: StyleTypes.Constant, + fillOpacityTransition: StyleTypes.Transition, + fillColor: StyleTypes.Color, + fillColorTransition: StyleTypes.Transition, + fillOutlineColor: StyleTypes.Color, + fillOutlineColorTransition: StyleTypes.Transition, + fillTranslate: StyleTypes.Translation, + fillTranslateTransition: StyleTypes.Transition, + fillTranslateAnchor: StyleTypes.Enum, + fillPattern: StyleTypes.Image, + fillEmissiveStrength: StyleTypes.Constant, + fillEmissiveStrengthTransition: StyleTypes.Transition, + lineCap: StyleTypes.Enum, + lineJoin: StyleTypes.Enum, + lineMiterLimit: StyleTypes.Constant, + lineRoundLimit: StyleTypes.Constant, + lineSortKey: StyleTypes.Constant, + lineOpacity: StyleTypes.Constant, + lineOpacityTransition: StyleTypes.Transition, + lineColor: StyleTypes.Color, + lineColorTransition: StyleTypes.Transition, + lineTranslate: StyleTypes.Translation, + lineTranslateTransition: StyleTypes.Transition, + lineTranslateAnchor: StyleTypes.Enum, + lineWidth: StyleTypes.Constant, + lineWidthTransition: StyleTypes.Transition, + lineGapWidth: StyleTypes.Constant, + lineGapWidthTransition: StyleTypes.Transition, + lineOffset: StyleTypes.Constant, + lineOffsetTransition: StyleTypes.Transition, + lineBlur: StyleTypes.Constant, + lineBlurTransition: StyleTypes.Transition, + lineDasharray: StyleTypes.Constant, + linePattern: StyleTypes.Image, + lineGradient: StyleTypes.Color, + lineTrimOffset: StyleTypes.Constant, + lineEmissiveStrength: StyleTypes.Constant, + lineEmissiveStrengthTransition: StyleTypes.Transition, + symbolPlacement: StyleTypes.Enum, + symbolSpacing: StyleTypes.Constant, + symbolAvoidEdges: StyleTypes.Constant, + symbolSortKey: StyleTypes.Constant, + symbolZOrder: StyleTypes.Enum, + iconAllowOverlap: StyleTypes.Constant, + iconIgnorePlacement: StyleTypes.Constant, + iconOptional: StyleTypes.Constant, + iconRotationAlignment: StyleTypes.Enum, + iconSize: StyleTypes.Constant, + iconTextFit: StyleTypes.Enum, + iconTextFitPadding: StyleTypes.Constant, + iconImage: StyleTypes.Image, + iconRotate: StyleTypes.Constant, + iconPadding: StyleTypes.Constant, + iconKeepUpright: StyleTypes.Constant, + iconOffset: StyleTypes.Constant, + iconAnchor: StyleTypes.Enum, + iconPitchAlignment: StyleTypes.Enum, + textPitchAlignment: StyleTypes.Enum, + textRotationAlignment: StyleTypes.Enum, + textField: StyleTypes.Constant, + textFont: StyleTypes.Constant, + textSize: StyleTypes.Constant, + textMaxWidth: StyleTypes.Constant, + textLineHeight: StyleTypes.Constant, + textLetterSpacing: StyleTypes.Constant, + textJustify: StyleTypes.Enum, + textRadialOffset: StyleTypes.Constant, + textVariableAnchor: StyleTypes.Constant, + textAnchor: StyleTypes.Enum, + textMaxAngle: StyleTypes.Constant, + textWritingMode: StyleTypes.Constant, + textRotate: StyleTypes.Constant, + textPadding: StyleTypes.Constant, + textKeepUpright: StyleTypes.Constant, + textTransform: StyleTypes.Enum, + textOffset: StyleTypes.Constant, + textAllowOverlap: StyleTypes.Constant, + textIgnorePlacement: StyleTypes.Constant, + textOptional: StyleTypes.Constant, + iconOpacity: StyleTypes.Constant, + iconOpacityTransition: StyleTypes.Transition, + iconColor: StyleTypes.Color, + iconColorTransition: StyleTypes.Transition, + iconHaloColor: StyleTypes.Color, + iconHaloColorTransition: StyleTypes.Transition, + iconHaloWidth: StyleTypes.Constant, + iconHaloWidthTransition: StyleTypes.Transition, + iconHaloBlur: StyleTypes.Constant, + iconHaloBlurTransition: StyleTypes.Transition, + iconTranslate: StyleTypes.Translation, + iconTranslateTransition: StyleTypes.Transition, + iconTranslateAnchor: StyleTypes.Enum, + textOpacity: StyleTypes.Constant, + textOpacityTransition: StyleTypes.Transition, + textColor: StyleTypes.Color, + textColorTransition: StyleTypes.Transition, + textHaloColor: StyleTypes.Color, + textHaloColorTransition: StyleTypes.Transition, + textHaloWidth: StyleTypes.Constant, + textHaloWidthTransition: StyleTypes.Transition, + textHaloBlur: StyleTypes.Constant, + textHaloBlurTransition: StyleTypes.Transition, + textTranslate: StyleTypes.Translation, + textTranslateTransition: StyleTypes.Transition, + textTranslateAnchor: StyleTypes.Enum, + symbolZElevate: StyleTypes.Constant, + iconEmissiveStrength: StyleTypes.Constant, + iconEmissiveStrengthTransition: StyleTypes.Transition, + textEmissiveStrength: StyleTypes.Constant, + textEmissiveStrengthTransition: StyleTypes.Transition, + iconImageCrossFade: StyleTypes.Constant, + iconImageCrossFadeTransition: StyleTypes.Transition, + circleSortKey: StyleTypes.Constant, + circleRadius: StyleTypes.Constant, + circleRadiusTransition: StyleTypes.Transition, + circleColor: StyleTypes.Color, + circleColorTransition: StyleTypes.Transition, + circleBlur: StyleTypes.Constant, + circleBlurTransition: StyleTypes.Transition, + circleOpacity: StyleTypes.Constant, + circleOpacityTransition: StyleTypes.Transition, + circleTranslate: StyleTypes.Translation, + circleTranslateTransition: StyleTypes.Transition, + circleTranslateAnchor: StyleTypes.Enum, + circlePitchScale: StyleTypes.Enum, + circlePitchAlignment: StyleTypes.Enum, + circleStrokeWidth: StyleTypes.Constant, + circleStrokeWidthTransition: StyleTypes.Transition, + circleStrokeColor: StyleTypes.Color, + circleStrokeColorTransition: StyleTypes.Transition, + circleStrokeOpacity: StyleTypes.Constant, + circleStrokeOpacityTransition: StyleTypes.Transition, + circleEmissiveStrength: StyleTypes.Constant, + circleEmissiveStrengthTransition: StyleTypes.Transition, + heatmapRadius: StyleTypes.Constant, + heatmapRadiusTransition: StyleTypes.Transition, + heatmapWeight: StyleTypes.Constant, + heatmapIntensity: StyleTypes.Constant, + heatmapIntensityTransition: StyleTypes.Transition, + heatmapColor: StyleTypes.Color, + heatmapOpacity: StyleTypes.Constant, + heatmapOpacityTransition: StyleTypes.Transition, + fillExtrusionOpacity: StyleTypes.Constant, + fillExtrusionOpacityTransition: StyleTypes.Transition, + fillExtrusionColor: StyleTypes.Color, + fillExtrusionColorTransition: StyleTypes.Transition, + fillExtrusionTranslate: StyleTypes.Translation, + fillExtrusionTranslateTransition: StyleTypes.Transition, + fillExtrusionTranslateAnchor: StyleTypes.Enum, + fillExtrusionPattern: StyleTypes.Image, + fillExtrusionHeight: StyleTypes.Constant, + fillExtrusionHeightTransition: StyleTypes.Transition, + fillExtrusionBase: StyleTypes.Constant, + fillExtrusionBaseTransition: StyleTypes.Transition, + fillExtrusionVerticalGradient: StyleTypes.Constant, + fillExtrusionRoundedRoof: StyleTypes.Constant, + fillExtrusionAmbientOcclusionWallRadius: StyleTypes.Constant, + fillExtrusionAmbientOcclusionWallRadiusTransition: StyleTypes.Transition, + fillExtrusionAmbientOcclusionGroundRadius: StyleTypes.Constant, + fillExtrusionAmbientOcclusionGroundRadiusTransition: StyleTypes.Transition, + fillExtrusionAmbientOcclusionGroundAttenuation: StyleTypes.Constant, + fillExtrusionAmbientOcclusionGroundAttenuationTransition: StyleTypes.Transition, + fillExtrusionFloodLightColor: StyleTypes.Color, + fillExtrusionFloodLightColorTransition: StyleTypes.Transition, + fillExtrusionFloodLightIntensity: StyleTypes.Constant, + fillExtrusionFloodLightIntensityTransition: StyleTypes.Transition, + fillExtrusionFloodLightWallRadius: StyleTypes.Constant, + fillExtrusionFloodLightWallRadiusTransition: StyleTypes.Transition, + fillExtrusionFloodLightGroundRadius: StyleTypes.Constant, + fillExtrusionFloodLightGroundRadiusTransition: StyleTypes.Transition, + fillExtrusionFloodLightGroundAttenuation: StyleTypes.Constant, + fillExtrusionFloodLightGroundAttenuationTransition: StyleTypes.Transition, + fillExtrusionVerticalScale: StyleTypes.Constant, + fillExtrusionVerticalScaleTransition: StyleTypes.Transition, + fillExtrusionCutoffFadeRange: StyleTypes.Constant, + rasterOpacity: StyleTypes.Constant, + rasterOpacityTransition: StyleTypes.Transition, + rasterHueRotate: StyleTypes.Constant, + rasterHueRotateTransition: StyleTypes.Transition, + rasterBrightnessMin: StyleTypes.Constant, + rasterBrightnessMinTransition: StyleTypes.Transition, + rasterBrightnessMax: StyleTypes.Constant, + rasterBrightnessMaxTransition: StyleTypes.Transition, + rasterSaturation: StyleTypes.Constant, + rasterSaturationTransition: StyleTypes.Transition, + rasterContrast: StyleTypes.Constant, + rasterContrastTransition: StyleTypes.Transition, + rasterResampling: StyleTypes.Enum, + rasterFadeDuration: StyleTypes.Constant, + rasterColor: StyleTypes.Color, + rasterColorMix: StyleTypes.Constant, + rasterColorMixTransition: StyleTypes.Transition, + rasterColorRange: StyleTypes.Constant, + rasterColorRangeTransition: StyleTypes.Transition, + hillshadeIlluminationDirection: StyleTypes.Constant, + hillshadeIlluminationAnchor: StyleTypes.Enum, + hillshadeExaggeration: StyleTypes.Constant, + hillshadeExaggerationTransition: StyleTypes.Transition, + hillshadeShadowColor: StyleTypes.Color, + hillshadeShadowColorTransition: StyleTypes.Transition, + hillshadeHighlightColor: StyleTypes.Color, + hillshadeHighlightColorTransition: StyleTypes.Transition, + hillshadeAccentColor: StyleTypes.Color, + hillshadeAccentColorTransition: StyleTypes.Transition, + modelId: StyleTypes.Constant, + modelOpacity: StyleTypes.Constant, + modelOpacityTransition: StyleTypes.Transition, + modelRotation: StyleTypes.Constant, + modelRotationTransition: StyleTypes.Transition, + modelScale: StyleTypes.Constant, + modelScaleTransition: StyleTypes.Transition, + modelTranslation: StyleTypes.Constant, + modelTranslationTransition: StyleTypes.Transition, + modelColor: StyleTypes.Color, + modelColorTransition: StyleTypes.Transition, + modelColorMixIntensity: StyleTypes.Constant, + modelColorMixIntensityTransition: StyleTypes.Transition, + modelType: StyleTypes.Enum, + modelCastShadows: StyleTypes.Constant, + modelReceiveShadows: StyleTypes.Constant, + modelAmbientOcclusionIntensity: StyleTypes.Constant, + modelAmbientOcclusionIntensityTransition: StyleTypes.Transition, + modelEmissiveStrength: StyleTypes.Constant, + modelEmissiveStrengthTransition: StyleTypes.Transition, + modelRoughness: StyleTypes.Constant, + modelRoughnessTransition: StyleTypes.Transition, + modelHeightBasedEmissiveStrengthMultiplier: StyleTypes.Constant, + modelHeightBasedEmissiveStrengthMultiplierTransition: StyleTypes.Transition, + modelCutoffFadeRange: StyleTypes.Constant, + backgroundColor: StyleTypes.Color, + backgroundColorTransition: StyleTypes.Transition, + backgroundPattern: StyleTypes.Image, + backgroundOpacity: StyleTypes.Constant, + backgroundOpacityTransition: StyleTypes.Transition, + backgroundEmissiveStrength: StyleTypes.Constant, + backgroundEmissiveStrengthTransition: StyleTypes.Transition, + skyType: StyleTypes.Enum, + skyAtmosphereSun: StyleTypes.Constant, + skyAtmosphereSunIntensity: StyleTypes.Constant, + skyGradientCenter: StyleTypes.Constant, + skyGradientRadius: StyleTypes.Constant, + skyGradient: StyleTypes.Color, + skyAtmosphereHaloColor: StyleTypes.Color, + skyAtmosphereColor: StyleTypes.Color, + skyOpacity: StyleTypes.Constant, + skyOpacityTransition: StyleTypes.Transition, + anchor: StyleTypes.Enum, + position: StyleTypes.Constant, + positionTransition: StyleTypes.Transition, + intensity: StyleTypes.Constant, + intensityTransition: StyleTypes.Transition, + range: StyleTypes.Constant, + rangeTransition: StyleTypes.Transition, + highColor: StyleTypes.Color, + highColorTransition: StyleTypes.Transition, + spaceColor: StyleTypes.Color, + spaceColorTransition: StyleTypes.Transition, + horizonBlend: StyleTypes.Constant, + horizonBlendTransition: StyleTypes.Transition, + starIntensity: StyleTypes.Constant, + starIntensityTransition: StyleTypes.Transition, + verticalRange: StyleTypes.Constant, + verticalRangeTransition: StyleTypes.Transition, + exaggeration: StyleTypes.Constant, + color: StyleTypes.Color, + colorTransition: StyleTypes.Transition, + visibility: StyleTypes.Constant +}; +const styleExtras = { + // padding + iconTextFitPadding: { + iosType: 'edgeinsets' + }, + // offsets + iconOffset: { + iosType: 'vector' + }, + textOffset: { + iosType: 'vector' + }, + lineOffset: { + iosType: 'vector' + }, + // translates + fillTranslate: { + iosType: 'vector' + }, + lineTranslate: { + iosType: 'vector' + }, + iconTranslate: { + iosType: 'vector' + }, + textTranslate: { + iosType: 'vector' + }, + circleTranslate: { + iosType: 'vector' + }, + fillExtrusionTranslate: { + iosType: 'vector' + } +}; +exports.styleExtras = styleExtras; +//# sourceMappingURL=styleMap.js.map \ No newline at end of file diff --git a/lib/commonjs/utils/styleMap.js.map b/lib/commonjs/utils/styleMap.js.map new file mode 100644 index 000000000..ebad86822 --- /dev/null +++ b/lib/commonjs/utils/styleMap.js.map @@ -0,0 +1 @@ +{"version":3,"names":["StyleTypes","Constant","Color","Transition","Translation","Function","Image","Enum","getStyleType","styleProp","isAndroid","styleExtras","iosType","styleMap","Error","fillSortKey","fillAntialias","fillOpacity","fillOpacityTransition","fillColor","fillColorTransition","fillOutlineColor","fillOutlineColorTransition","fillTranslate","fillTranslateTransition","fillTranslateAnchor","fillPattern","fillEmissiveStrength","fillEmissiveStrengthTransition","lineCap","lineJoin","lineMiterLimit","lineRoundLimit","lineSortKey","lineOpacity","lineOpacityTransition","lineColor","lineColorTransition","lineTranslate","lineTranslateTransition","lineTranslateAnchor","lineWidth","lineWidthTransition","lineGapWidth","lineGapWidthTransition","lineOffset","lineOffsetTransition","lineBlur","lineBlurTransition","lineDasharray","linePattern","lineGradient","lineTrimOffset","lineEmissiveStrength","lineEmissiveStrengthTransition","symbolPlacement","symbolSpacing","symbolAvoidEdges","symbolSortKey","symbolZOrder","iconAllowOverlap","iconIgnorePlacement","iconOptional","iconRotationAlignment","iconSize","iconTextFit","iconTextFitPadding","iconImage","iconRotate","iconPadding","iconKeepUpright","iconOffset","iconAnchor","iconPitchAlignment","textPitchAlignment","textRotationAlignment","textField","textFont","textSize","textMaxWidth","textLineHeight","textLetterSpacing","textJustify","textRadialOffset","textVariableAnchor","textAnchor","textMaxAngle","textWritingMode","textRotate","textPadding","textKeepUpright","textTransform","textOffset","textAllowOverlap","textIgnorePlacement","textOptional","iconOpacity","iconOpacityTransition","iconColor","iconColorTransition","iconHaloColor","iconHaloColorTransition","iconHaloWidth","iconHaloWidthTransition","iconHaloBlur","iconHaloBlurTransition","iconTranslate","iconTranslateTransition","iconTranslateAnchor","textOpacity","textOpacityTransition","textColor","textColorTransition","textHaloColor","textHaloColorTransition","textHaloWidth","textHaloWidthTransition","textHaloBlur","textHaloBlurTransition","textTranslate","textTranslateTransition","textTranslateAnchor","symbolZElevate","iconEmissiveStrength","iconEmissiveStrengthTransition","textEmissiveStrength","textEmissiveStrengthTransition","iconImageCrossFade","iconImageCrossFadeTransition","circleSortKey","circleRadius","circleRadiusTransition","circleColor","circleColorTransition","circleBlur","circleBlurTransition","circleOpacity","circleOpacityTransition","circleTranslate","circleTranslateTransition","circleTranslateAnchor","circlePitchScale","circlePitchAlignment","circleStrokeWidth","circleStrokeWidthTransition","circleStrokeColor","circleStrokeColorTransition","circleStrokeOpacity","circleStrokeOpacityTransition","circleEmissiveStrength","circleEmissiveStrengthTransition","heatmapRadius","heatmapRadiusTransition","heatmapWeight","heatmapIntensity","heatmapIntensityTransition","heatmapColor","heatmapOpacity","heatmapOpacityTransition","fillExtrusionOpacity","fillExtrusionOpacityTransition","fillExtrusionColor","fillExtrusionColorTransition","fillExtrusionTranslate","fillExtrusionTranslateTransition","fillExtrusionTranslateAnchor","fillExtrusionPattern","fillExtrusionHeight","fillExtrusionHeightTransition","fillExtrusionBase","fillExtrusionBaseTransition","fillExtrusionVerticalGradient","fillExtrusionRoundedRoof","fillExtrusionAmbientOcclusionWallRadius","fillExtrusionAmbientOcclusionWallRadiusTransition","fillExtrusionAmbientOcclusionGroundRadius","fillExtrusionAmbientOcclusionGroundRadiusTransition","fillExtrusionAmbientOcclusionGroundAttenuation","fillExtrusionAmbientOcclusionGroundAttenuationTransition","fillExtrusionFloodLightColor","fillExtrusionFloodLightColorTransition","fillExtrusionFloodLightIntensity","fillExtrusionFloodLightIntensityTransition","fillExtrusionFloodLightWallRadius","fillExtrusionFloodLightWallRadiusTransition","fillExtrusionFloodLightGroundRadius","fillExtrusionFloodLightGroundRadiusTransition","fillExtrusionFloodLightGroundAttenuation","fillExtrusionFloodLightGroundAttenuationTransition","fillExtrusionVerticalScale","fillExtrusionVerticalScaleTransition","fillExtrusionCutoffFadeRange","rasterOpacity","rasterOpacityTransition","rasterHueRotate","rasterHueRotateTransition","rasterBrightnessMin","rasterBrightnessMinTransition","rasterBrightnessMax","rasterBrightnessMaxTransition","rasterSaturation","rasterSaturationTransition","rasterContrast","rasterContrastTransition","rasterResampling","rasterFadeDuration","rasterColor","rasterColorMix","rasterColorMixTransition","rasterColorRange","rasterColorRangeTransition","hillshadeIlluminationDirection","hillshadeIlluminationAnchor","hillshadeExaggeration","hillshadeExaggerationTransition","hillshadeShadowColor","hillshadeShadowColorTransition","hillshadeHighlightColor","hillshadeHighlightColorTransition","hillshadeAccentColor","hillshadeAccentColorTransition","modelId","modelOpacity","modelOpacityTransition","modelRotation","modelRotationTransition","modelScale","modelScaleTransition","modelTranslation","modelTranslationTransition","modelColor","modelColorTransition","modelColorMixIntensity","modelColorMixIntensityTransition","modelType","modelCastShadows","modelReceiveShadows","modelAmbientOcclusionIntensity","modelAmbientOcclusionIntensityTransition","modelEmissiveStrength","modelEmissiveStrengthTransition","modelRoughness","modelRoughnessTransition","modelHeightBasedEmissiveStrengthMultiplier","modelHeightBasedEmissiveStrengthMultiplierTransition","modelCutoffFadeRange","backgroundColor","backgroundColorTransition","backgroundPattern","backgroundOpacity","backgroundOpacityTransition","backgroundEmissiveStrength","backgroundEmissiveStrengthTransition","skyType","skyAtmosphereSun","skyAtmosphereSunIntensity","skyGradientCenter","skyGradientRadius","skyGradient","skyAtmosphereHaloColor","skyAtmosphereColor","skyOpacity","skyOpacityTransition","anchor","position","positionTransition","intensity","intensityTransition","range","rangeTransition","highColor","highColorTransition","spaceColor","spaceColorTransition","horizonBlend","horizonBlendTransition","starIntensity","starIntensityTransition","verticalRange","verticalRangeTransition","exaggeration","color","colorTransition","visibility"],"sourceRoot":"../../../src","sources":["utils/styleMap.ts"],"mappings":";;;;;;;;AAGA;AAHA;AACA;;AAIO,MAAMA,UAAU,G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AC;EAED;EACA2D,UAAU,EAAE;IACV3D,OAAO,EAAE;EACX,CAAC;EACDgF,UAAU,EAAE;IACVhF,OAAO,EAAE;EACX,CAAC;EACDiC,UAAU,EAAE;IACVjC,OAAO,EAAE;EACX,CAAC;EAED;EACAW,aAAa,EAAE;IACbX,OAAO,EAAE;EACX,CAAC;EACD0B,aAAa,EAAE;IACb1B,OAAO,EAAE;EACX,CAAC;EACD8F,aAAa,EAAE;IACb9F,OAAO,EAAE;EACX,CAAC;EACD2G,aAAa,EAAE;IACb3G,OAAO,EAAE;EACX,CAAC;EACD8H,eAAe,EAAE;IACf9H,OAAO,EAAE;EACX,CAAC;EACDuJ,sBAAsB,EAAE;IACtBvJ,OAAO,EAAE;EACX;AACF,CAAC;AAAC"} diff --git a/lib/commonjs/web/MapContext.js b/lib/commonjs/web/MapContext.js new file mode 100644 index 000000000..2b9c48dd3 --- /dev/null +++ b/lib/commonjs/web/MapContext.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const MapContext = /*#__PURE__*/_react.default.createContext({}); +var _default = MapContext; +exports.default = _default; +//# sourceMappingURL=MapContext.js.map \ No newline at end of file diff --git a/lib/commonjs/web/MapContext.js.map b/lib/commonjs/web/MapContext.js.map new file mode 100644 index 000000000..0a428995f --- /dev/null +++ b/lib/commonjs/web/MapContext.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapContext","React","createContext"],"sourceRoot":"../../../src","sources":["web/MapContext.ts"],"mappings":";;;;;;AAAA;AAA0B;AAG1B,MAAMA,UAAU,gBAAGC,cAAK,CAACC,aAAa,CAAgB,CAAC,CAAC,CAAC;AAAC,eAE3CF,UAAU;AAAA"} diff --git a/lib/commonjs/web/MapboxModule.js b/lib/commonjs/web/MapboxModule.js new file mode 100644 index 000000000..1de5821af --- /dev/null +++ b/lib/commonjs/web/MapboxModule.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _mapboxGl = _interopRequireDefault(require("mapbox-gl")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const MapboxModule = { + LineJoin: {}, + StyleURL: { + Street: 'mapbox://styles/mapbox/streets-v11', + Satellite: 'mapbox://styles/mapbox/satellite-v9' + }, + setAccessToken: token => { + _mapboxGl.default.accessToken = token; + } +}; +var _default = MapboxModule; +exports.default = _default; +//# sourceMappingURL=MapboxModule.js.map \ No newline at end of file diff --git a/lib/commonjs/web/MapboxModule.js.map b/lib/commonjs/web/MapboxModule.js.map new file mode 100644 index 000000000..b65d8aace --- /dev/null +++ b/lib/commonjs/web/MapboxModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxModule","LineJoin","StyleURL","Street","Satellite","setAccessToken","token","mapboxgl","accessToken"],"sourceRoot":"../../../src","sources":["web/MapboxModule.js"],"mappings":";;;;;;AAAA;AAAiC;AAEjC,MAAMA,YAAY,GAAG;EACnBC,QAAQ,EAAE,CAAC,CAAC;EAEZC,QAAQ,EAAE;IACRC,MAAM,EAAE,oCAAoC;IAC5CC,SAAS,EAAE;EACb,CAAC;EAEDC,cAAc,EAAGC,KAAK,IAAK;IACzBC,iBAAQ,CAACC,WAAW,GAAGF,KAAK;EAC9B;AACF,CAAC;AAAC,eAEaN,YAAY;AAAA"} diff --git a/lib/commonjs/web/UnimplementedComponent.js b/lib/commonjs/web/UnimplementedComponent.js new file mode 100644 index 000000000..66327aad6 --- /dev/null +++ b/lib/commonjs/web/UnimplementedComponent.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const UnimplementedComponent = name => class SymbolLater extends _react.default.Component { + render() { + return /*#__PURE__*/_react.default.createElement("div", null, "TODO implement ", name); + } +}; +var _default = UnimplementedComponent; +exports.default = _default; +//# sourceMappingURL=UnimplementedComponent.js.map \ No newline at end of file diff --git a/lib/commonjs/web/UnimplementedComponent.js.map b/lib/commonjs/web/UnimplementedComponent.js.map new file mode 100644 index 000000000..c752bdbbc --- /dev/null +++ b/lib/commonjs/web/UnimplementedComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["UnimplementedComponent","name","SymbolLater","React","Component","render"],"sourceRoot":"../../../src","sources":["web/UnimplementedComponent.js"],"mappings":";;;;;;AAAA;AAA0B;AAE1B,MAAMA,sBAAsB,GAAIC,IAAI,IAClC,MAAMC,WAAW,SAASC,cAAK,CAACC,SAAS,CAAC;EACxCC,MAAM,GAAG;IACP,oBAAO,6DAAqBJ,IAAI,CAAO;EACzC;AACF,CAAC;AAAC,eAEWD,sBAAsB;AAAA"} diff --git a/lib/commonjs/web/components/Camera.js b/lib/commonjs/web/components/Camera.js new file mode 100644 index 000000000..efa40f34d --- /dev/null +++ b/lib/commonjs/web/components/Camera.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Camera = void 0; +var _react = _interopRequireDefault(require("react")); +var _MapContext = _interopRequireDefault(require("../MapContext")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +class Camera extends _react.default.Component { + componentDidMount() { + const { + map + } = this.context; + const { + centerCoordinate + } = this.props; + if (map && centerCoordinate) { + map.flyTo({ + center: centerCoordinate + }); + } + } + fitBounds(northEastCoordinates, southWestCoordinates) { + let padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + let animationDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.0; + const { + map + } = this.context; + if (map) { + map.fitBounds([northEastCoordinates, southWestCoordinates]); + } + } + render() { + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null); + } +} +exports.Camera = Camera; +_defineProperty(Camera, "contextType", _MapContext.default); +_defineProperty(Camera, "UserTrackingModes", []); +var _default = Camera; +exports.default = _default; +//# sourceMappingURL=Camera.js.map \ No newline at end of file diff --git a/lib/commonjs/web/components/Camera.js.map b/lib/commonjs/web/components/Camera.js.map new file mode 100644 index 000000000..80bec6cda --- /dev/null +++ b/lib/commonjs/web/components/Camera.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Camera","React","Component","componentDidMount","map","context","centerCoordinate","props","flyTo","center","fitBounds","northEastCoordinates","southWestCoordinates","padding","animationDuration","render","MapContext"],"sourceRoot":"../../../../src","sources":["web/components/Camera.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAuC;AAAA;AAEvC,MAAMA,MAAM,SAASC,cAAK,CAACC,SAAS,CAEjC;EAMDC,iBAAiB,GAAG;IAClB,MAAM;MAAEC;IAAI,CAAC,GAAG,IAAI,CAACC,OAAO;IAC5B,MAAM;MAAEC;IAAiB,CAAC,GAAG,IAAI,CAACC,KAAK;IACvC,IAAIH,GAAG,IAAIE,gBAAgB,EAAE;MAC3BF,GAAG,CAACI,KAAK,CAAC;QAAEC,MAAM,EAAEH;MAAiB,CAAC,CAAC;IACzC;EACF;EAEAI,SAAS,CACPC,oBAAsC,EACtCC,oBAAsC,EAGtC;IAAA,IAFAC,OAAO,uEAAG,CAAC;IAAA,IACXC,iBAAiB,uEAAG,GAAG;IAEvB,MAAM;MAAEV;IAAI,CAAC,GAAG,IAAI,CAACC,OAAO;IAC5B,IAAID,GAAG,EAAE;MACPA,GAAG,CAACM,SAAS,CAAC,CAACC,oBAAoB,EAAEC,oBAAoB,CAAC,CAAC;IAC7D;EACF;EAEAG,MAAM,GAAG;IACP,oBAAO,2DAAK;EACd;AACF;AAAC;AAAA,gBA/BKf,MAAM,iBAKWgB,mBAAU;AAAA,gBAL3BhB,MAAM,uBAMiB,EAAE;AAAA,eA4BhBA,MAAM;AAAA"} diff --git a/lib/commonjs/web/components/MapView.js b/lib/commonjs/web/components/MapView.js new file mode 100644 index 000000000..7ae6c2a39 --- /dev/null +++ b/lib/commonjs/web/components/MapView.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _react = _interopRequireDefault(require("react")); +var _mapboxGl = _interopRequireDefault(require("mapbox-gl")); +var _MapContext = _interopRequireDefault(require("../MapContext")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * MapView backed by Mapbox GL KS + */ +class MapView extends _react.default.Component { + constructor() { + super(...arguments); + _defineProperty(this, "state", { + map: null + }); + _defineProperty(this, "mapContainer", null); + _defineProperty(this, "map", null); + } + componentDidMount() { + const { + styleURL + } = this.props; + if (!this.mapContainer) { + console.error('MapView - mapContainer should is null'); + return; + } + const map = new _mapboxGl.default.Map({ + container: this.mapContainer, + style: styleURL || 'mapbox://styles/mapbox/streets-v11' + }); + this.map = map; + this.setState({ + map + }); + } + render() { + const { + children + } = this.props; + const { + map + } = this.state; + return /*#__PURE__*/_react.default.createElement("div", { + style: { + width: '100%', + height: '100%' + }, + ref: el => this.mapContainer = el + }, map && /*#__PURE__*/_react.default.createElement("div", { + style: { + position: 'absolute' + } + }, /*#__PURE__*/_react.default.createElement(_MapContext.default.Provider, { + value: { + map + } + }, children))); + } +} +var _default = MapView; +exports.default = _default; +//# sourceMappingURL=MapView.js.map \ No newline at end of file diff --git a/lib/commonjs/web/components/MapView.js.map b/lib/commonjs/web/components/MapView.js.map new file mode 100644 index 000000000..8291b4a71 --- /dev/null +++ b/lib/commonjs/web/components/MapView.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapView","React","Component","map","componentDidMount","styleURL","props","mapContainer","console","error","mapboxgl","Map","container","style","setState","render","children","state","width","height","el","position"],"sourceRoot":"../../../../src","sources":["web/components/MapView.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AAAuC;AAAA;AAEvC;AACA;AACA;AACA,MAAMA,OAAO,SAASC,cAAK,CAACC,SAAS,CAGnC;EAAA;IAAA;IAAA,+BACQ;MAAEC,GAAG,EAAE;IAAK,CAAC;IAAA,sCACc,IAAI;IAAA,6BAClB,IAAI;EAAA;EAEzBC,iBAAiB,GAAG;IAClB,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,KAAK;IAC/B,IAAI,CAAC,IAAI,CAACC,YAAY,EAAE;MACtBC,OAAO,CAACC,KAAK,CAAC,uCAAuC,CAAC;MACtD;IACF;IACA,MAAMN,GAAG,GAAG,IAAIO,iBAAQ,CAACC,GAAG,CAAC;MAC3BC,SAAS,EAAE,IAAI,CAACL,YAAY;MAC5BM,KAAK,EAAER,QAAQ,IAAI;IACrB,CAAC,CAAC;IACF,IAAI,CAACF,GAAG,GAAGA,GAAG;IACd,IAAI,CAACW,QAAQ,CAAC;MAAEX;IAAI,CAAC,CAAC;EACxB;EAEAY,MAAM,GAAG;IACP,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACV,KAAK;IAC/B,MAAM;MAAEH;IAAI,CAAC,GAAG,IAAI,CAACc,KAAK;IAC1B,oBACE;MACE,KAAK,EAAE;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAE;MACzC,GAAG,EAAGC,EAAE,IAAM,IAAI,CAACb,YAAY,GAAGa;IAAI,GAErCjB,GAAG,iBACF;MAAK,KAAK,EAAE;QAAEkB,QAAQ,EAAE;MAAW;IAAE,gBACnC,6BAAC,mBAAU,CAAC,QAAQ;MAAC,KAAK,EAAE;QAAElB;MAAI;IAAE,GACjCa,QAAQ,CACW,CAEzB,CACG;EAEV;AACF;AAAC,eAEchB,OAAO;AAAA"} diff --git a/lib/commonjs/web/index.js b/lib/commonjs/web/index.js new file mode 100644 index 000000000..779e3f065 --- /dev/null +++ b/lib/commonjs/web/index.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "Camera", { + enumerable: true, + get: function () { + return _Camera.default; + } +}); +Object.defineProperty(exports, "Logger", { + enumerable: true, + get: function () { + return _Logger.default; + } +}); +Object.defineProperty(exports, "MapView", { + enumerable: true, + get: function () { + return _MapView.default; + } +}); +exports.default = void 0; +var _MapboxModule = _interopRequireDefault(require("./MapboxModule")); +var _Camera = _interopRequireDefault(require("./components/Camera")); +var _MapView = _interopRequireDefault(require("./components/MapView")); +var _Logger = _interopRequireDefault(require("./utils/Logger")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const ExportedComponents = { + Camera: _Camera.default, + MapView: _MapView.default, + Logger: _Logger.default +}; +const Mapbox = { + ..._MapboxModule.default, + ...ExportedComponents +}; +var _default = Mapbox; +exports.default = _default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/commonjs/web/index.js.map b/lib/commonjs/web/index.js.map new file mode 100644 index 000000000..7e3da3af9 --- /dev/null +++ b/lib/commonjs/web/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["ExportedComponents","Camera","MapView","Logger","Mapbox","MapboxModule"],"sourceRoot":"../../../src","sources":["web/index.js"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAAoC;AAEpC,MAAMA,kBAAkB,GAAG;EACzBC,MAAM,EAANA,eAAM;EACNC,OAAO,EAAPA,gBAAO;EACPC,MAAM,EAANA;AACF,CAAC;AAED,MAAMC,MAAM,GAAG;EACb,GAAGC,qBAAY;EACf,GAAGL;AACL,CAAC;AAAC,eAGaI,MAAM;AAAA"} diff --git a/lib/commonjs/web/install.md b/lib/commonjs/web/install.md new file mode 100644 index 000000000..ef03e3cf4 --- /dev/null +++ b/lib/commonjs/web/install.md @@ -0,0 +1,25 @@ +Web support is work in progress, only basic map components works. + +Extra steps for web: +1. Add `mapbox-gl' dependency +``` +yarn add mapbox-gl +``` + +2. Configure web pack so that `rnmapbox/maps` is transpiled. `@expo/webpack-config` auto transpires packages starting with `react-native-` but `rnmapbox` has not `react-native in it's name, so it will not be transpired. See https://github.com/expo/expo-cli/issues/3744#issuecomment-893911288 and https://github.com/expo/expo-cli/tree/master/packages/webpack-config#include-modules : +``` +expo customize:web + +module.exports = async function (env, argv) { + const config = await createExpoWebpackConfigAsync( + { + ...env, + babel: { dangerouslyAddModulePathsToTranspile: ["@rnmapbox/maps"] }, + }, + argv + ); + + return config; +}; + +``` diff --git a/lib/commonjs/web/utils/Logger.js b/lib/commonjs/web/utils/Logger.js new file mode 100644 index 000000000..154bca83f --- /dev/null +++ b/lib/commonjs/web/utils/Logger.js @@ -0,0 +1,99 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* eslint-disable @typescript-eslint/no-empty-function */ + +class Logger { + static sharedInstance() { + if (this.instance === null) { + this.instance = new Logger(); + } + return this.instance; + } + constructor() { + _defineProperty(this, "level", 'info'); + _defineProperty(this, "startedCount", 0); + this.logCallback = null; + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + static setLogCallback(logCallback) { + this.sharedInstance().setLogCallback(logCallback); + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + setLogCallback(logCallback) { + this.logCallback = logCallback; + } + + /** + * This callback is displayed as part of the Requester class. + * @callback Logger~logCallback + * @param {object} log + * @param {string} log.message - the message of the log + * @param {string} log.level - log level + * @param {string} log.tag - optional tag used on android + */ + + /** + * setLogLevel + * @param {LogLevel} level + */ + static setLogLevel(level) { + this.sharedInstance().level = level; + } + start() {} + stop() {} + subscribe() { + //TODO + } + unsubscribe() { + //TODO + } + effectiveLevel(log) { + const { + level, + message, + tag + } = log; + if (level === 'warning') { + if (tag === 'Mbgl-HttpRequest' && message.startsWith('Request failed due to a permanent error: Canceled')) { + // this seems to happening too much to show a warning every time + return 'info'; + } + } + return level; + } + onLog(log) { + if (!this.logCallback || !this.logCallback(log)) { + const { + message + } = log; + const level = this.effectiveLevel(log); + if (level === 'error') { + console.error('Mapbox error', message, log); + } else if (level === 'warning') { + console.warn('Mapbox warning', message, log); + } else { + console.log(`Mapbox [${level}]`, message, log); + } + } + } +} +_defineProperty(Logger, "instance", null); +Logger.sharedInstance().start(); +var _default = Logger; +exports.default = _default; +//# sourceMappingURL=Logger.js.map \ No newline at end of file diff --git a/lib/commonjs/web/utils/Logger.js.map b/lib/commonjs/web/utils/Logger.js.map new file mode 100644 index 000000000..34f8e7a1d --- /dev/null +++ b/lib/commonjs/web/utils/Logger.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Logger","sharedInstance","instance","constructor","logCallback","setLogCallback","setLogLevel","level","start","stop","subscribe","unsubscribe","effectiveLevel","log","message","tag","startsWith","onLog","console","error","warn"],"sourceRoot":"../../../../src","sources":["web/utils/Logger.ts"],"mappings":";;;;;;;AAAA;;AASA,MAAMA,MAAM,CAAC;EAOX,OAAOC,cAAc,GAAG;IACtB,IAAI,IAAI,CAACC,QAAQ,KAAK,IAAI,EAAE;MAC1B,IAAI,CAACA,QAAQ,GAAG,IAAIF,MAAM,EAAE;IAC9B;IACA,OAAO,IAAI,CAACE,QAAQ;EACtB;EAEAC,WAAW,GAAG;IAAA,+BAXI,MAAM;IAAA,sCAET,CAAC;IAUd,IAAI,CAACC,WAAW,GAAG,IAAI;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,cAAc,CAACD,WAAwB,EAAE;IAC9C,IAAI,CAACH,cAAc,EAAE,CAACI,cAAc,CAACD,WAAW,CAAC;EACnD;;EAEA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A7FKb,MAAM,cACuB,IAAI;AA8FvCA,MAAM,CAACC,cAAc,EAAE,CAACO,KAAK,EAAE;AAAC,eAEjBR,MAAM;AAAA"} diff --git a/lib/module/Mapbox.js b/lib/module/Mapbox.js new file mode 100644 index 000000000..5bc610e16 --- /dev/null +++ b/lib/module/Mapbox.js @@ -0,0 +1,79 @@ +export * from './RNMBXModule'; +export { Camera, UserTrackingMode } from './components/Camera'; +export { Atmosphere } from './components/Atmosphere'; +export { default as MapView } from './components/MapView'; +export { default as Light } from './components/Light'; +export { default as PointAnnotation } from './components/PointAnnotation'; +export { default as Annotation } from './components/Annotation'; +export { default as Callout } from './components/Callout'; +export { default as StyleImport } from './components/StyleImport'; +export { default as UserLocation, UserLocationRenderMode } from './components/UserLocation'; +export { default as LocationPuck } from './components/LocationPuck'; +export { default as VectorSource } from './components/VectorSource'; +export { ShapeSource } from './components/ShapeSource'; +export { default as RasterSource } from './components/RasterSource'; +export { default as RasterDemSource } from './components/RasterDemSource'; +export { default as ImageSource } from './components/ImageSource'; +export { Viewport } from './components/Viewport'; +export { default as Models } from './components/Models'; +export { default as Images } from './components/Images'; +export { default as Image } from './components/Image'; +export { default as FillLayer } from './components/FillLayer'; +export { default as FillExtrusionLayer } from './components/FillExtrusionLayer'; +export { default as HeatmapLayer } from './components/HeatmapLayer'; +export { default as LineLayer } from './components/LineLayer'; +export { default as CircleLayer } from './components/CircleLayer'; +export { default as SkyLayer } from './components/SkyLayer'; +export { default as ModelLayer } from './components/ModelLayer'; +export { SymbolLayer } from './components/SymbolLayer'; +export { default as RasterLayer } from './components/RasterLayer'; +export { default as BackgroundLayer } from './components/BackgroundLayer'; +export { default as CustomLocationProvider } from './components/CustomLocationProvider'; +export { Terrain } from './components/Terrain'; +export { default as locationManager } from './modules/location/locationManager'; +export { default as offlineManager, OfflineCreatePackOptions } from './modules/offline/offlineManager'; +export { default as offlineManagerLegacy } from './modules/offline/offlineManagerLegacy'; +export { default as TileStore } from './modules/offline/TileStore'; +export { default as snapshotManager } from './modules/snapshot/snapshotManager'; +export { default as MarkerView } from './components/MarkerView'; +export { default as Animated } from './utils/animated/Animated'; +export { AnimatedCoordinatesArray, AnimatedExtractCoordinateFromArray, AnimatedPoint, AnimatedRouteCoordinatesArray, AnimatedShape } from './classes'; +export { default as Style } from './components/Style'; +export { default as Logger } from './utils/Logger'; +export { requestAndroidLocationPermissions } from './requestAndroidLocationPermissions'; +export { getAnnotationsLayerID } from './utils/getAnnotationsLayerID'; +import { deprecatedClass } from './utils/deprecation'; +import { AnimatedPoint } from './classes'; +import { UserTrackingMode } from './components/Camera'; +import MovePointShapeAnimator from './shape_animators/MovePointShapeAnimator'; +import LocationPuck from './components/LocationPuck'; + +/** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */ + +export const AnimatedMapPoint = deprecatedClass(AnimatedPoint, 'AnimatedMapPoint is deprecated please use AnimatedPoint'); + +/** @deprecated NativeUserLocation will be removed in future release. Use `LocationPuck` instead. */ +export const NativeUserLocation = LocationPuck; + +// types: +export let StyleURL; + +/** @deprecated UserTrackingModes is deprecated use UserTrackingMode */ +(function (StyleURL) { + StyleURL["Street"] = "mapbox://styles/mapbox/streets-v11"; + StyleURL["Dark"] = "mapbox://styles/mapbox/dark-v10"; + StyleURL["Light"] = "mapbox://styles/mapbox/light-v10"; + StyleURL["Outdoors"] = "mapbox://styles/mapbox/outdoors-v11"; + StyleURL["Satellite"] = "mapbox://styles/mapbox/satellite-v9"; + StyleURL["SatelliteStreet"] = "mapbox://styles/mapbox/satellite-streets-v11"; + StyleURL["TrafficDay"] = "mapbox://styles/mapbox/navigation-preview-day-v4"; + StyleURL["TrafficNight"] = "mapbox://styles/mapbox/navigation-preview-night-v4"; +})(StyleURL || (StyleURL = {})); +export const UserTrackingModes = UserTrackingMode; + +/** @experimental */ + +export const __experimental = { + MovePointShapeAnimator +}; +//# sourceMappingURL=Mapbox.js.map \ No newline at end of file diff --git a/lib/module/Mapbox.js.map b/lib/module/Mapbox.js.map new file mode 100644 index 000000000..13ed8cc5f --- /dev/null +++ b/lib/module/Mapbox.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Camera","UserTrackingMode","Atmosphere","default","MapView","Light","PointAnnotation","Annotation","Callout","StyleImport","UserLocation","UserLocationRenderMode","LocationPuck","VectorSource","ShapeSource","RasterSource","RasterDemSource","ImageSource","Viewport","Models","Images","Image","FillLayer","FillExtrusionLayer","HeatmapLayer","LineLayer","CircleLayer","SkyLayer","ModelLayer","SymbolLayer","RasterLayer","BackgroundLayer","CustomLocationProvider","Terrain","locationManager","offlineManager","OfflineCreatePackOptions","offlineManagerLegacy","TileStore","snapshotManager","MarkerView","Animated","AnimatedCoordinatesArray","AnimatedExtractCoordinateFromArray","AnimatedPoint","AnimatedRouteCoordinatesArray","AnimatedShape","Style","Logger","requestAndroidLocationPermissions","getAnnotationsLayerID","deprecatedClass","MovePointShapeAnimator","AnimatedMapPoint","NativeUserLocation","StyleURL","UserTrackingModes","__experimental"],"sourceRoot":"../../src","sources":["Mapbox.ts"],"mappings":"AAAA,cAAc,eAAe;AAE7B,SACEA,MAAM,EACNC,gBAAgB,QAKX,qBAAqB;AAC5B,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,OAAO,IAAIC,OAAO,QAAuB,sBAAsB;AACxE,SAASD,OAAO,IAAIE,KAAK,QAAQ,oBAAoB;AACrD,SAASF,OAAO,IAAIG,eAAe,QAAQ,8BAA8B;AACzE,SAASH,OAAO,IAAII,UAAU,QAAQ,yBAAyB;AAC/D,SAASJ,OAAO,IAAIK,OAAO,QAAQ,sBAAsB;AACzD,SAASL,OAAO,IAAIM,WAAW,QAAQ,0BAA0B;AACjE,SACEN,OAAO,IAAIO,YAAY,EACvBC,sBAAsB,QACjB,2BAA2B;AAClC,SAASR,OAAO,IAAIS,YAAY,QAAQ,2BAA2B;AACnE,SAAST,OAAO,IAAIU,YAAY,QAAQ,2BAA2B;AACnE,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASX,OAAO,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AQ,2BAA2B;AAC/D,SACEC,wBAAwB,EACxBC,kCAAkC,EAClCC,aAAa,EACbC,6BAA6B,EAC7BC,aAAa,QACR,WAAW;AAClB,SAAS3C,OAAO,IAAI4C,KAAK,QAAQ,oBAAoB;AACrD,SAAS5C,OAAO,IAAI6C,MAAM,QAAuB,gBAAgB;AACjE,SAASC,iCAAiC,QAAQ,qCAAqC;AACvF,SAASC,qBAAqB,QAAQ,+BAA+B;AAkBrE,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASP,aAAa,QAAQ,WAAW;AACzC,SAAS3C,gBAAgB,QAAQ,qBAAqB;AACtD,OAAOmD,sBAAsB,MAAM,0CAA0C;AAC7E,OAAOxC,YAAY,MAAM,2BAA2B;;AAEpD;;AAEA,OAAO,MAAMyC,gBAAgB,GAAGF,eAAe,CAC7CP,aAAa,EACb,yDAAyD,CAC1D;;AAED;AACA,OAAO,MAAMU,kBAAkB,GAAG1C,YAAY;;AAE9C;AACA,WAAY2C,QAAQ;;AAWpB;AAAA,WAXYA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,KAARA,QAAQ;AAYpB,OAAO,MAAMC,iBAAiB,GAAGvD,gBAAgB;;AAEjD;;AAEA,OAAO,MAAMwD,cAAc,GAAG;EAC5BL;AACF,CAAC"} diff --git a/lib/module/RNMBXModule.js b/lib/module/RNMBXModule.js new file mode 100644 index 000000000..9de397ecc --- /dev/null +++ b/lib/module/RNMBXModule.js @@ -0,0 +1,28 @@ +import { NativeModules } from 'react-native'; +const RNMBXModule = { + ...NativeModules.RNMBXModule +}; +if (NativeModules.RNMBXModule == null) { + if (global.expo != null) { + // global.expo.modules.ExponentConstants; + throw new Error('@rnmapbox/maps native code not available. Make sure you have linked the library and rebuild your app. See https://rnmapbox.github.io/docs/install?rebuild=expo#rebuild'); + } else { + throw new Error('@rnmapbox/maps native code not available. Make sure you have linked the library and rebuild your app. See https://rnmapbox.github.io/docs/install'); + } +} +export const { + StyleURL, + OfflinePackDownloadState, + LineJoin, + StyleSource, + TileServers, + removeCustomHeader, + addCustomHeader, + setAccessToken, + setWellKnownTileServer, + clearData, + getAccessToken, + setTelemetryEnabled, + setConnected +} = RNMBXModule; +//# sourceMappingURL=RNMBXModule.js.map \ No newline at end of file diff --git a/lib/module/RNMBXModule.js.map b/lib/module/RNMBXModule.js.map new file mode 100644 index 000000000..bad6a6d6e --- /dev/null +++ b/lib/module/RNMBXModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","RNMBXModule","global","expo","Error","StyleURL","OfflinePackDownloadState","LineJoin","StyleSource","TileServers","removeCustomHeader","addCustomHeader","setAccessToken","setWellKnownTileServer","clearData","getAccessToken","setTelemetryEnabled","setConnected"],"sourceRoot":"../../src","sources":["RNMBXModule.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAuC5C,MAAMC,WAAwB,GAAG;EAAE,GAAGD,aAAa,CAACC;AAAY,CAAC;AACjE,IAAID,aAAa,CAACC,WAAW,IAAI,IAAI,EAAE;EACrC,IAAKC,MAAM,CAAwBC,IAAI,IAAI,IAAI,EAAE;IAC/C;IACA,MAAM,IAAIC,KAAK,CACb,wKAAwK,CACzK;EACH,CAAC,MAAM;IACL,MAAM,IAAIA,KAAK,CACb,mJAAmJ,CACpJ;EACH;AACF;AAEA,OAAO,MAAM;EACXC,QAAQ;EACRC,wBAAwB;EACxBC,QAAQ;EACRC,WAAW;EACXC,WAAW;EACXC,kBAAkB;EAClBC,eAAe;EACfC,cAAc;EACdC,sBAAsB;EACtBC,SAAS;EACTC,cAAc;EACdC,mBAAmB;EACnBC;AACF,CAAC,GAAGhB,WAAW"} diff --git a/lib/module/assets/heading.png b/lib/module/assets/heading.png new file mode 100644 index 0000000000000000000000000000000000000000..9980c385e0782054ec30130e44ea704d62319f5a GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%C&rs6b?Si}&H|6fVg?3o zVGw3ym^DWNC}Vv@_I12J22UKFoioX?c=b!UvE%xzTN-d63Zzp00i_>zopr E09_tgKmY&$ literal 0 HcmV?d00001 diff --git a/lib/module/assets/heading@2x.png b/lib/module/assets/heading@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f3bce8761acd8f35b5c58095b3d75c8e51202e77 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofvPP)Tsw@I14-?iy0WW zg+Z8+Vb&Z8pkP#hPlzj!Hs1P_7HHO1y?&tSawS22!3>-o+W%Mip2-(_Khb1!*tH7j zAG2)t#xvb-R9WJ-T`qsiYoN+io-U3d6?5L6cjr57z~d4)z3~0sXaBDE1W(v;Vxx=h z;qA|A8rnY2&Ww|Z*{HL3FYk>gM)rb|Z+c?u+zwQ;*!;S8e6s&t_J`U6Y)2egws&mn z|0p<_>7@CDfNz>%K~4(M>_%T}`+8$a4OJ9uuwK-*&J^ z{j9y-%~Y!{E8$X|FyU_hBU=M6wq=_SsBE8~zdY@xxl&caoiVrT6#p%7K9tJwv|VeZ&zU^IcN2^^hh8n0`aa7h-#q_^0We@>tYw6r(>%CD`G`Oz7B^L&p}OMHT|bR&Ur{$C9sfj&0F<=D_g35_U&qc#qh#Kg#>XS>w6mg?jLP=9NpD8%^pw zPJcJHm@FuNVjh3W(%+UbCph_^=(B&?^!HGzyoSfO?xn9Ag8~Z{)ZAr1RrL4NTDt&2 z=@s|nR(O5Q-u~OcH)Fv&(}3wO&G-Cra9(sjr;>lmEGFjM_jVVy-G6`QHM8t%=DWX{ zV{iYx_t);i=G*W2<#>61g|WBw|2l9Xt^Ugn{vI8^o=~=9-+l>CwKLdgW)LbpC5@UwY51-pqV{e^Nn12PXKpS-iPRGjvtVnR~#vV(@hJb6Mw< G&;$U=mP-5p literal 0 HcmV?d00001 diff --git a/lib/module/classes/AnimatedCoordinatesArray.js b/lib/module/classes/AnimatedCoordinatesArray.js new file mode 100644 index 000000000..c8ea04d96 --- /dev/null +++ b/lib/module/classes/AnimatedCoordinatesArray.js @@ -0,0 +1,158 @@ +import { Animated } from 'react-native'; + +// see +// https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedWithChildren.js +const AnimatedWithChildren = Object.getPrototypeOf(Animated.ValueXY); +if (__DEV__) { + if (AnimatedWithChildren.name !== 'AnimatedWithChildren') { + console.error('AnimatedCoordinatesArray could not obtain AnimatedWithChildren base class'); + } +} +const defaultConfig = { + useNativeDriver: false +}; +export class AnimatedCoordinatesArray extends AnimatedWithChildren { + constructor() { + super(); + this.state = this.onInitialState(...arguments); + } + + /** + * Subclasses can override to calculate initial state + * + * @param {*} args - to value from animate + * @returns {object} - the state object + */ + onInitialState(coordinatesArray) { + return { + coords: coordinatesArray.map(coord => [coord[0], coord[1]]) + }; + } + + /** + * Subclasses can override getValue to calculate value from state. + * Value is typically coordinates array, but can be anything + * + * @param {object} state - either state from initialState and/or from calculate + * @returns {object} + */ + onGetValue(state) { + return state.coords; + } + + /** + * Calculates state based on startingState and progress, returns a new state + * + * @param {object} state - state object from initialState and/or from calculate + * @param {number} progress - value between 0 and 1 + * @returns {object} next state + */ + onCalculate(state, progress) { + const { + coords, + targetCoords + } = state; + const newF = progress; + const origF = 1.0 - newF; + + // common + const commonLen = Math.min(coords.length, targetCoords.length); + const common = coords.slice(0, commonLen).map((origCoord, i) => [origCoord[0] * origF + targetCoords[i][0] * newF, origCoord[1] * origF + targetCoords[i][1] * newF]); + if (targetCoords.length > coords.length) { + // only in new (adding) + const addingOrig = coords.length > 0 ? coords[coords.length - 1] : targetCoords[0]; + const adding = targetCoords.slice(commonLen, targetCoords.length).map(newCoord => [addingOrig[0] * origF + newCoord[0] * newF, addingOrig[1] * origF + newCoord[1] * newF]); + return { + coords: [...common, ...adding], + targetCoords + }; + } + if (coords.length > targetCoords.length) { + // only in orig (dissapearing) + const dissapearingNew = targetCoords.length > 0 ? targetCoords[targetCoords.length - 1] : coords[0]; + const dissapearing = coords.slice(commonLen, coords.length).map(origCoord => [origCoord[0] * origF + dissapearingNew[0] * newF, origCoord[1] * origF + dissapearingNew[1] * newF]); + return { + coords: [...common, ...dissapearing], + targetCoords + }; + } + return { + coords: common, + targetCoords + }; + } + + /** + * Subclasses can override to start a new animation + * + * @param {*} toValue - to value from animate + * @param {*} actCoords - the current coordinates array to start from + * @returns {object} The state + */ + onStart(state, toValue) { + const targetCoords = toValue.map(coord => [coord[0], coord[1]]); + return { + ...state, + targetCoords + }; + } + animate(progressValue, progressAnimation, config) { + const { + toValue + } = config; + const onAnimationStart = animation => { + if (this.animation) { + // there was a started but not finsihed animation + const actProgress = this.progressValue.__getValue(); + this.animation.stop(); + this.state = this.onCalculate(this.state, actProgress); + this.progressValue.__removeChild(this); + this.progressValue = null; + this.animation = null; + } + this.progressValue = progressValue; + this.progressValue.__addChild(this); + this.animation = animation; + this.state = this.onStart(this.state, toValue); + }; + const origAnimationStart = progressAnimation.start; + const newAnimation = progressAnimation; + newAnimation.start = function start() { + onAnimationStart(progressAnimation); + origAnimationStart(...arguments); + }; + return newAnimation; + } + timing(config) { + const progressValue = new Animated.Value(0.0); + return this.animate(progressValue, Animated.timing(progressValue, { + ...defaultConfig, + ...config, + toValue: 1.0 + }), config); + } + spring(config) { + const progressValue = new Animated.Value(0.0); + return this.animate(progressValue, Animated.spring(progressValue, { + ...defaultConfig, + ...config, + toValue: 1.0 + }), config); + } + decay(config) { + const progressValue = new Animated.Value(0.0); + return this.animate(progressValue, Animated.decay(this.progressValue, { + ...defaultConfig, + ...config, + toValue: 1.0 + }), config); + } + __getValue() { + if (!this.progressValue) { + return this.onGetValue(this.state); + } + return this.onGetValue(this.onCalculate(this.state, this.progressValue.__getValue())); + } +} +export default AnimatedCoordinatesArray; +//# sourceMappingURL=AnimatedCoordinatesArray.js.map \ No newline at end of file diff --git a/lib/module/classes/AnimatedCoordinatesArray.js.map b/lib/module/classes/AnimatedCoordinatesArray.js.map new file mode 100644 index 000000000..0eaf7ca0f --- /dev/null +++ b/lib/module/classes/AnimatedCoordinatesArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Animated","AnimatedWithChildren","Object","getPrototypeOf","ValueXY","__DEV__","name","console","error","defaultConfig","useNativeDriver","AnimatedCoordinatesArray","constructor","state","onInitialState","coordinatesArray","coords","map","coord","onGetValue","onCalculate","progress","targetCoords","newF","origF","commonLen","Math","min","length","common","slice","origCoord","i","addingOrig","adding","newCoord","dissapearingNew","dissapearing","onStart","toValue","animate","progressValue","progressAnimation","config","onAnimationStart","animation","actProgress","__getValue","stop","__removeChild","__addChild","origAnimationStart","start","newAnimation","timing","Value","spring","decay"],"sourceRoot":"../../../src","sources":["classes/AnimatedCoordinatesArray.js"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACH,QAAQ,CAACI,OAAO,CAAC;AACpE,IAAIC,OAAO,EAAE;EACX,IAAIJ,oBAAoB,CAACK,IAAI,KAAK,sBAAsB,EAAE;IACxDC,OAAO,CAACC,KAAK,CACX,2EAA2E,CAC5E;EACH;AACF;AAEA,MAAMC,aAAa,GAAG;EACpBC,eAAe,EAAE;AACnB,CAAC;AAED,OAAO,MAAMC,wBAAwB,SAASV,oBAAoB,CAAC;EACjEW,WAAW,GAAU;IACnB,KAAK,EAAE;IAEP,IAAI,CAACC,KAAK,GAAG,IAAI,CAACC,cAAc,CAAC,YAAO,CAAC;EAC3C;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEA,cAAc,CAACC,gBAAgB,EAAE;IAC/B,OAAO;MAAEC,MAAM,EAAED,gBAAgB,CAACE,GAAG,CAAEC,KAAK,IAAK,CAACA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,CAAC;IAAE,CAAC;EAC1E;;EAEA;AACF;AACA;AACA;A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ACb,MAAMF,aAAa,GAAG,IAAIzC,QAAQ,CAACuD,KAAK,CAAC,GAAG,CAAC;IAC7C,OAAO,IAAI,CAACf,OAAO,CACjBC,aAAa,EACbzC,QAAQ,CAACwD,MAAM,CAACf,aAAa,EAAE;MAC7B,GAAGhC,aAAa;MAChB,GAAGkC,MAAM;MACTJ,OAAO,EAAE;IACX,CAAC,CAAC,EACFI,MAAM,CACP;EACH;EAEAc,KAAK,CAACd,MAAM,EAAE;IACZ,MAAMF,aAAa,GAAG,IAAIzC,QAAQ,CAACuD,KAAK,CAAC,GAAG,CAAC;IAC7C,OAAO,IAAI,CAACf,OAAO,CACjBC,aAAa,EACbzC,QAAQ,CAACyD,KAAK,CAAC,IAAI,CAAChB,aAAa,EAAE;MACjC,GAAGhC,aAAa;MAChB,GAAGkC,MAAM;MACTJ,OAAO,EAAE;IACX,CAAC,CAAC,EACFI,MAAM,CACP;EACH;EAEAI,UAAU,GAAG;IACX,IAAI,CAAC,IAAI,CAACN,aAAa,EAAE;MACvB,OAAO,IAAI,CAACtB,UAAU,CAAC,IAAI,CAACN,KAAK,CAAC;IACpC;IACA,OAAO,IAAI,CAACM,UAAU,CACpB,IAAI,CAACC,WAAW,CAAC,IAAI,CAACP,KAAK,EAAE,IAAI,CAAC4B,aAAa,CAACM,UAAU,EAAE,CAAC,CAC9D;EACH;AACF;AAEA,eAAepC,wBAAwB"} diff --git a/lib/module/classes/AnimatedExtractCoordinateFromArray.js b/lib/module/classes/AnimatedExtractCoordinateFromArray.js new file mode 100644 index 000000000..4bd275fa1 --- /dev/null +++ b/lib/module/classes/AnimatedExtractCoordinateFromArray.js @@ -0,0 +1,37 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import { Animated } from 'react-native'; + +// see +// https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedWithChildren.js +const AnimatedWithChildren = Object.getPrototypeOf(Animated.ValueXY); +if (__DEV__) { + if (AnimatedWithChildren.name !== 'AnimatedWithChildren') { + console.error('AnimatedCoordinatesArray could not obtain AnimatedWithChildren base class'); + } +} +export class AnimatedExtractCoordinateFromArray extends AnimatedWithChildren { + constructor(array, index) { + super(); + _defineProperty(this, "_array", null); + _defineProperty(this, "_index", 0); + this._array = array; + this._index = index; + } + __getValue() { + const actArray = this._array.__getValue(); + let index = this._index; + if (index < 0) { + index += actArray.length; + } + return actArray[index]; + } + __attach() { + this._array.__addChild(this); + } + __detach() { + this._array.__removeChild(this); + super.__detach(); + } +} +export default AnimatedExtractCoordinateFromArray; +//# sourceMappingURL=AnimatedExtractCoordinateFromArray.js.map \ No newline at end of file diff --git a/lib/module/classes/AnimatedExtractCoordinateFromArray.js.map b/lib/module/classes/AnimatedExtractCoordinateFromArray.js.map new file mode 100644 index 000000000..bea85f588 --- /dev/null +++ b/lib/module/classes/AnimatedExtractCoordinateFromArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Animated","AnimatedWithChildren","Object","getPrototypeOf","ValueXY","__DEV__","name","console","error","AnimatedExtractCoordinateFromArray","constructor","array","index","_array","_index","__getValue","actArray","length","__attach","__addChild","__detach","__removeChild"],"sourceRoot":"../../../src","sources":["classes/AnimatedExtractCoordinateFromArray.js"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACH,QAAQ,CAACI,OAAO,CAAC;AACpE,IAAIC,OAAO,EAAE;EACX,IAAIJ,oBAAoB,CAACK,IAAI,KAAK,sBAAsB,EAAE;IACxDC,OAAO,CAACC,KAAK,CACX,2EAA2E,CAC5E;EACH;AACF;AAEA,OAAO,MAAMC,kCAAkC,SAASR,oBAAoB,CAAC;EAK3ES,WAAW,CAACC,KAAK,EAAEC,KAAK,EAAE;IACxB,KAAK,EAAE;IAAC,gCALD,IAAI;IAAA,gCAEJ,CAAC;IAIR,IAAI,CAACC,MAAM,GAAGF,KAAK;IACnB,IAAI,CAACG,MAAM,GAAGF,KAAK;EACrB;EAEAG,UAAU,GAAG;IACX,MAAMC,QAAQ,GAAG,IAAI,CAACH,MAAM,CAACE,UAAU,EAAE;IACzC,IAAIH,KAAK,GAAG,IAAI,CAACE,MAAM;IAEvB,IAAIF,KAAK,GAAG,CAAC,EAAE;MACbA,KAAK,IAAII,QAAQ,CAACC,MAAM;IAC1B;IACA,OAAOD,QAAQ,CAACJ,KAAK,CAAC;EACxB;EAEAM,QAAQ,GAAG;IACT,IAAI,CAACL,MAAM,CAACM,UAAU,CAAC,IAAI,CAAC;EAC9B;EAEAC,QAAQ,GAAG;IACT,IAAI,CAACP,MAAM,CAACQ,aAAa,CAAC,IAAI,CAAC;IAC/B,KAAK,CAACD,QAAQ,EAAE;EAClB;AACF;AAEA,eAAeX,kCAAkC"} diff --git a/lib/module/classes/AnimatedPoint.js b/lib/module/classes/AnimatedPoint.js new file mode 100644 index 000000000..83231195f --- /dev/null +++ b/lib/module/classes/AnimatedPoint.js @@ -0,0 +1,110 @@ +import { Animated } from 'react-native'; + +// Used react-native-maps as a reference +// https://github.com/react-community/react-native-maps/blob/master/lib/components/AnimatedRegion.js +const AnimatedWithChildren = Object.getPrototypeOf(Animated.ValueXY); +const DEFAULT_COORD = [0, 0]; +const DEFAULT_POINT = { + type: 'Point', + coordinates: DEFAULT_COORD +}; +let uniqueID = 0; +export class AnimatedPoint extends AnimatedWithChildren { + constructor() { + let point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_POINT; + super(); + this.longitude = point.coordinates[0] || 0; + this.latitude = point.coordinates[1] || 0; + if (!(this.longitude instanceof Animated.Value)) { + this.longitude = new Animated.Value(this.longitude); + } + if (!(this.latitude instanceof Animated.Value)) { + this.latitude = new Animated.Value(this.latitude); + } + this._listeners = {}; + } + setValue() { + let point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_POINT; + this.longitude.setValue(point.coordinates[0]); + this.latitude.setValue(point.coordinates[1]); + } + setOffset() { + let point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_POINT; + this.longitude.setOffset(point.coordinates[0]); + this.latitude.setOffset(point.coordinates[1]); + } + flattenOffset() { + this.longitude.flattenOffset(); + this.latitude.flattenOffset(); + } + stopAnimation(cb) { + this.longitude.stopAnimation(); + this.latitude.stopAnimation(); + if (typeof cb === 'function') { + cb(this.__getValue()); + } + } + addListener(cb) { + uniqueID += 1; + const id = `${String(uniqueID)}-${String(Date.now())}`; + const completeCB = () => { + if (typeof cb === 'function') { + cb(this.__getValue()); + } + }; + this._listeners[id] = { + longitude: this.longitude.addListener(completeCB), + latitude: this.latitude.addListener(completeCB) + }; + return id; + } + removeListener(id) { + this.longitude.removeListener(this._listeners[id].longitude); + this.latitude.removeListener(this._listeners[id].latitude); + delete this._listeners[id]; + } + spring() { + let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + coordinates: DEFAULT_COORD + }; + return Animated.parallel([Animated.spring(this.longitude, { + ...config, + toValue: config.coordinates[0], + useNativeDriver: false + }), Animated.spring(this.latitude, { + ...config, + toValue: config.coordinates[1], + useNativeDriver: false + })]); + } + timing() { + let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + coordinates: DEFAULT_COORD + }; + return Animated.parallel([Animated.timing(this.longitude, { + ...config, + toValue: config.coordinates[0], + useNativeDriver: false + }), Animated.timing(this.latitude, { + ...config, + toValue: config.coordinates[1], + useNativeDriver: false + })]); + } + __getValue() { + return { + type: 'Point', + coordinates: [this.longitude.__getValue(), this.latitude.__getValue()] + }; + } + __attach() { + this.longitude.__addChild(this); + this.latitude.__addChild(this); + } + __detach() { + this.longitude.__removeChild(this); + this.latitude.__removeChild(this); + } +} +export default AnimatedPoint; +//# sourceMappingURL=AnimatedPoint.js.map \ No newline at end of file diff --git a/lib/module/classes/AnimatedPoint.js.map b/lib/module/classes/AnimatedPoint.js.map new file mode 100644 index 000000000..15a918a64 --- /dev/null +++ b/lib/module/classes/AnimatedPoint.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Animated","AnimatedWithChildren","Object","getPrototypeOf","ValueXY","DEFAULT_COORD","DEFAULT_POINT","type","coordinates","uniqueID","AnimatedPoint","constructor","point","longitude","latitude","Value","_listeners","setValue","setOffset","flattenOffset","stopAnimation","cb","__getValue","addListener","id","String","Date","now","completeCB","removeListener","spring","config","parallel","toValue","useNativeDriver","timing","__attach","__addChild","__detach","__removeChild"],"sourceRoot":"../../../src","sources":["classes/AnimatedPoint.js"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACH,QAAQ,CAACI,OAAO,CAAC;AAEpE,MAAMC,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5B,MAAMC,aAAa,GAAG;EAAEC,IAAI,EAAE,OAAO;EAAEC,WAAW,EAAEH;AAAc,CAAC;AAEnE,IAAII,QAAQ,GAAG,CAAC;AAEhB,OAAO,MAAMC,aAAa,SAAST,oBAAoB,CAAC;EACtDU,WAAW,GAAwB;IAAA,IAAvBC,KAAK,uEAAGN,aAAa;IAC/B,KAAK,EAAE;IAEP,IAAI,CAACO,SAAS,GAAGD,KAAK,CAACJ,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,IAAI,CAACM,QAAQ,GAAGF,KAAK,CAACJ,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzC,IAAI,EAAE,IAAI,CAACK,SAAS,YAAYb,QAAQ,CAACe,KAAK,CAAC,EAAE;MAC/C,IAAI,CAACF,SAAS,GAAG,IAAIb,QAAQ,CAACe,KAAK,CAAC,IAAI,CAACF,SAAS,CAAC;IACrD;IAEA,IAAI,EAAE,IAAI,CAACC,QAAQ,YAAYd,QAAQ,CAACe,KAAK,CAAC,EAAE;MAC9C,IAAI,CAACD,QAAQ,GAAG,IAAId,QAAQ,CAAC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,WAAW,CAAC,CAAC,CAAC;MAC9B0B,eAAe,EAAE;IACnB,CAAC,CAAC,EACFlC,QAAQ,CAACmC,MAAM,CAAC,IAAI,CAACrB,QAAQ,EAAE;MAC7B,GAAGiB,MAAM;MACTE,OAAO,EAAEF,MAAM,CAACvB,WAAW,CAAC,CAAC,CAAC;MAC9B0B,eAAe,EAAE;IACnB,CAAC,CAAC,CACH,CAAC;EACJ;EAEAZ,UAAU,GAAG;IACX,OAAO;MACLf,IAAI,EAAE,OAAO;MACbC,WAAW,EAAE,CAAC,IAAI,CAACK,SAAS,CAACS,UAAU,EAAE,EAAE,IAAI,CAACR,QAAQ,CAACQ,UAAU,EAAE;IACvE,CAAC;EACH;EAEAc,QAAQ,GAAG;IACT,IAAI,CAACvB,SAAS,CAACwB,UAAU,CAAC,IAAI,CAAC;IAC/B,IAAI,CAACvB,QAAQ,CAACuB,UAAU,CAAC,IAAI,CAAC;EAChC;EAEAC,QAAQ,GAAG;IACT,IAAI,CAACzB,SAAS,CAAC0B,aAAa,CAAC,IAAI,CAAC;IAClC,IAAI,CAACzB,QAAQ,CAACyB,aAAa,CAAC,IAAI,CAAC;EACnC;AACF;AAEA,eAAe7B,aAAa"} diff --git a/lib/module/classes/AnimatedRouteCoordinatesArray.js b/lib/module/classes/AnimatedRouteCoordinatesArray.js new file mode 100644 index 000000000..0195c8c62 --- /dev/null +++ b/lib/module/classes/AnimatedRouteCoordinatesArray.js @@ -0,0 +1,148 @@ +import { lineString, point, convertDistance as convertDistanceFn, +// eslint-disable-line import/named +convertLength as convertLengthFn } from '@turf/helpers'; +import distance from '@turf/distance'; +import nearestPointOnLine from '@turf/nearest-point-on-line'; +import length from '@turf/length'; +import AnimatedCoordinatesArray from './AnimatedCoordinatesArray'; +const convertLength = convertLengthFn || convertDistanceFn; + +/** + * AnimatedRoutesCoordinatesArray - animates along route. + * By default start of route is start, and end of route animated from 100% of route to 0% or route. + * Eg we have full route to destination and as we're progressing the remaining route gets shorter and shorter. + */ +export class AnimatedRouteCoordinatesArray extends AnimatedCoordinatesArray { + /** + * Calculate initial state + * + * @param {*} args - to value from animate + * @param {{end?: {from?: number}}} options - options, example + * @returns {object} - the state object + */ + onInitialState(coordinatesArray) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let end = { + from: 0 + }; + if (options && options.end) { + end = options.end; + } + return { + fullRoute: coordinatesArray.map(coord => [coord[0], coord[1]]), + end + }; + } + + /** + * Calculate value from state. + * + * @param {object} state - either state from initialState and/or from calculate + * @returns {object} + */ + onGetValue(state) { + return state.actRoute || state.fullRoute; + } + + /** + * Calculates state based on startingState and progress, returns a new state + * + * @param {object} state - state object from initialState and/or from calculate + * @param {number} progress - value between 0 and 1 + * @returns {object} next state + */ + onCalculate(state, progress) { + const { + fullRoute, + end + } = state; + const currentEnd = end.from * (1.0 - progress) + progress * end.to; + let prevsum = 0; + let actsum = 0; + let i = fullRoute.length - 1; + while (actsum < currentEnd && i > 0) { + prevsum = actsum; + actsum += distance(point(fullRoute[i]), point(fullRoute[i - 1]), this.distconf); + i -= 1; + } + if (actsum <= currentEnd) { + const actRoute = [...fullRoute.slice(0, i + 1)]; + const minLineStringElements = 2; + if (actRoute.length < minLineStringElements) { + actRoute.push(actRoute[0]); + } + return { + fullRoute, + end: { + ...end, + current: currentEnd + }, + actRoute + }; + } + const r = (currentEnd - prevsum) / (actsum - prevsum); + const or = 1.0 - r; + + // console.log("i", i+1); + const actRoute = [...fullRoute.slice(0, i + 1), [fullRoute[i][0] * r + fullRoute[i + 1][0] * or, fullRoute[i][1] * r + fullRoute[i + 1][1] * or]]; + return { + fullRoute, + end: { + ...end, + current: currentEnd + }, + actRoute + }; + } + + /** + * Subclasses can override to start a new animation + * + * @param {*} toValue - to value from animate + * @param {*} actCoords - the current coordinates array to start from + * @returns {object} The state + */ + onStart(state, toValue) { + const { + fullRoute, + end + } = state; + let toDist; + if (!toValue.end) { + console.error('RouteCoordinatesArray: toValue should have end with either along or point'); + } + if (toValue.end.along != null) { + const { + units + } = toValue; + const ls = lineString(fullRoute); + toDist = convertLength(toValue.end.along, units); + toDist = length(ls) - toDist; + } + if (toDist != null) { + if (toValue.end.point) { + console.warn('RouteCoordinatesArray: toValue.end: has both along and point, point is ignored'); + } + } else if (toValue.end.point) { + const ls = lineString(fullRoute); + const nearest = nearestPointOnLine(ls, toValue.end.point); + toDist = length(ls) - nearest.properties.location; + } else { + console.warn('RouteCoordinatesArray: toValue.end: should have either along or point'); + } + const result = { + fullRoute, + end: { + ...end, + from: end.current != null ? end.current : end.from, + to: toDist + } + }; + return result; + } + get originalRoute() { + return this.state.fullRoute; + } +} +export default AnimatedRouteCoordinatesArray; +//# sourceMappingURL=AnimatedRouteCoordinatesArray.js.map \ No newline at end of file diff --git a/lib/module/classes/AnimatedRouteCoordinatesArray.js.map b/lib/module/classes/AnimatedRouteCoordinatesArray.js.map new file mode 100644 index 000000000..8df833049 --- /dev/null +++ b/lib/module/classes/AnimatedRouteCoordinatesArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["lineString","point","convertDistance","convertDistanceFn","convertLength","convertLengthFn","distance","nearestPointOnLine","length","AnimatedCoordinatesArray","AnimatedRouteCoordinatesArray","onInitialState","coordinatesArray","options","end","from","fullRoute","map","coord","onGetValue","state","actRoute","onCalculate","progress","currentEnd","to","prevsum","actsum","i","distconf","slice","minLineStringElements","push","current","r","or","onStart","toValue","toDist","console","error","along","units","ls","warn","nearest","properties","location","result","originalRoute"],"sourceRoot":"../../../src","sources":["classes/AnimatedRouteCoordinatesArray.js"],"mappings":"AAAA,SACEA,UAAU,EACVC,KAAK,EACLC,eAAe,IAAIC,iBAAiB;AAAE;AACtCC,aAAa,IAAIC,eAAe,QAC3B,eAAe;AACtB,OAAOC,QAAQ,MAAM,gBAAgB;AACrC,OAAOC,kBAAkB,MAAM,6BAA6B;AAC5D,OAAOC,MAAM,MAAM,cAAc;AAEjC,OAAOC,wBAAwB,MAAM,4BAA4B;AAEjE,MAAML,aAAa,GAAGC,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AAM;EACf;EAEA,IAAIC,aAAa,GAAG;IAClB,OAAO,IAAI,CAAC7B,KAAK,CAACJ,SAAS;EAC7B;AACF;AAEA,eAAeN,6BAA6B"} diff --git a/lib/module/classes/AnimatedShape.js b/lib/module/classes/AnimatedShape.js new file mode 100644 index 000000000..e5cf443e9 --- /dev/null +++ b/lib/module/classes/AnimatedShape.js @@ -0,0 +1,71 @@ +import { Animated } from 'react-native'; + +// see +// https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedWithChildren.js +const AnimatedWithChildren = Object.getPrototypeOf(Animated.ValueXY); +if (__DEV__) { + if (AnimatedWithChildren.name !== 'AnimatedWithChildren') { + console.error('AnimatedShape could not obtain AnimatedWithChildren base class'); + } +} + +/** + * AnimatedShape can be used to display an animated LineString, FeatureCollection, Point, or other struture inside the shape property. + * @example + * const animatedLon = useRef(new Animated.Value(-73.984638)).current; + * const animatedLat = useRef(new Animated.Value(40.759211)).current; + * const animatedShape = new AnimatedShape({ + * type: 'LineString', + * coordinates: [animatedLon, animatedLat], + * }); + * return + */ +export class AnimatedShape extends AnimatedWithChildren { + // equivalent of AnimatedStyle for shapes + // https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/nodes/AnimatedStyle.js + + constructor(shape) { + super(); + this.shape = shape; + } + _walkShapeAndGetValues(value) { + if (Array.isArray(value)) { + return value.map(i => this._walkShapeAndGetValues(i)); + } + if (value instanceof Animated.Node) { + return value.__getValue(); + } + if (typeof value === 'object') { + const result = {}; + for (const key in value) { + result[key] = this._walkShapeAndGetValues(value[key]); + } + return result; + } + return value; + } + __getValue() { + const result = this._walkShapeAndGetValues(this.shape); + return result; + } + _walkAndProcess(value, cb) { + if (Array.isArray(value)) { + value.forEach(i => this._walkAndProcess(i, cb)); + } else if (value instanceof Animated.Node) { + cb(value); + } else if (typeof value === 'object') { + for (const key in value) { + this._walkAndProcess(value[key], cb); + } + } + } + __attach() { + this._walkAndProcess(this.shape, v => v.__addChild(this)); + } + __detach() { + this._walkAndProcess(this.shape, v => v.__removeChild(this)); + super.__detach(); + } +} +export default AnimatedShape; +//# sourceMappingURL=AnimatedShape.js.map \ No newline at end of file diff --git a/lib/module/classes/AnimatedShape.js.map b/lib/module/classes/AnimatedShape.js.map new file mode 100644 index 000000000..56de0915b --- /dev/null +++ b/lib/module/classes/AnimatedShape.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Animated","AnimatedWithChildren","Object","getPrototypeOf","ValueXY","__DEV__","name","console","error","AnimatedShape","constructor","shape","_walkShapeAndGetValues","value","Array","isArray","map","i","Node","__getValue","result","key","_walkAndProcess","cb","forEach","__attach","v","__addChild","__detach","__removeChild"],"sourceRoot":"../../../src","sources":["classes/AnimatedShape.js"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACH,QAAQ,CAACI,OAAO,CAAC;AACpE,IAAIC,OAAO,EAAE;EACX,IAAIJ,oBAAoB,CAACK,IAAI,KAAK,sBAAsB,EAAE;IACxDC,OAAO,CAACC,KAAK,CACX,gEAAgE,CACjE;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,SAASR,oBAAoB,CAAC;EACtD;EACA;;EAEAS,WAAW,CAACC,KAAK,EAAE;IACjB,KAAK,EAAE;IACP,IAAI,CAACA,KAAK,GAAGA,KAAK;EACpB;EAEAC,sBAAsB,CAACC,KAAK,EAAE;IAC5B,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACxB,OAAOA,KAAK,CAACG,GAAG,CAAEC,CAAC,IAAK,IAAI,CAACL,sBAAsB,CAACK,CAAC,CAAC,CAAC;IACzD;IACA,IAAIJ,KAAK,YAAYb,QAAQ,CAACkB,IAAI,EAAE;MAClC,OAAOL,KAAK,CAACM,UAAU,EAAE;IAC3B;IACA,IAAI,OAAON,KAAK,KAAK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 000000000..a1c521f35 --- /dev/null +++ b/lib/module/classes/index.d.js @@ -0,0 +1,7 @@ +var WithAnimatedObject = Animated.WithAnimatedObject; +export class AnimatedCoordinatesArray {} +export class AnimatedExtractCoordinateFromArray {} +export class AnimatedPoint {} +export class AnimatedRouteCoordinatesArray {} +export class AnimatedShape {} +//# sourceMappingURL=index.d.js.map \ No newline at end of file diff --git a/lib/module/classes/index.d.js.map b/lib/module/classes/index.d.js.map new file mode 100644 index 000000000..4ec2e9c2d --- /dev/null +++ b/lib/module/classes/index.d.js.map @@ -0,0 +1 @@ +{"version":3,"names":["WithAnimatedObject","Animated","AnimatedCoordinatesArray","AnimatedExtractCoordinateFromArray","AnimatedPoint","AnimatedRouteCoordinatesArray","AnimatedShape"],"sourceRoot":"../../../src","sources":["classes/index.d.ts"],"mappings":"IAGOA,kBAAkB,GAAGC,QAAQ,CAACD,kBAAkB;AAEvD,OAAO,MAAME,wBAAwB,CAAC;AACtC,OAAO,MAAMC,kCAAkC,CAAC;AAChD,OAAO,MAAMC,aAAa,CAAsC;AAehE,OAAO,MAAMC,6BAA6B,CAAC;AAC3C,OAAO,MAAMC,aAAa,CAAC"} diff --git a/lib/module/classes/index.js b/lib/module/classes/index.js new file mode 100644 index 000000000..561752403 --- /dev/null +++ b/lib/module/classes/index.js @@ -0,0 +1,6 @@ +export * from './AnimatedCoordinatesArray'; +export * from './AnimatedExtractCoordinateFromArray'; +export * from './AnimatedPoint'; +export * from './AnimatedRouteCoordinatesArray'; +export * from './AnimatedShape'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/module/classes/index.js.map b/lib/module/classes/index.js.map new file mode 100644 index 000000000..47777d554 --- /dev/null +++ b/lib/module/classes/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["classes/index.js"],"mappings":"AAAA,cAAc,4BAA4B;AAC1C,cAAc,sCAAsC;AACpD,cAAc,iBAAiB;AAC/B,cAAc,iCAAiC;AAC/C,cAAc,iBAAiB"} diff --git a/lib/module/components/AbstractLayer.js b/lib/module/components/AbstractLayer.js new file mode 100644 index 000000000..519bb418b --- /dev/null +++ b/lib/module/components/AbstractLayer.js @@ -0,0 +1,54 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { processColor } from 'react-native'; +import { getFilter } from '../utils/filterUtils'; +import { transformStyle } from '../utils/StyleValue'; +class AbstractLayer extends React.PureComponent { + constructor() { + super(...arguments); + _defineProperty(this, "nativeLayer", null); + _defineProperty(this, "setNativeLayer", instance => { + this.nativeLayer = instance; + }); + } + get baseProps() { + return { + ...this.props, + id: this.props.id, + existing: this.props.existing, + sourceID: this.props.sourceID, + reactStyle: this.getStyle(this.props.style), + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + aboveLayerID: this.props.aboveLayerID, + belowLayerID: this.props.belowLayerID, + layerIndex: this.props.layerIndex, + filter: getFilter(this.props.filter), + style: undefined + }; + } + getStyleTypeFormatter(styleType) { + if (styleType === 'color') { + return processColor; + } + return undefined; + } + getStyle(style) { + return transformStyle(style); + } + setNativeProps(props) { + if (this.nativeLayer) { + var _this$nativeLayer; + let propsToPass = props; + if (props.style) { + propsToPass = { + ...props, + reactStyle: this.getStyle(props.style) + }; + } + (_this$nativeLayer = this.nativeLayer) === null || _this$nativeLayer === void 0 ? void 0 : _this$nativeLayer.setNativeProps(propsToPass); + } + } +} +export default AbstractLayer; +//# sourceMappingURL=AbstractLayer.js.map \ No newline at end of file diff --git a/lib/module/components/AbstractLayer.js.map b/lib/module/components/AbstractLayer.js.map new file mode 100644 index 000000000..0eb0de031 --- /dev/null +++ b/lib/module/components/AbstractLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","processColor","getFilter","transformStyle","AbstractLayer","PureComponent","instance","nativeLayer","baseProps","props","id","existing","sourceID","reactStyle","getStyle","style","minZoomLevel","maxZoomLevel","aboveLayerID","belowLayerID","layerIndex","filter","undefined","getStyleTypeFormatter","styleType","setNativeProps","propsToPass"],"sourceRoot":"../../../src","sources":["components/AbstractLayer.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAwBC,YAAY,QAAQ,cAAc;AAE1D,SAASC,SAAS,QAAQ,sBAAsB;AAEhD,SAAqBC,cAAc,QAAQ,qBAAqB;AAgBhE,MAAMC,aAAa,SAGTJ,KAAK,CAACK,aAAa,CAAY;EAAA;IAAA;IAAA,qCAsB5B,IAAI;IAAA,wCAGbC,QAEQ,IACL;MACH,IAAI,CAACC,WAAW,GAAGD,QAAQ;IAC7B,CAAC;EAAA;EA7BD,IAAIE,SAAS,GAEX;IACA,OAAO;MACL,GAAG,IAAI,CAACC,KAAK;MACbC,EAAE,EAAE,IAAI,CAACD,KAAK,CAACC,EAAE;MACjBC,QAAQ,EAAE,IAAI,CAACF,KAAK,CAACE,QAAQ;MAC7BC,QAAQ,EAAE,IAAI,CAACH,KAAK,CAACG,QAAQ;MAC7BC,UAAU,EAAE,IAAI,CAACC,QAAQ,CAAC,IAAI,CAACL,KAAK,CAACM,KAAK,CAAC;MAC3CC,YAAY,EAAE,IAAI,CAACP,KAAK,CAACO,YAAY;MACrCC,YAAY,EAAE,IAAI,CAACR,KAAK,CAACQ,YAAY;MACrCC,YAAY,EAAE,IAAI,CAACT,KAAK,CAACS,YAAY;MACrCC,YAAY,EAAE,IAAI,CAACV,KAAK,CAACU,YAAY;MACrCC,UAAU,EAAE,IAAI,CAACX,KAAK,CAACW,UAAU;MACjCC,MAAM,EAAEnB,SAAS,CAAC,IAAI,CAACO,KAAK,CAACY,MAAM,CAAC;MACpCN,KAAK,EAAEO;IACT,CAAC;EACH;EAcAC,qBAAqB,CAACC,SAAiB,EAAE;IACvC,IAAIA,SAAS,KAAK,OAAO,EAAE;MACzB,OAAOvB,YAAY;IACrB;IACA,OAAOqB,SAAS;EAClB;EAEAR,QAAQ,CACNC,KAAqC,EACM;IAC3C,OAAOZ,cAAc,CAACY,KAAK,CAAC;EAC9B;EAEAU,cAAc,CAAChB,KAAiC,EAAE;IAChD,IAAI,IAAI,CAACF,WAAW,EAAE;MAAA;MACpB,IAAImB,WAAW,GAAGjB,KAAK;MACvB,IAAIA,KAAK,CAACM,KAAK,EAAE;QACfW,WAAW,GAAG;UACZ,GAAGjB,KAAK;UACRI,UAAU,EAAE,IAAI,CAACC,QAAQ,CAACL,KAAK,CAACM,KAAK;QACvC,CAAC;MACH;MACA,yBAAI,CAACR,WAAW,sDAAhB,kBAAkBkB,cAAc,CAACC,WAAW,CAAC;IAC/C;EACF;AACF;AAEA,eAAetB,aAAa"} diff --git a/lib/module/components/AbstractSource.js b/lib/module/components/AbstractSource.js new file mode 100644 index 000000000..9c3a296d9 --- /dev/null +++ b/lib/module/components/AbstractSource.js @@ -0,0 +1,17 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +class AbstractSource extends React.PureComponent { + constructor() { + super(...arguments); + _defineProperty(this, "setNativeRef", instance => { + this._nativeRef = instance; + }); + } + setNativeProps(props) { + if (this._nativeRef) { + this._nativeRef.setNativeProps(props); + } + } +} +export default AbstractSource; +//# sourceMappingURL=AbstractSource.js.map \ No newline at end of file diff --git a/lib/module/components/AbstractSource.js.map b/lib/module/components/AbstractSource.js.map new file mode 100644 index 000000000..0a78fc562 --- /dev/null +++ b/lib/module/components/AbstractSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","AbstractSource","PureComponent","instance","_nativeRef","setNativeProps","props"],"sourceRoot":"../../../src","sources":["components/AbstractSource.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAKzB,MAAMC,cAAc,SAGVD,KAAK,CAACE,aAAa,CAAwB;EAAA;IAAA;IAAA,sCAWtCC,QAAQ,IAAK;MACxB,IAAI,CAACC,UAAU,GAAGD,QAAQ;IAC5B,CAAC;EAAA;EAVDE,cAAc,CAACC,KAAsB,EAAE;IACrC,IAAI,IAAI,CAACF,UAAU,EAAE;MACnB,IAAI,CAACA,UAAU,CAACC,cAAc,CAACC,KAAK,CAAC;IACvC;EACF;AAOF;AAEA,eAAeL,cAAc"} diff --git a/lib/module/components/Annotation.js b/lib/module/components/Annotation.js new file mode 100644 index 000000000..8713039d9 --- /dev/null +++ b/lib/module/components/Annotation.js @@ -0,0 +1,93 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { Easing } from 'react-native'; +import Animated from '../utils/animated/Animated'; +import { AnimatedPoint } from '../classes'; +import { SymbolLayer } from './SymbolLayer'; +class Annotation extends React.Component { + constructor(props) { + super(props); + const shape = this._getShapeFromProps(props); + this.state = { + shape: props.animated ? new AnimatedPoint(shape) : shape + }; + this.onPress = this.onPress.bind(this); + } + componentDidUpdate(prevProps) { + if (!Array.isArray(this.props.coordinates)) { + this.setState({ + shape: null + }); + return; + } + const haveCoordinatesChanged = prevProps.coordinates[0] !== this.props.coordinates[0] || prevProps.coordinates[1] !== this.props.coordinates[1]; + if (prevProps.animated !== this.props.animated || haveCoordinatesChanged && (!this.state.shape || !this.props.animated)) { + const shape = this._getShapeFromProps(this.props); + this.setState({ + shape: this.props.animated ? new AnimatedPoint(shape) : shape + }); + } else if (haveCoordinatesChanged && this.props.animated && this.state.shape) { + // flush current animations + this.state.shape.stopAnimation(); + this.state.shape.timing({ + coordinates: this.props.coordinates, + easing: this.props.animationEasingFunction, + duration: this.props.animationDuration + }).start(); + } + } + onPress(event) { + if (this.props.onPress) { + this.props.onPress(event); + } + } + _getShapeFromProps() { + var _props$coordinates, _props$coordinates2; + let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const lng = ((_props$coordinates = props.coordinates) === null || _props$coordinates === void 0 ? void 0 : _props$coordinates[0]) || 0; + const lat = ((_props$coordinates2 = props.coordinates) === null || _props$coordinates2 === void 0 ? void 0 : _props$coordinates2[1]) || 0; + return { + type: 'Point', + coordinates: [lng, lat] + }; + } + get symbolStyle() { + if (!this.props.icon) { + return undefined; + } + return Object.assign({}, this.props.style, { + iconImage: this.props.icon + }); + } + render() { + if (!this.props.coordinates) { + return null; + } + const children = []; + if (this.symbolStyle) { + children.push( /*#__PURE__*/React.createElement(SymbolLayer, { + id: `${this.props.id}-symbol`, + style: this.symbolStyle + })); + } + if (this.props.children) { + if (Array.isArray(this.props.children)) { + children.push(...this.props.children); + } else { + children.push(this.props.children); + } + } + return /*#__PURE__*/React.createElement(Animated.ShapeSource, { + id: this.props.id, + onPress: this.onPress, + shape: this.state.shape + }, children); + } +} +_defineProperty(Annotation, "defaultProps", { + animated: false, + animationDuration: 1000, + animationEasingFunction: Easing.linear +}); +export default Annotation; +//# sourceMappingURL=Annotation.js.map \ No newline at end of file diff --git a/lib/module/components/Annotation.js.map b/lib/module/components/Annotation.js.map new file mode 100644 index 000000000..0e77bc1e4 --- /dev/null +++ b/lib/module/components/Annotation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","Easing","Animated","AnimatedPoint","SymbolLayer","Annotation","Component","constructor","props","shape","_getShapeFromProps","state","animated","onPress","bind","componentDidUpdate","prevProps","Array","isArray","coordinates","setState","haveCoordinatesChanged","stopAnimation","timing","easing","animationEasingFunction","duration","animationDuration","start","event","lng","lat","type","symbolStyle","icon","undefined","Object","assign","style","iconImage","render","children","push","id","linear"],"sourceRoot":"../../../src","sources":["components/Annotation.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAwB,OAAO;AAC3C,SAAiCC,MAAM,QAAQ,cAAc;AAG7D,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAASC,aAAa,QAAQ,YAAY;AAI1C,SAASC,WAAW,QAAQ,eAAe;AAkB3C,MAAMC,UAAU,SAASL,KAAK,CAACM,SAAS,CAAyB;EAO/DC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IAEA,MAAMsB,QAAQ,GAAG,EAAE;IAEnB,IAAI,IAAI,CAACR,WAAW,EAAE;MACpBQ,QAAQ,CAACC,IAAI,eACX,oBAAC,WAAW;QACV,EAAE,EAAG,GAAE,IAAI,CAAClC,KAAK,CAACmC,EAAG,SAAS;QAC9B,KAAK,EAAE,IAAI,CAACV;MAAgC,EAC5C,CACH;IACH;IAEA,IAAI,IAAI,CAACzB,KAAK,CAACiC,QAAQ,EAAE;MACvB,IAAIxB,KAAK,CAACC,OAAO,CAAC,IAAI,CAACV,KAAK,CAACiC,QAAQ,CAAC,EAAE;QACtCA,QAAQ,CAACC,IAAI,CAAC,GAAG,IAAI,CAAClC,KAAK,CAACiC,QAAQ,CAAC;MACvC,CAAC,MAAM;QACLA,QAAQ,CAACC,IAAI,CAAC,IAAI,CAAClC,KAAK,CAACiC,QAAQ,CAAC;MACpC;IACF;IAEA,oBACE,oBAAC,QAAQ,CAAC,WAAW;MACnB,EAAE,EAAE,IAAI,CAACjC,KAAK,CAACmC,EAAG;MAClB,OAAO,EAAE,IAAI,CAAC9B,OAAQ;MACtB,KAAK,EAAE,IAAI,CAACF,KAAK,CAACF;IAA8C,GAE/DgC,QAAQ,CACY;EAE3B;AACF;AAAC,gBA/GKpC,UAAU,kBACQ;EACpBO,QAAQ,EAAE,KAAK;EACfe,iBAAiB,EAAE,IAAI;EACvBF,uBAAuB,EAAExB,MAAM,CAAC2C;AAClC,CAAC;AA4GH,eAAevC,UAAU"} diff --git a/lib/module/components/Atmosphere.js b/lib/module/components/Atmosphere.js new file mode 100644 index 000000000..671373b60 --- /dev/null +++ b/lib/module/components/Atmosphere.js @@ -0,0 +1,14 @@ +import React, { memo, useMemo } from 'react'; +import { transformStyle } from '../utils/StyleValue'; +import RNMBXAtmosphereNativeComponent from '../specs/RNMBXAtmosphereNativeComponent'; +export const Atmosphere = /*#__PURE__*/memo(props => { + const baseProps = useMemo(() => { + return { + ...props, + reactStyle: transformStyle(props.style), + style: undefined + }; + }, [props]); + return /*#__PURE__*/React.createElement(RNMBXAtmosphereNativeComponent, baseProps); +}); +//# sourceMappingURL=Atmosphere.js.map \ No newline at end of file diff --git a/lib/module/components/Atmosphere.js.map b/lib/module/components/Atmosphere.js.map new file mode 100644 index 000000000..2eb54e6d5 --- /dev/null +++ b/lib/module/components/Atmosphere.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","memo","useMemo","transformStyle","RNMBXAtmosphereNativeComponent","Atmosphere","props","baseProps","reactStyle","style","undefined"],"sourceRoot":"../../../src","sources":["components/Atmosphere.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAG5C,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,OAAOC,8BAA8B,MAAM,yCAAyC;AAMpF,OAAO,MAAMC,UAAU,gBAAGJ,IAAI,CAAEK,KAAY,IAAK;EAC/C,MAAMC,SAAS,GAAGL,OAAO,CAAC,MAAM;IAC9B,OAAO;MACL,GAAGI,KAAK;MACRE,UAAU,EAAEL,cAAc,CAACG,KAAK,CAACG,KAAK,CAAC;MACvCA,KAAK,EAAEC;IACT,CAAC;EACH,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;EAEX,oBAAO,oBAAC,8BAA8B,EAAKC,SAAS,CAAI;AAC1D,CAAC,CAAC"} diff --git a/lib/module/components/BackgroundLayer.js b/lib/module/components/BackgroundLayer.js new file mode 100644 index 000000000..2ec168ce5 --- /dev/null +++ b/lib/module/components/BackgroundLayer.js @@ -0,0 +1,25 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXBackgroundLayerNativeComponent from '../specs/RNMBXBackgroundLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const MapboxGL = NativeModules.RNMBXModule; +class BackgroundLayer extends AbstractLayer { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return /*#__PURE__*/React.createElement(RNMBXBackgroundLayerNativeComponent + // @ts-expect-error just codegen stuff + , _extends({ + ref: this.setNativeLayer + }, props)); + } +} +_defineProperty(BackgroundLayer, "defaultProps", { + sourceID: MapboxGL.StyleSource.DefaultSourceID +}); +export default BackgroundLayer; +//# sourceMappingURL=BackgroundLayer.js.map \ No newline at end of file diff --git a/lib/module/components/BackgroundLayer.js.map b/lib/module/components/BackgroundLayer.js.map new file mode 100644 index 000000000..9bb7b5379 --- /dev/null +++ b/lib/module/components/BackgroundLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXBackgroundLayerNativeComponent","AbstractLayer","MapboxGL","RNMBXModule","BackgroundLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/BackgroundLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAO5C,OAAOC,mCAAmC,MAAM,8CAA8C;AAE9F,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,QAAQ,GAAGH,aAAa,CAACI,WAAW;AAiE1C,MAAMC,eAAe,SAASH,aAAa,CAAyB;EAKlEI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD,oBACE,oBAAC;IACC;IAAA;MACA,GAAG,EAAE,IAAI,CAACC;IAAe,GACrBH,KAAK,EACT;EAEN;AACF;AAAC,gBAlBKF,eAAe,kBACG;EACpBM,QAAQ,EAAER,QAAQ,CAACS,WAAW,CAACC;AACjC,CAAC;AAiBH,eAAeR,eAAe"} diff --git a/lib/module/components/Callout.js b/lib/module/components/Callout.js new file mode 100644 index 000000000..862a121dd --- /dev/null +++ b/lib/module/components/Callout.js @@ -0,0 +1,82 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React from 'react'; +import { View, Text, Animated, StyleSheet } from 'react-native'; +import RNMBXCalloutNativeComponent from '../specs/RNMBXCalloutNativeComponent'; +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'center', + width: 180, + zIndex: 9999999 + }, + tip: { + zIndex: 1000, + marginTop: -2, + elevation: 0, + backgroundColor: 'transparent', + borderTopWidth: 16, + borderRightWidth: 8, + borderBottomWidth: 0, + borderLeftWidth: 8, + borderTopColor: 'white', + borderRightColor: 'transparent', + borderBottomColor: 'transparent', + borderLeftColor: 'transparent' + }, + content: { + position: 'relative', + padding: 8, + flex: 1, + borderRadius: 3, + borderWidth: 1, + borderColor: 'rgba(0, 0, 0, 0.2)', + backgroundColor: 'white' + }, + title: { + color: 'black', + textAlign: 'center' + } +}); +/** + * Callout that displays information about a selected annotation near the annotation. + */ +class Callout extends React.PureComponent { + get _containerStyle() { + const style = [{ + position: 'absolute', + zIndex: 999, + backgroundColor: 'transparent' + }]; + if (this.props.containerStyle) { + style.push(this.props.containerStyle); + } + return style; + } + get _hasChildren() { + return React.Children.count(this.props.children) > 0; + } + _renderDefaultCallout() { + return /*#__PURE__*/React.createElement(Animated.View, { + style: [styles.container, this.props.style] + }, /*#__PURE__*/React.createElement(View, { + style: [styles.content, this.props.contentStyle] + }, /*#__PURE__*/React.createElement(Text, { + style: [styles.title, this.props.textStyle] + }, this.props.title)), /*#__PURE__*/React.createElement(View, { + style: [styles.tip, this.props.tipStyle] + })); + } + _renderCustomCallout() { + return /*#__PURE__*/React.createElement(Animated.View, _extends({}, this.props, { + style: this.props.style + }), this.props.children); + } + render() { + const calloutContent = this._hasChildren ? this._renderCustomCallout() : this._renderDefaultCallout(); + return /*#__PURE__*/React.createElement(RNMBXCalloutNativeComponent, { + style: this._containerStyle + }, calloutContent); + } +} +export default Callout; +//# sourceMappingURL=Callout.js.map \ No newline at end of file diff --git a/lib/module/components/Callout.js.map b/lib/module/components/Callout.js.map new file mode 100644 index 000000000..4ba4e57ba --- /dev/null +++ b/lib/module/components/Callout.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","View","Text","Animated","StyleSheet","RNMBXCalloutNativeComponent","styles","create","container","alignItems","justifyContent","width","zIndex","tip","marginTop","elevation","backgroundColor","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","content","position","padding","flex","borderRadius","borderWidth","borderColor","title","color","textAlign","Callout","PureComponent","_containerStyle","style","props","containerStyle","push","_hasChildren","Children","count","children","_renderDefaultCallout","contentStyle","textStyle","tipStyle","_renderCustomCallout","render","calloutContent"],"sourceRoot":"../../../src","sources":["components/Callout.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SACEC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,UAAU,QAGL,cAAc;AAErB,OAAOC,2BAA2B,MAAM,sCAAsC;AAE9E,MAAMC,MAAM,GAAGF,UAAU,CAACG,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHD,MAAM,EAAE,IAAI;IACZE,SAAS,EAAE,CAAC,CAAC;IACbC,SAAS,EAAE,CAAC;IACZC,eAAe,EAAE,aAAa;IAC9BC,cAAc,EAAE,EAAE;IAClBC,gBAAgB,EAAE,CAAC;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AE,CAACzC,MAAM,CAAC0B,KAAK,EAAE,IAAI,CAACO,KAAK,CAACS,SAAS;IAAE,GAC/C,IAAI,CAACT,KAAK,CAACP,KAAK,CACZ,CACF,eACP,oBAAC,IAAI;MAAC,KAAK,EAAE,CAAC1B,MAAM,CAACO,GAAG,EAAE,IAAI,CAAC0B,KAAK,CAACU,QAAQ;IAAE,EAAG,CACpC;EAEpB;EAEAC,oBAAoB,GAAc;IAChC,oBACE,oBAAC,QAAQ,CAAC,IAAI,eAAK,IAAI,CAACX,KAAK;MAAE,KAAK,EAAE,IAAI,CAACA,KAAK,CAACD;IAAM,IACpD,IAAI,CAACC,KAAK,CAACM,QAAQ,CACN;EAEpB;EAEAM,MAAM,GAAG;IACP,MAAMC,cAAc,GAAG,IAAI,CAACV,YAAY,GACpC,IAAI,CAACQ,oBAAoB,EAAE,GAC3B,IAAI,CAACJ,qBAAqB,EAAE;IAChC,oBACE,oBAAC,2BAA2B;MAAC,KAAK,EAAE,IAAI,CAACT;IAAgB,GACtDe,cAAc,CACa;EAElC;AACF;AAEA,eAAejB,OAAO"} diff --git a/lib/module/components/Camera.js b/lib/module/components/Camera.js new file mode 100644 index 000000000..0979d003d --- /dev/null +++ b/lib/module/components/Camera.js @@ -0,0 +1,358 @@ +import React, { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useRef } from 'react'; +import { NativeModules } from 'react-native'; +import { makeLatLngBounds, makePoint } from '../utils/geoUtils'; +import NativeCameraView from '../specs/RNMBXCameraNativeComponent'; +const NativeModule = NativeModules.RNMBXModule; +export let UserTrackingMode; +(function (UserTrackingMode) { + UserTrackingMode["Follow"] = "normal"; + UserTrackingMode["FollowWithHeading"] = "compass"; + UserTrackingMode["FollowWithCourse"] = "course"; +})(UserTrackingMode || (UserTrackingMode = {})); +/** + * Converts the provided React Native animation mode into the corresponding native enum value. + */ +const nativeAnimationMode = mode => { + const NativeCameraModes = NativeModule.CameraModes; + switch (mode) { + case 'flyTo': + return NativeCameraModes.Flight; + case 'easeTo': + return NativeCameraModes.Ease; + case 'linearTo': + return NativeCameraModes.Linear; + case 'moveTo': + return NativeCameraModes.Move; + case 'none': + return NativeCameraModes.None; + default: + return NativeCameraModes.Ease; + } +}; + +// Native module types. + +/** + * Controls the perspective from which the user sees the map. + * + * To use imperative methods, pass in a ref object: + * + * ```tsx + * const camera = useRef(null); + * + * useEffect(() => { + * camera.current?.setCamera({ + * centerCoordinate: [lon, lat], + * }); + * }, []); + * + * return ( + * + * ); + * ``` + */ +export const Camera = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => { + const { + centerCoordinate, + bounds, + heading, + pitch, + zoomLevel, + padding, + animationDuration, + animationMode, + minZoomLevel, + maxZoomLevel, + maxBounds, + followUserLocation, + followUserMode, + followZoomLevel, + followPitch, + followHeading, + followPadding, + defaultSettings, + allowUpdates = true, + onUserTrackingModeChange + } = props; + const nativeCamera = useRef(null); + const buildNativeStop = useCallback(function (stop) { + var _stop$padding, _stop$bounds, _stop$padding2, _stop$bounds2, _stop$padding3, _stop$bounds3, _stop$padding4, _stop$bounds4; + let ignoreFollowUserLocation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + stop = { + ...stop, + type: 'CameraStop' + }; + if (followUserLocation && !ignoreFollowUserLocation) { + return null; + } + const _nativeStop = {}; + if (stop.pitch !== undefined) _nativeStop.pitch = stop.pitch; + if (stop.heading !== undefined) _nativeStop.heading = stop.heading; + if (stop.zoomLevel !== undefined) _nativeStop.zoom = stop.zoomLevel; + if (stop.animationMode !== undefined) _nativeStop.mode = nativeAnimationMode(stop.animationMode); + if (stop.animationDuration !== undefined || animationDuration !== undefined) _nativeStop.duration = stop.animationDuration ?? animationDuration; + if (stop.centerCoordinate) { + _nativeStop.centerCoordinate = JSON.stringify(makePoint(stop.centerCoordinate)); + } + if (stop.bounds && stop.bounds.ne && stop.bounds.sw) { + const { + ne, + sw + } = stop.bounds; + _nativeStop.bounds = JSON.stringify(makeLatLngBounds(ne, sw)); + } + const paddingTop = ((_stop$padding = stop.padding) === null || _stop$padding === void 0 ? void 0 : _stop$padding.paddingTop) ?? ((_stop$bounds = stop.bounds) === null || _stop$bounds === void 0 ? void 0 : _stop$bounds.paddingTop); + if (paddingTop !== undefined) { + _nativeStop.paddingTop = paddingTop; + } + const paddingRight = ((_stop$padding2 = stop.padding) === null || _stop$padding2 === void 0 ? void 0 : _stop$padding2.paddingRight) ?? ((_stop$bounds2 = stop.bounds) === null || _stop$bounds2 === void 0 ? void 0 : _stop$bounds2.paddingRight); + if (paddingRight !== undefined) { + _nativeStop.paddingRight = paddingRight; + } + const paddingBottom = ((_stop$padding3 = stop.padding) === null || _stop$padding3 === void 0 ? void 0 : _stop$padding3.paddingBottom) ?? ((_stop$bounds3 = stop.bounds) === null || _stop$bounds3 === void 0 ? void 0 : _stop$bounds3.paddingBottom); + if (paddingBottom != undefined) { + _nativeStop.paddingBottom = paddingBottom; + } + const paddingLeft = ((_stop$padding4 = stop.padding) === null || _stop$padding4 === void 0 ? void 0 : _stop$padding4.paddingLeft) ?? ((_stop$bounds4 = stop.bounds) === null || _stop$bounds4 === void 0 ? void 0 : _stop$bounds4.paddingLeft); + if (paddingLeft !== undefined) { + _nativeStop.paddingLeft = paddingLeft; + } + return _nativeStop; + }, [animationDuration, followUserLocation]); + + // since codegen uses `payload` name in cpp code for creating payload for event, + // we rename it to `payloadRenamed` to avoid name collision there on new arch + const _onUserTrackingModeChange = useCallback(event => { + if (onUserTrackingModeChange) { + if (!event.nativeEvent.payload) { + // @ts-expect-error see the comment above + event.nativeEvent.payload = event.nativeEvent.payloadRenamed; + } + onUserTrackingModeChange(event); + } + }, [onUserTrackingModeChange]); + const nativeDefaultStop = useMemo(() => { + if (!defaultSettings) { + return null; + } + return buildNativeStop(defaultSettings); + }, [defaultSettings, buildNativeStop]); + const nativeStop = useMemo(() => { + return buildNativeStop({ + type: 'CameraStop', + centerCoordinate, + bounds, + heading, + pitch, + zoomLevel, + padding, + animationDuration, + animationMode + }); + }, [centerCoordinate, bounds, heading, pitch, zoomLevel, padding, animationDuration, animationMode, buildNativeStop]); + const nativeMaxBounds = useMemo(() => { + if (!(maxBounds !== null && maxBounds !== void 0 && maxBounds.ne) || !(maxBounds !== null && maxBounds !== void 0 && maxBounds.sw)) { + return null; + } + return JSON.stringify(makeLatLngBounds(maxBounds.ne, maxBounds.sw)); + }, [maxBounds]); + const setCamera = function (config) { + let ignoreFollowUserLocation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (!allowUpdates) { + return; + } + lastTS += 1; + if (!config.type) + // @ts-expect-error The compiler doesn't understand that the `config` union type is guaranteed + // to be an object type. + config = { + ...config, + // @ts-expect-error Allows JS files to pass in an invalid config (lacking the `type` property), + // which would raise a compilation error in TS files. + type: config.stops ? 'CameraStops' : 'CameraStop' + }; + if (config.type === 'CameraStops') { + for (const _stop of config.stops) { + var _nativeCamera$current; + let _nativeStops = []; + const _nativeStop = buildNativeStop(_stop, ignoreFollowUserLocation); + if (_nativeStop) { + _nativeStops = [..._nativeStops, _nativeStop]; + } + (_nativeCamera$current = nativeCamera.current) === null || _nativeCamera$current === void 0 ? void 0 : _nativeCamera$current.setNativeProps({ + stop: { + stops: _nativeStops, + __updateTS: lastTS + } + }); + } + } else if (config.type === 'CameraStop') { + const _nativeStop = buildNativeStop(config, ignoreFollowUserLocation); + if (_nativeStop) { + var _nativeCamera$current2; + (_nativeCamera$current2 = nativeCamera.current) === null || _nativeCamera$current2 === void 0 ? void 0 : _nativeCamera$current2.setNativeProps({ + stop: { + __updateTS: lastTS, + ..._nativeStop + } + }); + } + } + }; + const fitBounds = function (ne, sw, paddingConfig) { + let _animationDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + let _padding = { + paddingTop: 0, + paddingBottom: 0, + paddingLeft: 0, + paddingRight: 0 + }; + if (typeof paddingConfig === 'object') { + if (paddingConfig.length === 2) { + _padding = { + paddingTop: paddingConfig[0], + paddingBottom: paddingConfig[0], + paddingLeft: paddingConfig[1], + paddingRight: paddingConfig[1] + }; + } else if (paddingConfig.length === 4) { + _padding = { + paddingTop: paddingConfig[0], + paddingBottom: paddingConfig[2], + paddingLeft: paddingConfig[3], + paddingRight: paddingConfig[1] + }; + } + } else if (typeof paddingConfig === 'number') { + _padding = { + paddingTop: paddingConfig, + paddingBottom: paddingConfig, + paddingLeft: paddingConfig, + paddingRight: paddingConfig + }; + } + setCamera({ + type: 'CameraStop', + bounds: { + ne, + sw + }, + padding: _padding, + animationDuration: _animationDuration, + animationMode: 'easeTo' + }); + }; + const flyTo = function (_centerCoordinate) { + let _animationDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000; + setCamera({ + type: 'CameraStop', + centerCoordinate: _centerCoordinate, + animationDuration: _animationDuration + }); + }; + const moveTo = function (_centerCoordinate) { + let _animationDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + setCamera({ + type: 'CameraStop', + centerCoordinate: _centerCoordinate, + animationDuration: _animationDuration, + animationMode: 'easeTo' + }); + }; + const zoomTo = function (_zoomLevel) { + let _animationDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000; + setCamera({ + type: 'CameraStop', + zoomLevel: _zoomLevel, + animationDuration: _animationDuration, + animationMode: 'flyTo' + }); + }; + useImperativeHandle(ref, () => ({ + /** + * Sets any camera properties, with default fallbacks if unspecified. + * + * @example + * camera.current?.setCamera({ + * centerCoordinate: [lon, lat], + * }); + * + * @param {CameraStop | CameraStops} config + * @param {boolean} ignoreFollowUserLocation + */ + setCamera, + /** + * Set the camera position to enclose the provided bounds, with optional + * padding and duration. + * + * @example + * camera.fitBounds([lon, lat], [lon, lat]); + * camera.fitBounds([lon, lat], [lon, lat], [20, 0], 1000); + * + * @param {Position} ne Northeast coordinate of bounding box + * @param {Position} sw Southwest coordinate of bounding box + * @param {number | number[]} paddingConfig The viewport padding, specified as a number (all sides equal), a 2-item array ([vertical, horizontal]), or a 4-item array ([top, right, bottom, left]) + * @param {number} animationDuration The transition duration + */ + fitBounds, + /** + * Sets the camera to center around the provided coordinate using a realistic 'travel' + * animation, with optional duration. + * + * @example + * camera.flyTo([lon, lat]); + * camera.flyTo([lon, lat], 12000); + * + * @param {Position} centerCoordinate The coordinate to center in the view + * @param {number} animationDuration The transition duration + */ + flyTo, + /** + * Sets the camera to center around the provided coordinate, with optional duration. + * + * @example + * camera.moveTo([lon, lat], 200); + * camera.moveTo([lon, lat]); + * + * @param {Position} centerCoordinate The coordinate to center in the view + * @param {number} animationDuration The transition duration + */ + moveTo, + /** + * Zooms the camera to the provided level, with optional duration. + * + * @example + * camera.zoomTo(16); + * camera.zoomTo(16, 100); + * + * @param {number} zoomLevel The target zoom + * @param {number} animationDuration The transition duration + */ + zoomTo + })); + return /*#__PURE__*/React.createElement(RNMBXCamera, { + testID: 'Camera' + // @ts-expect-error just codegen stuff + , + ref: nativeCamera, + stop: nativeStop, + animationDuration: animationDuration, + animationMode: animationMode, + defaultStop: nativeDefaultStop, + followUserLocation: followUserLocation, + followUserMode: followUserMode, + followZoomLevel: followZoomLevel, + followPitch: followPitch, + followHeading: followHeading, + followPadding: followPadding, + minZoomLevel: minZoomLevel, + maxZoomLevel: maxZoomLevel, + maxBounds: nativeMaxBounds + // @ts-expect-error just codegen stuff + , + onUserTrackingModeChange: _onUserTrackingModeChange + }); +})); +let lastTS = 0; +const RNMBXCamera = NativeCameraView; +//# sourceMappingURL=Camera.js.map \ No newline at end of file diff --git a/lib/module/components/Camera.js.map b/lib/module/components/Camera.js.map new file mode 100644 index 000000000..c9499b69e --- /dev/null +++ b/lib/module/components/Camera.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","forwardRef","memo","useCallback","useImperativeHandle","useMemo","useRef","NativeModules","makeLatLngBounds","makePoint","NativeCameraView","NativeModule","RNMBXModule","UserTrackingMode","nativeAnimationMode","mode","NativeCameraModes","CameraModes","Flight","Ease","Linear","Move","None","Camera","props","ref","centerCoordinate","bounds","heading","pitch","zoomLevel","padding","animationDuration","animationMode","minZoomLevel","maxZoomLevel","maxBounds","followUserLocation","followUserMode","followZoomLevel","followPitch","followHeading","followPadding","defaultSettings","allowUpdates","onUserTrackingModeChange","nativeCamera","buildNativeStop","stop","ignoreFollowUserLocation","type","_nativeStop","undefined","zoom","duration","JSON","stringify","ne","sw","paddingTop","paddingRight","paddingBottom","paddingLeft","_onUserTrackingModeChange","event","nativeEvent","payload","payloadRenamed","nativeDefaultStop","nativeStop","nativeMaxBounds","setCamera","config","lastTS","stops","_stop","_nativeStops","current","setNativeProps","__updateTS","fitBounds","paddingConfig","_animationDuration","_padding","length","flyTo","_centerCoordinate","moveTo","zoomTo","_zoomLevel","RNMBXCamera"],"sourceRoot":"../../../src","sources":["components/Camera.tsx"],"mappings":"AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AACd,SAASC,aAAa,QAAQ,cAAc;AAI5C,SAASC,gBAAgB,EAAEC,SAAS,QAAQ,mBAAmB;AAE/D,OAAOC,gBAAgB,MAAM,qCAAqC;AAElE,MAAMC,YAAY,GAAGJ,aAAa,CAACK,WAAW;AAE9C,WAAYC,gBAAgB;AAI3B,WAJWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAgB5B;AACA;AACA;AACA,MAAMC,mBAAmB,GACvBC,IAA0B,IACF;EACxB,MAAMC,iBAAiB,GAAGL,YAAY,CAACM,WAAW;EAElD,QAAQF,IAAI;IACV,KAAK,OAAO;MACV,OAAOC,iBAAiB,CAACE,MAAM;IACjC,KAAK,QAAQ;MACX,OAAOF,iBAAiB,CAACG,IAAI;IAC/B,KAAK,UAAU;MACb,OAAOH,iBAAiB,CAACI,MAAM;IACjC,KAAK,QAAQ;MACX,OAAOJ,iBAAiB,CAACK,IAAI;IAC/B,KAAK,MAAM;MACT,OAAOL,iBA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A;AACA;IACQK,KAAK;IACL;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQE,MAAM;IACN;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQC;EACF,CAAC,CAAC,CAAC;EAEH,oBACE,oBAAC,WAAW;IACV,MAAM,EAAE;IACR;IAAA;IACA,GAAG,EAAE1C,YAAa;IAClB,IAAI,EAAEuB,UAAW;IACjB,iBAAiB,EAAErC,iBAAkB;IACrC,aAAa,EAAEC,aAAc;IAC7B,WAAW,EAAEmC,iBAAkB;IAC/B,kBAAkB,EAAE/B,kBAAmB;IACvC,cAAc,EAAEC,cAAe;IAC/B,eAAe,EAAEC,eAAgB;IACjC,WAAW,EAAEC,WAAY;IACzB,aAAa,EAAEC,aAAc;IAC7B,aAAa,EAAEC,aAAc;IAC7B,YAAY,EAAER,YAAa;IAC3B,YAAY,EAAEC,YAAa;IAC3B,SAAS,EAAEmC;IACX;IAAA;IACA,wBAAwB,EAAEP;EAA0B,EACpD;AAEN,CAAC,CACF,CACF;AAED,IAAIU,MAAM,GAAG,CAAC;AAEd,MAAMiB,WAAW,GAAGhF,gBAAgB"} diff --git a/lib/module/components/CircleLayer.js b/lib/module/components/CircleLayer.js new file mode 100644 index 000000000..e068525ab --- /dev/null +++ b/lib/module/components/CircleLayer.js @@ -0,0 +1,34 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXCircleLayerNativeComponent from '../specs/RNMBXCircleLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * CircleLayer is a style layer that renders one or more filled circles on the map. + */ +class CircleLayer extends AbstractLayer { + render() { + const props = { + ...this.props, + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXCircleLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(CircleLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default CircleLayer; +//# sourceMappingURL=CircleLayer.js.map \ No newline at end of file diff --git a/lib/module/components/CircleLayer.js.map b/lib/module/components/CircleLayer.js.map new file mode 100644 index 000000000..9afbc3cfa --- /dev/null +++ b/lib/module/components/CircleLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXCircleLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","CircleLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/CircleLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAI5C,OAAOC,+BAA+B,MAAM,0CAA0C;AAEtF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,WAAW,SAASH,aAAa,CAAyB;EAK9DI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACb,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,oBAAC,+BAA+B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE5E;AACF;AAAC,gBAhBKF,WAAW,kBACO;EACpBM,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAeH,eAAeR,WAAW"} diff --git a/lib/module/components/CustomLocationProvider.js b/lib/module/components/CustomLocationProvider.js new file mode 100644 index 000000000..b34d9a1fd --- /dev/null +++ b/lib/module/components/CustomLocationProvider.js @@ -0,0 +1,7 @@ +import React, { memo } from 'react'; +import RNMBXCustomLocationProvider from '../specs/RNMBXCustomLocationProviderNativeComponent'; +const CustomLocationProvider = /*#__PURE__*/memo(props => { + return /*#__PURE__*/React.createElement(RNMBXCustomLocationProvider, props); +}); +export default CustomLocationProvider; +//# sourceMappingURL=CustomLocationProvider.js.map \ No newline at end of file diff --git a/lib/module/components/CustomLocationProvider.js.map b/lib/module/components/CustomLocationProvider.js.map new file mode 100644 index 000000000..2632b7588 --- /dev/null +++ b/lib/module/components/CustomLocationProvider.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","memo","RNMBXCustomLocationProvider","CustomLocationProvider","props"],"sourceRoot":"../../../src","sources":["components/CustomLocationProvider.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAEnC,OAAOC,2BAA2B,MAAM,qDAAqD;AAe7F,MAAMC,sBAAsB,gBAAGF,IAAI,CAAEG,KAAY,IAAK;EACpD,oBAAO,oBAAC,2BAA2B,EAAKA,KAAK,CAAI;AACnD,CAAC,CAAC;AAEF,eAAeD,sBAAsB"} diff --git a/lib/module/components/FillExtrusionLayer.js b/lib/module/components/FillExtrusionLayer.js new file mode 100644 index 000000000..c2c6d8116 --- /dev/null +++ b/lib/module/components/FillExtrusionLayer.js @@ -0,0 +1,29 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXFillExtrusionLayerNativeComponent from '../specs/RNMBXFillExtrusionLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const MapboxGL = NativeModules.RNMBXModule; +/** + * FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map. + */ +class FillExtrusionLayer extends AbstractLayer { + render() { + const props = { + ...this.props, + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return /*#__PURE__*/React.createElement(RNMBXFillExtrusionLayerNativeComponent + // @ts-expect-error just codegen stuff + , _extends({ + ref: this.setNativeLayer + }, props)); + } +} +_defineProperty(FillExtrusionLayer, "defaultProps", { + sourceID: MapboxGL.StyleSource.DefaultSourceID +}); +export default FillExtrusionLayer; +//# sourceMappingURL=FillExtrusionLayer.js.map \ No newline at end of file diff --git a/lib/module/components/FillExtrusionLayer.js.map b/lib/module/components/FillExtrusionLayer.js.map new file mode 100644 index 000000000..08866e940 --- /dev/null +++ b/lib/module/components/FillExtrusionLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXFillExtrusionLayerNativeComponent","AbstractLayer","MapboxGL","RNMBXModule","FillExtrusionLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/FillExtrusionLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAO5C,OAAOC,sCAAsC,MAAM,iDAAiD;AAEpG,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,QAAQ,GAAGH,aAAa,CAACI,WAAW;AAiE1C;AACA;AACA;AACA,MAAMC,kBAAkB,SAASH,aAAa,CAAyB;EAKrEI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACb,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD,oBACE,oBAAC;IACC;IAAA;MACA,GAAG,EAAE,IAAI,CAACC;IAAe,GACrBH,KAAK,EACT;EAEN;AACF;AAAC,gBAnBKF,kBAAkB,kBACA;EACpBM,QAAQ,EAAER,QAAQ,CAACS,WAAW,CAACC;AACjC,CAAC;AAkBH,eAAeR,kBAAkB"} diff --git a/lib/module/components/FillLayer.js b/lib/module/components/FillLayer.js new file mode 100644 index 000000000..45b8bb525 --- /dev/null +++ b/lib/module/components/FillLayer.js @@ -0,0 +1,33 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXFillLayerNativeComponent from '../specs/RNMBXFillLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map. + */ +class FillLayer extends AbstractLayer { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXFillLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(FillLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default FillLayer; +//# sourceMappingURL=FillLayer.js.map \ No newline at end of file diff --git a/lib/module/components/FillLayer.js.map b/lib/module/components/FillLayer.js.map new file mode 100644 index 000000000..2cdcded42 --- /dev/null +++ b/lib/module/components/FillLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXFillLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","FillLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/FillLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAI5C,OAAOC,6BAA6B,MAAM,wCAAwC;AAElF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,SAAS,SAASH,aAAa,CAAyB;EAK5DI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,oBAAC,6BAA6B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE1E;AACF;AAAC,gBAfKF,SAAS,kBACS;EACpBM,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAcH,eAAeR,SAAS"} diff --git a/lib/module/components/HeadingIndicator.js b/lib/module/components/HeadingIndicator.js new file mode 100644 index 000000000..0242488dd --- /dev/null +++ b/lib/module/components/HeadingIndicator.js @@ -0,0 +1,34 @@ +import React from 'react'; +import headingIcon from '../assets/heading.png'; +import { SymbolLayer } from './SymbolLayer'; +import Images from './Images'; +const style = { + iconImage: 'userLocationHeading', + iconAllowOverlap: true, + iconPitchAlignment: 'map', + iconRotationAlignment: 'map' +}; +const HeadingIndicator = _ref => { + let { + heading + } = _ref; + return /*#__PURE__*/React.createElement(React.Fragment, { + key: "mapboxUserLocationHeadingIndicatorWrapper" + }, /*#__PURE__*/React.createElement(Images, { + images: { + userLocationHeading: headingIcon + }, + key: "mapboxUserLocationHeadingImages" + }), /*#__PURE__*/React.createElement(SymbolLayer, { + key: "mapboxUserLocationHeadingIndicator", + id: "mapboxUserLocationHeadingIndicator", + sourceID: "mapboxUserLocation", + belowLayerID: "mapboxUserLocationWhiteCircle", + style: { + iconRotate: heading, + ...style + } + })); +}; +export default HeadingIndicator; +//# sourceMappingURL=HeadingIndicator.js.map \ No newline at end of file diff --git a/lib/module/components/HeadingIndicator.js.map b/lib/module/components/HeadingIndicator.js.map new file mode 100644 index 000000000..e7ec009b6 --- /dev/null +++ b/lib/module/components/HeadingIndicator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","headingIcon","SymbolLayer","Images","style","iconImage","iconAllowOverlap","iconPitchAlignment","iconRotationAlignment","HeadingIndicator","heading","userLocationHeading","iconRotate"],"sourceRoot":"../../../src","sources":["components/HeadingIndicator.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,uBAAuB;AAG/C,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOC,MAAM,MAAM,UAAU;AAE7B,MAAMC,KAAK,GAAG;EACZC,SAAS,EAAE,qBAAqB;EAChCC,gBAAgB,EAAE,IAAI;EACtBC,kBAAkB,EAAE,KAAK;EACzBC,qBAAqB,EAAE;AACzB,CAAU;AAMV,MAAMC,gBAAgB,GAAG,QAAwB;EAAA,IAAvB;IAAEC;EAAe,CAAC;EAC1C,oBACE,oBAAC,KAAK,CAAC,QAAQ;IAAC,GAAG,EAAC;EAA2C,gBAC7D,oBAAC,MAAM;IACL,MAAM,EAAE;MAAEC,mBAAmB,EAAEV;IAAY,CAAE;IAC7C,GAAG,EAAC;EAAiC,EACrC,eACF,oBAAC,WAAW;IACV,GAAG,EAAC,oCAAoC;IACxC,EAAE,EAAC,oCAAoC;IACvC,QAAQ,EAAC,oBAAoB;IAC7B,YAAY,EAAC,+BAA+B;IAC5C,KAAK,EAAE;MACLW,UAAU,EAAEF,OAAO;MACnB,GAAGN;IACL;EAAE,EACF,CACa;AAErB,CAAC;AAED,eAAeK,gBAAgB"} diff --git a/lib/module/components/HeatmapLayer.js b/lib/module/components/HeatmapLayer.js new file mode 100644 index 000000000..03dfcd8ca --- /dev/null +++ b/lib/module/components/HeatmapLayer.js @@ -0,0 +1,34 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXHeatmapLayerNativeComponent from '../specs/RNMBXHeatmapLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * HeatmapLayer is a style layer that renders one or more filled circles on the map. + */ +class HeatmapLayer extends AbstractLayer { + render() { + const props = { + ...this.props, + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXHeatmapLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(HeatmapLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default HeatmapLayer; +//# sourceMappingURL=HeatmapLayer.js.map \ No newline at end of file diff --git a/lib/module/components/HeatmapLayer.js.map b/lib/module/components/HeatmapLayer.js.map new file mode 100644 index 000000000..060ec955b --- /dev/null +++ b/lib/module/components/HeatmapLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXHeatmapLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","HeatmapLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/HeatmapLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAO5C,OAAOC,gCAAgC,MAAM,2CAA2C;AAExF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,YAAY,SAASH,aAAa,CAAyB;EAK/DI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACb,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,oBAAC,gCAAgC;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE7E;AACF;AAAC,gBAhBKF,YAAY,kBACM;EACpBM,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAeH,eAAeR,YAAY"} diff --git a/lib/module/components/Image.js b/lib/module/components/Image.js new file mode 100644 index 000000000..b1d8d9bc4 --- /dev/null +++ b/lib/module/components/Image.js @@ -0,0 +1,39 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React, { memo, forwardRef } from 'react'; +import { findNodeHandle } from 'react-native'; +import RNMBXImageNativeComponent from '../specs/RNMBXImageNativeComponent'; +import NativeRNMBXImageModule from '../specs/NativeRNMBXImageModule'; +const Image = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Image(_ref, ref) { + let { + name, + sdf, + stretchX, + stretchY, + children + } = _ref; + const nativeProps = { + name, + sdf, + stretchX, + stretchY, + children + }; + const imageRef = React.useRef(null); + const refresh = () => { + const handle = findNodeHandle(imageRef.current); + NativeRNMBXImageModule.refresh(handle); + }; + React.useImperativeHandle(ref, () => { + return { + refresh + }; + }); + + // @ts-expect-error just codegen stuff + return /*#__PURE__*/React.createElement(RNMBXImageNativeComponent, _extends({}, nativeProps, { + ref: imageRef + })); +})); +Image.displayName = 'Image'; +export default Image; +//# sourceMappingURL=Image.js.map \ No newline at end of file diff --git a/lib/module/components/Image.js.map b/lib/module/components/Image.js.map new file mode 100644 index 000000000..da9745f44 --- /dev/null +++ b/lib/module/components/Image.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","memo","forwardRef","findNodeHandle","RNMBXImageNativeComponent","NativeRNMBXImageModule","Image","ref","name","sdf","stretchX","stretchY","children","nativeProps","imageRef","useRef","refresh","handle","current","useImperativeHandle","displayName"],"sourceRoot":"../../../src","sources":["components/Image.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,UAAU,QAAsB,OAAO;AAC7D,SAASC,cAAc,QAAQ,cAAc;AAE7C,OAAOC,yBAAyB,MAAM,oCAAoC;AAC1E,OAAOC,sBAAsB,MAAM,iCAAiC;AA+BpE,MAAMC,KAAK,gBAAGL,IAAI,eAChBC,UAAU,CAAa,SAASI,KAAK,OAEnCC,GAA4B,EAC5B;EAAA,IAFA;IAAEC,IAAI;IAAEC,GAAG;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC;EAAgB,CAAC;EAGlD,MAAMC,WAAW,GAAG;IAClBL,IAAI;IACJC,GAAG;IACHC,QAAQ;IACRC,QAAQ;IACRC;EACF,CAAC;EAED,MAAME,QAAQ,GAAGd,KAAK,CAACe,MAAM,CAAC,IAAI,CAAC;EAEnC,MAAMC,OAAO,GAAG,MAAM;IACpB,MAAMC,MAAM,GAAGd,cAAc,CAACW,QAAQ,CAACI,OAAO,CAAQ;IACtDb,sBAAsB,CAACW,OAAO,CAACC,MAAM,CAAC;EACxC,CAAC;EAEDjB,KAAK,CAACmB,mBAAmB,CAACZ,GAAG,EAAE,MAAM;IACnC,OAAO;MAAES;IAAQ,CAAC;EACpB,CAAC,CAAC;;EAEF;EACA,oBAAO,oBAAC,yBAAyB,eAAKH,WAAW;IAAE,GAAG,EAAEC;EAAS,GAAG;AACtE,CAAC,CAAC,CACH;AAEDR,KAAK,CAACc,WAAW,GAAG,OAAO;AAE3B,eAAed,KAAK"} diff --git a/lib/module/components/ImageSource.js b/lib/module/components/ImageSource.js new file mode 100644 index 000000000..72c76715e --- /dev/null +++ b/lib/module/components/ImageSource.js @@ -0,0 +1,42 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React from 'react'; +import { cloneReactChildrenWithProps, isNumber, resolveImagePath } from '../utils'; +import RNMBXImageSourceNativeComponent from '../specs/RNMBXImageSourceNativeComponent'; +import AbstractSource from './AbstractSource'; +export const NATIVE_MODULE_NAME = 'RNMBXImageSource'; +/** + * ImageSource is a content source that is used for a georeferenced raster image to be shown on the map. + * The georeferenced image scales and rotates as the user zooms and rotates the map + */ +class ImageSource extends AbstractSource { + _getURL() { + const { + url + } = this.props; + if (isNumber(url)) { + return resolveImagePath(url); + } else { + return url; + } + } + render() { + if (!this.props.url || !this.props.coordinates || !this.props.coordinates.length) { + return null; + } + const props = { + ...this.props, + url: this._getURL() + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXImageSourceNativeComponent, _extends({ + ref: this.setNativeRef + }, props), cloneReactChildrenWithProps(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +export default ImageSource; +//# sourceMappingURL=ImageSource.js.map \ No newline at end of file diff --git a/lib/module/components/ImageSource.js.map b/lib/module/components/ImageSource.js.map new file mode 100644 index 000000000..e86b7d6b7 --- /dev/null +++ b/lib/module/components/ImageSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","cloneReactChildrenWithProps","isNumber","resolveImagePath","RNMBXImageSourceNativeComponent","AbstractSource","NATIVE_MODULE_NAME","ImageSource","_getURL","url","props","render","coordinates","length","setNativeRef","children","sourceID","id"],"sourceRoot":"../../../src","sources":["components/ImageSource.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SACEC,2BAA2B,EAC3BC,QAAQ,EACRC,gBAAgB,QACX,UAAU;AAEjB,OAAOC,+BAA+B,MAAM,0CAA0C;AAEtF,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,OAAO,MAAMC,kBAAkB,GAAG,kBAAkB;AA+BpD;AACA;AACA;AACA;AACA,MAAMC,WAAW,SAASF,cAAc,CAAqB;EAC3DG,OAAO,GAAuB;IAC5B,MAAM;MAAEC;IAAI,CAAC,GAAG,IAAI,CAACC,KAAK;IAE1B,IAAIR,QAAQ,CAACO,GAAG,CAAC,EAAE;MACjB,OAAON,gBAAgB,CAACM,GAAG,CAAC;IAC9B,CAAC,MAAM;MACL,OAAOA,GAAG;IACZ;EACF;EAEAE,MAAM,GAAG;IACP,IACE,CAAC,IAAI,CAACD,KAAK,CAACD,GAAG,IACf,CAAC,IAAI,CAACC,KAAK,CAACE,WAAW,IACvB,CAAC,IAAI,CAACF,KAAK,CAACE,WAAW,CAACC,MAAM,EAC9B;MACA,OAAO,IAAI;IACb;IAEA,MAAMH,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACbD,GAAG,EAAE,IAAI,CAACD,OAAO;IACnB,CAAC;IAED;MAAA;MACE;MACA,oBAAC,+BAA+B;QAAC,GAAG,EAAE,IAAI,CAACM;MAAa,GAAKJ,KAAK,GAC/DT,2BAA2B,CAAC,IAAI,CAACS,KAAK,CAACK,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAACN,KAAK,CAACO;MACvB,CAAC,CAAC;IAC8B;EAEtC;AACF;AAEA,eAAeV,WAAW"} diff --git a/lib/module/components/Images.js b/lib/module/components/Images.js new file mode 100644 index 000000000..0b045dd00 --- /dev/null +++ b/lib/module/components/Images.js @@ -0,0 +1,93 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { Image as RNImage } from 'react-native'; +import RNMBXImagesNativeComponent from '../specs/RNMBXImagesNativeComponent'; +import { ShapeSource } from './ShapeSource'; +import Image from './Image'; +export const NATIVE_MODULE_NAME = 'RNMBXImages'; +function _isUrlOrPath(value) { + return (typeof value === 'string' || value instanceof String) && (value.startsWith('file://') || value.startsWith('http://') || value.startsWith('https://') || value.startsWith('data:') || value.startsWith('asset://') || value.startsWith('/')); +} +function isImageSourcePropType(value) { + if (typeof value === 'number' || value instanceof Number) { + return true; + } + const valueAsSource = value; + return !!valueAsSource.uri && typeof valueAsSource.uri === 'string'; +} +const isChildAnImage = child => { + return /*#__PURE__*/React.isValidElement(child) && child.type === Image; +}; +/** + * Images defines the images used in Symbol etc. layers. + */ +class Images extends React.PureComponent { + _getImages() { + if (!this.props.images && !this.props.nativeAssetImages) { + return {}; + } + const images = {}; + let nativeImages = []; + if (this.props.images) { + const imageNames = Object.keys(this.props.images); + for (const imageName of imageNames) { + const value = this.props.images[imageName]; + if (imageName === ShapeSource.NATIVE_ASSETS_KEY && Array.isArray(value)) { + console.error(`Use of ${ShapeSource.NATIVE_ASSETS_KEY} in Images#images is not supported use Images#nativeAssetImages`); + } else if (_isUrlOrPath(value)) { + images[imageName] = value; + } else if (isImageSourcePropType(value)) { + const res = RNImage.resolveAssetSource(value); + if (res && res.uri) { + images[imageName] = res; + } + } else { + let imageEntry = value; + if (imageEntry.image) { + imageEntry = { + ...imageEntry, + resolvedImage: RNImage.resolveAssetSource(imageEntry.image) + }; + } + images[imageName] = imageEntry; + } + } + } + const { + children + } = this.props; + if (children) { + const childrenWithWrongType = React.Children.toArray(children).find(child => !isChildAnImage(child)); + if (childrenWithWrongType) { + console.error(`Images component on accepts Image a children passed in: ${childrenWithWrongType.type || 'n/a'}`); + } + } + if (this.props.nativeAssetImages) { + nativeImages = this.props.nativeAssetImages; + } + return { + images, + nativeImages + }; + } + _onImageMissing(event) { + if (this.props.onImageMissing) { + this.props.onImageMissing(event.nativeEvent.payload.imageKey); + } + } + render() { + const props = { + hasOnImageMissing: !!this.props.onImageMissing, + onImageMissing: this._onImageMissing.bind(this), + ...this._getImages() + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXImagesNativeComponent, props, this.props.children) + ); + } +} +_defineProperty(Images, "NATIVE_ASSETS_KEY", 'assets'); +export default Images; +//# sourceMappingURL=Images.js.map \ No newline at end of file diff --git a/lib/module/components/Images.js.map b/lib/module/components/Images.js.map new file mode 100644 index 000000000..d7a3734ed --- /dev/null +++ b/lib/module/components/Images.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","Image","RNImage","RNMBXImagesNativeComponent","ShapeSource","NATIVE_MODULE_NAME","_isUrlOrPath","value","String","startsWith","isImageSourcePropType","Number","valueAsSource","uri","isChildAnImage","child","isValidElement","type","Images","PureComponent","_getImages","props","images","nativeAssetImages","nativeImages","imageNames","Object","keys","imageName","NATIVE_ASSETS_KEY","Array","isArray","console","error","res","resolveAssetSource","imageEntry","image","resolvedImage","children","childrenWithWrongType","Children","toArray","find","_onImageMissing","event","onImageMissing","nativeEvent","payload","imageKey","render","hasOnImageMissing","bind"],"sourceRoot":"../../../src","sources":["components/Images.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAmC,OAAO;AACtD,SAASC,KAAK,IAAIC,OAAO,QAAwB,cAAc;AAG/D,OAAOC,0BAA0B,MAAM,qCAAqC;AAE5E,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOH,KAAK,MAAM,SAAS;AAE3B,OAAO,MAAMI,kBAAkB,GAAG,aAAa;AAO/C,SAASC,YAAY,CAACC,KAAiB,EAAmB;EACxD,OACE,CAAC,OAAOA,KAAK,KAAK,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AAY,GAAG,IAAI,CAACH,KAAK,CAACE,iBAAiB;IAC7C;IAEA,OAAO;MACLD,MAAM;MACNE;IACF,CAAC;EACH;EAEAoB,eAAe,CAACC,KAA+C,EAAE;IAC/D,IAAI,IAAI,CAACxB,KAAK,CAACyB,cAAc,EAAE;MAC7B,IAAI,CAACzB,KAAK,CAACyB,cAAc,CAACD,KAAK,CAACE,WAAW,CAACC,OAAO,CAACC,QAAQ,CAAC;IAC/D;EACF;EAEAC,MAAM,GAAG;IACP,MAAM7B,KAAK,GAAG;MACZ8B,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC9B,KAAK,CAACyB,cAAc;MAC9CA,cAAc,EAAE,IAAI,CAACF,eAAe,CAACQ,IAAI,CAAC,IAAI,CAAC;MAC/C,GAAG,IAAI,CAAChC,UAAU;IACpB,CAAC;IAED;MAAA;MACE;MACA,oBAAC,0BAA0B,EAAKC,KAAK,EAClC,IAAI,CAACA,KAAK,CAACkB,QAAQ;IACO;EAEjC;AACF;AAAC,gBAxFKrB,MAAM,uBACiB,QAAQ;AAyFrC,eAAeA,MAAM"} diff --git a/lib/module/components/Light.js b/lib/module/components/Light.js new file mode 100644 index 000000000..fbac829d9 --- /dev/null +++ b/lib/module/components/Light.js @@ -0,0 +1,38 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React, { forwardRef, memo, useImperativeHandle, useRef } from 'react'; +import RNMBXLightNativeComponent from '../specs/RNMBXLightNativeComponent'; +import { transformStyle } from '../utils/StyleValue'; +import nativeRef from '../utils/nativeRef'; +/** + * Light represents the light source for extruded geometries + */ +function Light(props, ref) { + const { + style, + ...propWithoutStyle + } = props; + const nativeLightRef = nativeRef(useRef(null)); + useImperativeHandle(ref, () => ({ + setNativeProps(_props) { + var _nativeLightRef$curre; + let propsToPass = _props; + if (_props.style) { + propsToPass = { + ..._props, + reactStyle: transformStyle(_props.style) + }; + } + (_nativeLightRef$curre = nativeLightRef.current) === null || _nativeLightRef$curre === void 0 ? void 0 : _nativeLightRef$curre.setNativeProps(propsToPass); + } + })); + return /*#__PURE__*/React.createElement(RNMBXLightNativeComponent + // @ts-expect-error just codegen stuff + , _extends({ + ref: nativeLightRef, + testID: "RNMBXLight" + }, propWithoutStyle, { + reactStyle: transformStyle(style) + })); +} +export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(Light)); +//# sourceMappingURL=Light.js.map \ No newline at end of file diff --git a/lib/module/components/Light.js.map b/lib/module/components/Light.js.map new file mode 100644 index 000000000..ec892d297 --- /dev/null +++ b/lib/module/components/Light.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","forwardRef","memo","useImperativeHandle","useRef","RNMBXLightNativeComponent","transformStyle","nativeRef","Light","props","ref","style","propWithoutStyle","nativeLightRef","setNativeProps","_props","propsToPass","reactStyle","current"],"sourceRoot":"../../../src","sources":["components/Light.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAE5E,OAAOC,yBAAyB,MAAM,oCAAoC;AAG1E,SAASC,cAAc,QAAQ,qBAAqB;AACpD,OAAOC,SAAS,MAAM,oBAAoB;AAa1C;AACA;AACA;AACA,SAASC,KAAK,CAACC,KAAY,EAAEC,GAAqC,EAAE;EAClE,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAiB,CAAC,GAAGH,KAAK;EAE5C,MAAMI,cAAc,GAAGN,SAAS,CAACH,MAAM,CAAC,IAAI,CAAC,CAAC;EAE9CD,mBAAmB,CAACO,GAAG,EAAE,OAAO;IAC9BI,cAAc,CAACC,MAAkC,EAAE;MAAA;MACjD,IAAIC,WAAW,GAAGD,MAAM;MACxB,IAAIA,MAAM,CAACJ,KAAK,EAAE;QAChBK,WAAW,GAAG;UACZ,GAAGD,MAAM;UACTE,UAAU,EAAEX,cAAc,CAACS,MAAM,CAACJ,KAAK;QACzC,CAAC;MACH;MACA,yBAAAE,cAAc,CAACK,OAAO,0DAAtB,sBAAwBJ,cAAc,CAACE,WAAW,CAAC;IACrD;EACF,CAAC,CAAC,CAAC;EAEH,oBACE,oBAAC;EACC;EAAA;IACA,GAAG,EAAEH,cAAe;IACpB,MAAM,EAAC;EAAY,GACfD,gBAAgB;IACpB,UAAU,EAAEN,cAAc,CAACK,KAAK;EAAE,GAClC;AAEN;AAEA,4BAAeT,IAAI,eAACD,UAAU,CAACO,KAAK,CAAC,CAAC"} diff --git a/lib/module/components/LineLayer.js b/lib/module/components/LineLayer.js new file mode 100644 index 000000000..a9947725a --- /dev/null +++ b/lib/module/components/LineLayer.js @@ -0,0 +1,33 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXLineLayerNativeComponent from '../specs/RNMBXLineLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * LineLayer is a style layer that renders one or more stroked polylines on the map. + */ +class LineLayer extends AbstractLayer { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXLineLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(LineLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default LineLayer; +//# sourceMappingURL=LineLayer.js.map \ No newline at end of file diff --git a/lib/module/components/LineLayer.js.map b/lib/module/components/LineLayer.js.map new file mode 100644 index 000000000..5e2c10a57 --- /dev/null +++ b/lib/module/components/LineLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXLineLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","LineLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/LineLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAI5C,OAAOC,6BAA6B,MAAM,wCAAwC;AAElF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,SAAS,SAASH,aAAa,CAAyB;EAK5DI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,oBAAC,6BAA6B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE1E;AACF;AAAC,gBAfKF,SAAS,kBACS;EACpBM,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAcH,eAAeR,SAAS"} diff --git a/lib/module/components/LocationPuck.js b/lib/module/components/LocationPuck.js new file mode 100644 index 000000000..45fc8265f --- /dev/null +++ b/lib/module/components/LocationPuck.js @@ -0,0 +1,57 @@ +import React, { memo } from 'react'; +import { processColor } from 'react-native'; +import RNMBXNativeUserLocation from '../specs/RNMBXNativeUserLocationNativeComponent'; +const defaultProps = { + visible: true +}; + +/** + * Renders a puck on the map that shows the device's current location. + */ +const LocationPuck = /*#__PURE__*/memo(props => { + const { + iosShowsUserHeadingIndicator, + pulsing, + ...rest + } = props; + const nativePulsing = pulsing ? _pulsingToNative(pulsing) : undefined; + let baseProps = { + ...defaultProps, + pulsing: nativePulsing + }; + if (iosShowsUserHeadingIndicator) { + console.warn('LocationPuck: iosShowsUserHeadingIndicator is deprecated, use puckBearingEnabled={true} puckBearing="heading" instead'); + baseProps = { + ...baseProps, + puckBearingEnabled: true, + puckBearing: 'heading' + }; + } + const actualProps = { + ...baseProps, + ...rest + }; + return /*#__PURE__*/React.createElement(RNMBXNativeUserLocation, actualProps); +}); +function _pulsingToNative(pulsing) { + if (pulsing === 'default') { + return { + kind: 'default' + }; + } + if (pulsing == null) { + return undefined; + } + const { + color, + isEnabled, + radius + } = pulsing; + return { + color: processColor(color), + isEnabled, + radius + }; +} +export default LocationPuck; +//# sourceMappingURL=LocationPuck.js.map \ No newline at end of file diff --git a/lib/module/components/LocationPuck.js.map b/lib/module/components/LocationPuck.js.map new file mode 100644 index 000000000..64716bc7e --- /dev/null +++ b/lib/module/components/LocationPuck.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","memo","processColor","RNMBXNativeUserLocation","defaultProps","visible","LocationPuck","props","iosShowsUserHeadingIndicator","pulsing","rest","nativePulsing","_pulsingToNative","undefined","baseProps","console","warn","puckBearingEnabled","puckBearing","actualProps","kind","color","isEnabled","radius"],"sourceRoot":"../../../src","sources":["components/LocationPuck.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,YAAY,QAAyB,cAAc;AAE5D,OAAOC,uBAAuB,MAEvB,iDAAiD;AA8FxD,MAAMC,YAAY,GAAG;EACnBC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA,MAAMC,YAAY,gBAAGL,IAAI,CAAEM,KAAY,IAAK;EAC1C,MAAM;IAAEC,4BAA4B;IAAEC,OAAO;IAAE,GAAGC;EAAK,CAAC,GAAGH,KAAK;EAChE,MAAMI,aAAa,GAAGF,OAAO,GAAGG,gBAAgB,CAACH,OAAO,CAAC,GAAGI,SAAS;EACrE,IAAIC,SAAsB,GAAG;IAAE,GAAGV,YAAY;IAAEK,OAAO,EAAEE;EAAc,CAAC;EACxE,IAAIH,4BAA4B,EAAE;IAChCO,OAAO,CAACC,IAAI,CACV,uHAAuH,CACxH;IAEDF,SAAS,GAAG;MACV,GAAGA,SAAS;MACZG,kBAAkB,EAAE,IAAI;MACxBC,WAAW,EAAE;IACf,CAAC;EACH;EACA,MAAMC,WAAW,GAAG;IAAE,GAAGL,SAAS;IAAE,GAAGJ;EAAK,CAAC;EAC7C,oBAAO,oBAAC,uBAAuB,EAAKS,WAAW,CAAI;AACrD,CAAC,CAAC;AAEF,SAASP,gBAAgB,CACvBH,OAAyB,EACW;EACpC,IAAIA,OAAO,KAAK,SAAS,EAAE;IACzB,OAAO;MAAEW,IAAI,EAAE;IAAU,CAAC;EAC5B;EACA,IAAIX,OAAO,IAAI,IAAI,EAAE;IACnB,OAAOI,SAAS;EAClB;EACA,MAAM;IAAEQ,KAAK;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGd,OAAO;EAC5C,OAAO;IACLY,KAAK,EAAEnB,YAAY,CAACmB,KAAK,CAAC;IAC1BC,SAAS;IACTC;EACF,CAAC;AACH;AAEA,eAAejB,YAAY"} diff --git a/lib/module/components/MapView.js b/lib/module/components/MapView.js new file mode 100644 index 000000000..398c892ed --- /dev/null +++ b/lib/module/components/MapView.js @@ -0,0 +1,574 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { View, StyleSheet, NativeModules } from 'react-native'; +import { debounce } from 'debounce'; +import NativeMapView from '../specs/RNMBXMapViewNativeComponent'; +import NativeMapViewModule from '../specs/NativeMapViewModule'; +import { isFunction, isAndroid } from '../utils'; +import { getFilter } from '../utils/filterUtils'; +import Logger from '../utils/Logger'; +import NativeBridgeComponent from './NativeBridgeComponent'; +const { + RNMBXModule +} = NativeModules; +const { + EventTypes +} = RNMBXModule; +if (RNMBXModule == null) { + console.error('Native part of Mapbox React Native libraries were not registered properly, double check our native installation guides.'); +} +if (!RNMBXModule.MapboxV10) { + console.warn('@rnmapbox/maps: Non v10 implementations are deprecated and will be removed in next version - see https://github.com/rnmapbox/maps/wiki/Deprecated-RNMapboxImpl-Maplibre'); +} +const styles = StyleSheet.create({ + matchParent: { + flex: 1 + } +}); +const defaultStyleURL = RNMBXModule.StyleURL.Street; +/** + * MapView backed by Mapbox Native GL + */ +class MapView extends NativeBridgeComponent(React.PureComponent, NativeMapViewModule) { + constructor(props) { + super(props); + _defineProperty(this, "deprecationLogged", { + contentInset: false, + regionDidChange: false, + regionIsChanging: false + }); + this.logger = Logger.sharedInstance(); + this.logger.start(); + this.state = { + isReady: null, + region: null, + width: 0, + height: 0, + isUserInteraction: false + }; + this._onPress = this._onPress.bind(this); + this._onLongPress = this._onLongPress.bind(this); + this._onChange = this._onChange.bind(this); + this._onLayout = this._onLayout.bind(this); + this._onCameraChanged = this._onCameraChanged.bind(this); + + // debounced map change methods + this._onDebouncedRegionWillChange = debounce(this._onRegionWillChange.bind(this), props.regionWillChangeDebounceTime, true); + this._onDebouncedRegionDidChange = debounce(this._onRegionDidChange.bind(this), props.regionDidChangeDebounceTime); + } + componentDidMount() { + this._setHandledMapChangedEvents(this.props); + } + componentWillUnmount() { + this._onDebouncedRegionWillChange.clear(); + this._onDebouncedRegionDidChange.clear(); + this.logger.stop(); + } + UNSAFE_componentWillReceiveProps(nextProps) { + this._setHandledMapChangedEvents(nextProps); + } + _setHandledMapChangedEvents(props) { + if (isAndroid() || RNMBXModule.MapboxV10) { + const events = []; + function addIfHasHandler(name) { + if (props[`on${name}`] != null) { + if (EventTypes[name] == null) { + if (name === 'DidFailLoadingMap') { + console.warn(`rnmapbox maps: on${name} is deprecated, please use onMapLoadingError`); + } else { + console.warn(`rnmapbox maps: ${name} is not supported`); + } + } else { + events.push(EventTypes[name]); + return true; + } + } + return false; + } + addIfHasHandler('RegionWillChange'); + addIfHasHandler('RegionIsChanging'); + addIfHasHandler('RegionDidChange'); + addIfHasHandler('UserLocationUpdate'); + addIfHasHandler('WillStartLoadingMap'); + addIfHasHandler('DidFinishLoadingMap'); + addIfHasHandler('MapLoadingError'); + addIfHasHandler('DidFailLoadingMap'); + addIfHasHandler('WillStartRenderingFrame'); + addIfHasHandler('DidFinishRenderingFrame'); + addIfHasHandler('DidFinishRenderingFrameFully'); + addIfHasHandler('WillStartRenderingMap'); + addIfHasHandler('DidFinishRenderingMap'); + addIfHasHandler('DidFinishRenderingMapFully'); + addIfHasHandler('DidFinishLoadingStyle'); + addIfHasHandler('CameraChanged'); + addIfHasHandler('MapIdle'); + if (addIfHasHandler('RegionDidChange')) { + if (!this.deprecationLogged.regionDidChange) { + console.warn('onRegionDidChange is deprecated and will be removed in next release - please use onMapIdle. https://github.com/rnmapbox/maps/wiki/Deprecated-RegionIsDidChange'); + this.deprecationLogged.regionDidChange = true; + } + if (props.onMapIdle) { + console.warn('rnmapbox/maps: only one of MapView.onRegionDidChange or onMapIdle is supported'); + } + } + if (addIfHasHandler('RegionIsChanging')) { + if (!this.deprecationLogged.regionIsChanging) { + console.warn('onRegionIsChanging is deprecated and will be removed in next release - please use onCameraChanged. https://github.com/rnmapbox/maps/wiki/Deprecated-RegionIsDidChange'); + this.deprecationLogged.regionIsChanging = true; + } + if (props.onCameraChanged) { + console.warn('rnmapbox/maps: only one of MapView.onRegionIsChanging or onCameraChanged is supported'); + } + } + if (props.onRegionWillChange) { + console.warn('onRegionWillChange is deprecated and will be removed in v10 - please use onRegionIsChanging'); + } + this._runNativeMethod('setHandledMapChangedEvents', this._nativeRef, [events]); + } + } + + /** + * Converts a geographic coordinate to a point in the given view’s coordinate system. + * + * @example + * const pointInView = await this._map.getPointInView([-37.817070, 144.949901]); + * + * @param {Array} coordinate - A point expressed in the map view's coordinate system. + * @return {Array} + */ + async getPointInView(coordinate) { + const res = await this._runNative('getPointInView', [coordinate]); + return res.pointInView; + } + + /** + * Converts a point in the given view’s coordinate system to a geographic coordinate. + * + * @example + * const coordinate = await this._map.getCoordinateFromView([100, 100]); + * + * @param {Array} point - A point expressed in the given view’s coordinate system. + * @return {Array} + */ + async getCoordinateFromView(point) { + const res = await this._runNative('getCoordinateFromView', [point]); + return res.coordinateFromView; + } + + /** + * The coordinate bounds (ne, sw) visible in the user’s viewport. + * + * @example + * const visibleBounds = await this._map.getVisibleBounds(); + * + * @return {Array} + */ + async getVisibleBounds() { + const res = await this._runNative('getVisibleBounds'); + return res.visibleBounds; + } + + /** + * Returns an array of rendered map features that intersect with a given point. + * + * @example + * this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2']) + * + * @param {Array} coordinate - A point expressed in the map view’s coordinate system. + * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. + * @param {Array=} layerIDs - A array of layer id's to filter the features by + * @return {FeatureCollection} + */ + + async queryRenderedFeaturesAtPoint(coordinate) { + let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + if (!coordinate || coordinate.length < 2) { + throw new Error('Must pass in valid coordinate[lng, lat]'); + } + const res = await this._runNative('queryRenderedFeaturesAtPoint', [coordinate, getFilter(filter), layerIDs]); + if (isAndroid()) { + return JSON.parse(res.data); + } + return res.data; + } + + /** + * Returns an array of rendered map features that intersect with the given rectangle, + * restricted to the given style layers and filtered by the given predicate. In v10, + * passing an empty array will query the entire visible bounds of the map. + * + * @example + * this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2']) + * + * @param {Array} bbox - A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area. + * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. + * @param {Array=} layerIDs - A array of layer id's to filter the features by + * @return {FeatureCollection} + */ + async queryRenderedFeaturesInRect(bbox) { + let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + if (bbox != null && (bbox.length === 4 || RNMBXModule.MapboxV10 && bbox.length === 0)) { + const res = await this._runNative('queryRenderedFeaturesInRect', [bbox, getFilter(filter), layerIDs]); + if (isAndroid()) { + return JSON.parse(res.data); + } + return res.data; + } else { + throw new Error('Must pass in a valid bounding box: [top, right, bottom, left]. An empty array [] is also acceptable in v10.'); + } + } + + /** + * Returns an array of GeoJSON Feature objects representing features within the specified vector tile or GeoJSON source that satisfy the query parameters. + * + * @example + * this._map.querySourceFeatures('your-source-id', [], ['your-source-layer']) + * + * @param {String} sourceId - Style source identifier used to query for source features. + * @param {Array=} filter - A filter to limit query results. + * @param {Array=} sourceLayerIDs - The name of the source layers to query. For vector tile sources, this parameter is required. For GeoJSON sources, it is ignored. + * @return {FeatureCollection} + */ + async querySourceFeatures(sourceId) { + let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let sourceLayerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + const args = [sourceId, getFilter(filter), sourceLayerIDs]; + const res = await this._runNative('querySourceFeatures', args); + if (isAndroid()) { + return JSON.parse(res.data); + } + return res.data; + } + + /** + * Map camera will perform updates based on provided config. Deprecated use Camera#setCamera. + * @deprecated use Camera#setCamera + */ + setCamera() { + console.warn('MapView.setCamera is deprecated - please use Camera#setCamera'); + } + _runNative(methodName) { + let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + return super._runNativeMethod(methodName, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore TODO: fix types + this._nativeRef, args); + } + + /** + * Takes snapshot of map with current tiles and returns a URI to the image + * @param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64 + * @return {String} + */ + async takeSnap() { + let writeToDisk = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + const res = await this._runNative('takeSnap', [writeToDisk]); + return res.uri; + } + + /** + * Returns the current zoom of the map view. + * + * @example + * const zoom = await this._map.getZoom(); + * + * @return {Number} + */ + + async getZoom() { + const res = await this._runNative('getZoom'); + return res.zoom; + } + + /** + * Returns the map's geographical centerpoint + * + * @example + * const center = await this._map.getCenter(); + * + * @return {Array} Coordinates + */ + async getCenter() { + const res = await this._runNative('getCenter'); + return res.center; + } + + /** + * + * Clears temporary map data from the data path defined in the given resource + * options. Useful to reduce the disk usage or in case the disk cache contains + * invalid data. + * + * v10 only + */ + async clearData() { + if (!RNMBXModule.MapboxV10) { + console.warn('RNMapbox: clearData is only implemented in v10 implementation or later'); + return; + } + await this._runNative('clearData'); + } + + /** + * Queries the currently loaded data for elevation at a geographical location. + * The elevation is returned in meters relative to mean sea-level. + * Returns null if terrain is disabled or if terrain data for the location hasn't been loaded yet. + * + * @param {Array} coordinate - the coordinates to query elevation at + * @return {Number} + */ + async queryTerrainElevation(coordinate) { + const res = await this._runNative('queryTerrainElevation', [coordinate]); + return res.data; + } + + /** + * Sets the visibility of all the layers referencing the specified `sourceLayerId` and/or `sourceId` + * + * @example + * await this._map.setSourceVisibility(false, 'composite', 'building') + * + * @param {boolean} visible - Visibility of the layers + * @param {String} sourceId - Identifier of the target source (e.g. 'composite') + * @param {String=} sourceLayerId - Identifier of the target source-layer (e.g. 'building') + */ + setSourceVisibility(visible, sourceId) { + let sourceLayerId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + this._runNative('setSourceVisibility', [visible, sourceId, sourceLayerId]); + } + _decodePayload(payload) { + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + _onPress(e) { + if (isFunction(this.props.onPress)) { + this.props.onPress(this._decodePayload(e.nativeEvent.payload)); + } + } + _onLongPress(e) { + if (isFunction(this.props.onLongPress)) { + this.props.onLongPress(this._decodePayload(e.nativeEvent.payload)); + } + } + _onRegionWillChange(payload) { + if (isFunction(this.props.onRegionWillChange)) { + this.props.onRegionWillChange(payload); + } + this.setState({ + isUserInteraction: payload.properties.isUserInteraction, + isAnimatingFromUserInteraction: payload.properties.isAnimatingFromUserInteraction + }); + } + _onRegionDidChange(payload) { + if (isFunction(this.props.onRegionDidChange)) { + this.props.onRegionDidChange(payload); + } + this.setState({ + region: payload + }); + } + _onCameraChanged(e) { + var _this$props$onCameraC, _this$props; + (_this$props$onCameraC = (_this$props = this.props).onCameraChanged) === null || _this$props$onCameraC === void 0 ? void 0 : _this$props$onCameraC.call(_this$props, this._decodePayload(e.nativeEvent.payload)); + } + _onChange(e) { + const { + regionWillChangeDebounceTime, + regionDidChangeDebounceTime + } = this.props; + const { + type + } = e.nativeEvent; + const payload = this._decodePayload(e.nativeEvent.payload); + let propName = ''; + let deprecatedPropName = ''; + switch (type) { + case EventTypes.RegionWillChange: + if (regionWillChangeDebounceTime && regionWillChangeDebounceTime > 0) { + this._onDebouncedRegionWillChange(payload); + } else { + propName = 'onRegionWillChange'; + } + break; + case EventTypes.RegionIsChanging: + propName = 'onRegionIsChanging'; + break; + case EventTypes.RegionDidChange: + if (regionDidChangeDebounceTime && regionDidChangeDebounceTime > 0) { + this._onDebouncedRegionDidChange(payload); + } else { + propName = 'onRegionDidChange'; + } + break; + case EventTypes.CameraChanged: + propName = 'onCameraChanged'; + break; + case EventTypes.MapIdle: + propName = 'onMapIdle'; + break; + case EventTypes.UserLocationUpdated: + propName = 'onUserLocationUpdate'; + break; + case EventTypes.WillStartLoadingMap: + propName = 'onWillStartLoadingMap'; + break; + case EventTypes.DidFinishLoadingMap: + propName = 'onDidFinishLoadingMap'; + break; + case EventTypes.DidFailLoadingMap: + propName = 'onDidFailLoadingMap'; + break; + case EventTypes.MapLoadingError: + propName = 'onMapLoadingError'; + deprecatedPropName = 'onDidFailLoadingMap'; + break; + case EventTypes.WillStartRenderingFrame: + propName = 'onWillStartRenderingFrame'; + break; + case EventTypes.DidFinishRenderingFrame: + propName = 'onDidFinishRenderingFrame'; + break; + case EventTypes.DidFinishRenderingFrameFully: + propName = 'onDidFinishRenderingFrameFully'; + break; + case EventTypes.WillStartRenderingMap: + propName = 'onWillStartRenderingMap'; + break; + case EventTypes.DidFinishRenderingMap: + propName = 'onDidFinishRenderingMap'; + break; + case EventTypes.DidFinishRenderingMapFully: + propName = 'onDidFinishRenderingMapFully'; + break; + case EventTypes.DidFinishLoadingStyle: + propName = 'onDidFinishLoadingStyle'; + break; + default: + console.warn('Unhandled event callback type', type); + } + if (propName !== '') { + this._handleOnChange(propName, payload); + } + if (deprecatedPropName !== '') { + this._handleOnChange(deprecatedPropName, payload); + } + } + _onLayout(e) { + this.setState({ + isReady: true, + width: e.nativeEvent.layout.width, + height: e.nativeEvent.layout.height + }); + } + _handleOnChange(propName, payload) { + const func = this.props[propName]; + if (func && isFunction(func)) { + func(payload); + } + } + _getContentInset() { + if (!this.props.contentInset) { + return; + } + if (RNMBXModule.MapboxV10) { + if (!this.deprecationLogged.contentInset) { + console.warn('@rnmapbox/maps: contentInset is deprecated, use Camera padding instead.'); + this.deprecationLogged.contentInset = true; + } + } + if (!Array.isArray(this.props.contentInset)) { + return [this.props.contentInset]; + } + return this.props.contentInset; + } + _setNativeRef(nativeRef) { + if (nativeRef != null) { + this._nativeRef = nativeRef; + super._runPendingNativeMethods(nativeRef); + } + } + setNativeProps(props) { + if (this._nativeRef) { + this._nativeRef.setNativeProps(props); + } + } + _setStyleURL(props) { + // user set a styleURL, no need to alter props + if (props.styleURL) { + return; + } + + // user set styleJSON pass it to styleURL + if (props.styleJSON && !props.styleURL) { + props.styleURL = props.styleJSON; + } + + // user neither set styleJSON nor styleURL + // set defaultStyleUrl + if (!props.styleJSON || !props.styleURL) { + props.styleURL = defaultStyleURL; + } + } + _setLocalizeLabels(props) { + if (!RNMBXModule.MapboxV10) { + return; + } + if (typeof props.localizeLabels === 'boolean') { + props.localizeLabels = { + locale: 'current' + }; + } + } + render() { + const props = { + ...this.props, + contentInset: this._getContentInset(), + style: styles.matchParent + }; + this._setStyleURL(props); + this._setLocalizeLabels(props); + const callbacks = { + ref: nativeRef => this._setNativeRef(nativeRef), + onPress: this._onPress, + onLongPress: this._onLongPress, + onMapChange: this._onChange, + onCameraChanged: this._onCameraChanged + }; + let mapView = null; + if (this.state.isReady) { + if (props._nativeImpl) { + mapView = /*#__PURE__*/React.createElement(props._nativeImpl, _extends({}, props, callbacks)); + } else { + mapView = /*#__PURE__*/React.createElement(RNMBXMapView, _extends({}, props, callbacks), this.props.children); + } + } + return /*#__PURE__*/React.createElement(View, { + onLayout: this._onLayout, + style: this.props.style, + testID: mapView ? undefined : this.props.testID + }, mapView); + } +} +_defineProperty(MapView, "defaultProps", { + scrollEnabled: true, + pitchEnabled: true, + rotateEnabled: true, + attributionEnabled: true, + compassEnabled: false, + compassFadeWhenNorth: false, + logoEnabled: true, + scaleBarEnabled: true, + surfaceView: RNMBXModule.MapboxV10 ? true : false, + requestDisallowInterceptTouchEvent: false, + regionWillChangeDebounceTime: 10, + regionDidChangeDebounceTime: 500 +}); +const RNMBXMapView = NativeMapView; +export default MapView; +//# sourceMappingURL=MapView.js.map \ No newline at end of file diff --git a/lib/module/components/MapView.js.map b/lib/module/components/MapView.js.map new file mode 100644 index 000000000..181b58e41 --- /dev/null +++ b/lib/module/components/MapView.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","View","StyleSheet","NativeModules","debounce","NativeMapView","NativeMapViewModule","isFunction","isAndroid","getFilter","Logger","NativeBridgeComponent","RNMBXModule","EventTypes","console","error","MapboxV10","warn","styles","create","matchParent","flex","defaultStyleURL","StyleURL","Street","MapView","PureComponent","constructor","props","contentInset","regionDidChange","regionIsChanging","logger","sharedInstance","start","state","isReady","region","width","height","isUserInteraction","_onPress","bind","_onLongPress","_onChange","_onLayout","_onCameraChanged","_onDebouncedRegionWillChange","_onRegionWillChange","regionWillChangeDebounceTime","_onDebouncedRegionDidChange","_onRegionDidChange","regionDidChangeDebounceTime","componentDidMount","_setHandledMapChangedEvents","componentWillUnmount","clear","stop","UNSAFE_componentWillReceiveProps","nextProps","events","addIfHasHandler","name","push","deprecationLogged","onMapIdle","onCameraChanged","onRegionWillChange","_runNativeMethod","_nativeRef","getPointInView","coordinate","res","_runNative","pointInView","getCoordinateFromView","point","coordinateFromView","getVisibleBounds","visibleBounds","queryRenderedFeaturesAtPoint","filter","layerIDs","length","Error","JSON","parse","data","queryRenderedFeaturesInRect","bbox","querySourceFeatures","sourceId","sourceLayerIDs","args","setCamera","methodName","takeSnap","writeToDisk","uri","getZoom","zoom","getCenter","center","clearData","queryTerrainElevation","setSourceVisibility","visible","sourceLayerId","_decodePayload","payload","e","onPress","nativeEvent","onLongPress","setState","properties","isAnimatingFromUserInteraction","onRegionDidChange","type","propName","deprecatedPropName","RegionWillChange","RegionIsChanging","RegionDidChange","CameraChanged","MapIdle","UserLocationUpdated","WillStartLoadingMap","DidFinishLoadingMap","DidFailLoadingMap","MapLoadingError","WillStartRenderingFrame","DidFinishRenderingFrame","DidFinishRenderingFrameFully","WillStartRenderingMap","DidFinishRenderingMap","DidFinishRenderingMapFully","DidFinishLoadingStyle","_handleOnChange","layout","func","_getContentInset","Array","isArray","_setNativeRef","nativeRef","_runPendingNativeMethods","setNativeProps","_setStyleURL","styleURL","styleJSON","_setLocalizeLabels","localizeLabels","locale","render","style","callbacks","ref","onMapChange","mapView","_nativeImpl","children","undefined","testID","scrollEnabled","pitchEnabled","rotateEnabled","attributionEnabled","compassEnabled","compassFadeWhenNorth","logoEnabled","scaleBarEnabled","surfaceView","requestDisallowInterceptTouchEvent","RNMBXMapView"],"sourceRoot":"../../../src","sources":["components/MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SACEC,IAAI,EACJC,UAAU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;EACrBC,oBAAoB,EAAE,KAAK;EAC3BC,WAAW,EAAE,IAAI;EACjBC,eAAe,EAAE,IAAI;EACrBC,WAAW,EAAEhK,WAAW,CAACI,SAAS,GAAG,IAAI,GAAG,KAAK;EACjD6J,kCAAkC,EAAE,KAAK;EACzC5H,4BAA4B,EAAE,EAAE;EAChCG,2BAA2B,EAAE;AAC/B,CAAC;AAssBH,MAAM0H,YAAY,GAAGzK,aAAoC;AAEzD,eAAeoB,OAAO"} diff --git a/lib/module/components/MarkerView.js b/lib/module/components/MarkerView.js new file mode 100644 index 000000000..fc84e2a41 --- /dev/null +++ b/lib/module/components/MarkerView.js @@ -0,0 +1,92 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules, Platform } from 'react-native'; +import RNMBXMakerViewContentCoponent from '../specs/RNMBXMarkerViewContentNativeComponent'; +import NativeMarkerViewComponent from '../specs/RNMBXMarkerViewNativeComponent'; +import { toJSONString } from '../utils'; +import { makePoint } from '../utils/geoUtils'; +import PointAnnotation from './PointAnnotation'; +const Mapbox = NativeModules.RNMBXModule; +/** + * MarkerView represents an interactive React Native marker on the map. + * + * If you have static views, consider using PointAnnotation or SymbolLayer to display + * an image, as they'll offer much better performance. Mapbox suggests using this + * component for a maximum of around 100 views displayed at one time. + * + * This is implemented with view annotations on [Android](https://docs.mapbox.com/android/maps/guides/annotations/view-annotations/) + * and [iOS](https://docs.mapbox.com/ios/maps/guides/annotations/view-annotations). + * + * This component has no dedicated `onPress` method. Instead, you should handle gestures + * with the React views passed in as `children`. + */ +class MarkerView extends React.PureComponent { + _idForPointAnnotation() { + if (this.__idForPointAnnotation === undefined) { + MarkerView.lastId = MarkerView.lastId + 1; + this.__idForPointAnnotation = `MV-${MarkerView.lastId}`; + } + return this.__idForPointAnnotation; + } + _getCoordinate(coordinate) { + if (!coordinate) { + return undefined; + } + return toJSONString(makePoint(coordinate)); + } + render() { + if (this.props.anchor.x < 0 || this.props.anchor.y < 0 || this.props.anchor.x > 1 || this.props.anchor.y > 1) { + console.warn(`[MarkerView] Anchor with value (${this.props.anchor.x}, ${this.props.anchor.y}) should not be outside the range [(0, 0), (1, 1)]`); + } + if (Platform.OS === 'ios' && !Mapbox.MapboxV10) { + return /*#__PURE__*/React.createElement(PointAnnotation, _extends({ + id: this._idForPointAnnotation() + }, this.props)); + } + const { + anchor = { + x: 0.5, + y: 0.5 + } + } = this.props; + return /*#__PURE__*/React.createElement(RNMBXMarkerView, { + style: [{ + flex: 0, + alignSelf: 'flex-start' + }, this.props.style], + coordinate: [Number(this.props.coordinate[0]), Number(this.props.coordinate[1])], + anchor: anchor, + allowOverlap: this.props.allowOverlap, + allowOverlapWithPuck: this.props.allowOverlapWithPuck, + isSelected: this.props.isSelected, + onTouchEnd: e => { + e.stopPropagation(); + } + }, /*#__PURE__*/React.createElement(RNMBXMakerViewContentCoponent, { + style: { + flex: 0, + alignSelf: 'flex-start' + }, + onStartShouldSetResponder: _event => { + return true; + }, + onTouchEnd: e => { + e.stopPropagation(); + } + }, this.props.children)); + } +} +_defineProperty(MarkerView, "defaultProps", { + anchor: { + x: 0.5, + y: 0.5 + }, + allowOverlap: false, + allowOverlapWithPuck: false, + isSelected: false +}); +_defineProperty(MarkerView, "lastId", 0); +const RNMBXMarkerView = NativeMarkerViewComponent; +export default MarkerView; +//# sourceMappingURL=MarkerView.js.map \ No newline at end of file diff --git a/lib/module/components/MarkerView.js.map b/lib/module/components/MarkerView.js.map new file mode 100644 index 000000000..16ead21db --- /dev/null +++ b/lib/module/components/MarkerView.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","Platform","RNMBXMakerViewContentCoponent","NativeMarkerViewComponent","toJSONString","makePoint","PointAnnotation","Mapbox","RNMBXModule","MarkerView","PureComponent","_idForPointAnnotation","__idForPointAnnotation","undefined","lastId","_getCoordinate","coordinate","render","props","anchor","x","y","console","warn","OS","MapboxV10","flex","alignSelf","style","Number","allowOverlap","allowOverlapWithPuck","isSelected","e","stopPropagation","_event","children","RNMBXMarkerView"],"sourceRoot":"../../../src","sources":["components/MarkerView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,QAAQ,QAAwB,cAAc;AAEtE,OAAOC,6BAA6B,MAAM,gDAAgD;AAC1F,OAAOC,yBAAyB,MAAM,yCAAyC;AAE/E,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,SAAS,QAAQ,mBAAmB;AAE7C,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,MAAM,GAAGP,aAAa,CAACQ,WAAW;AAuCxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,SAASV,KAAK,CAACW,aAAa,CAAQ;EAWlDC,qBAAqB,GAAW;IAC9B,IAAI,IAAI,CAACC,sBAAsB,KAAKC,SAAS,EAAE;MAC7CJ,UAAU,CAACK,MAAM,GAAGL,UAAU,CAACK,MAAM,GAAG,CAAC;MACzC,IAAI,CAACF,sBAAsB,GAAI,MAAKH,UAAU,CAACK,MAAO,EAAC;IACzD;IACA,OAAO,IAAI,CAACF,sBAAsB;EACpC;EAEAG,cAAc,CAACC,UAAoB,EAAsB;IACvD,IAAI,CAACA,UAAU,EAAE;MACf,OAAOH,SAAS;IAClB;IACA,OAAOT,YAAY,CAACC,SAAS,CAACW,UAAU,CAAC,CAAC;EAC5C;EAEAC,MAAM,GAAG;IACP,IACE,IAAI,CAACC,KAAK,CAACC,MAAM,CAACC,CAAC,GAAG,CAAC,IACvB,IAAI,CAACF,KAAK,CAACC,MAAM,CAACE,CAA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AAS,EAAE;MAAa,CAAE;MAC5C,yBAAyB,EAAGQ,MAAM,IAAK;QACrC,OAAO,IAAI;MACb,CAAE;MACF,UAAU,EAAGF,CAAC,IAAK;QACjBA,CAAC,CAACC,eAAe,EAAE;MACrB;IAAE,GAED,IAAI,CAAChB,KAAK,CAACkB,QAAQ,CACU,CAChB;EAEtB;AACF;AAAC,gBAjFK3B,UAAU,kBACwB;EACpCU,MAAM,EAAE;IAAEC,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAI,CAAC;EAC1BS,YAAY,EAAE,KAAK;EACnBC,oBAAoB,EAAE,KAAK;EAC3BC,UAAU,EAAE;AACd,CAAC;AAAA,gBANGvB,UAAU,YAQE,CAAC;AA2EnB,MAAM4B,eAAe,GAAGlC,yBAAyB;AAEjD,eAAeM,UAAU"} diff --git a/lib/module/components/ModelLayer.js b/lib/module/components/ModelLayer.js new file mode 100644 index 000000000..3102a2bac --- /dev/null +++ b/lib/module/components/ModelLayer.js @@ -0,0 +1,29 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXModelLayerNativeComponent from '../specs/RNMBXModelLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * ModelLayer is a style layer that renders one or more stroked polylines on the map. + */ +class ModelLayer extends AbstractLayer { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return /*#__PURE__*/React.createElement(RNMBXModelLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props)); + } +} +_defineProperty(ModelLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default ModelLayer; +//# sourceMappingURL=ModelLayer.js.map \ No newline at end of file diff --git a/lib/module/components/ModelLayer.js.map b/lib/module/components/ModelLayer.js.map new file mode 100644 index 000000000..a8b6f7368 --- /dev/null +++ b/lib/module/components/ModelLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXModelLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","ModelLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/ModelLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAI5C,OAAOC,8BAA8B,MAAM,yCAAyC;AAEpF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;;AAExC;;AA4EA;AACA;AACA;AACA,MAAMC,UAAU,SAASH,aAAa,CAAyB;EAK7DI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD,oBACE,oBAAC,8BAA8B;MAAC,GAAG,EAAE,IAAI,CAACC;IAAe,GAAKH,KAAK,EAAI;EAE3E;AACF;AAAC,gBAdKF,UAAU,kBACQ;EACpBM,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAaH,eAAeR,UAAU"} diff --git a/lib/module/components/Models.js b/lib/module/components/Models.js new file mode 100644 index 000000000..c07fc08f7 --- /dev/null +++ b/lib/module/components/Models.js @@ -0,0 +1,36 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React from 'react'; +import { Image } from 'react-native'; +import NativeModels from '../specs/RNMBXModelsNativeComponent'; +function _resolveAssets(models) { + const resolvedModels = {}; + Object.keys(models).forEach(key => { + const model = models[key]; + if (typeof model === 'string') { + resolvedModels[key] = { + url: model + }; + } else { + const asset = Image.resolveAssetSource(model); + if (!asset) { + throw new Error(`Could not resolve model asset: ${model}`); + } + resolvedModels[key] = asset; + } + }); + return resolvedModels; +} + +/** + * Name of 3D model assets to be used in the map + */ +export default function Models(props) { + const { + models, + ...restOfProps + } = props; + return /*#__PURE__*/React.createElement(NativeModels, _extends({}, restOfProps, { + models: _resolveAssets(models) + })); +} +//# sourceMappingURL=Models.js.map \ No newline at end of file diff --git a/lib/module/components/Models.js.map b/lib/module/components/Models.js.map new file mode 100644 index 000000000..d7c4ca59c --- /dev/null +++ b/lib/module/components/Models.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","Image","NativeModels","_resolveAssets","models","resolvedModels","Object","keys","forEach","key","model","url","asset","resolveAssetSource","Error","Models","props","restOfProps"],"sourceRoot":"../../../src","sources":["components/Models.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,cAAc;AAEpC,OAAOC,YAAY,MAAM,qCAAqC;AAe9D,SAASC,cAAc,CAACC,MAAuB,EAE7C;EACA,MAAMC,cAAwC,GAAG,CAAC,CAAC;EACnDC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,CAACI,OAAO,CAAEC,GAAG,IAAK;IACnC,MAAMC,KAAK,GAAGN,MAAM,CAACK,GAAG,CAAC;IACzB,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC7BL,cAAc,CAACI,GAAG,CAAC,GAAG;QAAEE,GAAG,EAAED;MAAM,CAAC;IACtC,CAAC,MAAM;MACL,MAAME,KAAK,GAAGX,KAAK,CAACY,kBAAkB,CAACH,KAAK,CAAC;MAC7C,IAAI,CAACE,KAAK,EAAE;QACV,MAAM,IAAIE,KAAK,CAAE,kCAAiCJ,KAAM,EAAC,CAAC;MAC5D;MACAL,cAAc,CAACI,GAAG,CAAC,GAAGG,KAAK;IAC7B;EACF,CAAC,CAAC;EACF,OAAOP,cAAc;AACvB;;AAEA;AACA;AACA;AACA,eAAe,SAASU,MAAM,CAACC,KAAY,EAAE;EAC3C,MAAM;IAAEZ,MAAM;IAAE,GAAGa;EAAY,CAAC,GAAGD,KAAK;EACxC,oBAAO,oBAAC,YAAY,eAAKC,WAAW;IAAE,MAAM,EAAEd,cAAc,CAACC,MAAM;EAAE,GAAG;AAC1E"} diff --git a/lib/module/components/NativeBridgeComponent.js b/lib/module/components/NativeBridgeComponent.js new file mode 100644 index 000000000..2f39ee090 --- /dev/null +++ b/lib/module/components/NativeBridgeComponent.js @@ -0,0 +1,36 @@ +import { runNativeMethod } from '../utils'; +const NativeBridgeComponent = (Base, turboModule) => class extends Base { + constructor() { + super(...arguments); + this._turboModule = turboModule; + this._preRefMapMethodQueue = []; + } + async _runPendingNativeMethods(nativeRef) { + if (nativeRef) { + while (this._preRefMapMethodQueue.length > 0) { + const item = this._preRefMapMethodQueue.pop(); + if (item && item.method && item.resolver) { + const res = await this._runNativeMethod(item.method.name, nativeRef, item.method.args); + item.resolver(res); + } + } + } + } + _runNativeMethod(methodName, nativeRef) { + let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + if (!nativeRef) { + return new Promise(resolve => { + this._preRefMapMethodQueue.push({ + method: { + name: methodName, + args + }, + resolver: resolve + }); + }); + } + return runNativeMethod(this._turboModule, methodName, nativeRef, args); + } +}; +export default NativeBridgeComponent; +//# sourceMappingURL=NativeBridgeComponent.js.map \ No newline at end of file diff --git a/lib/module/components/NativeBridgeComponent.js.map b/lib/module/components/NativeBridgeComponent.js.map new file mode 100644 index 000000000..d0640e28d --- /dev/null +++ b/lib/module/components/NativeBridgeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["runNativeMethod","NativeBridgeComponent","Base","turboModule","constructor","_turboModule","_preRefMapMethodQueue","_runPendingNativeMethods","nativeRef","length","item","pop","method","resolver","res","_runNativeMethod","name","args","methodName","Promise","resolve","push"],"sourceRoot":"../../../src","sources":["components/NativeBridgeComponent.tsx"],"mappings":"AAGA,SAAyBA,eAAe,QAAQ,UAAU;AAO1D,MAAMC,qBAAqB,GAAG,CAI5BC,IAAmB,EACnBC,WAAwB,KAExB,cAAcD,IAAI,CAAC;EAOjBE,WAAW,GAAiB;IAC1B,KAAK,CAAC,YAAO,CAAC;IAEd,IAAI,CAACC,YAAY,GAAGF,WAAW;IAC/B,IAAI,CAACG,qBAAqB,GAAG,EAAE;EACjC;EAEA,MAAMC,wBAAwB,CAAUC,SAAkB,EAAE;IAC1D,IAAIA,SAAS,EAAE;MACb,OAAO,IAAI,CAACF,qBAAqB,CAACG,MAAM,GAAG,CAAC,EAAE;QAC5C,MAAMC,IAAI,GAAG,IAAI,CAACJ,qBAAqB,CAACK,GAAG,EAAE;QAE7C,IAAID,IAAI,IAAIA,IAAI,CAACE,MAAM,IAAIF,IAAI,CAACG,QAAQ,EAAE;UACxC,MAAMC,GAAG,GAAG,MAAM,IAAI,CAACC,gBAAgB,CACrCL,IAAI,CAACE,MAAM,CAACI,IAAI,EAChBR,SAAS,EACTE,IAAI,CAACE,MAAM,CAACK,IAAI,CACjB;UACDP,IAAI,CAACG,QAAQ,CAACC,GAAG,CAAC;QACpB;MACF;IACF;EACF;EAEAC,gBAAgB,CACdG,UAAkB,EAClBV,SAA8B,EAET;IAAA,IADrBS,IAAiB,uEAAG,EAAE;IAEtB,IAAI,CAACT,SAAS,EAAE;MACd,OAAO,IAAIW,OAAO,CAAcC,OAAO,IAAK;QAC1C,IAAI,CAACd,qBAAqB,CAACe,IAAI,CAAC;UAC9BT,MAAM,EAAE;YAAEI,IAAI,EAAEE,UAAU;YAAED;UAAK,CAAC;UAClCJ,QAAQ,EAAEO;QACZ,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAOpB,eAAe,CAAC,IAAI,CAACK,YAAY,EAAEa,UAAU,EAAEV,SAAS,EAAES,IAAI,CAAC;EACxE;AACF,CAAC;AAEH,eAAehB,qBAAqB"} diff --git a/lib/module/components/PointAnnotation.js b/lib/module/components/PointAnnotation.js new file mode 100644 index 000000000..282732b2e --- /dev/null +++ b/lib/module/components/PointAnnotation.js @@ -0,0 +1,130 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { StyleSheet } from 'react-native'; +import { toJSONString, isFunction } from '../utils'; +import checkRequiredProps from '../utils/checkRequiredProps'; +import { makePoint } from '../utils/geoUtils'; +import RNMBXPointAnnotationNativeComponent from '../specs/RNMBXPointAnnotationNativeComponent'; +import NativeRNMBXPointAnnotationModule from '../specs/NativeRNMBXPointAnnotationModule'; +import NativeBridgeComponent from './NativeBridgeComponent'; +export const NATIVE_MODULE_NAME = 'RNMBXPointAnnotation'; +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'center', + position: 'absolute' + } +}); +/** + * PointAnnotation represents a one-dimensional shape located at a single geographical coordinate. + * + * Consider using ShapeSource and SymbolLayer instead, if you have many points and static images, + * they'll offer much better performance. + * + * If you need interactive views please use MarkerView because PointAnnotation will render children onto a bitmap. + * Also disable any kind of animations like `fadeDuration` of `Image`. + * Otherwise, the bitmap might be rendered at an unknown state of the animation. + */ +class PointAnnotation extends NativeBridgeComponent(React.PureComponent, NativeRNMBXPointAnnotationModule) { + constructor(props) { + super(props); + _defineProperty(this, "_nativeRef", null); + checkRequiredProps('PointAnnotation', props, ['id', 'coordinate']); + this._onSelected = this._onSelected.bind(this); + this._onDeselected = this._onDeselected.bind(this); + this._onDragStart = this._onDragStart.bind(this); + this._onDrag = this._onDrag.bind(this); + this._onDragEnd = this._onDragEnd.bind(this); + } + _decodePayload(payload) { + // we check whether the payload is a string, since the strict type safety is enforced only on iOS on the new arch + // on Android, on both archs, the payload is an object + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + _onSelected(e) { + if (isFunction(this.props.onSelected)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onSelected(payload); + } + } + _onDeselected(e) { + if (isFunction(this.props.onDeselected)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDeselected(payload); + } + } + _onDragStart(e) { + if (isFunction(this.props.onDragStart)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDragStart(payload); + } + } + _onDrag(e) { + if (isFunction(this.props.onDrag)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDrag(payload); + } + } + _onDragEnd(e) { + if (isFunction(this.props.onDragEnd)) { + const payload = this._decodePayload(e.nativeEvent.payload); + this.props.onDragEnd(payload); + } + } + _getCoordinate() { + if (!this.props.coordinate) { + return undefined; + } + return toJSONString(makePoint(this.props.coordinate)); + } + + /** + * On v10 and pre v10 android point annotation is rendered offscreen with a canvas into an image. + * To rerender the image from the current state of the view call refresh. + * Call this for example from Image#onLoad. + */ + refresh() { + this._runNativeMethod('refresh', this._nativeRef, []); + } + _setNativeRef(nativeRef) { + this._nativeRef = nativeRef; + super._runPendingNativeMethods(nativeRef); + } + render() { + const props = { + ...this.props, + ref: nativeRef => this._setNativeRef(nativeRef), + id: this.props.id, + title: this.props.title, + snippet: this.props.snippet, + anchor: this.props.anchor, + selected: this.props.selected, + draggable: this.props.draggable, + style: [this.props.style, styles.container], + onMapboxPointAnnotationSelected: this._onSelected, + onMapboxPointAnnotationDeselected: this._onDeselected, + onMapboxPointAnnotationDragStart: this._onDragStart, + onMapboxPointAnnotationDrag: this._onDrag, + onMapboxPointAnnotationDragEnd: this._onDragEnd, + coordinate: this._getCoordinate() + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXPointAnnotationNativeComponent, props, this.props.children) + ); + } +} +_defineProperty(PointAnnotation, "defaultProps", { + anchor: { + x: 0.5, + y: 0.5 + }, + draggable: false +}); +export default PointAnnotation; +//# sourceMappingURL=PointAnnotation.js.map \ No newline at end of file diff --git a/lib/module/components/PointAnnotation.js.map b/lib/module/components/PointAnnotation.js.map new file mode 100644 index 000000000..eb65593cb --- /dev/null +++ b/lib/module/components/PointAnnotation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","StyleSheet","toJSONString","isFunction","checkRequiredProps","makePoint","RNMBXPointAnnotationNativeComponent","NativeRNMBXPointAnnotationModule","NativeBridgeComponent","NATIVE_MODULE_NAME","styles","create","container","alignItems","justifyContent","position","PointAnnotation","PureComponent","constructor","props","_onSelected","bind","_onDeselected","_onDragStart","_onDrag","_onDragEnd","_decodePayload","payload","JSON","parse","e","onSelected","nativeEvent","onDeselected","onDragStart","onDrag","onDragEnd","_getCoordinate","coordinate","undefined","refresh","_runNativeMethod","_nativeRef","_setNativeRef","nativeRef","_runPendingNativeMethods","render","ref","id","title","snippet","anchor","selected","draggable","style","onMapboxPointAnnotationSelected","onMapboxPointAnnotationDeselected","onMapboxPointAnnotationDragStart","onMapboxPointAnnotationDrag","onMapboxPointAnnotationDragEnd","children","x","y"],"sourceRoot":"../../../src","sources":["components/PointAnnotation.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,SAASC,UAAU,QAAwB,cAAc;AAGzD,SAASC,YAAY,EAAEC,UAAU,QAAQ,UAAU;AACnD,OAAOC,kBAAkB,MAAM,6BAA6B;AAC5D,SAASC,SAAS,QAAQ,mBAAmB;AAG7C,OAAOC,mCAAmC,MAAM,8CAA8C;AAC9F,OAAOC,gCAAgC,MAAM,2CAA2C;AAExF,OAAOC,qBAAqB,MAA0B,yBAAyB;AAE/E,OAAO,MAAMC,kBAAkB,GAAG,sBAAsB;AAExD,MAAMC,MAAM,GAAGT,UAAU,CAACU,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAA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,EAAE;EAAI,CAAC;EAC1BT,SAAS,EAAE;AACb,CAAC;AAoHH,eAAerC,eAAe"} diff --git a/lib/module/components/RasterDemSource.js b/lib/module/components/RasterDemSource.js new file mode 100644 index 000000000..e829109d7 --- /dev/null +++ b/lib/module/components/RasterDemSource.js @@ -0,0 +1,56 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXRasterDemSourceNativeComponent from '../specs/RNMBXRasterDemSourceNativeComponent'; +import { cloneReactChildrenWithProps } from '../utils'; +import AbstractSource from './AbstractSource'; +const isTileTemplateUrl = url => !!url && (url.includes('{z}') || url.includes('{bbox-') || url.includes('{quadkey}')); +const MapboxGL = NativeModules.RNMBXModule; +class RasterDemSource extends AbstractSource { + constructor(props) { + super(props); + if (isTileTemplateUrl(props.url)) { + console.warn(`RasterDemSource 'url' property contains a Tile URL Template, but is intended for a StyleJSON URL. Please migrate your VectorSource to use: \`tileUrlTemplates=["${props.url}"]\` instead.`); + } + } + render() { + let { + url + } = this.props; + let { + tileUrlTemplates + } = this.props; + + // Swapping url for tileUrlTemplates to provide backward compatibility + // when RasterSource supported only tile url as url prop + if (isTileTemplateUrl(url)) { + tileUrlTemplates = [url]; + url = undefined; + } + const props = { + ...this.props, + id: this.props.id, + existing: this.props.existing, + url, + tileUrlTemplates, + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + tileSize: this.props.tileSize + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXRasterDemSourceNativeComponent, _extends({ + ref: this.setNativeRef + }, props), cloneReactChildrenWithProps(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(RasterDemSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +export default RasterDemSource; +//# sourceMappingURL=RasterDemSource.js.map \ No newline at end of file diff --git a/lib/module/components/RasterDemSource.js.map b/lib/module/components/RasterDemSource.js.map new file mode 100644 index 000000000..605d19ed4 --- /dev/null +++ b/lib/module/components/RasterDemSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXRasterDemSourceNativeComponent","cloneReactChildrenWithProps","AbstractSource","isTileTemplateUrl","url","includes","MapboxGL","RNMBXModule","RasterDemSource","constructor","props","console","warn","render","tileUrlTemplates","undefined","id","existing","minZoomLevel","maxZoomLevel","tileSize","setNativeRef","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/RasterDemSource.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAE5C,OAAOC,mCAAmC,MAAM,8CAA8C;AAC9F,SAASC,2BAA2B,QAAQ,UAAU;AAEtD,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,iBAAiB,GAAIC,GAAY,IACrC,CAAC,CAACA,GAAG,KACJA,GAAG,CAACC,QAAQ,CAAC,KAAK,CAAC,IAAID,GAAG,CAACC,QAAQ,CAAC,QAAQ,CAAC,IAAID,GAAG,CAACC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE9E,MAAMC,QAAQ,GAAGP,aAAa,CAACQ,WAAW;AAiD1C,MAAMC,eAAe,SAASN,cAAc,CAAqB;EAK/DO,WAAW,CAACC,KAAY,EAAE;IACxB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAIP,iBAAiB,CAACO,KAAK,CAACN,GAAG,CAAC,EAAE;MAChCO,OAAO,CAACC,IAAI,CACT,mKAAkKF,KAAK,CAACN,GAAI,eAAc,CAC5L;IACH;EACF;EAEAS,MAAM,GAAG;IACP,IAAI;MAAET;IAAI,CAAC,GAAG,IAAI,CAACM,KAAK;IACxB,IAAI;MAAEI;IAAiB,CAAC,GAAG,IAAI,CAACJ,KAAK;;IAErC;IACA;IACA,IAAIP,iBAAiB,CAACC,GAAG,CAAC,EAAE;MAC1BU,gBAAgB,GAAG,CAACV,GAAG,CAAC;MACxBA,GAAG,GAAGW,SAAS;IACjB;IAEA,MAAML,KAAK,GAAG;MACZ,GAAG,IAAI,CAACA,KAAK;MACbM,EAAE,EAAE,IAAI,CAACN,KAAK,CAACM,EAAE;MACjBC,QAAQ,EAAE,IAAI,CAACP,KAAK,CAACO,QAAQ;MAC7Bb,GAAG;MACHU,gBAAgB;MAChBI,YAAY,EAAE,IAAI,CAACR,KAAK,CAACQ,YAAY;MACrCC,YAAY,EAAE,IAAI,CAACT,KAAK,CAACS,YAAY;MACrCC,QAAQ,EAAE,IAAI,CAACV,KAAK,CAACU;IACvB,CAAC;IACD;MAAA;MACE;MACA,oBAAC,mCAAmC;QAAC,GAAG,EAAE,IAAI,CAACC;MAAa,GAAKX,KAAK,GACnET,2BAA2B,CAAC,IAAI,CAACS,KAAK,CAACY,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAACb,KAAK,CAACM;MACvB,CAAC,CAAC;IACkC;EAE1C;AACF;AAAC,gBA5CKR,eAAe,kBACG;EACpBQ,EAAE,EAAEV,QAAQ,CAACkB,WAAW,CAACC;AAC3B,CAAC;AA2CH,eAAejB,eAAe"} diff --git a/lib/module/components/RasterLayer.js b/lib/module/components/RasterLayer.js new file mode 100644 index 000000000..cbf6d7388 --- /dev/null +++ b/lib/module/components/RasterLayer.js @@ -0,0 +1,30 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXRasterLayerNativeComponent from '../specs/RNMBXRasterLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +class RasterLayer extends AbstractLayer { + render() { + const props = { + ...this.baseProps, + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXRasterLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props)) + ); + } +} +_defineProperty(RasterLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default RasterLayer; +//# sourceMappingURL=RasterLayer.js.map \ No newline at end of file diff --git a/lib/module/components/RasterLayer.js.map b/lib/module/components/RasterLayer.js.map new file mode 100644 index 000000000..5a68e9a9a --- /dev/null +++ b/lib/module/components/RasterLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXRasterLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","RasterLayer","render","props","baseProps","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/RasterLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAI5C,OAAOC,+BAA+B,MAAM,0CAA0C;AAEtF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;;AAExC;;AA4EA,MAAMC,WAAW,SAASH,aAAa,CAAyB;EAK9DI,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG;MACZ,GAAG,IAAI,CAACC,SAAS;MACjBC,aAAa,EAAE,IAAI,CAACF,KAAK,CAACE;IAC5B,CAAC;IACD;MAAA;MACE;MACA,oBAAC,+BAA+B;QAAC,GAAG,EAAE,IAAI,CAACC;MAAe,GAAKH,KAAK;IAAI;EAE5E;AACF;AAAC,gBAfKF,WAAW,kBACO;EACpBM,QAAQ,EAAER,MAAM,CAACS,WAAW,CAACC;AAC/B,CAAC;AAcH,eAAeR,WAAW"} diff --git a/lib/module/components/RasterSource.js b/lib/module/components/RasterSource.js new file mode 100644 index 000000000..915cf5d71 --- /dev/null +++ b/lib/module/components/RasterSource.js @@ -0,0 +1,63 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import { cloneReactChildrenWithProps } from '../utils'; +import RNMBXRasterSourceNativeComponent from '../specs/RNMBXRasterSourceNativeComponent'; +import AbstractSource from './AbstractSource'; +const MapboxGL = NativeModules.RNMBXModule; +const isTileTemplateUrl = url => !!url && (url.includes('{z}') || url.includes('{bbox-') || url.includes('{quadkey}')); +/** + * RasterSource is a map content source that supplies raster image tiles to be shown on the map. + * The location of and metadata about the tiles are defined either by an option dictionary + * or by an external file that conforms to the TileJSON specification. + */ +class RasterSource extends AbstractSource { + constructor(props) { + super(props); + if (isTileTemplateUrl(props.url)) { + console.warn(`RasterSource 'url' property contains a Tile URL Template, but is intended for a StyleJSON URL. Please migrate your VectorSource to use: \`tileUrlTemplates=["${props.url}"]\` instead.`); + } + } + render() { + let { + url + } = this.props; + let { + tileUrlTemplates + } = this.props; + + // Swapping url for tileUrlTemplates to provide backward compatibility + // when RasterSource supported only tile url as url prop + if (isTileTemplateUrl(url)) { + tileUrlTemplates = [url]; + url = undefined; + } + const props = { + ...this.props, + id: this.props.id, + existing: this.props.existing, + url, + tileUrlTemplates, + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + tileSize: this.props.tileSize, + tms: this.props.tms, + attribution: this.props.attribution + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXRasterSourceNativeComponent, _extends({ + ref: this.setNativeRef + }, props), cloneReactChildrenWithProps(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(RasterSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +export default RasterSource; +//# sourceMappingURL=RasterSource.js.map \ No newline at end of file diff --git a/lib/module/components/RasterSource.js.map b/lib/module/components/RasterSource.js.map new file mode 100644 index 000000000..fef872ecc --- /dev/null +++ b/lib/module/components/RasterSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","cloneReactChildrenWithProps","RNMBXRasterSourceNativeComponent","AbstractSource","MapboxGL","RNMBXModule","isTileTemplateUrl","url","includes","RasterSource","constructor","props","console","warn","render","tileUrlTemplates","undefined","id","existing","minZoomLevel","maxZoomLevel","tileSize","tms","attribution","setNativeRef","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/RasterSource.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAE5C,SAASC,2BAA2B,QAAQ,UAAU;AAEtD,OAAOC,gCAAgC,MAAM,2CAA2C;AAExF,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,QAAQ,GAAGJ,aAAa,CAACK,WAAW;AAE1C,MAAMC,iBAAiB,GAAIC,GAAY,IACrC,CAAC,CAACA,GAAG,KACJA,GAAG,CAACC,QAAQ,CAAC,KAAK,CAAC,IAAID,GAAG,CAACC,QAAQ,CAAC,QAAQ,CAAC,IAAID,GAAG,CAACC,QAAQ,CAAC,WAAW,CAAC,CAAC;AA4D9E;AACA;AACA;AACA;AACA;AACA,MAAMC,YAAY,SAASN,cAAc,C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A6CH,eAAenB,YAAY"} diff --git a/lib/module/components/ShapeSource.js b/lib/module/components/ShapeSource.js new file mode 100644 index 000000000..29b296120 --- /dev/null +++ b/lib/module/components/ShapeSource.js @@ -0,0 +1,153 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXShapeSourceNativeComponent from '../specs/RNMBXShapeSourceNativeComponent'; +import NativeRNMBXShapeSourceModule from '../specs/NativeRNMBXShapeSourceModule'; +import { toJSONString, cloneReactChildrenWithProps, isFunction, isAndroid } from '../utils'; +import { copyPropertiesAsDeprecated } from '../utils/deprecation'; +import AbstractSource from './AbstractSource'; +import NativeBridgeComponent from './NativeBridgeComponent'; +const MapboxGL = NativeModules.RNMBXModule; +/** + * ShapeSource is a map content source that supplies vector shapes to be shown on the map. + * The shape may be an url or a GeoJSON object + */ +export class ShapeSource extends NativeBridgeComponent(AbstractSource, NativeRNMBXShapeSourceModule) { + constructor(props) { + super(props); + } + _setNativeRef(nativeRef) { + this.setNativeRef(nativeRef); + super._runPendingNativeMethods(nativeRef); + } + + /** + * Returns the zoom needed to expand the cluster. + * + * @example + * const zoom = await shapeSource.getClusterExpansionZoom(clusterId); + * + * @param {Feature} feature - The feature cluster to expand. + * @return {number} + */ + async getClusterExpansionZoom(feature) { + const res = await this._runNativeMethod('getClusterExpansionZoom', this._nativeRef, [JSON.stringify(feature)]); + return res.data; + } + + /** + * Returns the FeatureCollection from the cluster. + * + * @example + * const collection = await shapeSource.getClusterLeaves(clusterId, limit, offset); + * + * @param {GeoJSON.Feature} feature - The feature cluster to expand. + * @param {number} limit - The number of points to return. + * @param {number} offset - The amount of points to skip (for pagination). + * @return {FeatureCollection} + */ + async getClusterLeaves(feature, limit, offset) { + const res = await this._runNativeMethod('getClusterLeaves', this._nativeRef, [JSON.stringify(feature), limit, offset]); + if (isAndroid()) { + return JSON.parse(res.data); + } + return res.data; + } + + /** + * Returns the FeatureCollection from the cluster (on the next zoom level). + * + * @example + * const collection = await shapeSource.getClusterChildren(clusterId); + * + * @param {GeoJSON.Feature} feature - The feature cluster to expand. + * @return {FeatureCollection} + */ + async getClusterChildren(feature) { + const res = await this._runNativeMethod('getClusterChildren', this._nativeRef, [JSON.stringify(feature)]); + if (isAndroid()) { + return JSON.parse(res.data); + } + return res.data; + } + setNativeProps(props) { + const shallowProps = Object.assign({}, props); + + // Adds support for Animated + if (shallowProps.shape && typeof shallowProps.shape !== 'string') { + shallowProps.shape = JSON.stringify(shallowProps.shape); + } + super.setNativeProps(shallowProps); + } + _getShape() { + if (!this.props.shape) { + return; + } + return toJSONString(this.props.shape); + } + _decodePayload(payload) { + // we check whether the payload is a string, since the strict type safety is enforced only on iOS on the new arch + // on Android, on both archs, the payload is an object + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + onPress(event) { + var _this$props$onPress, _this$props; + const payload = this._decodePayload(event.nativeEvent.payload); + const { + features, + coordinates, + point + } = payload; + let newEvent = { + features, + coordinates, + point + }; + newEvent = copyPropertiesAsDeprecated(event, newEvent, key => { + console.warn(`event.${key} is deprecated on ShapeSource#onPress, please use event.features`); + }, { + nativeEvent: origNativeEvent => ({ + ...origNativeEvent, + payload: features[0] + }) + }); + (_this$props$onPress = (_this$props = this.props).onPress) === null || _this$props$onPress === void 0 ? void 0 : _this$props$onPress.call(_this$props, newEvent); + } + render() { + const props = { + id: this.props.id, + existing: this.props.existing, + url: this.props.url, + shape: this._getShape(), + hitbox: this.props.hitbox, + hasPressListener: isFunction(this.props.onPress), + onMapboxShapeSourcePress: this.onPress.bind(this), + cluster: this.props.cluster ? 1 : 0, + clusterRadius: this.props.clusterRadius, + clusterMaxZoomLevel: this.props.clusterMaxZoomLevel, + clusterProperties: this.props.clusterProperties, + maxZoomLevel: this.props.maxZoomLevel, + buffer: this.props.buffer, + tolerance: this.props.tolerance, + lineMetrics: this.props.lineMetrics, + onPress: undefined, + ref: nativeRef => this._setNativeRef(nativeRef) + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXShapeSourceNativeComponent, props, cloneReactChildrenWithProps(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(ShapeSource, "NATIVE_ASSETS_KEY", 'assets'); +_defineProperty(ShapeSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +//# sourceMappingURL=ShapeSource.js.map \ No newline at end of file diff --git a/lib/module/components/ShapeSource.js.map b/lib/module/components/ShapeSource.js.map new file mode 100644 index 000000000..44c8e21d4 --- /dev/null +++ b/lib/module/components/ShapeSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXShapeSourceNativeComponent","NativeRNMBXShapeSourceModule","toJSONString","cloneReactChildrenWithProps","isFunction","isAndroid","copyPropertiesAsDeprecated","AbstractSource","NativeBridgeComponent","MapboxGL","RNMBXModule","ShapeSource","constructor","props","_setNativeRef","nativeRef","setNativeRef","_runPendingNativeMethods","getClusterExpansionZoom","feature","res","_runNativeMethod","_nativeRef","JSON","stringify","data","getClusterLeaves","limit","offset","parse","getClusterChildren","setNativeProps","shallowProps","Object","assign","shape","_getShape","_decodePayload","payload","onPress","event","nativeEvent","features","coordinates","point","newEvent","key","console","warn","origNativeEvent","render","id","existing","url","hitbox","hasPressListener","onMapboxShapeSourcePress","bind","cluster","clusterRadius","clusterMaxZoomLevel","clusterProperties","maxZoomLevel","buffer","tolerance","lineMetrics","undefined","ref","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/ShapeSource.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,aAAa,QAER,cAAc;AAErB,OAAOC,+BAA+B,MAAM,0CAA0C;AACtF,OAAOC,4BAA4B,MAAM,uCAAuC;AAChF,SACEC,YAAY,EACZC,2BAA2B,EAC3BC,UAAU,EACVC,SAAS,QACJ,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BC,WAAW,EAAE,IAAI,CAACpD,KAAK,CAACoD,WAAW;MACnC1B,OAAO,EAAE2B,SAAS;MAClBC,GAAG,EACDpD,SAAiE,IAC9D,IAAI,CAACD,aAAa,CAACC,SAAS;IACnC,CAAC;IAED;MAAA;MACE;MACA,oBAAC,+BAA+B,EAAKF,KAAK,EACvCV,2BAA2B,CAAC,IAAI,CAACU,KAAK,CAACuD,QAAQ,EAAE;QAChDC,QAAQ,EAAE,IAAI,CAACxD,KAAK,CAACsC;MACvB,CAAC,CAAC;IAC8B;EAEtC;AACF;AAAC,gBAtLYxC,WAAW,uBAIK,QAAQ;AAAA,gBAJxBA,WAAW,kBAMA;EACpBwC,EAAE,EAAE1C,QAAQ,CAAC6D,WAAW,CAACC;AAC3B,CAAC"} diff --git a/lib/module/components/SkyLayer.js b/lib/module/components/SkyLayer.js new file mode 100644 index 000000000..441b27c28 --- /dev/null +++ b/lib/module/components/SkyLayer.js @@ -0,0 +1,24 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXSkyLayerNativeComponent from '../specs/RNMBXSkyLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +const Mapbox = NativeModules.RNMBXModule; +/** + * SkyLayer is a spherical dome around the map that is always rendered behind all other layers + */ +class SkyLayer extends AbstractLayer { + render() { + return /*#__PURE__*/React.createElement(RNMBXSkyLayerNativeComponent + // @ts-expect-error just codegen stuff + , _extends({ + ref: this.setNativeLayer + }, this.baseProps)); + } +} +_defineProperty(SkyLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +export default SkyLayer; +//# sourceMappingURL=SkyLayer.js.map \ No newline at end of file diff --git a/lib/module/components/SkyLayer.js.map b/lib/module/components/SkyLayer.js.map new file mode 100644 index 000000000..6e375445b --- /dev/null +++ b/lib/module/components/SkyLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXSkyLayerNativeComponent","AbstractLayer","Mapbox","RNMBXModule","SkyLayer","render","setNativeLayer","baseProps","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/SkyLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,cAAc;AAI5C,OAAOC,4BAA4B,MAAM,uCAAuC;AAEhF,OAAOC,aAAa,MAAM,iBAAiB;AAE3C,MAAMC,MAAM,GAAGH,aAAa,CAACI,WAAW;AAgDxC;AACA;AACA;AACA,MAAMC,QAAQ,SAASH,aAAa,CAAyB;EAK3DI,MAAM,GAAG;IACP,oBACE,oBAAC;IACC;IAAA;MACA,GAAG,EAAE,IAAI,CAACC;IAAe,GACrB,IAAI,CAACC,SAAS,EAClB;EAEN;AACF;AAAC,gBAdKH,QAAQ,kBACU;EACpBI,QAAQ,EAAEN,MAAM,CAACO,WAAW,CAACC;AAC/B,CAAC;AAaH,eAAeN,QAAQ"} diff --git a/lib/module/components/Style.js b/lib/module/components/Style.js new file mode 100644 index 000000000..a5520b9d6 --- /dev/null +++ b/lib/module/components/Style.js @@ -0,0 +1,255 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React, { useMemo, useState, useEffect } from 'react'; +import CircleLayer from './CircleLayer'; +import RasterLayer from './RasterLayer'; +import { SymbolLayer } from './SymbolLayer'; +import LineLayer from './LineLayer'; +import FillLayer from './FillLayer'; +import FillExtrusionLayer from './FillExtrusionLayer'; +import BackgroundLayer from './BackgroundLayer'; +import HeatmapLayer from './HeatmapLayer'; +import VectorSource from './VectorSource'; +import RasterSource from './RasterSource'; +import ImageSource from './ImageSource'; +import { ShapeSource } from './ShapeSource'; +function toCamelCase(s) { + return s.replace(/([-_][a-z])/gi, $1 => { + return $1.toUpperCase().replace('-', '').replace('_', ''); + }); +} + +// Patches the Mapbox Style Specification keys into the style props attributes: +// icon-allow-overlap -> iconAllowOverlap +function toCamelCaseKeys(oldObj) { + if (!oldObj) { + return {}; + } + const newObj = {}; + Object.keys(oldObj).forEach(key => { + const value = oldObj[key]; + if (key.includes('-')) { + newObj[toCamelCase(key)] = value; + } else { + newObj[key] = value; + } + }); + return newObj; +} +function getLayerComponentType(layer) { + const { + type + } = layer; + switch (type) { + case 'circle': + return CircleLayer; + case 'symbol': + return SymbolLayer; + case 'raster': + return RasterLayer; + case 'line': + return LineLayer; + case 'fill': + return FillLayer; + case 'fill-extrusion': + return FillExtrusionLayer; + case 'background': + return BackgroundLayer; + case 'heatmap': + return HeatmapLayer; + } + console.warn(`Mapbox layer type '${type}' is not supported/`); + return null; +} +function asLayerComponent(layer) { + const LayerComponent = getLayerComponentType(layer); + if (!LayerComponent) { + return null; + } + const style = { + ...toCamelCaseKeys(layer.paint), + ...toCamelCaseKeys(layer.layout) + }; + const layerProps = {}; + if (layer.source) { + layerProps.sourceID = layer.source; + } + if (layer['source-layer']) { + layerProps.sourceLayerID = layer['source-layer']; + } + if (layer.minzoom) { + layerProps.minZoomLevel = layer.minzoom; + } + if (layer.maxzoom) { + layerProps.maxZoomLevel = layer.maxzoom; + } + if (layer.filter) { + layerProps.filter = layer.filter; + } + if (Object.keys(style).length) { + layerProps.style = style; + } + return /*#__PURE__*/React.createElement(LayerComponent, _extends({ + key: layer.id, + id: layer.id + }, layerProps)); +} +function getTileSourceProps(source) { + const sourceProps = {}; + if (source.url) { + sourceProps.url = source.url; + } + if (source.tiles) { + sourceProps.tileUrlTemplates = source.tiles; + } + if (source.minzoom !== undefined) { + sourceProps.minZoomLevel = source.minzoom; + } + if (source.maxzoom !== undefined) { + sourceProps.maxZoomLevel = source.maxzoom; + } + if (source.attribution) { + sourceProps.attribution = source.attribution; + } + if (source.scheme && source.scheme === 'tms') { + sourceProps.tms = true; + } + return sourceProps; +} +function getVectorSource(id, source) { + const sourceProps = { + ...getTileSourceProps(source) + }; + return /*#__PURE__*/React.createElement(VectorSource, _extends({ + key: id, + id: id + }, sourceProps)); +} +function getRasterSource(id, source) { + const sourceProps = { + ...getTileSourceProps(source) + }; + if (source.tileSize) { + sourceProps.tileSize = source.tileSize; + } + return /*#__PURE__*/React.createElement(RasterSource, _extends({ + key: id, + id: id + }, sourceProps)); +} +function getImageSource(id, source) { + const sourceProps = { + url: source.url, + coordinates: source.coordinates + }; + return /*#__PURE__*/React.createElement(ImageSource, _extends({ + key: id, + id: id + }, sourceProps)); +} +function getShapeSource(id, source) { + const sourceProps = {}; + if (source.data && typeof source.data === 'string') { + sourceProps.url = source.data; + } else if (source.data && typeof source.data === 'object') { + sourceProps.shape = source.data; + } + if (source.cluster !== undefined) { + sourceProps.cluster = source.cluster; + } + if (source.clusterRadius !== undefined) { + sourceProps.clusterRadius = source.clusterRadius; + } + if (source.maxzoom !== undefined) { + sourceProps.maxZoomLevel = source.maxzoom; + } + if (source.clusterMaxZoom !== undefined) { + sourceProps.clusterMaxZoomLevel = source.clusterMaxZoom; + } + if (source.clusterProperties !== undefined) { + sourceProps.clusterProperties = source.clusterProperties; + } + if (source.buffer !== undefined) { + sourceProps.buffer = source.buffer; + } + if (source.tolerance !== undefined) { + sourceProps.tolerance = source.tolerance; + } + if (source.lineMetrics !== undefined) { + sourceProps.lineMetrics = source.lineMetrics; + } + return /*#__PURE__*/React.createElement(ShapeSource, _extends({ + key: id, + id: id + }, sourceProps)); +} +function asSourceComponent(id, source) { + switch (source.type) { + case 'vector': + return getVectorSource(id, source); + case 'raster': + return getRasterSource(id, source); + case 'image': + return getImageSource(id, source); + case 'geojson': + return getShapeSource(id, source); + } + console.warn(`Mapbox source type '${source.type}' is not supported/`); + return null; +} +/** + * Style is a component that automatically adds sources / layers to the map using Mapbox GL Style Spec. + * Only [`sources`](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources) & [`layers`](https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/) are supported. + * Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/rnmapbox/maps/tree/main/docs. + */ +const Style = props => { + const [fetchedJson, setFetchedJson] = useState({}); + const json = typeof props.json === 'object' ? props.json : fetchedJson; + + // Fetch style when props.json is a URL + useEffect(() => { + const abortController = new AbortController(); + const fetchStyleJson = async json => { + try { + const response = await fetch(json, { + signal: abortController.signal + }); + const responseJson = await response.json(); + setFetchedJson(responseJson); + } catch (error) { + const e = error; + if (e.name === 'AbortError') { + return; + } + throw e; + } + }; + if (typeof props.json === 'string') { + fetchStyleJson(props.json); + } + return function cleanup() { + abortController.abort(); + }; + }, [props.json]); + + // Extract layer components from json + const layerComponents = useMemo(() => { + if (!json.layers) { + return []; + } + return json.layers.map(asLayerComponent).filter(x => !!x); + }, [json.layers]); + + // Extract source components from json + const { + sources + } = json; + const sourceComponents = useMemo(() => { + if (!sources || !Object.keys(sources)) { + return []; + } + return Object.keys(sources).map(id => asSourceComponent(id, sources[id])).filter(x => !!x); + }, [sources]); + return /*#__PURE__*/React.createElement(React.Fragment, null, sourceComponents, layerComponents); +}; +export default Style; +//# sourceMappingURL=Style.js.map \ No newline at end of file diff --git a/lib/module/components/Style.js.map b/lib/module/components/Style.js.map new file mode 100644 index 000000000..5d3f0878b --- /dev/null +++ b/lib/module/components/Style.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","useMemo","useState","useEffect","CircleLayer","RasterLayer","SymbolLayer","LineLayer","FillLayer","FillExtrusionLayer","BackgroundLayer","HeatmapLayer","VectorSource","RasterSource","ImageSource","ShapeSource","toCamelCase","s","replace","$1","toUpperCase","toCamelCaseKeys","oldObj","newObj","Object","keys","forEach","key","value","includes","getLayerComponentType","layer","type","console","warn","asLayerComponent","LayerComponent","style","paint","layout","layerProps","source","sourceID","sourceLayerID","minzoom","minZoomLevel","maxzoom","maxZoomLevel","filter","length","id","getTileSourceProps","sourceProps","url","tiles","tileUrlTemplates","undefined","attribution","scheme","tms","getVectorSource","getRasterSource","tileSize","getImageSource","coordinates","getShapeSource","data","shape","cluster","clusterRadius","clusterMaxZoom","clusterMaxZoomLevel","clusterProperties","buffer","tolerance","lineMetrics","asSourceComponent","Style","props","fetchedJson","setFetchedJson","json","abortController","AbortController","fetchStyleJson","response","fetch","signal","responseJson","error","e","name","cleanup","abort","layerComponents","layers","map","x","sources","sourceComponents"],"sourceRoot":"../../../src","sources":["components/Style.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAI3D,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,WAAW,CAACC,CAAS,EAAU;EACtC,OAAOA,CAAC,CAACC,OAAO,CAAC,eAAe,EAAGC,EAAE,IAAK;IACxC,OAAOA,EAAE,CAACC,WAAW,EAAE,CAACF,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAACA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3D,CAAC,CAAC;AACJ;;AAEA;AACA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AAI,KAAK,YAAY,EAAE;UAC3B;QACF;QACA,MAAMD,CAAC;MACT;IACF,CAAC;IACD,IAAI,OAAOZ,KAAK,CAACG,IAAI,KAAK,QAAQ,EAAE;MAClCG,cAAc,CAACN,KAAK,CAACG,IAAI,CAAC;IAC5B;IACA,OAAO,SAASW,OAAO,GAAG;MACxBV,eAAe,CAACW,KAAK,EAAE;IACzB,CAAC;EACH,CAAC,EAAE,CAACf,KAAK,CAACG,IAAI,CAAC,CAAC;;EAEhB;EACA,MAAMa,eAAe,GAAG7F,OAAO,CAAC,MAAM;IACpC,IAAI,CAACgF,IAAI,CAACc,MAAM,EAAE;MAChB,OAAO,EAAE;IACX;IACA,OAAOd,IAAI,CAACc,MAAM,CAACC,GAAG,CAAC7D,gBAAgB,CAAC,CAACa,MAAM,CAAEiD,CAAC,IAAK,CAAC,CAACA,CAAC,CAAC;EAC7D,CAAC,EAAE,CAAChB,IAAI,CAACc,MAAM,CAAC,CAAC;;EAEjB;EACA,MAAM;IAAEG;EAAQ,CAAC,GAAGjB,IAAI;EACxB,MAAMkB,gBAAgB,GAAGlG,OAAO,CAAC,MAAM;IACrC,IAAI,CAACiG,OAAO,IAAI,CAAC1E,MAAM,CAACC,IAAI,CAACyE,OAAO,CAAC,EAAE;MACrC,OAAO,EAAE;IACX;IACA,OAAO1E,MAAM,CAACC,IAAI,CAACyE,OAAO,CAAC,CACxBF,GAAG,CAAE9C,EAAE,IAAK0B,iBAAiB,CAAC1B,EAAE,EAAEgD,OAAO,CAAChD,EAAE,CAAC,CAAC,CAAC,CAC/CF,MAAM,CAAEiD,CAAC,IAAK,CAAC,CAACA,CAAC,CAAC;EACvB,CAAC,EAAE,CAACC,OAAO,CAAC,CAAC;EAEb,oBACE,0CACGC,gBAAgB,EAChBL,eAAe,CACf;AAEP,CAAC;AAED,eAAejB,KAAK"} diff --git a/lib/module/components/StyleImport.js b/lib/module/components/StyleImport.js new file mode 100644 index 000000000..5bc74821d --- /dev/null +++ b/lib/module/components/StyleImport.js @@ -0,0 +1,11 @@ +import React, { memo } from 'react'; +import NativeStyleImport from '../specs/RNMBXStyleImportNativeComponent'; +/** + * Use StyleImport to set configuration options on the new standard style. **V11 only.** + * + * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style + */ +export default /*#__PURE__*/memo(props => { + return /*#__PURE__*/React.createElement(NativeStyleImport, props); +}); +//# sourceMappingURL=StyleImport.js.map \ No newline at end of file diff --git a/lib/module/components/StyleImport.js.map b/lib/module/components/StyleImport.js.map new file mode 100644 index 000000000..07fe56ffe --- /dev/null +++ b/lib/module/components/StyleImport.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","memo","NativeStyleImport","props"],"sourceRoot":"../../../src","sources":["components/StyleImport.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAEnC,OAAOC,iBAAiB,MAAM,0CAA0C;AAuBxE;AACA;AACA;AACA;AACA;AACA,4BAAeD,IAAI,CAAEE,KAAY,IAAK;EACpC,oBAAO,oBAAC,iBAAiB,EAAKA,KAAK,CAAI;AACzC,CAAC,CAAC"} diff --git a/lib/module/components/SymbolLayer.js b/lib/module/components/SymbolLayer.js new file mode 100644 index 000000000..04db3758a --- /dev/null +++ b/lib/module/components/SymbolLayer.js @@ -0,0 +1,56 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { View, NativeModules } from 'react-native'; +import RNMBXSymbolLayerNativeComponent from '../specs/RNMBXSymbolLayerNativeComponent'; +import AbstractLayer from './AbstractLayer'; +export const NATIVE_MODULE_NAME = 'RNMBXSymbolLayer'; +const Mapbox = NativeModules.RNMBXModule; + +// @{codepart-replace-start(LayerPropsCommon.codepart-tsx)} + +/** + * SymbolLayer is a style layer that renders icon and text labels at points or along lines on the map. + */ +export class SymbolLayer extends AbstractLayer { + constructor() { + super(...arguments); + _defineProperty(this, "deprecationLogged", { + snapshot: false + }); + } + _shouldSnapshot() { + let isSnapshot = false; + if (React.Children.count(this.baseProps.children) <= 0) { + return isSnapshot; + } + React.Children.forEach(this.baseProps.children, child => { + if ((child === null || child === void 0 ? void 0 : child.type) === View) { + isSnapshot = true; + } + }); + if (isSnapshot && !this.deprecationLogged.snapshot) { + console.warn('SymbolLayer: passing children for symbol layer is deprecated, please use @rnmapbox/maps Image component instead. https://github.com/rnmapbox/maps/wiki/Deprecated-SymbolLayerChildren'); + this.deprecationLogged.snapshot = true; + } + return isSnapshot; + } + render() { + const props = { + ...this.baseProps, + snapshot: this._shouldSnapshot(), + sourceLayerID: this.props.sourceLayerID + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXSymbolLayerNativeComponent, _extends({ + ref: this.setNativeLayer + }, props), this.props.children) + ); + } +} +_defineProperty(SymbolLayer, "defaultProps", { + sourceID: Mapbox.StyleSource.DefaultSourceID +}); +//# sourceMappingURL=SymbolLayer.js.map \ No newline at end of file diff --git a/lib/module/components/SymbolLayer.js.map b/lib/module/components/SymbolLayer.js.map new file mode 100644 index 000000000..b48460fd5 --- /dev/null +++ b/lib/module/components/SymbolLayer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","View","NativeModules","RNMBXSymbolLayerNativeComponent","AbstractLayer","NATIVE_MODULE_NAME","Mapbox","RNMBXModule","SymbolLayer","snapshot","_shouldSnapshot","isSnapshot","Children","count","baseProps","children","forEach","child","type","deprecationLogged","console","warn","render","props","sourceLayerID","setNativeLayer","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/SymbolLayer.tsx"],"m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Ae,GAAKF,KAAK,GACjE,IAAI,CAACA,KAAK,CAACR,QAAQ;IACY;EAEtC;AACF;AAAC,gBA1CYP,WAAW,kBACA;EACpBkB,QAAQ,EAAEpB,MAAM,CAACqB,WAAW,CAACC;AAC/B,CAAC"} diff --git a/lib/module/components/Terrain.js b/lib/module/components/Terrain.js new file mode 100644 index 000000000..01774636b --- /dev/null +++ b/lib/module/components/Terrain.js @@ -0,0 +1,24 @@ +import React, { memo, useMemo } from 'react'; +import { transformStyle } from '../utils/StyleValue'; +import RNMBXATerrainNativeComponent from '../specs/RNMBXTerrainNativeComponent'; +export const Terrain = /*#__PURE__*/memo(props => { + let { + style = {} + } = props; + if (props.exaggeration) { + console.warn(`Terrain: exaggeration property is deprecated pls use style.exaggeration instead!`); + style = { + exaggeration: props.exaggeration, + ...style + }; + } + const baseProps = useMemo(() => { + return { + ...props, + reactStyle: transformStyle(style), + style: undefined + }; + }, [props, style]); + return /*#__PURE__*/React.createElement(RNMBXATerrainNativeComponent, baseProps); +}); +//# sourceMappingURL=Terrain.js.map \ No newline at end of file diff --git a/lib/module/components/Terrain.js.map b/lib/module/components/Terrain.js.map new file mode 100644 index 000000000..a304575d1 --- /dev/null +++ b/lib/module/components/Terrain.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","memo","useMemo","transformStyle","RNMBXATerrainNativeComponent","Terrain","props","style","exaggeration","console","warn","baseProps","reactStyle","undefined"],"sourceRoot":"../../../src","sources":["components/Terrain.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAG5C,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,OAAOC,4BAA4B,MAAM,sCAAsC;AAmB/E,OAAO,MAAMC,OAAO,gBAAGJ,IAAI,CAAEK,KAAY,IAAK;EAC5C,IAAI;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGD,KAAK;EAE1B,IAAIA,KAAK,CAACE,YAAY,EAAE;IACtBC,OAAO,CAACC,IAAI,CACT,kFAAiF,CACnF;IACDH,KAAK,GAAG;MAAEC,YAAY,EAAEF,KAAK,CAACE,YAAY;MAAE,GAAGD;IAAM,CAAC;EACxD;EAEA,MAAMI,SAAS,GAAGT,OAAO,CAAC,MAAM;IAC9B,OAAO;MACL,GAAGI,KAAK;MACRM,UAAU,EAAET,cAAc,CAACI,KAAK,CAAC;MACjCA,KAAK,EAAEM;IACT,CAAC;EACH,CAAC,EAAE,CAACP,KAAK,EAAEC,KAAK,CAAC,CAAC;EAElB,oBAAO,oBAAC,4BAA4B,EAAKI,SAAS,CAAI;AACxD,CAAC,CAAC"} diff --git a/lib/module/components/UserLocation.js b/lib/module/components/UserLocation.js new file mode 100644 index 000000000..f29d0d5c0 --- /dev/null +++ b/lib/module/components/UserLocation.js @@ -0,0 +1,206 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import locationManager from '../modules/location/locationManager'; +import Annotation from './Annotation'; +import CircleLayer from './CircleLayer'; +import HeadingIndicator from './HeadingIndicator'; +import NativeUserLocation from './LocationPuck'; +const mapboxBlue = 'rgba(51, 181, 229, 100)'; +const layerStyles = { + normal: { + pulse: { + circleRadius: 15, + circleColor: mapboxBlue, + circleOpacity: 0.2, + circlePitchAlignment: 'map' + }, + background: { + circleRadius: 9, + circleColor: '#fff', + circlePitchAlignment: 'map' + }, + foreground: { + circleRadius: 6, + circleColor: mapboxBlue, + circlePitchAlignment: 'map' + } + } +}; +const normalIcon = (showsUserHeadingIndicator, heading) => [/*#__PURE__*/React.createElement(CircleLayer, { + key: "mapboxUserLocationPulseCircle", + id: "mapboxUserLocationPulseCircle", + style: layerStyles.normal.pulse +}), /*#__PURE__*/React.createElement(CircleLayer, { + key: "mapboxUserLocationWhiteCircle", + id: "mapboxUserLocationWhiteCircle", + style: layerStyles.normal.background +}), /*#__PURE__*/React.createElement(CircleLayer, { + key: "mapboxUserLocationBlueCircle", + id: "mapboxUserLocationBlueCircle", + aboveLayerID: "mapboxUserLocationWhiteCircle", + style: layerStyles.normal.foreground +}), ...(showsUserHeadingIndicator && typeof heading === 'number' ? [HeadingIndicator({ + heading, + key: 'mapboxUserLocationHeadingIndicator' +})] : [])]; +export let UserLocationRenderMode; +(function (UserLocationRenderMode) { + UserLocationRenderMode["Native"] = "native"; + UserLocationRenderMode["Normal"] = "normal"; +})(UserLocationRenderMode || (UserLocationRenderMode = {})); +class UserLocation extends React.Component { + constructor(props) { + super(props); + _defineProperty(this, "_isMounted", undefined); + _defineProperty(this, "locationManagerRunning", false); + this.state = { + shouldShowUserLocation: false, + coordinates: null, + heading: null + }; + this._onLocationUpdate = this._onLocationUpdate.bind(this); + } + + // required as #setLocationManager attempts to setState + // after component unmount + + async componentDidMount() { + this._isMounted = true; + locationManager.setMinDisplacement(this.props.minDisplacement || 0); + await this.setLocationManager({ + running: this.needsLocationManagerRunning() + }); + if (this.props.renderMode === UserLocationRenderMode.Native) { + return; + } + } + async componentDidUpdate(prevProps) { + await this.setLocationManager({ + running: this.needsLocationManagerRunning() + }); + if (this.props.minDisplacement !== prevProps.minDisplacement) { + locationManager.setMinDisplacement(this.props.minDisplacement || 0); + } + if (this.props.requestsAlwaysUse !== prevProps.requestsAlwaysUse) { + locationManager.setRequestsAlwaysUse(this.props.requestsAlwaysUse || false); + } + } + async componentWillUnmount() { + this._isMounted = false; + await this.setLocationManager({ + running: false + }); + } + + /** + * Whether to start or stop listening to the locationManager + * + * Notice, that listening will start automatically when + * either `onUpdate` or `visible` are set + * + * @async + * @param {Object} running - Object with key `running` and `boolean` value + * @return {Promise} + */ + async setLocationManager(_ref) { + let { + running + } = _ref; + if (this.locationManagerRunning !== running) { + this.locationManagerRunning = running; + if (running) { + locationManager.addListener(this._onLocationUpdate); + const location = await locationManager.getLastKnownLocation(); + this._onLocationUpdate(location); + } else { + locationManager.removeListener(this._onLocationUpdate); + } + } + } + + /** + * + * If locationManager should be running + * + * @return {boolean} + */ + needsLocationManagerRunning() { + return !!this.props.onUpdate || this.props.renderMode === UserLocationRenderMode.Normal && this.props.visible; + } + _onLocationUpdate(location) { + if (!this._isMounted || !location) { + return; + } + let coordinates = null; + let heading = null; + if (location && location.coords) { + const { + longitude, + latitude + } = location.coords; + ({ + heading + } = location.coords); + coordinates = [longitude, latitude]; + } + this.setState({ + coordinates, + heading: heading ?? null + }); + if (this.props.onUpdate) { + this.props.onUpdate(location); + } + } + _renderNative() { + const { + androidRenderMode, + showsUserHeadingIndicator + } = this.props; + const props = { + androidRenderMode, + iosShowsUserHeadingIndicator: showsUserHeadingIndicator + }; + return /*#__PURE__*/React.createElement(NativeUserLocation, props); + } + render() { + const { + heading, + coordinates + } = this.state; + const { + children, + visible, + showsUserHeadingIndicator, + onPress, + animated + } = this.props; + if (!visible) { + return null; + } + if (this.props.renderMode === UserLocationRenderMode.Native) { + return this._renderNative(); + } + if (!coordinates) { + return null; + } + return /*#__PURE__*/React.createElement(Annotation, { + id: "mapboxUserLocation", + animated: animated, + onPress: onPress, + coordinates: coordinates, + style: { + iconRotate: heading + } + }, children || normalIcon(showsUserHeadingIndicator, heading)); + } +} +_defineProperty(UserLocation, "defaultProps", { + animated: true, + visible: true, + showsUserHeadingIndicator: false, + requestsAlwaysUse: false, + minDisplacement: 0, + renderMode: UserLocationRenderMode.Normal +}); +export default UserLocation; +//# sourceMappingURL=UserLocation.js.map \ No newline at end of file diff --git a/lib/module/components/UserLocation.js.map b/lib/module/components/UserLocation.js.map new file mode 100644 index 000000000..2b04b48b8 --- /dev/null +++ b/lib/module/components/UserLocation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","locationManager","Annotation","CircleLayer","HeadingIndicator","NativeUserLocation","mapboxBlue","layerStyles","normal","pulse","circleRadius","circleColor","circleOpacity","circlePitchAlignment","background","foreground","normalIcon","showsUserHeadingIndicator","heading","key","UserLocationRenderMode","UserLocation","Component","constructor","props","undefined","state","shouldShowUserLocation","coordinates","_onLocationUpdate","bind","componentDidMount","_isMounted","setMinDisplacement","minDisplacement","setLocationManager","running","needsLocationManagerRunning","renderMode","Native","componentDidUpdate","prevProps","requestsAlwaysUse","setRequestsAlwaysUse","componentWillUnmount","locationManagerRunning","addListener","location","getLastKnownLocation","removeListener","onUpdate","Normal","visible","coords","longitude","latitude","setState","_renderNative","androidRenderMode","iosShowsUserHeadingIndicator","render","children","onPress","animated","iconRotate"],"sourceRoot":"../../../src","sources":["components/UserLocation.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAwB,OAAO;AAE3C,OAAOC,eAAe,MAAM,qCAAqC;AAIjE,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,kBAAkB,MAAM,gBAAgB;AAE/C,MAAMC,UAAU,GAAG,yBAAyB;AAE5C,MAAMC,WAA+D,GAAG;EACtEC,MAAM,EAAE;IACNC,KAAK,EAAE;MACLC,YAAY,EAAE,EAAE;MAChBC,WAAW,EAAEL,UAAU;MACvBM,aAAa,EAAE,GAAG;MAClBC,oBAAoB,EAAE;IACxB,CAAC;IACDC,UAAU,EAAE;MACVJ,YAAY,EAAE,CAAC;MACfC,WAAW,EAAE,MAAM;MACnBE,oBAAoB,EAAE;IACxB,CAAC;IACDE,UAAU,EAAE;MACVL,YAAY,EAAE,CAAC;MACfC,WAAW,EAAEL,UAAU;MACvBO,oBAAoB,EAAE;IACxB;EACF;AACF,CAAC;AAED,MAAMG,UAAU,GAAG,CACjBC,yBAAmC,EACnCC,OAAuB,KACJ,cACnB,oBAAC,WAAW;EACV,GAAG,EAAC,+BAA+B;EACnC,EAAE,EAAC,+BAA+B;EAClC,KAAK,EAAEX,WAAW,CAACC,MAAM,CAACC;AAAM,EAChC,eACF,oBAAC,WAAW;EACV,GAAG,EAAC,+BAA+B;EACnC,EAAE,EAAC,+BAA+B;EAClC,KAAK,EAAEF,WAAW,CAACC,MAAM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U,KAAKlB,sBAAsB,CAACmB,MAAM,EAAE;MAC3D,OAAO,IAAI,CAACkB,aAAa,EAAE;IAC7B;IAEA,IAAI,CAAC7B,WAAW,EAAE;MAChB,OAAO,IAAI;IACb;IAEA,oBACE,oBAAC,UAAU;MACT,EAAE,EAAC,oBAAoB;MACvB,QAAQ,EAAEmC,QAAS;MACnB,OAAO,EAAED,OAAQ;MACjB,WAAW,EAAElC,WAAY;MACzB,KAAK,EAAE;QACLoC,UAAU,EAAE9C;MACd;IAAE,GAED2C,QAAQ,IAAI7C,UAAU,CAACC,yBAAyB,EAAEC,OAAO,CAAC,CAChD;EAEjB;AACF;AAAC,gBAnKKG,YAAY,kBACM;EACpB0C,QAAQ,EAAE,IAAI;EACdX,OAAO,EAAE,IAAI;EACbnC,yBAAyB,EAAE,KAAK;EAChCyB,iBAAiB,EAAE,KAAK;EACxBR,eAAe,EAAE,CAAC;EAClBI,UAAU,EAAElB,sBAAsB,CAAC+B;AACrC,CAAC;AA6JH,eAAe9B,YAAY"} diff --git a/lib/module/components/VectorSource.js b/lib/module/components/VectorSource.js new file mode 100644 index 000000000..521e087fa --- /dev/null +++ b/lib/module/components/VectorSource.js @@ -0,0 +1,86 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import { NativeModules } from 'react-native'; +import RNMBXVectorSourceNativeComponent from '../specs/RNMBXVectorSourceNativeComponent'; +import { cloneReactChildrenWithProps, isFunction } from '../utils'; +import { copyPropertiesAsDeprecated } from '../utils/deprecation'; +import AbstractSource from './AbstractSource'; +const MapboxGL = NativeModules.RNMBXModule; +export const NATIVE_MODULE_NAME = 'RNMBXVectorSource'; +// Omit; +/** + * VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map. + * The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. + */ +class VectorSource extends AbstractSource { + constructor(props) { + super(props); + } + _decodePayload(payload) { + // we check whether the payload is a string, since the strict type safety is enforced only on iOS on the new arch + // on Android, on both archs, the payload is an object + if (typeof payload === 'string') { + return JSON.parse(payload); + } else { + return payload; + } + } + onPress(event) { + const payload = this._decodePayload(event.nativeEvent.payload); + const { + features, + coordinates, + point + } = payload; + let newEvent = { + features, + coordinates, + point + }; + newEvent = copyPropertiesAsDeprecated(event, newEvent, key => { + console.warn(`event.${key} is deprecated on VectorSource#onPress, please use event.features`); + }, { + nativeEvent: origNativeEvent => ({ + ...origNativeEvent, + payload: features[0] + }) + }); + const { + onPress + } = this.props; + if (onPress) { + onPress(newEvent); + } + } + render() { + const props = { + id: this.props.id, + existing: this.props.existing, + url: this.props.url, + tileUrlTemplates: this.props.tileUrlTemplates, + minZoomLevel: this.props.minZoomLevel, + maxZoomLevel: this.props.maxZoomLevel, + tms: this.props.tms, + attribution: this.props.attribution, + hitbox: this.props.hitbox, + hasPressListener: isFunction(this.props.onPress), + onMapboxVectorSourcePress: this.onPress.bind(this), + onPress: undefined + }; + return ( + /*#__PURE__*/ + // @ts-expect-error just codegen stuff + React.createElement(RNMBXVectorSourceNativeComponent, _extends({ + ref: this.setNativeRef + }, props), cloneReactChildrenWithProps(this.props.children, { + sourceID: this.props.id + })) + ); + } +} +_defineProperty(VectorSource, "defaultProps", { + id: MapboxGL.StyleSource.DefaultSourceID +}); +export default VectorSource; +//# sourceMappingURL=VectorSource.js.map \ No newline at end of file diff --git a/lib/module/components/VectorSource.js.map b/lib/module/components/VectorSource.js.map new file mode 100644 index 000000000..e6bc49abb --- /dev/null +++ b/lib/module/components/VectorSource.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","NativeModules","RNMBXVectorSourceNativeComponent","cloneReactChildrenWithProps","isFunction","copyPropertiesAsDeprecated","AbstractSource","MapboxGL","RNMBXModule","NATIVE_MODULE_NAME","VectorSource","constructor","props","_decodePayload","payload","JSON","parse","onPress","event","nativeEvent","features","coordinates","point","newEvent","key","console","warn","origNativeEvent","render","id","existing","url","tileUrlTemplates","minZoomLevel","maxZoomLevel","tms","attribution","hitbox","hasPressListener","onMapboxVectorSourcePress","bind","undefined","setNativeRef","children","sourceID","StyleSource","DefaultSourceID"],"sourceRoot":"../../../src","sources":["components/VectorSource.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAA8B,cAAc;AAElE,OAAOC,gCAAgC,MAAM,2CAA2C;AACxF,SAASC,2BAA2B,EAAEC,UAAU,QAAQ,UAAU;AAClE,SAASC,0BAA0B,QAAQ,sBAAsB;AAGjE,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,QAAQ,GAAGN,aAAa,CAACO,WAAW;AAE1C,OAAO,MAAMC,kBAAkB,GAAG,mBAAmB;AA8E3B;AAC1B;AACA;AACA;AACA;AACA,MAAMC,YAAY,SAASJ,cAAc,CAAqB;EAK5DK,WAAW,CAACC,KAAY,EAAE;IACxB,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,cAAc,CAACC,OAA8B,EAAgB;IAC3D;IACA;IACA,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B,OAAOC,IAAI,CAACC,KAAK,CAACF,OAAO,CAAC;IAC5B,CAAC,MAAM;MACL,OAAOA,OAAO;IAChB;EACF;EAEAG,OAAO,CACLC,KAEE,EACF;IACA,MAAMJ,OAAO,GAAG,IAAI,CAACD,cAAc,CAACK,KAAK,CAACC,WAAW,CAACL,OAAO,CAAC;IAC9D,MAAM;MAAEM,QAAQ;MAAEC,WAAW;MAAEC;IAAM,CAAC,GAAGR,OAAO;IAChD,IAAIS,QAAQ,GAAG;MACbH,QAAQ;MACRC,WAAW;MACXC;IACF,CAAC;IAC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AAE;QAChDC,QAAQ,EAAE,IAAI,CAAChC,KAAK,CAACiB;MACvB,CAAC,CAAC;IAC+B;EAEvC;AACF;AAAC,gBA5EKnB,YAAY,kBACM;EACpBmB,EAAE,EAAEtB,QAAQ,CAACsC,WAAW,CAACC;AAC3B,CAAC;AA2EH,eAAepC,YAAY"} diff --git a/lib/module/components/Viewport.js b/lib/module/components/Viewport.js new file mode 100644 index 000000000..f816d0e49 --- /dev/null +++ b/lib/module/components/Viewport.js @@ -0,0 +1,96 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import React, { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react'; +import { findNodeHandle } from 'react-native'; +import NativeViewport from '../specs/RNMBXViewportNativeComponent'; +import RNMBXViewportModule from '../specs/NativeRNMBXViewportModule'; +/** + * provides a structured approach to organizing camera management logic into states and transitions between them. + * + * At any given time, the viewport is either: + * - idle + * - in a state (camera is being managed by a ViewportState) + * - transitioning between states + * + * See [android](https://docs.mapbox.com/android/maps/api/${ANDROID_SDK_VERSION}/mapbox-maps-android/com.mapbox.maps.plugin.viewport/viewport.html), + * [ios](https://docs.mapbox.com/ios/maps/api/${IOS_SDK_VERSION}/Viewport.html#/s:10MapboxMaps8ViewportC) + */ +export const Viewport = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => { + const commands = useMemo(() => new NativeCommands(RNMBXViewportModule), []); + const nativeViewport = useRef(null); + useEffect(() => { + if (nativeViewport.current) { + commands.setNativeRef(nativeViewport.current); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [commands, nativeViewport.current]); + useImperativeHandle(ref, () => ({ + getState() { + console.log(' => calling getState'); + return commands.call('getState', []); + }, + async idle() { + return commands.call('idle', []); + }, + transitionTo(state, transition) { + return commands.call('transitionTo', [state, transition]); + } + })); + const onStatusChangedNative = useMemo(() => { + const propsOnStatusChanged = props.onStatusChanged; + if (propsOnStatusChanged != null) { + return event => { + propsOnStatusChanged(event.nativeEvent.payload); + }; + } else { + return undefined; + } + }, [props.onStatusChanged]); + return /*#__PURE__*/React.createElement(RNMBXViewport, _extends({}, props, { + hasStatusChanged: props.onStatusChanged != null, + onStatusChanged: onStatusChangedNative, + ref: nativeViewport + })); +})); +const RNMBXViewport = NativeViewport; +class NativeCommands { + constructor(module) { + this.module = module; + this.preRefMethodQueue = []; + } + async setNativeRef(nativeRef) { + if (nativeRef) { + this.nativeRef = nativeRef; + while (this.preRefMethodQueue.length > 0) { + const item = this.preRefMethodQueue.pop(); + if (item && item.method && item.resolver) { + const res = await this._call(item.method.name, nativeRef, item.method.args); + item.resolver(res); + } + } + } + } + call(name, args) { + if (this.nativeRef) { + return this._call(name, this.nativeRef, args); + } else { + return new Promise(resolve => { + this.preRefMethodQueue.push({ + method: { + name, + args + }, + resolver: resolve + }); + }); + } + } + _call(name, nativeRef, args) { + const handle = findNodeHandle(nativeRef); + if (handle) { + return this.module[name](handle, ...args); + } else { + throw new Error(`Could not find handle for native ref ${module} when trying to invoke ${String(name)}`); + } + } +} +//# sourceMappingURL=Viewport.js.map \ No newline at end of file diff --git a/lib/module/components/Viewport.js.map b/lib/module/components/Viewport.js.map new file mode 100644 index 000000000..67b2c758b --- /dev/null +++ b/lib/module/components/Viewport.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","forwardRef","memo","useEffect","useImperativeHandle","useMemo","useRef","findNodeHandle","NativeViewport","RNMBXViewportModule","Viewport","props","ref","commands","NativeCommands","nativeViewport","current","setNativeRef","getState","console","log","call","idle","transitionTo","state","transition","onStatusChangedNative","propsOnStatusChanged","onStatusChanged","event","nativeEvent","payload","undefined","RNMBXViewport","constructor","module","preRefMethodQueue","nativeRef","length","item","pop","method","resolver","res","_call","name","args","Promise","resolve","push","handle","Error","String"],"sourceRoot":"../../../src","sources":["components/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ClB,OAAO,IAAI,CAACO,KAAK,CAACC,IAAI,EAAE,IAAI,CAACR,SAAS,EAAES,IAAI,CAAC;IAC/C,CAAC,MAAM;MACL,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;QAC9B,IAAI,CAACZ,iBAAiB,CAACa,IAAI,CAAC;UAC1BR,MAAM,EAAE;YAAEI,IAAI;YAAEC;UAAK,CAAC;UACtBJ,QAAQ,EAAEM;QACZ,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF;EAEAJ,KAAK,CACHC,IAAwB,EACxBR,SAAkB,EAClBS,IAAiB,EACL;IACZ,MAAMI,MAAM,GAAG3C,cAAc,CAAC8B,SAAS,CAAC;IACxC,IAAIa,MAAM,EAAE;MACV,OACE,IAAI,CAACf,MAAM,CAACU,IAAI,CAAC,CAIjBK,MAAM,EAAE,GAAGJ,IAAI,CAAC;IACpB,CAAC,MAAM;MACL,MAAM,IAAIK,KAAK,CACZ,wCAAuChB,MAAO,0BAAyBiB,MAAM,CAC5EP,IAAI,CACJ,EAAC,CACJ;IACH;EACF;AACF"} diff --git a/lib/module/components/codeparts/LayerPropsCommon.codepart-tsx b/lib/module/components/codeparts/LayerPropsCommon.codepart-tsx new file mode 100644 index 000000000..545326fb8 --- /dev/null +++ b/lib/module/components/codeparts/LayerPropsCommon.codepart-tsx @@ -0,0 +1,62 @@ +type Slot = 'bottom' | 'middle' | 'top'; + +type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; diff --git a/lib/module/global.d.js b/lib/module/global.d.js new file mode 100644 index 000000000..0830f4017 --- /dev/null +++ b/lib/module/global.d.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=global.d.js.map \ No newline at end of file diff --git a/lib/module/global.d.js.map b/lib/module/global.d.js.map new file mode 100644 index 000000000..23edb4a28 --- /dev/null +++ b/lib/module/global.d.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../src","sources":["global.d.ts"],"mappings":""} diff --git a/lib/module/index.js b/lib/module/index.js new file mode 100644 index 000000000..c85970c41 --- /dev/null +++ b/lib/module/index.js @@ -0,0 +1,4 @@ +export * from './Mapbox'; +import * as Mapbox from './Mapbox'; +export default Mapbox; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/module/index.js.map b/lib/module/index.js.map new file mode 100644 index 000000000..808135b11 --- /dev/null +++ b/lib/module/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Mapbox"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,UAAU;AACxB,OAAO,KAAKA,MAAM,MAAM,UAAU;AAElC,eAAeA,MAAM"} diff --git a/lib/module/index.web.js b/lib/module/index.web.js new file mode 100644 index 000000000..4ab4fd280 --- /dev/null +++ b/lib/module/index.web.js @@ -0,0 +1,3 @@ +export * from './web'; +export { default } from './web'; +//# sourceMappingURL=index.web.js.map \ No newline at end of file diff --git a/lib/module/index.web.js.map b/lib/module/index.web.js.map new file mode 100644 index 000000000..d6c5d14b8 --- /dev/null +++ b/lib/module/index.web.js.map @@ -0,0 +1 @@ +{"version":3,"names":["default"],"sourceRoot":"../../src","sources":["index.web.js"],"mappings":"AAAA,cAAc,OAAO;AACrB,SAASA,OAAO,QAAQ,OAAO"} diff --git a/lib/module/modules/location/locationManager.js b/lib/module/modules/location/locationManager.js new file mode 100644 index 000000000..56651cf7e --- /dev/null +++ b/lib/module/modules/location/locationManager.js @@ -0,0 +1,130 @@ +import { NativeModules, NativeEventEmitter, AppState } from 'react-native'; +const MapboxGL = NativeModules.RNMBXModule; +const MapboxGLLocationManager = NativeModules.RNMBXLocationModule; +export const LocationModuleEventEmitter = new NativeEventEmitter(MapboxGLLocationManager); + +/** + * Location sent by locationManager + */ + +/** + * LocationManager is a singleton, see `locationManager` + */ +export class LocationManager { + constructor() { + this._listeners = []; + this._lastKnownLocation = null; + this._isListening = false; + this._requestsAlwaysUse = false; + this._onUpdate = this._onUpdate.bind(this); + this.subscription = null; + this._appStateListener = AppState.addEventListener('change', this._handleAppStateChange.bind(this)); + } + async getLastKnownLocation() { + if (!this._lastKnownLocation) { + let lastKnownLocation; + + // as location can be brittle it might happen, + // that we get an exception from native land + // let's silently catch it and simply log out + // instead of throwing an exception + try { + lastKnownLocation = await MapboxGLLocationManager.getLastKnownLocation(); + } catch (error) { + console.warn('locationManager Error: ', error); + } + if (!this._lastKnownLocation && lastKnownLocation) { + this._lastKnownLocation = lastKnownLocation; + } + } + return this._lastKnownLocation; + } + addListener(listener) { + if (!this._isListening) { + this.start(); + } + if (!this._listeners.includes(listener)) { + this._listeners.push(listener); + if (this._lastKnownLocation) { + listener(this._lastKnownLocation); + } + } + } + removeListener(listener) { + this._listeners = this._listeners.filter(l => l !== listener); + if (this._listeners.length === 0) { + this.stop(); + } + } + removeAllListeners() { + this._listeners = []; + this.stop(); + } + _handleAppStateChange(appState) { + if (!this._requestsAlwaysUse) { + if (appState === 'background') { + this.stop(); + } else if (appState === 'active') { + if (this._listeners.length > 0) { + this.start(); + } + } + } + } + start() { + let displacement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + let validDisplacement = 1; + if (displacement === -1 || displacement === null || displacement === undefined) { + validDisplacement = this._minDisplacement || -1; + } else { + validDisplacement = displacement; + } + if (!this._isListening) { + MapboxGLLocationManager.start(validDisplacement); + this.subscription = LocationModuleEventEmitter.addListener(MapboxGL.LocationCallbackName.Update, this._onUpdate); + this._isListening = true; + } + } + stop() { + MapboxGLLocationManager.stop(); + if (this._isListening && this.subscription) { + this.subscription.remove(); + } + this._isListening = false; + } + setMinDisplacement(minDisplacement) { + this._minDisplacement = minDisplacement; + MapboxGLLocationManager.setMinDisplacement(minDisplacement); + } + setRequestsAlwaysUse(requestsAlwaysUse) { + MapboxGLLocationManager.setRequestsAlwaysUse(requestsAlwaysUse); + this._requestsAlwaysUse = requestsAlwaysUse; + } + _onUpdate(location) { + this._lastKnownLocation = location; + this._listeners.forEach(l => l(location)); + } + + /** + * simulates location updates, experimental [V10, iOS only] + */ + _simulateHeading(changesPerSecond, increment) { + MapboxGLLocationManager.simulateHeading(changesPerSecond, increment); + } + + /** + * Sets the period at which location events will be sent over the React Native bridge. + * The default is 0, aka no limit. [V10, iOS only] + * + * @example + * locationManager.setLocationEventThrottle(500); + * + * @param {Number} throttleValue event throttle value in ms. + * @return {void} + */ + setLocationEventThrottle(throttleValue) { + MapboxGLLocationManager.setLocationEventThrottle(throttleValue); + } +} +export default new LocationManager(); +//# sourceMappingURL=locationManager.js.map \ No newline at end of file diff --git a/lib/module/modules/location/locationManager.js.map b/lib/module/modules/location/locationManager.js.map new file mode 100644 index 000000000..f79aa1f5e --- /dev/null +++ b/lib/module/modules/location/locationManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","NativeEventEmitter","AppState","MapboxGL","RNMBXModule","MapboxGLLocationManager","RNMBXLocationModule","LocationModuleEventEmitter","LocationManager","constructor","_listeners","_lastKnownLocation","_isListening","_requestsAlwaysUse","_onUpdate","bind","subscription","_appStateListener","addEventListener","_handleAppStateChange","getLastKnownLocation","lastKnownLocation","error","console","warn","addListener","listener","start","includes","push","removeListener","filter","l","length","stop","removeAllListeners","appState","displacement","validDisplacement","undefined","_minDisplacement","LocationCallbackName","Update","remove","setMinDisplacement","minDisplacement","setRequestsAlwaysUse","requestsAlwaysUse","location","forEach","_simulateHeading","changesPerSecond","increment","simulateHeading","setLocationEventThrottle","throttleValue"],"sourceRoot":"../../../../src","sources":["modules/location/locationManager.ts"],"mappings":"AAAA,SACEA,aAAa,EACbC,kBAAkB,EAClBC,QAAQ,QAIH,cAAc;AAErB,MAAMC,QAAQ,GAAGH,aAAa,CAACI,WAAW;AAC1C,MAAMC,uBAAuB,GAAGL,aAAa,CAACM,mBAAmB;AAEjE,OAAO,MAAMC,0BAA0B,GAAG,IAAIN,kBAAkB,CAC9DI,uBAAuB,CACxB;;AAED;AACA;AACA;;AAkDA;AACA;AACA;AACA,OAAO,MAAMG,eAAe,CAAC;EAS3BC,WAAW,GAAG;IACZ,IAAI,CAACC,UAAU,GAAG,EAAE;IACpB,IAAI,CAACC,kBAAkB,GAAG,IAAI;IAC9B,IAAI,CAACC,YAAY,GAAG,KAAK;IACzB,IAAI,CAACC,kBAAkB,GAAG,KAAK;IAC/B,IAAI,CAACC,SAAS,GAAG,IAAI,CAACA,SAAS,CAACC,IAAI,CAAC,IAAI,CAAC;IAC1C,IAAI,CAACC,YAAY,GAAG,IAAI;IAExB,IAAI,CAACC,iBAAiB,GAAGf,QAAQ,CAACgB,gBAAgB,CAChD,QAAQ,EACR,IAAI,CAACC,qBAAqB,CAACJ,IAAI,CAAC,IAAI,CAAC,CACtC;EACH;EAEA,MAAMK,oBAAoB,GAAG;IAC3B,IAAI,CAAC,IAAI,CAACT,kBAAkB,EAAE;MAC5B,IAAIU,iBAAiB;;MAErB;MACA;MACA;MACA;MACA,IAAI;QACFA,iBAAiB,GACf,MAAMhB,uBAAuB,CAACe,oBAAoB,EAAE;MACxD,CAAC,CAAC,OAAOE,KAAK,EAAE;QACdC,OAAO,CAACC,IAAI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ACEE,gBAAgB,CAACC,gBAAwB,EAAEC,SAAiB,EAAE;IAC5D/C,uBAAuB,CAACgD,eAAe,CAACF,gBAAgB,EAAEC,SAAS,CAAC;EACtE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,wBAAwB,CAACC,aAAqB,EAAE;IAC9ClD,uBAAuB,CAACiD,wBAAwB,CAACC,aAAa,CAAC;EACjE;AACF;AAEA,eAAe,IAAI/C,eAAe,EAAE"} diff --git a/lib/module/modules/offline/OfflineCreatePackOptions.js b/lib/module/modules/offline/OfflineCreatePackOptions.js new file mode 100644 index 000000000..830bda2ec --- /dev/null +++ b/lib/module/modules/offline/OfflineCreatePackOptions.js @@ -0,0 +1,36 @@ +import { makeLatLngBounds } from '../../utils/geoUtils'; +import { toJSONString } from '../../utils'; +class OfflineCreatePackOptions { + constructor(options) { + this._assert(options); + this.name = options.name; + this.styleURL = options.styleURL; + this.bounds = this._makeLatLngBounds(options.bounds); + this.minZoom = options.minZoom; + this.maxZoom = options.maxZoom; + this.metadata = this._makeMetadata(options.metadata); + } + _assert(options) { + if (!options.styleURL) { + throw new Error('Style URL must be provided for creating an offline pack'); + } + if (!options.name) { + throw new Error('Name must be provided for creating an offline pack'); + } + if (!options.bounds) { + throw new Error('Bounds must be provided for creating an offline pack'); + } + } + _makeLatLngBounds(bounds) { + const [ne, sw] = bounds; + return toJSONString(makeLatLngBounds(ne, sw)); + } + _makeMetadata(metadata) { + return JSON.stringify({ + ...metadata, + name: this.name + }); + } +} +export default OfflineCreatePackOptions; +//# sourceMappingURL=OfflineCreatePackOptions.js.map \ No newline at end of file diff --git a/lib/module/modules/offline/OfflineCreatePackOptions.js.map b/lib/module/modules/offline/OfflineCreatePackOptions.js.map new file mode 100644 index 000000000..c5933e00e --- /dev/null +++ b/lib/module/modules/offline/OfflineCreatePackOptions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["makeLatLngBounds","toJSONString","OfflineCreatePackOptions","constructor","options","_assert","name","styleURL","bounds","_makeLatLngBounds","minZoom","maxZoom","metadata","_makeMetadata","Error","ne","sw","JSON","stringify"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflineCreatePackOptions.ts"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,YAAY,QAAQ,aAAa;AAW1C,MAAMC,wBAAwB,CAAC;EAQ7BC,WAAW,CAACC,OAAqC,EAAE;IACjD,IAAI,CAACC,OAAO,CAACD,OAAO,CAAC;IAErB,IAAI,CAACE,IAAI,GAAGF,OAAO,CAACE,IAAI;IACxB,IAAI,CAACC,QAAQ,GAAGH,OAAO,CAACG,QAAQ;IAChC,IAAI,CAACC,MAAM,GAAG,IAAI,CAACC,iBAAiB,CAACL,OAAO,CAACI,MAAM,CAAC;IACpD,IAAI,CAACE,OAAO,GAAGN,OAAO,CAACM,OAAO;IAC9B,IAAI,CAACC,OAAO,GAAGP,OAAO,CAACO,OAAO;IAC9B,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACC,aAAa,CAACT,OAAO,CAACQ,QAAQ,CAAC;EACtD;EAEAP,OAAO,CAACD,OAAqC,EAAE;IAC7C,IAAI,CAACA,OAAO,CAACG,QAAQ,EAAE;MACrB,MAAM,IAAIO,KAAK,CACb,yDAAyD,CAC1D;IACH;IAEA,IAAI,CAACV,OAAO,CAACE,IAAI,EAAE;MACjB,MAAM,IAAIQ,KAAK,CAAC,oDAAoD,CAAC;IACvE;IAEA,IAAI,CAACV,OAAO,CAACI,MAAM,EAAE;MACnB,MAAM,IAAIM,KAAK,CAAC,sDAAsD,CAAC;IACzE;EACF;EAEAL,iBAAiB,CAACD,MAA4C,EAAU;IACtE,MAAM,CAACO,EAAE,EAAEC,EAAE,CAAC,GAAGR,MAAM;IACvB,OAAOP,YAAY,CAACD,gBAAgB,CAACe,EAAE,EAAEC,EAAE,CAAC,CAAC;EAC/C;EAEAH,aAAa,CAACD,QAA6C,EAAE;IAC3D,OAAOK,IAAI,CAACC,SAAS,CAAC;MACpB,GAAGN,QAAQ;MACXN,IAAI,EAAE,IAAI,CAACA;IACb,CAAC,CAAC;EACJ;AACF;AAEA,eAAeJ,wBAAwB"} diff --git a/lib/module/modules/offline/OfflinePack.js b/lib/module/modules/offline/OfflinePack.js new file mode 100644 index 000000000..707a600ec --- /dev/null +++ b/lib/module/modules/offline/OfflinePack.js @@ -0,0 +1,34 @@ +import { NativeModules } from 'react-native'; +const MapboxGLOfflineManager = NativeModules.RNMBXOfflineModule; +class OfflinePack { + constructor(pack) { + this.pack = pack; + this._metadata = null; + } + get name() { + const { + metadata + } = this; + return metadata && metadata.name; + } + get bounds() { + return this.pack.bounds; + } + get metadata() { + if (!this._metadata && this.pack.metadata) { + this._metadata = JSON.parse(this.pack.metadata); + } + return this._metadata; + } + status() { + return MapboxGLOfflineManager.getPackStatus(this.name); + } + resume() { + return MapboxGLOfflineManager.resumePackDownload(this.name); + } + pause() { + return MapboxGLOfflineManager.pausePackDownload(this.name); + } +} +export default OfflinePack; +//# sourceMappingURL=OfflinePack.js.map \ No newline at end of file diff --git a/lib/module/modules/offline/OfflinePack.js.map b/lib/module/modules/offline/OfflinePack.js.map new file mode 100644 index 000000000..3e9e9ad66 --- /dev/null +++ b/lib/module/modules/offline/OfflinePack.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","MapboxGLOfflineManager","RNMBXOfflineModule","OfflinePack","constructor","pack","_metadata","name","metadata","bounds","JSON","parse","status","getPackStatus","resume","resumePackDownload","pause","pausePackDownload"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflinePack.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAI5C,MAAMC,sBAAsB,GAAGD,aAAa,CAACE,kBAAkB;AAa/D,MAAMC,WAAW,CAAC;EAGhBC,WAAW,CAACC,IAA8B,EAAE;IAC1C,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,SAAS,GAAG,IAAI;EACvB;EAEA,IAAIC,IAAI,GAAG;IACT,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI;IACzB,OAAOA,QAAQ,IAAIA,QAAQ,CAACD,IAAI;EAClC;EAEA,IAAIE,MAAM,GAAG;IACX,OAAO,IAAI,CAACJ,IAAI,CAACI,MAAM;EACzB;EAEA,IAAID,QAAQ,GAAG;IACb,IAAI,CAAC,IAAI,CAACF,SAAS,IAAI,IAAI,CAACD,IAAI,CAACG,QAAQ,EAAE;MACzC,IAAI,CAACF,SAAS,GAAGI,IAAI,CAACC,KAAK,CAAC,IAAI,CAACN,IAAI,CAACG,QAAQ,CAAC;IACjD;IACA,OAAO,IAAI,CAACF,SAAS;EACvB;EAEAM,MAAM,GAA+B;IACnC,OAAOX,sBAAsB,CAACY,aAAa,CAAC,IAAI,CAACN,IAAI,CAAC;EACxD;EAEAO,MAAM,GAAkB;IACtB,OAAOb,sBAAsB,CAACc,kBAAkB,CAAC,IAAI,CAACR,IAAI,CAAC;EAC7D;EAEAS,KAAK,GAAkB;IACrB,OAAOf,sBAAsB,CAACgB,iBAAiB,CAAC,IAAI,CAACV,IAAI,CAAC;EAC5D;AACF;AAEA,eAAeJ,WAAW"} diff --git a/lib/module/modules/offline/OfflinePackLegacy.js b/lib/module/modules/offline/OfflinePackLegacy.js new file mode 100644 index 000000000..77297e34f --- /dev/null +++ b/lib/module/modules/offline/OfflinePackLegacy.js @@ -0,0 +1,34 @@ +import { NativeModules } from 'react-native'; +const MapboxGLOfflineManager = NativeModules.RNMBXOfflineModuleLegacy; +class OfflinePackLegacy { + constructor(pack) { + this.pack = pack; + this._metadata = null; + } + get name() { + const { + metadata + } = this; + return metadata && metadata.name; + } + get bounds() { + return this.pack.bounds; + } + get metadata() { + if (!this._metadata && this.pack.metadata) { + this._metadata = JSON.parse(this.pack.metadata); + } + return this._metadata; + } + status() { + return MapboxGLOfflineManager.getPackStatus(this.name); + } + resume() { + return MapboxGLOfflineManager.resumePackDownload(this.name); + } + pause() { + return MapboxGLOfflineManager.pausePackDownload(this.name); + } +} +export default OfflinePackLegacy; +//# sourceMappingURL=OfflinePackLegacy.js.map \ No newline at end of file diff --git a/lib/module/modules/offline/OfflinePackLegacy.js.map b/lib/module/modules/offline/OfflinePackLegacy.js.map new file mode 100644 index 000000000..86ab50191 --- /dev/null +++ b/lib/module/modules/offline/OfflinePackLegacy.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","MapboxGLOfflineManager","RNMBXOfflineModuleLegacy","OfflinePackLegacy","constructor","pack","_metadata","name","metadata","bounds","JSON","parse","status","getPackStatus","resume","resumePackDownload","pause","pausePackDownload"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflinePackLegacy.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAI5C,MAAMC,sBAAsB,GAAGD,aAAa,CAACE,wBAAwB;AAarE,MAAMC,iBAAiB,CAAC;EAGtBC,WAAW,CAACC,IAA8B,EAAE;IAC1C,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,SAAS,GAAG,IAAI;EACvB;EAEA,IAAIC,IAAI,GAAG;IACT,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI;IACzB,OAAOA,QAAQ,IAAIA,QAAQ,CAACD,IAAI;EAClC;EAEA,IAAIE,MAAM,GAAG;IACX,OAAO,IAAI,CAACJ,IAAI,CAACI,MAAM;EACzB;EAEA,IAAID,QAAQ,GAAG;IACb,IAAI,CAAC,IAAI,CAACF,SAAS,IAAI,IAAI,CAACD,IAAI,CAACG,QAAQ,EAAE;MACzC,IAAI,CAACF,SAAS,GAAGI,IAAI,CAACC,KAAK,CAAC,IAAI,CAACN,IAAI,CAACG,QAAQ,CAAC;IACjD;IACA,OAAO,IAAI,CAACF,SAAS;EACvB;EAEAM,MAAM,GAA+B;IACnC,OAAOX,sBAAsB,CAACY,aAAa,CAAC,IAAI,CAACN,IAAI,CAAC;EACxD;EAEAO,MAAM,GAAkB;IACtB,OAAOb,sBAAsB,CAACc,kBAAkB,CAAC,IAAI,CAACR,IAAI,CAAC;EAC7D;EAEAS,KAAK,GAAkB;IACrB,OAAOf,sBAAsB,CAACgB,iBAAiB,CAAC,IAAI,CAACV,IAAI,CAAC;EAC5D;AACF;AAEA,eAAeJ,iBAAiB"} diff --git a/lib/module/modules/offline/TileStore.js b/lib/module/modules/offline/TileStore.js new file mode 100644 index 000000000..ae0f2331c --- /dev/null +++ b/lib/module/modules/offline/TileStore.js @@ -0,0 +1,38 @@ +import NativeRNMBXTileStoreModule from '../../specs/NativeRNMBXTileStoreModule'; +/** + * TileStore manages downloads and storage for requests to tile-related API endpoints, + * enforcing a disk usage quota: tiles available on disk may be deleted to make room for a new download. + * This interface can be used by an app developer to set the disk quota. + */ + +export default class TileStore { + /** + * Creates a TileStore instance for the given storage path. The returned instance exists as long as it is retained by the client. + * If the tile store instance already exists for the given path this method will return it without creating a new instance, + * thus making sure that there is only one tile store instance for a path at a time. If the given path is empty, the tile + * store at the default location is returned. On iOS, this storage path is excluded from automatic cloud backup. On Android, + * please exclude the storage path in your Manifest. + * Please refer to the [Android Documentation](https://developer.android.com/guide/topics/data/autobackup.html#IncludingFiles) for detailed information. + * + * @param path The path on disk where tiles and metadata will be stored + */ + static async shared(path) { + const __nativeTag = await NativeRNMBXTileStoreModule.shared(path); + return new TileStore(__nativeTag); + } + constructor(__nativeTag) { + this.__nativeTag = __nativeTag; + } + + /** + * Sets additional options for this instance that are specific to a data type. + Params: + key – The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions. domain – The data type this setting should be applied for. value – The value for the configuration option, or null if it should be reset. + */ + async setOption(key, domain, value) { + await NativeRNMBXTileStoreModule.setOption(this.__nativeTag, key, domain, { + value + }); + } +} +//# sourceMappingURL=TileStore.js.map \ No newline at end of file diff --git a/lib/module/modules/offline/TileStore.js.map b/lib/module/modules/offline/TileStore.js.map new file mode 100644 index 000000000..07b897dd8 --- /dev/null +++ b/lib/module/modules/offline/TileStore.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeRNMBXTileStoreModule","TileStore","shared","path","__nativeTag","constructor","setOption","key","domain","value"],"sourceRoot":"../../../../src","sources":["modules/offline/TileStore.ts"],"mappings":"AAAA,OAAOA,0BAA0B,MAAM,wCAAwC;AAK/E;AACA;AACA;AACA;AACA;;AAEA,eAAe,MAAMC,SAAS,CAAC;EAE7B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,MAAM,CAACC,IAAa,EAAsB;IACrD,MAAMC,WAAW,GAAG,MAAMJ,0BAA0B,CAACE,MAAM,CAACC,IAAI,CAAC;IACjE,OAAO,IAAIF,SAAS,CAACG,WAAW,CAAC;EACnC;EAEQC,WAAW,CAACD,WAAmB,EAAE;IACvC,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAME,SAAS,CACbC,GAAW,EACXC,MAAsB,EACtBC,KAAoB,EACL;IACf,MAAMT,0BAA0B,CAACM,SAAS,CAAC,IAAI,CAACF,WAAW,EAAEG,GAAG,EAAEC,MAAM,EAAE;MACxEC;IACF,CAAC,CAAC;EACJ;AACF"} diff --git a/lib/module/modules/offline/offlineManager.js b/lib/module/modules/offline/offlineManager.js new file mode 100644 index 000000000..74a6499e8 --- /dev/null +++ b/lib/module/modules/offline/offlineManager.js @@ -0,0 +1,435 @@ +import { NativeModules, NativeEventEmitter } from 'react-native'; +import { isUndefined, isFunction, isAndroid } from '../../utils'; +export { default as OfflineCreatePackOptions } from './OfflineCreatePackOptions'; +import OfflineCreatePackOptions from './OfflineCreatePackOptions'; +import OfflinePack from './OfflinePack'; +const { + RNMBXModule +} = NativeModules; +const MapboxOfflineManager = NativeModules.RNMBXOfflineModule; +export const OfflineModuleEventEmitter = new NativeEventEmitter(MapboxOfflineManager); +/** + * OfflineManager implements a singleton (shared object) that manages offline packs. + * All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. + * The shared object maintains a canonical collection of offline packs. + */ +class OfflineManager { + constructor() { + this._hasInitialized = false; + this._offlinePacks = {}; + this._progressListeners = {}; + this._errorListeners = {}; + this._onProgress = this._onProgress.bind(this); + this._onError = this._onError.bind(this); + this.subscriptionProgress = null; + this.subscriptionError = null; + } + + /** + * Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); + * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); + * + * await Mapbox.offlineManager.createPack({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }, progressListener, errorListener) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @param {Callback=} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback=} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + async createPack(options, progressListener, errorListener) { + await this._initialize(); + const packOptions = new OfflineCreatePackOptions(options); + if (this._offlinePacks[packOptions.name]) { + throw new Error(`Offline pack with name ${packOptions.name} already exists.`); + } + this.subscribe(packOptions.name, progressListener, errorListener); + const nativeOfflinePack = await MapboxOfflineManager.createPack(packOptions); + this._offlinePacks[packOptions.name] = new OfflinePack(nativeOfflinePack); + } + + /** + * Legacy Download Method - Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); + * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); + * + * await MapboxGL.offlineManager.createPackLegacy({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }, progressListener, errorListener) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @param {Callback=} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback=} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + async createPackLegacy(options, progressListener, errorListener) { + const packOptions = new OfflineCreatePackOptions(options); + this.subscribe(packOptions.name, progressListener, errorListener); + const nativeOfflinePack = await MapboxOfflineManager.createPackLegacy(packOptions); + this._offlinePacks[packOptions.name] = new OfflinePack(nativeOfflinePack); + } + + /** + * Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated. + * + * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. + * + * @example + * await Mapbox.offlineManager.invalidatePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async invalidatePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.invalidatePack(name); + } + } + + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await Mapbox.offlineManager.deletePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async deletePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.deletePack(name); + delete this._offlinePacks[name]; + } + } + + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await MapboxGL.offlineManager.deletePackLegacy('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async deletePackLegacy(name) { + if (!name) { + return; + } + await MapboxOfflineManager.deletePackLegacy(name); + } + + /** + * Forces a revalidation of the tiles in the ambient cache and downloads a fresh version of the tiles from the tile server. + * This is the recommend method for clearing the cache. + * This is the most efficient method because tiles in the ambient cache are re-downloaded to remove outdated data from a device. + * It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects. + * + * @deprecated Not implemented in v10 + * + * @example + * await Mapbox.offlineManager.invalidateAmbientCache(); + * + * @return {void} + */ + async invalidateAmbientCache() { + if (RNMBXModule.MapboxV10) { + console.warn('RNMapbox: invalidateAmbientCache is not implemented on v10'); + return; + } + await this._initialize(); + await MapboxOfflineManager.invalidateAmbientCache(); + } + + /** + * Erases resources from the ambient cache. + * This method clears the cache and decreases the amount of space that map resources take up on the device. + * + * @deprecated Not implemented in v10 + * + * @example + * await Mapbox.offlineManager.clearAmbientCache(); + * + * @return {void} + */ + async clearAmbientCache() { + if (RNMBXModule.MapboxV10) { + console.warn('RNMapbox: clearAmbientCache is not implemented on v10'); + return; + } + await this._initialize(); + await MapboxOfflineManager.clearAmbientCache(); + } + + /** + * Migrates the offline cache from pre-v10 SDKs to the new v10 cache location + * + * @example + * await Mapbox.offlineManager.migrateOfflineCache() + * + * @return {void} + */ + async migrateOfflineCache() { + await MapboxOfflineManager.migrateOfflineCache(); + } + + /** + * Sets the maximum size of the ambient cache in bytes. Disables the ambient cache if set to 0. + * This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased. + * + * @example + * await Mapbox.offlineManager.setMaximumAmbientCacheSize(5000000); + * + * @param {Number} size Size of ambient cache. + * @return {void} + */ + async setMaximumAmbientCacheSize(size) { + await this._initialize(); + await MapboxOfflineManager.setMaximumAmbientCacheSize(size); + } + + /** + * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. + * + * @example + * await Mapbox.offlineManager.resetDatabase(); + * + * @return {void} + */ + async resetDatabase() { + await MapboxOfflineManager.resetDatabase(); + this._offlinePacks = {}; + await this._initialize(true); + } + + /** + * Retrieves all the current offline packs that are stored in the database. + * + * @example + * const offlinePacks = await Mapbox.offlineManager.getPacks(); + * + * @return {Array} + */ + async getPacks() { + await this._initialize(true); + return Object.keys(this._offlinePacks).map(name => this._offlinePacks[name]); + } + + /** + * Retrieves all the current offline legacy packs that are stored in the database. + * + * @example + * const offlinePacks = await MapboxGL.offlineManager.getPacksLegacy(); + * + * @return {Array} + */ + async getPacksLegacy() { + const packs = await MapboxOfflineManager.getPacksLegacy(); + return Object.keys(packs).map(name => ({ + ...packs[name], + metadata: typeof packs[name].metadata === 'string' ? JSON.parse(packs[name].metadata) : packs[name].metadata + })); + } + + /** + * Retrieves an offline pack that is stored in the database by name. + * + * @example + * const offlinePack = await Mapbox.offlineManager.getPack(); + * + * @param {String} name Name of the offline pack. + * @return {OfflinePack} + */ + async getPack(name) { + await this._initialize(true); + return this._offlinePacks[name]; + } + + /** + * Sideloads offline db + * + * @example + * await Mapbox.offlineManager.mergeOfflineRegions(path); + * + * @param {String} path Path to offline tile db on file system. + * @return {void} + */ + async mergeOfflineRegions(path) { + await this._initialize(); + return MapboxOfflineManager.mergeOfflineRegions(path); + } + + /** + * Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. + * + * @example + * Mapbox.offlineManager.setTileCountLimit(1000); + * + * @param {Number} limit Map tile limit count. + * @return {void} + */ + setTileCountLimit(limit) { + MapboxOfflineManager.setTileCountLimit(limit); + } + + /** + * Legacy Download Method - Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. + * + * @example + * MapboxGL.offlineManager.setTileCountLimitLegacy(1000); + * + * @param {Number} limit Map tile limit count. + * @return {void} + */ + setTileCountLimitLegacy(limit) { + MapboxOfflineManager.setTileCountLimitLegacy(limit); + } + + /** + * Sets the period at which download status events will be sent over the React Native bridge. + * The default is 300ms. + * + * @example + * Mapbox.offlineManager.setProgressEventThrottle(500); + * + * @param {Number} throttleValue event throttle value in ms. + * @return {void} + */ + setProgressEventThrottle(throttleValue) { + MapboxOfflineManager.setProgressEventThrottle(throttleValue); + } + + /** + * Subscribe to download status/error events for the requested offline pack. + * Note that createPack calls this internally if listeners are provided. + * + * @example + * const progressListener = (offlinePack, status) => console.log(offlinePack, status) + * const errorListener = (offlinePack, err) => console.log(offlinePack, err) + * Mapbox.offlineManager.subscribe('packName', progressListener, errorListener) + * + * @param {String} packName Name of the offline pack. + * @param {Callback} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + async subscribe(packName, progressListener, errorListener) { + const totalProgressListeners = Object.keys(this._progressListeners).length; + if (isFunction(progressListener)) { + if (totalProgressListeners === 0) { + this.subscriptionProgress = OfflineModuleEventEmitter.addListener(RNMBXModule.OfflineCallbackName.Progress, this._onProgress); + } + this._progressListeners[packName] = progressListener; + } + const totalErrorListeners = Object.keys(this._errorListeners).length; + if (isFunction(errorListener)) { + if (totalErrorListeners === 0) { + this.subscriptionError = OfflineModuleEventEmitter.addListener(RNMBXModule.OfflineCallbackName.Error, this._onError); + } + this._errorListeners[packName] = errorListener; + } + + // we need to manually set the pack observer on Android + // if we're resuming a pack download instead of going thru the create flow + if (isAndroid() && this._offlinePacks[packName]) { + try { + // manually set a listener, since listeners are only set on create flow + await MapboxOfflineManager.setPackObserver(packName); + } catch (e) { + console.log('Unable to set pack observer', e); + } + } + } + + /** + * Unsubscribes any listeners associated with the offline pack. + * It's a good idea to call this on componentWillUnmount. + * + * @example + * Mapbox.offlineManager.unsubscribe('packName') + * + * @param {String} packName Name of the offline pack. + * @return {void} + */ + unsubscribe(packName) { + delete this._progressListeners[packName]; + delete this._errorListeners[packName]; + if (Object.keys(this._progressListeners).length === 0 && this.subscriptionProgress) { + this.subscriptionProgress.remove(); + } + if (Object.keys(this._errorListeners).length === 0 && this.subscriptionError) { + this.subscriptionError.remove(); + } + } + async _initialize(forceInit) { + if (this._hasInitialized && !forceInit) { + return true; + } + const nativeOfflinePacks = await MapboxOfflineManager.getPacks(); + for (const nativeOfflinePack of nativeOfflinePacks) { + const offlinePack = new OfflinePack(nativeOfflinePack); + this._offlinePacks[offlinePack.name] = offlinePack; + } + this._hasInitialized = true; + return true; + } + _onProgress(e) { + const { + name, + state + } = e.payload; + if (!this._hasListeners(name, this._progressListeners)) { + return; + } + const pack = this._offlinePacks[name]; + this._progressListeners[name](pack, e.payload); + + // cleanup listeners now that they are no longer needed + if (state === RNMBXModule.OfflinePackDownloadState.Complete) { + this.unsubscribe(name); + } + } + _onError(e) { + const { + name + } = e.payload; + if (!this._hasListeners(name, this._errorListeners)) { + return; + } + const pack = this._offlinePacks[name]; + this._errorListeners[name](pack, e.payload); + } + _hasListeners(name, listenerMap) { + return !isUndefined(this._offlinePacks[name]) && isFunction(listenerMap[name]); + } +} +const offlineManager = new OfflineManager(); +export default offlineManager; +//# sourceMappingURL=offlineManager.js.map \ No newline at end of file diff --git a/lib/module/modules/offline/offlineManager.js.map b/lib/module/modules/offline/offlineManager.js.map new file mode 100644 index 000000000..567a2dd0e --- /dev/null +++ b/lib/module/modules/offline/offlineManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","NativeEventEmitter","isUndefined","isFunction","isAndroid","default","OfflineCreatePackOptions","OfflinePack","RNMBXModule","MapboxOfflineManager","RNMBXOfflineModule","OfflineModuleEventEmitter","OfflineManager","constructor","_hasInitialized","_offlinePacks","_progressListeners","_errorListeners","_onProgress","bind","_onError","subscriptionProgress","subscriptionError","createPack","options","progressListener","errorListener","_initialize","packOptions","name","Error","subscribe","nativeOfflinePack","createPackLegacy","invalidatePack","offlinePack","deletePack","deletePackLegacy","invalidateAmbientCache","MapboxV10","console","warn","clearAmbientCache","migrateOfflineCache","setMaximumAmbientCacheSize","size","resetDatabase","getPacks","Object","keys","map","getPacksLegacy","packs","metadata","JSON","parse","getPack","mergeOfflineRegions","path","setTileCountLimit","limit","setTileCountLimitLegacy","setProgressEventThrottle","throttleValue","packName","totalProgressListeners","length","addListener","OfflineCallbackName","Progress","totalErrorListeners","setPackObserver","e","log","unsubscribe","remove","forceInit","nativeOfflinePacks","state","payload","_hasListeners","pack","OfflinePackDownloadState","Complete","listenerMap","offlineManager"],"sourceRoot":"../../../../src","sources":["modules/offline/offlineManager.ts"],"mappings":"AAAA,SACEA,aAAa,EACbC,kBAAkB,QAEb,cAAc;AAErB,SAASC,WAAW,EAAEC,UAAU,EAAEC,SAAS,QAAQ,aAAa;AAEhE,SACEC,OAAO,IAAIC,wBAAwB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zE,cAAc,EAAE;AAC3C,eAAeyE,cAAc"} diff --git a/lib/module/modules/offline/offlineManagerLegacy.js b/lib/module/modules/offline/offlineManagerLegacy.js new file mode 100644 index 000000000..49e2f42c5 --- /dev/null +++ b/lib/module/modules/offline/offlineManagerLegacy.js @@ -0,0 +1,154 @@ +import { NativeModules } from 'react-native'; +export { default as OfflineCreatePackOptions } from './OfflineCreatePackOptions'; +import OfflineCreatePackOptions from './OfflineCreatePackOptions'; +import OfflinePack from './OfflinePackLegacy'; +const MapboxOfflineManager = NativeModules.RNMBXOfflineModuleLegacy; + +/** + * OfflineManagerLegacy implements a singleton (shared object) that manages offline packs. + * All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. + * The shared object maintains a canonical collection of offline packs. + */ +class OfflineManagerLegacy { + constructor() { + this._hasInitialized = false; + this._offlinePacks = {}; + } + + /** + * Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * await Mapbox.offlineManager.createPack({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @return {void} + */ + async createPack(options) { + await this._initialize(); + const packOptions = new OfflineCreatePackOptions(options); + if (this._offlinePacks[packOptions.name]) { + throw new Error(`Offline pack with name ${packOptions.name} already exists.`); + } + const nativeOfflinePack = await MapboxOfflineManager.createPack(packOptions); + this._offlinePacks[packOptions.name] = new OfflinePack(nativeOfflinePack); + } + + /** + * Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated. + * + * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. + * + * @example + * await Mapbox.offlineManagerLegacy.invalidatePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async invalidatePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.invalidatePack(name); + } + } + + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await Mapbox.offlineManagerLegacy.deletePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + async deletePack(name) { + if (!name) { + return; + } + await this._initialize(); + const offlinePack = this._offlinePacks[name]; + if (offlinePack) { + await MapboxOfflineManager.deletePack(name); + delete this._offlinePacks[name]; + } + } + + /** + * Migrates the offline cache from pre-v10 SDKs to the new v10 cache location + * + * @example + * await Mapbox.offlineManager.migrateOfflineCache() + * + * @return {void} + */ + async migrateOfflineCache() { + await MapboxOfflineManager.migrateOfflineCache(); + } + + /** + * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. + * + * @example + * await Mapbox.offlineManager.resetDatabase(); + * + * @return {void} + */ + async resetDatabase() { + await MapboxOfflineManager.resetDatabase(); + this._offlinePacks = {}; + await this._initialize(true); + } + + /** + * Retrieves all the current offline packs that are stored in the database. + * + * @example + * const offlinePacks = await Mapbox.offlineManagerLegacy.getPacks(); + * + * @return {Array} + */ + async getPacks() { + await this._initialize(); + return Object.keys(this._offlinePacks).map(name => this._offlinePacks[name]); + } + + /** + * Retrieves an offline pack that is stored in the database by name. + * + * @example + * const offlinePack = await Mapbox.offlineManagerLegacy.getPack(); + * + * @param {String} name Name of the offline pack. + * @return {OfflinePack} + */ + async getPack(name) { + await this._initialize(); + return this._offlinePacks[name]; + } + async _initialize(forceInit) { + if (this._hasInitialized && !forceInit) { + return true; + } + const nativeOfflinePacks = await MapboxOfflineManager.getPacks(); + for (const nativeOfflinePack of nativeOfflinePacks) { + const offlinePack = new OfflinePack(nativeOfflinePack); + this._offlinePacks[offlinePack.name] = offlinePack; + } + this._hasInitialized = true; + return true; + } +} +const offlineManagerLegacy = new OfflineManagerLegacy(); +export default offlineManagerLegacy; +//# sourceMappingURL=offlineManagerLegacy.js.map \ No newline at end of file diff --git a/lib/module/modules/offline/offlineManagerLegacy.js.map b/lib/module/modules/offline/offlineManagerLegacy.js.map new file mode 100644 index 000000000..984a8cc29 --- /dev/null +++ b/lib/module/modules/offline/offlineManagerLegacy.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","default","OfflineCreatePackOptions","OfflinePack","MapboxOfflineManager","RNMBXOfflineModuleLegacy","OfflineManagerLegacy","constructor","_hasInitialized","_offlinePacks","createPack","options","_initialize","packOptions","name","Error","nativeOfflinePack","invalidatePack","offlinePack","deletePack","migrateOfflineCache","resetDatabase","getPacks","Object","keys","map","getPack","forceInit","nativeOfflinePacks","offlineManagerLegacy"],"sourceRoot":"../../../../src","sources":["modules/offline/offlineManagerLegacy.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,SACEC,OAAO,IAAIC,wBAAwB,QAE9B,4BAA4B;AACnC,OAAOA,wBAAwB,MAExB,4BAA4B;AACnC,OAAOC,WAAW,MAAM,qBAAqB;AAE7C,MAAMC,oBAAoB,GAAGJ,aAAa,CAACK,wBAAwB;;AAEnE;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,CAAC;EAIzBC,WAAW,GAAG;IACZ,IAAI,CAACC,eAAe,GAAG,KAAK;IAC5B,IAAI,CAACC,aAAa,GAAG,CAAC,CAAC;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,UAAU,CAACC,OAAqC,EAAiB;IACrE,MAAM,IAAI,CAACC,WAAW,EAAE;IAExB,MAAMC,WAAW,GAAG,IAAIX,wBAAwB,CAACS,OAAO,CAAC;IAEzD,IAAI,IAAI,CAACF,aAAa,CAACI,WAAW,CAACC,IAAI,CAAC,EAAE;MACxC,MAAM,IAAIC,KAAK,CACZ,0BAAyBF,WAAW,CAACC,IAAK,kBAAiB,CAC7D;IACH;IAEA,MAAME,iBAAiB,GAAG,MAAMZ,oBAAoB,CAACM,UAAU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,OAAOW,MAAM,CAACC,IAAI,CAAC,IAAI,CAACf,aAAa,CAAC,CAACgB,GAAG,CACvCX,IAAI,IAAK,IAAI,CAACL,aAAa,CAACK,IAAI,CAAC,CACnC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMY,OAAO,CAACZ,IAAY,EAAoC;IAC5D,MAAM,IAAI,CAACF,WAAW,EAAE;IACxB,OAAO,IAAI,CAACH,aAAa,CAACK,IAAI,CAAC;EACjC;EAEA,MAAMF,WAAW,CAACe,SAAmB,EAAoB;IACvD,IAAI,IAAI,CAACnB,eAAe,IAAI,CAACmB,SAAS,EAAE;MACtC,OAAO,IAAI;IACb;IAEA,MAAMC,kBAAkB,GAAG,MAAMxB,oBAAoB,CAACkB,QAAQ,EAAE;IAEhE,KAAK,MAAMN,iBAAiB,IAAIY,kBAAkB,EAAE;MAClD,MAAMV,WAAW,GAAG,IAAIf,WAAW,CAACa,iBAAiB,CAAC;MACtD,IAAI,CAACP,aAAa,CAACS,WAAW,CAACJ,IAAI,CAAC,GAAGI,WAAW;IACpD;IAEA,IAAI,CAACV,eAAe,GAAG,IAAI;IAC3B,OAAO,IAAI;EACb;AACF;AAEA,MAAMqB,oBAAoB,GAAG,IAAIvB,oBAAoB,EAAE;AACvD,eAAeuB,oBAAoB"} diff --git a/lib/module/modules/snapshot/SnapshotOptions.js b/lib/module/modules/snapshot/SnapshotOptions.js new file mode 100644 index 000000000..4191e92ee --- /dev/null +++ b/lib/module/modules/snapshot/SnapshotOptions.js @@ -0,0 +1,53 @@ +import { NativeModules } from 'react-native'; +import { toJSONString } from '../../utils'; +import { makePoint, makeFeatureCollection } from '../../utils/geoUtils'; +const MapboxGL = NativeModules.RNMBXModule; +class SnapshotOptions { + constructor() { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (!options.centerCoordinate && !options.bounds) { + throw new Error('Center coordinate or bounds must be supplied in order to take a snapshot'); + } + this.styleURL = options.styleURL || MapboxGL.StyleURL.Street; + this.heading = options.heading || 0.0; + this.pitch = options.pitch || 0.0; + this.zoomLevel = options.zoomLevel || 16.0; + this.width = options.width || 50.0; + this.height = options.height || 50.0; + this.writeToDisk = options.writeToDisk || false; + this.withLogo = options.withLogo === undefined ? true : options.withLogo; + if (options.centerCoordinate) { + this.centerCoordinate = this._createCenterCoordPoint(options.centerCoordinate); + } + if (options.bounds) { + this.bounds = this._createBoundsCollection(options.bounds); + } + } + toJSON() { + return { + styleURL: this.styleURL, + heading: this.heading, + pitch: this.pitch, + zoomLevel: this.zoomLevel, + width: this.width, + height: this.height, + writeToDisk: this.writeToDisk, + centerCoordinate: this.centerCoordinate, + bounds: this.bounds, + withLogo: this.withLogo + }; + } + _createCenterCoordPoint(centerCoordinate) { + const point = makePoint(centerCoordinate); + return toJSONString(point); + } + _createBoundsCollection(bounds) { + const features = []; + for (const bound of bounds) { + features.push(makePoint(bound)); + } + return toJSONString(makeFeatureCollection(features)); + } +} +export default SnapshotOptions; +//# sourceMappingURL=SnapshotOptions.js.map \ No newline at end of file diff --git a/lib/module/modules/snapshot/SnapshotOptions.js.map b/lib/module/modules/snapshot/SnapshotOptions.js.map new file mode 100644 index 000000000..d04e0c54d --- /dev/null +++ b/lib/module/modules/snapshot/SnapshotOptions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","toJSONString","makePoint","makeFeatureCollection","MapboxGL","RNMBXModule","SnapshotOptions","constructor","options","centerCoordinate","bounds","Error","styleURL","StyleURL","Street","heading","pitch","zoomLevel","width","height","writeToDisk","withLogo","undefined","_createCenterCoordPoint","_createBoundsCollection","toJSON","point","features","bound","push"],"sourceRoot":"../../../../src","sources":["modules/snapshot/SnapshotOptions.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,SAAS,EAAEC,qBAAqB,QAAQ,sBAAsB;AAEvE,MAAMC,QAAQ,GAAGJ,aAAa,CAACK,WAA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ACzBC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BX,gBAAgB,EAAE,IAAI,CAACA,gBAAgB;MACvCC,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBW,QAAQ,EAAE,IAAI,CAACA;IACjB,CAAC;EACH;EAEAE,uBAAuB,CAACd,gBAA0B,EAAE;IAClD,MAAMiB,KAAK,GAAGxB,SAAS,CAACO,gBAAgB,CAAC;IACzC,OAAOR,YAAY,CAACyB,KAAK,CAAC;EAC5B;EAEAF,uBAAuB,CAACd,MAAkB,EAAE;IAC1C,MAAMiB,QAAQ,GAAG,EAAE;IAEnB,KAAK,MAAMC,KAAK,IAAIlB,MAAM,EAAE;MAC1BiB,QAAQ,CAACE,IAAI,CAAC3B,SAAS,CAAC0B,KAAK,CAAC,CAAC;IACjC;IAEA,OAAO3B,YAAY,CAACE,qBAAqB,CAACwB,QAAQ,CAAC,CAAC;EACtD;AACF;AAEA,eAAerB,eAAe"} diff --git a/lib/module/modules/snapshot/snapshotManager.js b/lib/module/modules/snapshot/snapshotManager.js new file mode 100644 index 000000000..b1154de25 --- /dev/null +++ b/lib/module/modules/snapshot/snapshotManager.js @@ -0,0 +1,60 @@ +import { NativeModules } from 'react-native'; +import SnapshotOptions from './SnapshotOptions'; +const MapboxGLSnapshotManger = NativeModules.RNMBXSnapshotModule; + +/** + * The snapshotManager generates static raster images of the map. + * Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide. + * The snapshotter generates the snapshot asynchronous. + */ +class SnapshotManager { + /** + * Takes a snapshot of the base map using the provided Snapshot options. NOTE pitch, heading, zoomLevel only works when centerCoordinate is set! + * + * @example + * + * // creates a temp file png of base map + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * centerCoordinate: [-74.126410, 40.797968], + * width: width, + * height: height, + * zoomLevel: 12, + * pitch: 30, + * heading: 20, + * styleURL: MapboxGL.StyleURL.Dark, + * writeToDisk: true, // Create a temporary file + * }); + * + * // creates base64 png of base map without logo + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * centerCoordinate: [-74.126410, 40.797968], + * width: width, + * height: height, + * zoomLevel: 12, + * pitch: 30, + * heading: 20, + * styleURL: MapboxGL.StyleURL.Dark, + * withLogo: false, // Disable Mapbox logo (Android only) + * }); + * + * // creates snapshot with bounds + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * bounds: [[-74.126410, 40.797968], [-74.143727, 40.772177]], + * width: width, + * height: height, + * styleURL: MapboxGL.StyleURL.Dark, + * }); + * + * @param {SnapshotOptions} options Snapshot options for create a static image of the base map + * @return {Promise} + */ + async takeSnap() { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const snapshotOptions = new SnapshotOptions(options); + const uri = await MapboxGLSnapshotManger.takeSnap(snapshotOptions); + return uri; + } +} +const snapshotManager = new SnapshotManager(); +export default snapshotManager; +//# sourceMappingURL=snapshotManager.js.map \ No newline at end of file diff --git a/lib/module/modules/snapshot/snapshotManager.js.map b/lib/module/modules/snapshot/snapshotManager.js.map new file mode 100644 index 000000000..5b21e1568 --- /dev/null +++ b/lib/module/modules/snapshot/snapshotManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeModules","SnapshotOptions","MapboxGLSnapshotManger","RNMBXSnapshotModule","SnapshotManager","takeSnap","options","snapshotOptions","uri","snapshotManager"],"sourceRoot":"../../../../src","sources":["modules/snapshot/snapshotManager.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAG5C,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,sBAAsB,GAAGF,aAAa,CAACG,mBAAmB;;AAEhE;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,CAAC;EACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,QAAQ,GAAgC;IAAA,IAA/BC,OAAO,uEAAG,CAAC,CAAC;IACzB,MAAMC,eAAe,GAAG,IAAIN,eAAe,CAACK,OAAO,CAAC;IAEpD,MAAME,GAAG,GAAG,MAAMN,sBAAsB,CAACG,QAAQ,CAACE,eAAe,CAAC;IAClE,OAAOC,GAAG;EACZ;AACF;AAEA,MAAMC,eAAe,GAAG,IAAIL,eAAe,EAAE;AAC7C,eAAeK,eAAe"} diff --git a/lib/module/requestAndroidLocationPermissions.js b/lib/module/requestAndroidLocationPermissions.js new file mode 100644 index 000000000..108b491a3 --- /dev/null +++ b/lib/module/requestAndroidLocationPermissions.js @@ -0,0 +1,19 @@ +import { PermissionsAndroid } from 'react-native'; +import { isAndroid } from './utils'; +export async function requestAndroidLocationPermissions() { + if (isAndroid()) { + const res = await PermissionsAndroid.requestMultiple([PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]); + if (!res) { + return false; + } + const permissions = Object.keys(res); + for (const permission of permissions) { + if (res[permission] === PermissionsAndroid.RESULTS.GRANTED) { + return true; + } + } + return false; + } + throw new Error('You should only call this method on Android!'); +} +//# sourceMappingURL=requestAndroidLocationPermissions.js.map \ No newline at end of file diff --git a/lib/module/requestAndroidLocationPermissions.js.map b/lib/module/requestAndroidLocationPermissions.js.map new file mode 100644 index 000000000..3e0f7ea7d --- /dev/null +++ b/lib/module/requestAndroidLocationPermissions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["PermissionsAndroid","isAndroid","requestAndroidLocationPermissions","res","requestMultiple","PERMISSIONS","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","permissions","Object","keys","permission","RESULTS","GRANTED","Error"],"sourceRoot":"../../src","sources":["requestAndroidLocationPermissions.ts"],"mappings":"AAAA,SAAqBA,kBAAkB,QAAQ,cAAc;AAE7D,SAASC,SAAS,QAAQ,SAAS;AAEnC,OAAO,eAAeC,iCAAiC,GAAqB;EAC1E,IAAID,SAAS,EAAE,EAAE;IACf,MAAME,GAAG,GAAG,MAAMH,kBAAkB,CAACI,eAAe,CAAC,CACnDJ,kBAAkB,CAACK,WAAW,CAACC,oBAAoB,EACnDN,kBAAkB,CAACK,WAAW,CAACE,sBAAsB,CACtD,CAAC;IAEF,IAAI,CAACJ,GAAG,EAAE;MACR,OAAO,KAAK;IACd;IAEA,MAAMK,WAAqB,GAAGC,MAAM,CAACC,IAAI,CAACP,GAAG,CAAC;IAC9C,KAAK,MAAMQ,UAAU,IAAIH,WAAW,EAAE;MACpC,IACEL,GAAG,CAACQ,UAAU,CAAe,KAAKX,kBAAkB,CAACY,OAAO,CAACC,OAAO,EACpE;QACA,OAAO,IAAI;MACb;IACF;IAEA,OAAO,KAAK;EACd;EAEA,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;AACjE"} diff --git a/lib/module/shape_animators/MovePointShapeAnimator.js b/lib/module/shape_animators/MovePointShapeAnimator.js new file mode 100644 index 000000000..849684882 --- /dev/null +++ b/lib/module/shape_animators/MovePointShapeAnimator.js @@ -0,0 +1,13 @@ +import NativeRNMBXMovePointShapeAnimatorModule from '../specs/NativeRNMBXMovePointShapeAnimatorModule'; +import ShapeAnimatorManager from './ShapeAnimatorManager'; +export default class MovePointShapeAnimator { + constructor(from) { + const tag = ShapeAnimatorManager.nextTag(); + NativeRNMBXMovePointShapeAnimatorModule.create(tag, [from[0], from[1]]); + this.__nativeTag = tag; + } + start() { + NativeRNMBXMovePointShapeAnimatorModule.start(this.__nativeTag); + } +} +//# sourceMappingURL=MovePointShapeAnimator.js.map \ No newline at end of file diff --git a/lib/module/shape_animators/MovePointShapeAnimator.js.map b/lib/module/shape_animators/MovePointShapeAnimator.js.map new file mode 100644 index 000000000..ff2452c92 --- /dev/null +++ b/lib/module/shape_animators/MovePointShapeAnimator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeRNMBXMovePointShapeAnimatorModule","ShapeAnimatorManager","MovePointShapeAnimator","constructor","from","tag","nextTag","create","__nativeTag","start"],"sourceRoot":"../../../src","sources":["shape_animators/MovePointShapeAnimator.ts"],"mappings":"AACA,OAAOA,uCAAuC,MAAM,kDAAkD;AAEtG,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,eAAe,MAAMC,sBAAsB,CAAC;EAG1CC,WAAW,CAACC,IAAc,EAAE;IAC1B,MAAMC,GAAG,GAAGJ,oBAAoB,CAACK,OAAO,EAAE;IAC1CN,uCAAuC,CAACO,MAAM,CAACF,GAAG,EAAE,CAACD,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,IAAI,CAACI,WAAW,GAAGH,GAAG;EACxB;EAEAI,KAAK,GAAG;IACNT,uCAAuC,CAACS,KAAK,CAAC,IAAI,CAACD,WAAW,CAAC;EACjE;AACF"} diff --git a/lib/module/shape_animators/ShapeAnimatorManager.js b/lib/module/shape_animators/ShapeAnimatorManager.js new file mode 100644 index 000000000..dcf38c319 --- /dev/null +++ b/lib/module/shape_animators/ShapeAnimatorManager.js @@ -0,0 +1,9 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +export default class ShapeAnimatorManager { + static nextTag() { + this.tag += 1; + return this.tag; + } +} +_defineProperty(ShapeAnimatorManager, "tag", 42); +//# sourceMappingURL=ShapeAnimatorManager.js.map \ No newline at end of file diff --git a/lib/module/shape_animators/ShapeAnimatorManager.js.map b/lib/module/shape_animators/ShapeAnimatorManager.js.map new file mode 100644 index 000000000..c7b9f28e5 --- /dev/null +++ b/lib/module/shape_animators/ShapeAnimatorManager.js.map @@ -0,0 +1 @@ +{"version":3,"names":["ShapeAnimatorManager","nextTag","tag"],"sourceRoot":"../../../src","sources":["shape_animators/ShapeAnimatorManager.tsx"],"mappings":";AAAA,eAAe,MAAMA,oBAAoB,CAAC;EAGxC,OAAOC,OAAO,GAAW;IACvB,IAAI,CAACC,GAAG,IAAI,CAAC;IACb,OAAO,IAAI,CAACA,GAAG;EACjB;AACF;AAAC,gBAPoBF,oBAAoB,SAC1B,EAAE"} diff --git a/lib/module/specs/NativeMapViewModule.js b/lib/module/specs/NativeMapViewModule.js new file mode 100644 index 000000000..12f2fb757 --- /dev/null +++ b/lib/module/specs/NativeMapViewModule.js @@ -0,0 +1,5 @@ +/* eslint-disable @typescript-eslint/ban-types */ + +import { TurboModuleRegistry } from 'react-native'; +export default TurboModuleRegistry.getEnforcing('RNMBXMapViewModule'); +//# sourceMappingURL=NativeMapViewModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeMapViewModule.js.map b/lib/module/specs/NativeMapViewModule.js.map new file mode 100644 index 000000000..46bc2a66c --- /dev/null +++ b/lib/module/specs/NativeMapViewModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeMapViewModule.ts"],"mappings":"AAAA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;AAkDlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,oBAAoB,CAAC"} diff --git a/lib/module/specs/NativeRNMBXImageModule.js b/lib/module/specs/NativeRNMBXImageModule.js new file mode 100644 index 000000000..359a02b0d --- /dev/null +++ b/lib/module/specs/NativeRNMBXImageModule.js @@ -0,0 +1,5 @@ +/* eslint-disable @typescript-eslint/ban-types */ + +import { TurboModuleRegistry } from 'react-native'; +export default TurboModuleRegistry.getEnforcing('RNMBXImageModule'); +//# sourceMappingURL=NativeRNMBXImageModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeRNMBXImageModule.js.map b/lib/module/specs/NativeRNMBXImageModule.js.map new file mode 100644 index 000000000..ab8d1ff8e --- /dev/null +++ b/lib/module/specs/NativeRNMBXImageModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXImageModule.ts"],"mappings":"AAAA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;AAMlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,kBAAkB,CAAC"} diff --git a/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js b/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js new file mode 100644 index 000000000..8e4fb1e4f --- /dev/null +++ b/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js @@ -0,0 +1,6 @@ +import { TurboModuleRegistry } from 'react-native'; + +//import type { UnsafeMixed } from './codegenUtils'; + +export default TurboModuleRegistry.getEnforcing('RNMBXMovePointShapeAnimatorModule'); +//# sourceMappingURL=NativeRNMBXMovePointShapeAnimatorModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map b/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map new file mode 100644 index 000000000..b328abe96 --- /dev/null +++ b/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXMovePointShapeAnimatorModule.ts"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;AASA,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,mCAAmC,CACpC"} diff --git a/lib/module/specs/NativeRNMBXPointAnnotationModule.js b/lib/module/specs/NativeRNMBXPointAnnotationModule.js new file mode 100644 index 000000000..b8771c39b --- /dev/null +++ b/lib/module/specs/NativeRNMBXPointAnnotationModule.js @@ -0,0 +1,5 @@ +/* eslint-disable @typescript-eslint/ban-types */ + +import { TurboModuleRegistry } from 'react-native'; +export default TurboModuleRegistry.getEnforcing('RNMBXPointAnnotationModule'); +//# sourceMappingURL=NativeRNMBXPointAnnotationModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map b/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map new file mode 100644 index 000000000..069b96448 --- /dev/null +++ b/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXPointAnnotationModule.ts"],"mappings":"AAAA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;AAMlD,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,4BAA4B,CAC7B"} diff --git a/lib/module/specs/NativeRNMBXShapeSourceModule.js b/lib/module/specs/NativeRNMBXShapeSourceModule.js new file mode 100644 index 000000000..60216bec0 --- /dev/null +++ b/lib/module/specs/NativeRNMBXShapeSourceModule.js @@ -0,0 +1,5 @@ +/* eslint-disable @typescript-eslint/ban-types */ + +import { TurboModuleRegistry } from 'react-native'; +export default TurboModuleRegistry.getEnforcing('RNMBXShapeSourceModule'); +//# sourceMappingURL=NativeRNMBXShapeSourceModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeRNMBXShapeSourceModule.js.map b/lib/module/specs/NativeRNMBXShapeSourceModule.js.map new file mode 100644 index 000000000..410df4cc3 --- /dev/null +++ b/lib/module/specs/NativeRNMBXShapeSourceModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXShapeSourceModule.ts"],"mappings":"AAAA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;AAmBlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC"} diff --git a/lib/module/specs/NativeRNMBXTileStoreModule.js b/lib/module/specs/NativeRNMBXTileStoreModule.js new file mode 100644 index 000000000..0cf62cd67 --- /dev/null +++ b/lib/module/specs/NativeRNMBXTileStoreModule.js @@ -0,0 +1,6 @@ +import { TurboModuleRegistry } from 'react-native'; + +// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars + +export default TurboModuleRegistry.getEnforcing('RNMBXTileStoreModule'); +//# sourceMappingURL=NativeRNMBXTileStoreModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeRNMBXTileStoreModule.js.map b/lib/module/specs/NativeRNMBXTileStoreModule.js.map new file mode 100644 index 000000000..040e6a147 --- /dev/null +++ b/lib/module/specs/NativeRNMBXTileStoreModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXTileStoreModule.ts"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;AAsBA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,sBAAsB,CAAC"} diff --git a/lib/module/specs/NativeRNMBXViewportModule.js b/lib/module/specs/NativeRNMBXViewportModule.js new file mode 100644 index 000000000..c881adc6c --- /dev/null +++ b/lib/module/specs/NativeRNMBXViewportModule.js @@ -0,0 +1,3 @@ +import { TurboModuleRegistry } from 'react-native'; +export default TurboModuleRegistry.getEnforcing('RNMBXViewportModule'); +//# sourceMappingURL=NativeRNMBXViewportModule.js.map \ No newline at end of file diff --git a/lib/module/specs/NativeRNMBXViewportModule.js.map b/lib/module/specs/NativeRNMBXViewportModule.js.map new file mode 100644 index 000000000..9bbf5a48e --- /dev/null +++ b/lib/module/specs/NativeRNMBXViewportModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeRNMBXViewportModule.ts"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAsClD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC"} diff --git a/lib/module/specs/RNMBXAtmosphereNativeComponent.js b/lib/module/specs/RNMBXAtmosphereNativeComponent.js new file mode 100644 index 000000000..4cf2f7050 --- /dev/null +++ b/lib/module/specs/RNMBXAtmosphereNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXAtmosphere'); +//# sourceMappingURL=RNMBXAtmosphereNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXAtmosphereNativeComponent.js.map b/lib/module/specs/RNMBXAtmosphereNativeComponent.js.map new file mode 100644 index 000000000..46466adff --- /dev/null +++ b/lib/module/specs/RNMBXAtmosphereNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXAtmosphereNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAQ5F,eAAeA,sBAAsB,CACnC,iBAAiB,CAClB"} diff --git a/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js b/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js new file mode 100644 index 000000000..96c989a19 --- /dev/null +++ b/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXBackgroundLayer'); +//# sourceMappingURL=RNMBXBackgroundLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js.map b/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js.map new file mode 100644 index 000000000..11e67aef9 --- /dev/null +++ b/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXBackgroundLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAuB5F,eAAeA,sBAAsB,CACnC,sBAAsB,CACvB"} diff --git a/lib/module/specs/RNMBXCalloutNativeComponent.js b/lib/module/specs/RNMBXCalloutNativeComponent.js new file mode 100644 index 000000000..5bbea6e26 --- /dev/null +++ b/lib/module/specs/RNMBXCalloutNativeComponent.js @@ -0,0 +1,6 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface + +export default codegenNativeComponent('RNMBXCallout'); +//# sourceMappingURL=RNMBXCalloutNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXCalloutNativeComponent.js.map b/lib/module/specs/RNMBXCalloutNativeComponent.js.map new file mode 100644 index 000000000..8edb26461 --- /dev/null +++ b/lib/module/specs/RNMBXCalloutNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCalloutNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;;AAE5F;;AAGA,eAAeA,sBAAsB,CACnC,cAAc,CACf"} diff --git a/lib/module/specs/RNMBXCameraNativeComponent.js b/lib/module/specs/RNMBXCameraNativeComponent.js new file mode 100644 index 000000000..c05df113c --- /dev/null +++ b/lib/module/specs/RNMBXCameraNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXCamera'); +//# sourceMappingURL=RNMBXCameraNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXCameraNativeComponent.js.map b/lib/module/specs/RNMBXCameraNativeComponent.js.map new file mode 100644 index 000000000..31a09a893 --- /dev/null +++ b/lib/module/specs/RNMBXCameraNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCameraNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AA0C5F,eAAeA,sBAAsB,CACnC,aAAa,CACd"} diff --git a/lib/module/specs/RNMBXCircleLayerNativeComponent.js b/lib/module/specs/RNMBXCircleLayerNativeComponent.js new file mode 100644 index 000000000..ce19a253e --- /dev/null +++ b/lib/module/specs/RNMBXCircleLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXCircleLayer'); +//# sourceMappingURL=RNMBXCircleLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXCircleLayerNativeComponent.js.map b/lib/module/specs/RNMBXCircleLayerNativeComponent.js.map new file mode 100644 index 000000000..18a7c664f --- /dev/null +++ b/lib/module/specs/RNMBXCircleLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCircleLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiC5F,eAAeA,sBAAsB,CACnC,kBAAkB,CACnB"} diff --git a/lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js b/lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js new file mode 100644 index 000000000..97689ffcd --- /dev/null +++ b/lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXCustomLocationProvider'); +//# sourceMappingURL=RNMBXCustomLocationProviderNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js.map b/lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js.map new file mode 100644 index 000000000..1c48a18b7 --- /dev/null +++ b/lib/module/specs/RNMBXCustomLocationProviderNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXCustomLocationProviderNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAe5F,eAAeA,sBAAsB,CACnC,6BAA6B,CAC9B"} diff --git a/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js b/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js new file mode 100644 index 000000000..e5fab910e --- /dev/null +++ b/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXFillExtrusionLayer'); +//# sourceMappingURL=RNMBXFillExtrusionLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js.map b/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js.map new file mode 100644 index 000000000..7e8ac3815 --- /dev/null +++ b/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXFillExtrusionLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAwB5F,eAAeA,sBAAsB,CACnC,yBAAyB,CAC1B"} diff --git a/lib/module/specs/RNMBXFillLayerNativeComponent.js b/lib/module/specs/RNMBXFillLayerNativeComponent.js new file mode 100644 index 000000000..dd8d32046 --- /dev/null +++ b/lib/module/specs/RNMBXFillLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXFillLayer'); +//# sourceMappingURL=RNMBXFillLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXFillLayerNativeComponent.js.map b/lib/module/specs/RNMBXFillLayerNativeComponent.js.map new file mode 100644 index 000000000..0ef5ddbf3 --- /dev/null +++ b/lib/module/specs/RNMBXFillLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXFillLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiC5F,eAAeA,sBAAsB,CACnC,gBAAgB,CACjB"} diff --git a/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js b/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js new file mode 100644 index 000000000..8a31f3d88 --- /dev/null +++ b/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXHeatmapLayer'); +//# sourceMappingURL=RNMBXHeatmapLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js.map b/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js.map new file mode 100644 index 000000000..e9168f6f2 --- /dev/null +++ b/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXHeatmapLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiC5F,eAAeA,sBAAsB,CACnC,mBAAmB,CACpB"} diff --git a/lib/module/specs/RNMBXImageNativeComponent.js b/lib/module/specs/RNMBXImageNativeComponent.js new file mode 100644 index 000000000..95bdc8546 --- /dev/null +++ b/lib/module/specs/RNMBXImageNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXImage'); +//# sourceMappingURL=RNMBXImageNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXImageNativeComponent.js.map b/lib/module/specs/RNMBXImageNativeComponent.js.map new file mode 100644 index 000000000..eebb2fdc0 --- /dev/null +++ b/lib/module/specs/RNMBXImageNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXImageNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAc5F,eAAeA,sBAAsB,CACnC,YAAY,CACb"} diff --git a/lib/module/specs/RNMBXImageSourceNativeComponent.js b/lib/module/specs/RNMBXImageSourceNativeComponent.js new file mode 100644 index 000000000..a348f993d --- /dev/null +++ b/lib/module/specs/RNMBXImageSourceNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXImageSource'); +//# sourceMappingURL=RNMBXImageSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXImageSourceNativeComponent.js.map b/lib/module/specs/RNMBXImageSourceNativeComponent.js.map new file mode 100644 index 000000000..55b8d8f30 --- /dev/null +++ b/lib/module/specs/RNMBXImageSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXImageSourceNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAW5F,eAAeA,sBAAsB,CACnC,kBAAkB,CACnB"} diff --git a/lib/module/specs/RNMBXImagesNativeComponent.js b/lib/module/specs/RNMBXImagesNativeComponent.js new file mode 100644 index 000000000..7c4e3e96f --- /dev/null +++ b/lib/module/specs/RNMBXImagesNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXImages'); +//# sourceMappingURL=RNMBXImagesNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXImagesNativeComponent.js.map b/lib/module/specs/RNMBXImagesNativeComponent.js.map new file mode 100644 index 000000000..fe5d4680c --- /dev/null +++ b/lib/module/specs/RNMBXImagesNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXImagesNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAc5F,eAAeA,sBAAsB,CACnC,aAAa,CACd"} diff --git a/lib/module/specs/RNMBXLightNativeComponent.js b/lib/module/specs/RNMBXLightNativeComponent.js new file mode 100644 index 000000000..54e66a018 --- /dev/null +++ b/lib/module/specs/RNMBXLightNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXLight'); +//# sourceMappingURL=RNMBXLightNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXLightNativeComponent.js.map b/lib/module/specs/RNMBXLightNativeComponent.js.map new file mode 100644 index 000000000..9bd088e7b --- /dev/null +++ b/lib/module/specs/RNMBXLightNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXLightNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAQ5F,eAAeA,sBAAsB,CACnC,YAAY,CACb"} diff --git a/lib/module/specs/RNMBXLineLayerNativeComponent.js b/lib/module/specs/RNMBXLineLayerNativeComponent.js new file mode 100644 index 000000000..d2efd3d46 --- /dev/null +++ b/lib/module/specs/RNMBXLineLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXLineLayer'); +//# sourceMappingURL=RNMBXLineLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXLineLayerNativeComponent.js.map b/lib/module/specs/RNMBXLineLayerNativeComponent.js.map new file mode 100644 index 000000000..47d4544e2 --- /dev/null +++ b/lib/module/specs/RNMBXLineLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXLineLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiC5F,eAAeA,sBAAsB,CACnC,gBAAgB,CACjB"} diff --git a/lib/module/specs/RNMBXMapViewNativeComponent.js b/lib/module/specs/RNMBXMapViewNativeComponent.js new file mode 100644 index 000000000..8d7cf5320 --- /dev/null +++ b/lib/module/specs/RNMBXMapViewNativeComponent.js @@ -0,0 +1,5 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXMapView'); + +// The actually types for callbacks are sometwhat different due to codegen limitations: +//# sourceMappingURL=RNMBXMapViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXMapViewNativeComponent.js.map b/lib/module/specs/RNMBXMapViewNativeComponent.js.map new file mode 100644 index 000000000..d946a7a81 --- /dev/null +++ b/lib/module/specs/RNMBXMapViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMapViewNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiF5F,eAAeA,sBAAsB,CACnC,cAAc,CACf;;AAED"} diff --git a/lib/module/specs/RNMBXMarkerViewContentNativeComponent.js b/lib/module/specs/RNMBXMarkerViewContentNativeComponent.js new file mode 100644 index 000000000..a5b4573a5 --- /dev/null +++ b/lib/module/specs/RNMBXMarkerViewContentNativeComponent.js @@ -0,0 +1,6 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface + +export default codegenNativeComponent('RNMBXMarkerViewContent'); +//# sourceMappingURL=RNMBXMarkerViewContentNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXMarkerViewContentNativeComponent.js.map b/lib/module/specs/RNMBXMarkerViewContentNativeComponent.js.map new file mode 100644 index 000000000..038f6cb7d --- /dev/null +++ b/lib/module/specs/RNMBXMarkerViewContentNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMarkerViewContentNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;;AAE5F;;AAGA,eAAeA,sBAAsB,CACnC,wBAAwB,CACzB"} diff --git a/lib/module/specs/RNMBXMarkerViewNativeComponent.js b/lib/module/specs/RNMBXMarkerViewNativeComponent.js new file mode 100644 index 000000000..b17599acd --- /dev/null +++ b/lib/module/specs/RNMBXMarkerViewNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXMarkerView'); +//# sourceMappingURL=RNMBXMarkerViewNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXMarkerViewNativeComponent.js.map b/lib/module/specs/RNMBXMarkerViewNativeComponent.js.map new file mode 100644 index 000000000..a63e12c8f --- /dev/null +++ b/lib/module/specs/RNMBXMarkerViewNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMarkerViewNativeComponent.ts"],"mappings":"AAEA,OAAOA,sBAAsB,MAAM,yDAAyD;AAmB5F,eAAeA,sBAAsB,CACnC,iBAAiB,CAClB"} diff --git a/lib/module/specs/RNMBXModelLayerNativeComponent.js b/lib/module/specs/RNMBXModelLayerNativeComponent.js new file mode 100644 index 000000000..53b510243 --- /dev/null +++ b/lib/module/specs/RNMBXModelLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXModelLayer'); +//# sourceMappingURL=RNMBXModelLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXModelLayerNativeComponent.js.map b/lib/module/specs/RNMBXModelLayerNativeComponent.js.map new file mode 100644 index 000000000..afd83abff --- /dev/null +++ b/lib/module/specs/RNMBXModelLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXModelLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAkC5F,eAAeA,sBAAsB,CACnC,iBAAiB,CAClB"} diff --git a/lib/module/specs/RNMBXModelsNativeComponent.js b/lib/module/specs/RNMBXModelsNativeComponent.js new file mode 100644 index 000000000..9e758ccce --- /dev/null +++ b/lib/module/specs/RNMBXModelsNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXModels'); +//# sourceMappingURL=RNMBXModelsNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXModelsNativeComponent.js.map b/lib/module/specs/RNMBXModelsNativeComponent.js.map new file mode 100644 index 000000000..5ae51c4ef --- /dev/null +++ b/lib/module/specs/RNMBXModelsNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXModelsNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAc5F,eAAeA,sBAAsB,CACnC,aAAa,CACd"} diff --git a/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js b/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js new file mode 100644 index 000000000..c874230a4 --- /dev/null +++ b/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXNativeUserLocation'); +//# sourceMappingURL=RNMBXNativeUserLocationNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map b/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map new file mode 100644 index 000000000..7f8191adf --- /dev/null +++ b/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXNativeUserLocationNativeComponent.ts"],"mappings":"AAKA,OAAOA,sBAAsB,MAAM,yDAAyD;AA+B5F,eAAeA,sBAAsB,CACnC,yBAAyB,CAC1B"} diff --git a/lib/module/specs/RNMBXPointAnnotationNativeComponent.js b/lib/module/specs/RNMBXPointAnnotationNativeComponent.js new file mode 100644 index 000000000..19016700c --- /dev/null +++ b/lib/module/specs/RNMBXPointAnnotationNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXPointAnnotation'); +//# sourceMappingURL=RNMBXPointAnnotationNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map b/lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map new file mode 100644 index 000000000..e4c0a8da6 --- /dev/null +++ b/lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXPointAnnotationNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAoC5F,eAAeA,sBAAsB,CACnC,sBAAsB,CACvB"} diff --git a/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js b/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js new file mode 100644 index 000000000..d1d3faa8d --- /dev/null +++ b/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXRasterDemSource'); +//# sourceMappingURL=RNMBXRasterDemSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js.map b/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js.map new file mode 100644 index 000000000..eaa5501d0 --- /dev/null +++ b/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXRasterDemSourceNativeComponent.ts"],"mappings":"AAEA,OAAOA,sBAAsB,MAAM,yDAAyD;AAc5F,eAAeA,sBAAsB,CACnC,sBAAsB,CACvB"} diff --git a/lib/module/specs/RNMBXRasterLayerNativeComponent.js b/lib/module/specs/RNMBXRasterLayerNativeComponent.js new file mode 100644 index 000000000..5dbad034c --- /dev/null +++ b/lib/module/specs/RNMBXRasterLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXRasterLayer'); +//# sourceMappingURL=RNMBXRasterLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXRasterLayerNativeComponent.js.map b/lib/module/specs/RNMBXRasterLayerNativeComponent.js.map new file mode 100644 index 000000000..352992432 --- /dev/null +++ b/lib/module/specs/RNMBXRasterLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXRasterLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiC5F,eAAeA,sBAAsB,CACnC,kBAAkB,CACnB"} diff --git a/lib/module/specs/RNMBXRasterSourceNativeComponent.js b/lib/module/specs/RNMBXRasterSourceNativeComponent.js new file mode 100644 index 000000000..96fbe9a10 --- /dev/null +++ b/lib/module/specs/RNMBXRasterSourceNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXRasterSource'); +//# sourceMappingURL=RNMBXRasterSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXRasterSourceNativeComponent.js.map b/lib/module/specs/RNMBXRasterSourceNativeComponent.js.map new file mode 100644 index 000000000..fe81c11f4 --- /dev/null +++ b/lib/module/specs/RNMBXRasterSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXRasterSourceNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiB5F,eAAeA,sBAAsB,CACnC,mBAAmB,CACpB"} diff --git a/lib/module/specs/RNMBXShapeSourceNativeComponent.js b/lib/module/specs/RNMBXShapeSourceNativeComponent.js new file mode 100644 index 000000000..8833c4cc6 --- /dev/null +++ b/lib/module/specs/RNMBXShapeSourceNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXShapeSource'); +//# sourceMappingURL=RNMBXShapeSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map b/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map new file mode 100644 index 000000000..15390f0cf --- /dev/null +++ b/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXShapeSourceNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AA6B5F,eAAeA,sBAAsB,CACnC,kBAAkB,CACnB"} diff --git a/lib/module/specs/RNMBXSkyLayerNativeComponent.js b/lib/module/specs/RNMBXSkyLayerNativeComponent.js new file mode 100644 index 000000000..8c8d5ae5f --- /dev/null +++ b/lib/module/specs/RNMBXSkyLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXSkyLayer'); +//# sourceMappingURL=RNMBXSkyLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXSkyLayerNativeComponent.js.map b/lib/module/specs/RNMBXSkyLayerNativeComponent.js.map new file mode 100644 index 000000000..23932d1b8 --- /dev/null +++ b/lib/module/specs/RNMBXSkyLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXSkyLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAuB5F,eAAeA,sBAAsB,CACnC,eAAe,CAChB"} diff --git a/lib/module/specs/RNMBXStyleImportNativeComponent.js b/lib/module/specs/RNMBXStyleImportNativeComponent.js new file mode 100644 index 000000000..efdfca159 --- /dev/null +++ b/lib/module/specs/RNMBXStyleImportNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXStyleImport'); +//# sourceMappingURL=RNMBXStyleImportNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXStyleImportNativeComponent.js.map b/lib/module/specs/RNMBXStyleImportNativeComponent.js.map new file mode 100644 index 000000000..08554efc8 --- /dev/null +++ b/lib/module/specs/RNMBXStyleImportNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXStyleImportNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAU5F,eAAeA,sBAAsB,CACnC,kBAAkB,CACnB"} diff --git a/lib/module/specs/RNMBXSymbolLayerNativeComponent.js b/lib/module/specs/RNMBXSymbolLayerNativeComponent.js new file mode 100644 index 000000000..c79cb8f26 --- /dev/null +++ b/lib/module/specs/RNMBXSymbolLayerNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXSymbolLayer'); +//# sourceMappingURL=RNMBXSymbolLayerNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXSymbolLayerNativeComponent.js.map b/lib/module/specs/RNMBXSymbolLayerNativeComponent.js.map new file mode 100644 index 000000000..cb504a487 --- /dev/null +++ b/lib/module/specs/RNMBXSymbolLayerNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXSymbolLayerNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiC5F,eAAeA,sBAAsB,CACnC,kBAAkB,CACnB"} diff --git a/lib/module/specs/RNMBXTerrainNativeComponent.js b/lib/module/specs/RNMBXTerrainNativeComponent.js new file mode 100644 index 000000000..eba7a7f11 --- /dev/null +++ b/lib/module/specs/RNMBXTerrainNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXTerrain'); +//# sourceMappingURL=RNMBXTerrainNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXTerrainNativeComponent.js.map b/lib/module/specs/RNMBXTerrainNativeComponent.js.map new file mode 100644 index 000000000..965928581 --- /dev/null +++ b/lib/module/specs/RNMBXTerrainNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXTerrainNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAS5F,eAAeA,sBAAsB,CACnC,cAAc,CACf"} diff --git a/lib/module/specs/RNMBXVectorSourceNativeComponent.js b/lib/module/specs/RNMBXVectorSourceNativeComponent.js new file mode 100644 index 000000000..ea37457d4 --- /dev/null +++ b/lib/module/specs/RNMBXVectorSourceNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXVectorSource'); +//# sourceMappingURL=RNMBXVectorSourceNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXVectorSourceNativeComponent.js.map b/lib/module/specs/RNMBXVectorSourceNativeComponent.js.map new file mode 100644 index 000000000..2bd9e65df --- /dev/null +++ b/lib/module/specs/RNMBXVectorSourceNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXVectorSourceNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAwB5F,eAAeA,sBAAsB,CACnC,mBAAmB,CACpB"} diff --git a/lib/module/specs/RNMBXViewportNativeComponent.js b/lib/module/specs/RNMBXViewportNativeComponent.js new file mode 100644 index 000000000..5e24c87a9 --- /dev/null +++ b/lib/module/specs/RNMBXViewportNativeComponent.js @@ -0,0 +1,3 @@ +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +export default codegenNativeComponent('RNMBXViewport'); +//# sourceMappingURL=RNMBXViewportNativeComponent.js.map \ No newline at end of file diff --git a/lib/module/specs/RNMBXViewportNativeComponent.js.map b/lib/module/specs/RNMBXViewportNativeComponent.js.map new file mode 100644 index 000000000..d22da0a07 --- /dev/null +++ b/lib/module/specs/RNMBXViewportNativeComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXViewportNativeComponent.ts"],"mappings":"AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AA2G5F,eAAeA,sBAAsB,CACnC,eAAe,CAChB"} diff --git a/lib/module/specs/codegenUtils.js b/lib/module/specs/codegenUtils.js new file mode 100644 index 000000000..fe598cd57 --- /dev/null +++ b/lib/module/specs/codegenUtils.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=codegenUtils.js.map \ No newline at end of file diff --git a/lib/module/specs/codegenUtils.js.map b/lib/module/specs/codegenUtils.js.map new file mode 100644 index 000000000..208731b62 --- /dev/null +++ b/lib/module/specs/codegenUtils.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/codegenUtils.ts"],"mappings":""} diff --git a/lib/module/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts b/lib/module/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts new file mode 100644 index 000000000..7717d2757 --- /dev/null +++ b/lib/module/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts @@ -0,0 +1,18 @@ +// see https://github.com/rnmapbox/maps/wiki/FabricOptionalProp +type OptionalProp = UnsafeMixed; +type Slot = 'bottom' | 'middle' | 'top'; + +type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; diff --git a/lib/module/types/BaseProps.js b/lib/module/types/BaseProps.js new file mode 100644 index 000000000..b3280b660 --- /dev/null +++ b/lib/module/types/BaseProps.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=BaseProps.js.map \ No newline at end of file diff --git a/lib/module/types/BaseProps.js.map b/lib/module/types/BaseProps.js.map new file mode 100644 index 000000000..adbd1fbd9 --- /dev/null +++ b/lib/module/types/BaseProps.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/BaseProps.ts"],"mappings":""} diff --git a/lib/module/types/OnPressEvent.js b/lib/module/types/OnPressEvent.js new file mode 100644 index 000000000..7e328c7bf --- /dev/null +++ b/lib/module/types/OnPressEvent.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=OnPressEvent.js.map \ No newline at end of file diff --git a/lib/module/types/OnPressEvent.js.map b/lib/module/types/OnPressEvent.js.map new file mode 100644 index 000000000..197dc88ce --- /dev/null +++ b/lib/module/types/OnPressEvent.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/OnPressEvent.ts"],"mappings":""} diff --git a/lib/module/types/Position.js b/lib/module/types/Position.js new file mode 100644 index 000000000..b922decb0 --- /dev/null +++ b/lib/module/types/Position.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=Position.js.map \ No newline at end of file diff --git a/lib/module/types/Position.js.map b/lib/module/types/Position.js.map new file mode 100644 index 000000000..eda9b67cb --- /dev/null +++ b/lib/module/types/Position.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Position.ts"],"mappings":""} diff --git a/lib/module/types/index.js b/lib/module/types/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/lib/module/types/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/module/types/index.js.map b/lib/module/types/index.js.map new file mode 100644 index 000000000..010d2638c --- /dev/null +++ b/lib/module/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":""} diff --git a/lib/module/utils/BridgeValue.js b/lib/module/utils/BridgeValue.js new file mode 100644 index 000000000..d0ab37d1c --- /dev/null +++ b/lib/module/utils/BridgeValue.js @@ -0,0 +1,57 @@ +import { isBoolean, isNumber, isString } from './index'; +export default class BridgeValue { + constructor(rawValue) { + this.rawValue = rawValue; + } + get type() { + if (Array.isArray(this.rawValue)) { + return 'array'; + } + if (isBoolean(this.rawValue)) { + return 'boolean'; + } + if (isNumber(this.rawValue)) { + return 'number'; + } + if (isString(this.rawValue)) { + return 'string'; + } + if (this.rawValue && typeof this.rawValue === 'object') { + return 'hashmap'; + } + throw new Error(`[type - ${this.rawValue}] BridgeValue must be a primitive/array/object`); + } + get value() { + const { + type + } = this; + let value; + if (type === 'array') { + value = []; + const rawValue = this.rawValue; + for (const innerRawValue of rawValue) { + const bridgeValue = new BridgeValue(innerRawValue); + value.push(bridgeValue.toJSON()); + } + } else if (type === 'hashmap') { + value = []; + const rawValue = this.rawValue; + const stringKeys = Object.keys(rawValue); + for (const stringKey of stringKeys) { + value.push([new BridgeValue(stringKey).toJSON(), new BridgeValue(rawValue[stringKey]).toJSON()]); + } + } else if (type === 'boolean' || type === 'number' || type === 'string') { + value = this.rawValue; + } else { + throw new Error(`[value - ${this.rawValue}] BridgeValue must be a primitive/array/object`); + } + return value; + } + toJSON(formatter) { + return { + type: this.type, + value: typeof formatter === 'function' ? formatter(this.value) : this.value + }; + } +} +//# sourceMappingURL=BridgeValue.js.map \ No newline at end of file diff --git a/lib/module/utils/BridgeValue.js.map b/lib/module/utils/BridgeValue.js.map new file mode 100644 index 000000000..d07ed771b --- /dev/null +++ b/lib/module/utils/BridgeValue.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isBoolean","isNumber","isString","BridgeValue","constructor","rawValue","type","Array","isArray","Error","value","innerRawValue","bridgeValue","push","toJSON","stringKeys","Object","keys","stringKey","formatter"],"sourceRoot":"../../../src","sources":["utils/BridgeValue.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,SAAS;AAkBvD,eAAe,MAAMC,WAAW,CAAC;EAG/BC,WAAW,CAACC,QAAsB,EAAE;IAClC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAEA,IAAIC,IAAI,GAAoB;IAC1B,IAAIC,KAAK,CAACC,OAAO,CAAC,IAAI,CAACH,QAAQ,CAAC,EAAE;MAChC,OAAO,OAAO;IAChB;IACA,IAAIL,SAAS,CAAC,IAAI,CAACK,QAAQ,CAAC,EAAE;MAC5B,OAAO,SAAS;IAClB;IACA,IAAIJ,QAAQ,CAAC,IAAI,CAACI,QAAQ,CAAC,EAAE;MAC3B,OAAO,QAAQ;IACjB;IACA,IAAIH,QAAQ,CAAC,IAAI,CAACG,QAAQ,CAAC,EAAE;MAC3B,OAAO,QAAQ;IACjB;IACA,IAAI,IAAI,CAACA,QAAQ,IAAI,OAAO,IAAI,CAACA,QAAQ,KAAK,QAAQ,EAAE;MACtD,OAAO,SAAS;IAClB;IACA,MAAM,IA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C,IAAI,CAACT,KAAK,CAAC,GAAG,IAAI,CAACA;IACnE,CAAC;EACH;AACF"} diff --git a/lib/module/utils/Logger.js b/lib/module/utils/Logger.js new file mode 100644 index 000000000..72f28f0dc --- /dev/null +++ b/lib/module/utils/Logger.js @@ -0,0 +1,112 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import { NativeEventEmitter, NativeModules } from 'react-native'; +const { + RNMBXLogging +} = NativeModules; +class Logger { + static sharedInstance() { + if (this.instance === null) { + this.instance = new Logger(); + } + return this.instance; + } + constructor() { + this.loggerEmitter = new NativeEventEmitter(RNMBXLogging); + this.startedCount = 0; + this.logCallback = undefined; + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + static setLogCallback(logCallback) { + this.sharedInstance().setLogCallback(logCallback); + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + setLogCallback(logCallback) { + this.logCallback = logCallback; + } + + /** + * This callback is displayed as part of the Requester class. + * @callback Logger~logCallback + * @param {object} log + * @param {string} log.message - the message of the log + * @param {string} log.level - log level + * @param {string} log.tag - optional tag used on android + */ + + /** + * setLogLevel + * @param {LogLevel} level + */ + static setLogLevel(level) { + RNMBXLogging.setLogLevel(level); + } + + /** + * @type {('error'|'warning'|'info'|'debug'|'verbose')} LogLevel - Supported log levels + */ + start() { + if (this.startedCount === 0) { + this.subscribe(); + } + this.startedCount += 1; + } + stop() { + this.startedCount -= 1; + if (this.startedCount === 0) { + this.unsubscribe(); + } + } + subscribe() { + this.subscription = this.loggerEmitter.addListener('LogEvent', log => { + this.onLog(log); + }); + } + unsubscribe() { + var _this$subscription; + (_this$subscription = this.subscription) === null || _this$subscription === void 0 ? void 0 : _this$subscription.remove(); + this.subscription = undefined; + } + effectiveLevel(log) { + const { + level, + message, + tag + } = log; + if (level === 'warning') { + if (tag === 'Mbgl-HttpRequest' && message.startsWith('Request failed due to a permanent error: Canceled')) { + // this seems to happening too much to show a warning every time + return 'info'; + } + } + return level; + } + onLog(log) { + if (!this.logCallback || !this.logCallback(log)) { + const { + message + } = log; + const level = this.effectiveLevel(log); + if (level === 'error') { + console.error('Mapbox error', message, log); + } else if (level === 'warning') { + console.warn('Mapbox warning', message, log); + } else { + console.log(`Mapbox [${level}]`, message, log); + } + } + } +} +_defineProperty(Logger, "instance", null); +Logger.sharedInstance().start(); +export default Logger; +//# sourceMappingURL=Logger.js.map \ No newline at end of file diff --git a/lib/module/utils/Logger.js.map b/lib/module/utils/Logger.js.map new file mode 100644 index 000000000..2efc053f4 --- /dev/null +++ b/lib/module/utils/Logger.js.map @@ -0,0 +1 @@ +{"version":3,"names":["NativeEventEmitter","NativeModules","RNMBXLogging","Logger","sharedInstance","instance","constructor","loggerEmitter","startedCount","logCallback","undefined","setLogCallback","setLogLevel","level","start","subscribe","stop","unsubscribe","subscription","addListener","log","onLog","remove","effectiveLevel","message","tag","startsWith","console","error","warn"],"sourceRoot":"../../../src","sources":["utils/Logger.ts"],"mappings":";AAAA,SAEEA,kBAAkB,EAClBC,aAAa,QACR,cAAc;AACrB,MAAM;EAAEC;AAAa,CAAC,GAAGD,aAAa;AAYtC,MAAME,MAAM,CAAC;EAQX,OAAOC,cAAc,GAAG;IACtB,IAAI,IAAI,CAACC,QAAQ,KAAK,IAAI,EAAE;MAC1B,IAAI,CAACA,QAAQ,GAAG,IAAIF,MAAM,EAAE;IAC9B;IACA,OAAO,IAAI,CAACE,QAAQ;EACtB;EAEAC,WAAW,GAAG;IACZ,IAAI,CAACC,aAAa,GAAG,IAAIP,kBAAkB,CAACE,YAAY,CAAC;IACzD,IAAI,CAACM,YAAY,GAAG,CAAC;IACrB,IAAI,CAACC,WAAW,GAAGC,SAAS;EAC9B;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,cAAc,CAACF,W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,CAACD,GAAc,EAAE;IACpB,IAAI,CAAC,IAAI,CAACX,WAAW,IAAI,CAAC,IAAI,CAACA,WAAW,CAACW,GAAG,CAAC,EAAE;MAC/C,MAAM;QAAEI;MAAQ,CAAC,GAAGJ,GAAG;MACvB,MAAMP,KAAK,GAAG,IAAI,CAACU,cAAc,CAACH,GAAG,CAAC;MACtC,IAAIP,KAAK,KAAK,OAAO,EAAE;QACrBc,OAAO,CAACC,KAAK,CAAC,cAAc,EAAEJ,OAAO,EAAEJ,GAAG,CAAC;MAC7C,CAAC,MAAM,IAAIP,KAAK,KAAK,SAAS,EAAE;QAC9Bc,OAAO,CAACE,IAAI,CAAC,gBAAgB,EAAEL,OAAO,EAAEJ,GAAG,CAAC;MAC9C,CAAC,MAAM;QACLO,OAAO,CAACP,GAAG,CAAE,WAAUP,KAAM,GAAE,EAAEW,OAAO,EAAEJ,GAAG,CAAC;MAChD;IACF;EACF;AACF;AAAC,gBAhHKjB,MAAM,cACuB,IAAI;AAiHvCA,MAAM,CAACC,cAAc,EAAE,CAACU,KAAK,EAAE;AAE/B,eAAeX,MAAM"} diff --git a/lib/module/utils/MapboxStyles.d.js b/lib/module/utils/MapboxStyles.d.js new file mode 100644 index 000000000..44e70b6a8 --- /dev/null +++ b/lib/module/utils/MapboxStyles.d.js @@ -0,0 +1,184 @@ +/* This file was generated from MapboxStyle.ts.ejs do not modify */ +/* TODO */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var VisibilityEnum; +(function (VisibilityEnum) { + VisibilityEnum["Visible"] = "visible"; + VisibilityEnum["None"] = "none"; +})(VisibilityEnum || (VisibilityEnum = {})); +var FillTranslateAnchorEnum; +(function (FillTranslateAnchorEnum) { + FillTranslateAnchorEnum["Map"] = "map"; + FillTranslateAnchorEnum["Viewport"] = "viewport"; +})(FillTranslateAnchorEnum || (FillTranslateAnchorEnum = {})); +var LineCapEnum; +(function (LineCapEnum) { + LineCapEnum["Butt"] = "butt"; + LineCapEnum["Round"] = "round"; + LineCapEnum["Square"] = "square"; +})(LineCapEnum || (LineCapEnum = {})); +var LineJoinEnum; +(function (LineJoinEnum) { + LineJoinEnum["Bevel"] = "bevel"; + LineJoinEnum["Round"] = "round"; + LineJoinEnum["Miter"] = "miter"; +})(LineJoinEnum || (LineJoinEnum = {})); +var LineTranslateAnchorEnum; +(function (LineTranslateAnchorEnum) { + LineTranslateAnchorEnum["Map"] = "map"; + LineTranslateAnchorEnum["Viewport"] = "viewport"; +})(LineTranslateAnchorEnum || (LineTranslateAnchorEnum = {})); +var SymbolPlacementEnum; +(function (SymbolPlacementEnum) { + SymbolPlacementEnum["Point"] = "point"; + SymbolPlacementEnum["Line"] = "line"; + SymbolPlacementEnum["LineCenter"] = "line-center"; +})(SymbolPlacementEnum || (SymbolPlacementEnum = {})); +var SymbolZOrderEnum; +(function (SymbolZOrderEnum) { + SymbolZOrderEnum["Auto"] = "auto"; + SymbolZOrderEnum["ViewportY"] = "viewport-y"; + SymbolZOrderEnum["Source"] = "source"; +})(SymbolZOrderEnum || (SymbolZOrderEnum = {})); +var IconRotationAlignmentEnum; +(function (IconRotationAlignmentEnum) { + IconRotationAlignmentEnum["Map"] = "map"; + IconRotationAlignmentEnum["Viewport"] = "viewport"; + IconRotationAlignmentEnum["Auto"] = "auto"; +})(IconRotationAlignmentEnum || (IconRotationAlignmentEnum = {})); +var IconTextFitEnum; +(function (IconTextFitEnum) { + IconTextFitEnum["None"] = "none"; + IconTextFitEnum["Width"] = "width"; + IconTextFitEnum["Height"] = "height"; + IconTextFitEnum["Both"] = "both"; +})(IconTextFitEnum || (IconTextFitEnum = {})); +var IconAnchorEnum; +(function (IconAnchorEnum) { + IconAnchorEnum["Center"] = "center"; + IconAnchorEnum["Left"] = "left"; + IconAnchorEnum["Right"] = "right"; + IconAnchorEnum["Top"] = "top"; + IconAnchorEnum["Bottom"] = "bottom"; + IconAnchorEnum["TopLeft"] = "top-left"; + IconAnchorEnum["TopRight"] = "top-right"; + IconAnchorEnum["BottomLeft"] = "bottom-left"; + IconAnchorEnum["BottomRight"] = "bottom-right"; +})(IconAnchorEnum || (IconAnchorEnum = {})); +var IconPitchAlignmentEnum; +(function (IconPitchAlignmentEnum) { + IconPitchAlignmentEnum["Map"] = "map"; + IconPitchAlignmentEnum["Viewport"] = "viewport"; + IconPitchAlignmentEnum["Auto"] = "auto"; +})(IconPitchAlignmentEnum || (IconPitchAlignmentEnum = {})); +var TextPitchAlignmentEnum; +(function (TextPitchAlignmentEnum) { + TextPitchAlignmentEnum["Map"] = "map"; + TextPitchAlignmentEnum["Viewport"] = "viewport"; + TextPitchAlignmentEnum["Auto"] = "auto"; +})(TextPitchAlignmentEnum || (TextPitchAlignmentEnum = {})); +var TextRotationAlignmentEnum; +(function (TextRotationAlignmentEnum) { + TextRotationAlignmentEnum["Map"] = "map"; + TextRotationAlignmentEnum["Viewport"] = "viewport"; + TextRotationAlignmentEnum["Auto"] = "auto"; +})(TextRotationAlignmentEnum || (TextRotationAlignmentEnum = {})); +var TextJustifyEnum; +(function (TextJustifyEnum) { + TextJustifyEnum["Auto"] = "auto"; + TextJustifyEnum["Left"] = "left"; + TextJustifyEnum["Center"] = "center"; + TextJustifyEnum["Right"] = "right"; +})(TextJustifyEnum || (TextJustifyEnum = {})); +var TextVariableAnchorEnum; +(function (TextVariableAnchorEnum) { + TextVariableAnchorEnum["Center"] = "center"; + TextVariableAnchorEnum["Left"] = "left"; + TextVariableAnchorEnum["Right"] = "right"; + TextVariableAnchorEnum["Top"] = "top"; + TextVariableAnchorEnum["Bottom"] = "bottom"; + TextVariableAnchorEnum["TopLeft"] = "top-left"; + TextVariableAnchorEnum["TopRight"] = "top-right"; + TextVariableAnchorEnum["BottomLeft"] = "bottom-left"; + TextVariableAnchorEnum["BottomRight"] = "bottom-right"; +})(TextVariableAnchorEnum || (TextVariableAnchorEnum = {})); +var TextAnchorEnum; +(function (TextAnchorEnum) { + TextAnchorEnum["Center"] = "center"; + TextAnchorEnum["Left"] = "left"; + TextAnchorEnum["Right"] = "right"; + TextAnchorEnum["Top"] = "top"; + TextAnchorEnum["Bottom"] = "bottom"; + TextAnchorEnum["TopLeft"] = "top-left"; + TextAnchorEnum["TopRight"] = "top-right"; + TextAnchorEnum["BottomLeft"] = "bottom-left"; + TextAnchorEnum["BottomRight"] = "bottom-right"; +})(TextAnchorEnum || (TextAnchorEnum = {})); +var TextWritingModeEnum; +(function (TextWritingModeEnum) { + TextWritingModeEnum["Horizontal"] = "horizontal"; + TextWritingModeEnum["Vertical"] = "vertical"; +})(TextWritingModeEnum || (TextWritingModeEnum = {})); +var TextTransformEnum; +(function (TextTransformEnum) { + TextTransformEnum["None"] = "none"; + TextTransformEnum["Uppercase"] = "uppercase"; + TextTransformEnum["Lowercase"] = "lowercase"; +})(TextTransformEnum || (TextTransformEnum = {})); +var IconTranslateAnchorEnum; +(function (IconTranslateAnchorEnum) { + IconTranslateAnchorEnum["Map"] = "map"; + IconTranslateAnchorEnum["Viewport"] = "viewport"; +})(IconTranslateAnchorEnum || (IconTranslateAnchorEnum = {})); +var TextTranslateAnchorEnum; +(function (TextTranslateAnchorEnum) { + TextTranslateAnchorEnum["Map"] = "map"; + TextTranslateAnchorEnum["Viewport"] = "viewport"; +})(TextTranslateAnchorEnum || (TextTranslateAnchorEnum = {})); +var CircleTranslateAnchorEnum; +(function (CircleTranslateAnchorEnum) { + CircleTranslateAnchorEnum["Map"] = "map"; + CircleTranslateAnchorEnum["Viewport"] = "viewport"; +})(CircleTranslateAnchorEnum || (CircleTranslateAnchorEnum = {})); +var CirclePitchScaleEnum; +(function (CirclePitchScaleEnum) { + CirclePitchScaleEnum["Map"] = "map"; + CirclePitchScaleEnum["Viewport"] = "viewport"; +})(CirclePitchScaleEnum || (CirclePitchScaleEnum = {})); +var CirclePitchAlignmentEnum; +(function (CirclePitchAlignmentEnum) { + CirclePitchAlignmentEnum["Map"] = "map"; + CirclePitchAlignmentEnum["Viewport"] = "viewport"; +})(CirclePitchAlignmentEnum || (CirclePitchAlignmentEnum = {})); +var FillExtrusionTranslateAnchorEnum; +(function (FillExtrusionTranslateAnchorEnum) { + FillExtrusionTranslateAnchorEnum["Map"] = "map"; + FillExtrusionTranslateAnchorEnum["Viewport"] = "viewport"; +})(FillExtrusionTranslateAnchorEnum || (FillExtrusionTranslateAnchorEnum = {})); +var RasterResamplingEnum; +(function (RasterResamplingEnum) { + RasterResamplingEnum["Linear"] = "linear"; + RasterResamplingEnum["Nearest"] = "nearest"; +})(RasterResamplingEnum || (RasterResamplingEnum = {})); +var HillshadeIlluminationAnchorEnum; +(function (HillshadeIlluminationAnchorEnum) { + HillshadeIlluminationAnchorEnum["Map"] = "map"; + HillshadeIlluminationAnchorEnum["Viewport"] = "viewport"; +})(HillshadeIlluminationAnchorEnum || (HillshadeIlluminationAnchorEnum = {})); +var ModelTypeEnum; +(function (ModelTypeEnum) { + ModelTypeEnum["Common3d"] = "common-3d"; + ModelTypeEnum["LocationIndicator"] = "location-indicator"; +})(ModelTypeEnum || (ModelTypeEnum = {})); +var SkyTypeEnum; +(function (SkyTypeEnum) { + SkyTypeEnum["Gradient"] = "gradient"; + SkyTypeEnum["Atmosphere"] = "atmosphere"; +})(SkyTypeEnum || (SkyTypeEnum = {})); +var AnchorEnum; +(function (AnchorEnum) { + AnchorEnum["Map"] = "map"; + AnchorEnum["Viewport"] = "viewport"; +})(AnchorEnum || (AnchorEnum = {})); +export {}; +//# sourceMappingURL=MapboxStyles.d.js.map \ No newline at end of file diff --git a/lib/module/utils/MapboxStyles.d.js.map b/lib/module/utils/MapboxStyles.d.js.map new file mode 100644 index 000000000..855865b25 --- /dev/null +++ b/lib/module/utils/MapboxStyles.d.js.map @@ -0,0 +1 @@ +{"version":3,"names":["VisibilityEnum","FillTranslateAnchorEnum","LineCapEnum","LineJoinEnum","LineTranslateAnchorEnum","SymbolPlacementEnum","SymbolZOrderEnum","IconRotationAlignmentEnum","IconTextFitEnum","IconAnchorEnum","IconPitchAlignmentEnum","TextPitchAlignmentEnum","TextRotationAlignmentEnum","TextJustifyEnum","TextVariableAnchorEnum","TextAnchorEnum","TextWritingModeEnum","TextTransformEnum","IconTranslateAnchorEnum","TextTranslateAnchorEnum","CircleTranslateAnchorEnum","CirclePitchScaleEnum","CirclePitchAlignmentEnum","FillExtrusionTranslateAnchorEnum","RasterResamplingEnum","HillshadeIlluminationAnchorEnum","ModelTypeEnum","SkyTypeEnum","AnchorEnum"],"sourceRoot":"../../../src","sources":["utils/MapboxStyles.d.ts"],"mappings":"AAAA;AAUsC;AAuHtC;AAAA,IAKKA,cAAc;AAAA,WAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAdA,cAAc;AAAA,IAOdC,uBAAuB;AAAA,WAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB;AAAA,IAOvBC,WAAW;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW;AAAA,IASXC,YAAY;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAAA,IASZC,uBAAuB;AAAA,WAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB;AAAA,IAOvBC,mBAAmB;AAAA,WAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;AAAA,GAAnBA,mBAAmB,KAAnBA,mBAAmB;AAAA,IASnBC,gBAAgB;AAAA,WAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAAA,IAShBC,yBAAyB;AAAA,WAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAy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A+B;AAAA,GAA/BA,+BAA+B,KAA/BA,+BAA+B;AAAA,IAO/BC,aAAa;AAAA,WAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAAA,IAObC,WAAW;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW;AAAA,IAOXC,UAAU;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU;AAAA"} diff --git a/lib/module/utils/StyleValue.js b/lib/module/utils/StyleValue.js new file mode 100644 index 000000000..2a56e0294 --- /dev/null +++ b/lib/module/utils/StyleValue.js @@ -0,0 +1,37 @@ +import { Image, processColor } from 'react-native'; +import BridgeValue from './BridgeValue'; +import { getStyleType } from './styleMap'; +export function transformStyle(style) { + if (!style) { + return; + } + const nativeStyle = {}; + const styleProps = Object.keys(style); + for (const styleProp of styleProps) { + const styleType = getStyleType(styleProp); + let rawStyle = style[styleProp]; + if (styleType === 'color' && typeof rawStyle === 'string') { + const color = processColor(rawStyle); + if (color === null || color === undefined || typeof color === 'symbol') { + console.error(`RNMapbox: Invalid color value: ${rawStyle} using red`); + rawStyle = 'ff0000'; + } else { + rawStyle = color; + } + } else if (styleType === 'image' && typeof rawStyle === 'number') { + rawStyle = Image.resolveAssetSource(rawStyle) || {}; + } + if (styleType === 'image' && !(Array.isArray(rawStyle) || typeof rawStyle === 'string' && !rawStyle.startsWith('http://') && !rawStyle.startsWith('https://'))) { + console.warn(`RNMapbox: Image or URL in ${styleProp} is deprecated, use Images component. See https://github.com/rnmapbox/maps/wiki/Deprecated-URLInIconImages`); + } + if (rawStyle !== undefined) { + const bridgeValue = new BridgeValue(rawStyle); + nativeStyle[styleProp] = { + styletype: styleType, + stylevalue: bridgeValue.toJSON() + }; + } + } + return nativeStyle; +} +//# sourceMappingURL=StyleValue.js.map \ No newline at end of file diff --git a/lib/module/utils/StyleValue.js.map b/lib/module/utils/StyleValue.js.map new file mode 100644 index 000000000..eb33a320f --- /dev/null +++ b/lib/module/utils/StyleValue.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Image","processColor","BridgeValue","getStyleType","transformStyle","style","nativeStyle","styleProps","Object","keys","styleProp","styleType","rawStyle","color","undefined","console","error","resolveAssetSource","Array","isArray","startsWith","warn","bridgeValue","styletype","stylevalue","toJSON"],"sourceRoot":"../../../src","sources":["utils/StyleValue.ts"],"mappings":"AAAA,SAASA,KAAK,EAAEC,YAAY,QAAQ,cAAc;AAElD,OAAOC,WAAW,MAGX,eAAe;AAEtB,SAASC,YAAY,QAAQ,YAAY;AAOzC,OAAO,SAASC,cAAc,CAC5BC,KAAqC,EACM;EAC3C,IAAI,CAACA,KAAK,EAAE;IACV;EACF;EAEA,MAAMC,WAA0C,GAAG,CAAC,CAAC;EACrD,MAAMC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAA8B;EAClE,KAAK,MAAMK,SAAS,IAAIH,UAAU,EAAE;IAClC,MAAMI,SAAS,GAAGR,YAAY,CAACO,SAAS,CAAC;IACzC,IAAIE,QAAkC,GAAGP,KAAK,CAACK,SAAS,CAAC;IAEzD,IAAIC,SAAS,KAAK,OAAO,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MACzD,MAAMC,KAAK,GAAGZ,YAAY,CAACW,QAAQ,CAAC;MACpC,IAAIC,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;QACtEE,OAAO,CAACC,KAAK,CAAE,kCAAiCJ,QAAS,YAAW,CAAC;QACrEA,QAAQ,GAAG,QAAQ;MACrB,CAAC,MAAM;QACLA,QAAQ,GAAGC,KAAK;MAClB;IACF,CAAC,MAAM,IAAIF,SAAS,KAAK,OAAO,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MAChEA,QAAQ,GACLZ,KAAK,CAACiB,kBAAkB,CAACL,QAAQ,CAAC,IAAgC,CAAC,CAAC;IACzE;IACA,IACED,SAAS,KAAK,OAAO,IACrB,EACEO,KAAK,CAACC,OAAO,CAACP,QAAQ,CAAC,IACtB,OAAOA,QAAQ,KAAK,QAAQ,IAC3B,CAACA,QAAQ,CAACQ,UAAU,CAAC,SAAS,CAAC,IAC/B,CAACR,QAAQ,CAACQ,UAAU,CAAC,UAAU,CAAE,CACpC,EACD;MACAL,OAAO,CAACM,IAAI,CACT,6BAA4BX,SAAU,4GAA2G,CACnJ;IACH;IAEA,IAAIE,QAAQ,KAAKE,SAAS,EAAE;MAC1B,MAAMQ,WAAW,GAAG,IAAIpB,WAAW,CAACU,QAAQ,CAAC;MAC7CN,WAAW,CAACI,SAAS,CAAC,GAAG;QACvBa,SAAS,EAAEZ,SAAS;QACpBa,UAAU,EAAEF,WAAW,CAACG,MAAM;MAChC,CAAC;IACH;EACF;EAEA,OAAOnB,WAAW;AACpB"} diff --git a/lib/module/utils/animated/Animated.js b/lib/module/utils/animated/Animated.js new file mode 100644 index 000000000..a403f1341 --- /dev/null +++ b/lib/module/utils/animated/Animated.js @@ -0,0 +1,25 @@ +import { Animated as RNAnimated } from 'react-native'; +import { ShapeSource } from '../../components/ShapeSource'; +import ImageSource from '../../components/ImageSource'; +import FillLayer from '../../components/FillLayer'; +import FillExtrusionLayer from '../../components/FillExtrusionLayer'; +import LineLayer from '../../components/LineLayer'; +import CircleLayer from '../../components/CircleLayer'; +import { SymbolLayer } from '../../components/SymbolLayer'; +import RasterLayer from '../../components/RasterLayer'; +import BackgroundLayer from '../../components/BackgroundLayer'; +const Animated = { + // sources + ShapeSource: RNAnimated.createAnimatedComponent(ShapeSource), + ImageSource: RNAnimated.createAnimatedComponent(ImageSource), + // layers + FillLayer: RNAnimated.createAnimatedComponent(FillLayer), + FillExtrusionLayer: RNAnimated.createAnimatedComponent(FillExtrusionLayer), + LineLayer: RNAnimated.createAnimatedComponent(LineLayer), + CircleLayer: RNAnimated.createAnimatedComponent(CircleLayer), + SymbolLayer: RNAnimated.createAnimatedComponent(SymbolLayer), + RasterLayer: RNAnimated.createAnimatedComponent(RasterLayer), + BackgroundLayer: RNAnimated.createAnimatedComponent(BackgroundLayer) +}; +export default Animated; +//# sourceMappingURL=Animated.js.map \ No newline at end of file diff --git a/lib/module/utils/animated/Animated.js.map b/lib/module/utils/animated/Animated.js.map new file mode 100644 index 000000000..229c077e4 --- /dev/null +++ b/lib/module/utils/animated/Animated.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Animated","RNAnimated","ShapeSource","ImageSource","FillLayer","FillExtrusionLayer","LineLayer","CircleLayer","SymbolLayer","RasterLayer","BackgroundLayer","createAnimatedComponent"],"sourceRoot":"../../../../src","sources":["utils/animated/Animated.ts"],"mappings":"AAAC,SAASA,QAAQ,IAAIC,UAAU,QAAQ,cAAc;AAEtD,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,SAAS,MAAM,4BAA4B;AAClD,OAAOC,kBAAkB,MAAM,qCAAqC;AACpE,OAAOC,SAAS,MAAM,4BAA4B;AAClD,OAAOC,WAAW,MAAM,8BAA8B;AACtD,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,eAAe,MAAM,kCAAkC;AAE9D,MAAMV,QAAQ,GAAG;EACf;EACAE,WAAW,EAAED,UAAU,CAACU,uBAAuB,CAACT,WAAW,CAAC;EAC5DC,WAAW,EAAEF,UAAU,CAACU,uBAAuB,CAACR,WAAW,CAAC;EAE5D;EACAC,SAAS,EAAEH,UAAU,CAACU,uBAAuB,CAACP,SAAS,CAAC;EACxDC,kBAAkB,EAAEJ,UAAU,CAACU,uBAAuB,CAACN,kBAAkB,CAAC;EAC1EC,SAAS,EAAEL,UAAU,CAACU,uBAAuB,CAACL,SAAS,CAAC;EACxDC,WAAW,EAAEN,UAAU,CAACU,uBAAuB,CAACJ,WAAW,CAAC;EAC5DC,WAAW,EAAEP,UAAU,CAACU,uBAAuB,CAACH,WAAW,CAAC;EAC5DC,WAAW,EAAER,UAAU,CAACU,uBAAuB,CAACF,WAAW,CAAC;EAC5DC,eAAe,EAAET,UAAU,CAACU,uBAAuB,CAACD,eAAe;AACrE,CAAC;AAED,eAAeV,QAAQ"} diff --git a/lib/module/utils/checkRequiredProps.js b/lib/module/utils/checkRequiredProps.js new file mode 100644 index 000000000..7b32b9336 --- /dev/null +++ b/lib/module/utils/checkRequiredProps.js @@ -0,0 +1,8 @@ +export default function checkRequiredProps(tag, props, required) { + for (const key of required) { + if (props[key] === undefined) { + console.error(`Error: ${tag} property: ${key} is required but it was missing.`); + } + } +} +//# sourceMappingURL=checkRequiredProps.js.map \ No newline at end of file diff --git a/lib/module/utils/checkRequiredProps.js.map b/lib/module/utils/checkRequiredProps.js.map new file mode 100644 index 000000000..10581ac3a --- /dev/null +++ b/lib/module/utils/checkRequiredProps.js.map @@ -0,0 +1 @@ +{"version":3,"names":["checkRequiredProps","tag","props","required","key","undefined","console","error"],"sourceRoot":"../../../src","sources":["utils/checkRequiredProps.ts"],"mappings":"AAIA,eAAe,SAASA,kBAAkB,CAExCC,GAAW,EAAEC,KAAY,EAAEC,QAA+B,EAAE;EAC5D,KAAK,MAAMC,GAAG,IAAID,QAAQ,EAAE;IAC1B,IAAID,KAAK,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC5BC,OAAO,CAACC,KAAK,CACV,UAASN,GAAI,cACZG,GACD,kCAAiC,CACnC;IACH;EACF;AACF"} diff --git a/lib/module/utils/deprecation.js b/lib/module/utils/deprecation.js new file mode 100644 index 000000000..d774c1c52 --- /dev/null +++ b/lib/module/utils/deprecation.js @@ -0,0 +1,33 @@ +/** + * deprecatedClass: creates a subclass of the class, which prints deprecated warning when called + */ +export function deprecatedClass(origClass, deprecationMessage) { + const result = class extends origClass { + constructor() { + console.log(`Deprecated: ${deprecationMessage}`); + super(...arguments); + } + }; + return result; +} + +/** + * Copy properties from origObject to newObject, but only those which not exists in newObject. + * Calls onDeprecatedCalled callback in case a copied property is invoked. + */ +export function copyPropertiesAsDeprecated(origObject, newObject, onDeprecatedCalled) { + let accessors = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + const result = newObject; + for (const [key, value] of Object.entries(origObject)) { + if (!newObject[key]) { + Object.defineProperty(result, key, { + get() { + onDeprecatedCalled(key); + return accessors[key] ? accessors[key](value) : value; + } + }); + } + } + return result; +} +//# sourceMappingURL=deprecation.js.map \ No newline at end of file diff --git a/lib/module/utils/deprecation.js.map b/lib/module/utils/deprecation.js.map new file mode 100644 index 000000000..570e1d904 --- /dev/null +++ b/lib/module/utils/deprecation.js.map @@ -0,0 +1 @@ +{"version":3,"names":["deprecatedClass","origClass","deprecationMessage","result","constructor","console","log","copyPropertiesAsDeprecated","origObject","newObject","onDeprecatedCalled","accessors","key","value","Object","entries","defineProperty","get"],"sourceRoot":"../../../src","sources":["utils/deprecation.ts"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,SAASA,eAAe,CAC7BC,SAAY,EACZC,kBAA0B,EACvB;EACH,MAAMC,MAAM,GAAG,cAAcF,SAAS,CAAC;IACrCG,WAAW,GAAiB;MAC1BC,OAAO,CAACC,GAAG,CAAE,eAAcJ,kBAAmB,EAAC,CAAC;MAChD,KAAK,CAAC,YAAO,CAAC;IAChB;EACF,CAAC;EACD,OAAOC,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,0BAA0B,CAIxCC,UAA0B,EAC1BC,SAA6B,EAC7BC,kBAAyC,EAErB;EAAA,IADpBC,SAAyD,uEAAG,CAAC,CAAC;EAE9D,MAAMR,MAAM,GAAGM,SAAS;EACxB,KAAK,MAAM,CAACG,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACP,UAAU,CAAC,EAAE;IACrD,IAAI,CAACC,SAAS,CAACG,GAAG,CAAC,EAAE;MACnBE,MAAM,CAACE,cAAc,CAACb,MAAM,EAAES,GAAG,EAAE;QACjCK,GAAG,GAAG;UACJP,kBAAkB,CAACE,GAAG,CAAC;UACvB,OAAOD,SAAS,CAACC,GAAG,CAAC,GAAGD,SAAS,CAACC,GAAG,CAAC,CAACC,KAAK,CAAC,GAAGA,KAAK;QACvD;MACF,CAAC,CAAC;IACJ;EACF;EACA,OAAOV,MAAM;AACf"} diff --git a/lib/module/utils/filterUtils.js b/lib/module/utils/filterUtils.js new file mode 100644 index 000000000..49542e54e --- /dev/null +++ b/lib/module/utils/filterUtils.js @@ -0,0 +1,7 @@ +export function getFilter(filter) { + if (!Array.isArray(filter) || filter.length === 0) { + return []; + } + return filter; +} +//# sourceMappingURL=filterUtils.js.map \ No newline at end of file diff --git a/lib/module/utils/filterUtils.js.map b/lib/module/utils/filterUtils.js.map new file mode 100644 index 000000000..070893c86 --- /dev/null +++ b/lib/module/utils/filterUtils.js.map @@ -0,0 +1 @@ +{"version":3,"names":["getFilter","filter","Array","isArray","length"],"sourceRoot":"../../../src","sources":["utils/filterUtils.ts"],"mappings":"AAAA,OAAO,SAASA,SAAS,CAACC,MAA0B,EAAY;EAC9D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,IAAIA,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;IACjD,OAAO,EAAE;EACX;EAEA,OAAOH,MAAM;AACf"} diff --git a/lib/module/utils/geoUtils.js b/lib/module/utils/geoUtils.js new file mode 100644 index 000000000..761b483bd --- /dev/null +++ b/lib/module/utils/geoUtils.js @@ -0,0 +1,23 @@ +import { featureCollection, point, feature, lineString } from '@turf/helpers'; +import distance from '@turf/distance'; +import along from '@turf/along'; +export const makePoint = point; +export const makeLineString = lineString; +export function makeLatLngBounds(northEastCoordinates, southWestCoordinates) { + return featureCollection([point(northEastCoordinates), point(southWestCoordinates)]); +} +export const makeFeature = feature; +export function makeFeatureCollection() { + let features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + let options = arguments.length > 1 ? arguments[1] : undefined; + return featureCollection(features, options); +} +export function addToFeatureCollection(newFeatureCollection, newFeature) { + return { + ...newFeatureCollection, + features: [...newFeatureCollection.features, newFeature] + }; +} +export const calculateDistance = distance; +export const pointAlongLine = along; +//# sourceMappingURL=geoUtils.js.map \ No newline at end of file diff --git a/lib/module/utils/geoUtils.js.map b/lib/module/utils/geoUtils.js.map new file mode 100644 index 000000000..d802423b3 --- /dev/null +++ b/lib/module/utils/geoUtils.js.map @@ -0,0 +1 @@ +{"version":3,"names":["featureCollection","point","feature","lineString","distance","along","makePoint","makeLineString","makeLatLngBounds","northEastCoordinates","southWestCoordinates","makeFeature","makeFeatureCollection","features","options","addToFeatureCollection","newFeatureCollection","newFeature","calculateDistance","pointAlongLine"],"sourceRoot":"../../../src","sources":["utils/geoUtils.ts"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,KAAK,EACLC,OAAO,EACPC,UAAU,QASL,eAAe;AACtB,OAAOC,QAAQ,MAAM,gBAAgB;AACrC,OAAOC,KAAK,MAAM,aAAa;AAE/B,OAAO,MAAMC,SAAS,GAAGL,KAAK;AAE9B,OAAO,MAAMM,cAAc,GAAGJ,UAAU;AAExC,OAAO,SAASK,gBAAgB,CAC9BC,oBAA8B,EAC9BC,oBAA8B,EACJ;EAC1B,OAAOV,iBAAiB,CAAC,CACvBC,KAAK,CAACQ,oBAAoB,CAAC,EAC3BR,KAAK,CAACS,oBAAoB,CAAC,CAC5B,CAAC;AACJ;AAEA,OAAO,MAAMC,WAAW,GAAGT,OAAO;AAElC,OAAO,SAASU,qBAAqB,GAMnC;EAAA,IALAC,QAA8B,uEAAG,EAAE;EAAA,IACnCC,OAGC;EAED,OAAOd,iBAAiB,CAACa,QAAQ,EAAEC,OAAO,CAAC;AAC7C;AAEA,OAAO,SAASC,sBAAsB,CACpCC,oBAAuC,EACvCC,UAAmB,EACA;EACnB,OAAO;IACL,GAAGD,oBAAoB;IACvBH,QAAQ,EAAE,CAAC,GAAGG,oBAAoB,CAACH,QAAQ,EAAEI,UAAU;EACzD,CAAC;AACH;AAEA,OAAO,MAAMC,iBAAiB,GAAGd,QAAQ;AAEzC,OAAO,MAAMe,cAAc,GAAGd,KAAK"} diff --git a/lib/module/utils/getAnnotationsLayerID.js b/lib/module/utils/getAnnotationsLayerID.js new file mode 100644 index 000000000..fe5b72677 --- /dev/null +++ b/lib/module/utils/getAnnotationsLayerID.js @@ -0,0 +1,15 @@ +import { Platform } from 'react-native'; + +/* + * Retrieve the layer ids used for PointAnnotations and Callouts + */ +export const getAnnotationsLayerID = type => { + return Platform.select({ + android: 'RNMBX-mapview-annotations', + ios: { + PointAnnotations: 'RNMBX-mapview-point-annotations', + Callouts: 'RNMBX-mapview-callouts' + }[type] + }); +}; +//# sourceMappingURL=getAnnotationsLayerID.js.map \ No newline at end of file diff --git a/lib/module/utils/getAnnotationsLayerID.js.map b/lib/module/utils/getAnnotationsLayerID.js.map new file mode 100644 index 000000000..596f7761f --- /dev/null +++ b/lib/module/utils/getAnnotationsLayerID.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Platform","getAnnotationsLayerID","type","select","android","ios","PointAnnotations","Callouts"],"sourceRoot":"../../../src","sources":["utils/getAnnotationsLayerID.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAChCC,IAAqC,IAClC;EACH,OAAOF,QAAQ,CAACG,MAAM,CAAC;IACrBC,OAAO,EAAE,2BAA2B;IACpCC,GAAG,EAAE;MACHC,gBAAgB,EAAE,iCAAiC;MACnDC,QAAQ,EAAE;IACZ,CAAC,CAACL,IAAI;EACR,CAAC,CAAC;AACJ,CAAC"} diff --git a/lib/module/utils/index.js b/lib/module/utils/index.js new file mode 100644 index 000000000..3577832eb --- /dev/null +++ b/lib/module/utils/index.js @@ -0,0 +1,63 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import React from 'react'; +import { findNodeHandle, Platform, Image } from 'react-native'; +export function isAndroid() { + return Platform.OS === 'android'; +} +export function existenceChange(cur, next) { + if (!cur && !next) { + return false; + } + return !cur && next || cur && !next; +} +export function isFunction(fn) { + return typeof fn === 'function'; +} +export function isNumber(num) { + return typeof num === 'number' && !Number.isNaN(num); +} +export function isUndefined(obj) { + return typeof obj === 'undefined'; +} +export function isString(str) { + return typeof str === 'string'; +} +export function isBoolean(bool) { + return typeof bool === 'boolean'; +} +export function isPrimitive(value) { + return isString(value) || isNumber(value) || isBoolean(value); +} +export function runNativeMethod(turboModule, name, nativeRef, args) { + const handle = findNodeHandle(nativeRef); + if (!handle) { + throw new Error(`Could not find handle for native ref ${module}.${name}`); + } + + // @ts-expect-error TS says that string cannot be used to index Turbomodules. + // It can, it's just not pretty. + return turboModule[name](handle, ...args); +} +export function cloneReactChildrenWithProps(children) { + let propsToAdd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (!children) { + return null; + } + let foundChildren = null; + if (!Array.isArray(children)) { + foundChildren = [children]; + } else { + foundChildren = children; + } + const filteredChildren = foundChildren.filter(child => !!child); // filter out falsy children, since some can be null + return React.Children.map(filteredChildren, child => /*#__PURE__*/React.cloneElement(child, propsToAdd)); +} +export function resolveImagePath(imageRef) { + const res = Image.resolveAssetSource(imageRef); + return res.uri; +} +export function toJSONString() { + let json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + return JSON.stringify(json); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/module/utils/index.js.map b/lib/module/utils/index.js.map new file mode 100644 index 000000000..a2d1c911b --- /dev/null +++ b/lib/module/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","findNodeHandle","Platform","Image","isAndroid","OS","existenceChange","cur","next","isFunction","fn","isNumber","num","Number","isNaN","isUndefined","obj","isString","str","isBoolean","bool","isPrimitive","value","runNativeMethod","turboModule","name","nativeRef","args","handle","Error","module","cloneReactChildrenWithProps","children","propsToAdd","foundChildren","Array","isArray","filteredChildren","filter","child","Children","map","cloneElement","resolveImagePath","imageRef","res","resolveAssetSource","uri","toJSONString","json","JSON","stringify"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,cAAc,EACdC,QAAQ,EACRC,KAAK,QAGA,cAAc;AAErB,OAAO,SAASC,SAAS,GAAY;EACnC,OAAOF,QAAQ,CAACG,EAAE,KAAK,SAAS;AAClC;AAEA,OAAO,SAASC,eAAe,CAACC,GAAY,EAAEC,IAAa,EAAW;EACpE,IAAI,CAACD,GAAG,IAAI,CAACC,IAAI,EAAE;IACjB,OAAO,KAAK;EACd;EACA,OAAQ,CAACD,GAAG,IAAIC,IAAI,IAAMD,GAAG,IAAI,CAACC,IAAK;AACzC;AAEA,OAAO,SAASC,UAAU,CAACC,EAAW,EAAiB;EACrD,OAAO,OAAOA,EAAE,KAAK,UAAU;AACjC;AAEA,OAAO,SAASC,QAAQ,CAACC,GAAY,EAAiB;EACpD,OAAO,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACC,MAAM,CAACC,KAAK,CAACF,GAAG,CAAC;AACtD;AAEA,OAAO,SAASG,WAAW,CAACC,GAAY,EAAoB;EAC1D,OAAO,OAAOA,GAAG,KAAK,WAAW;AACnC;AAEA,OAAO,SAASC,QAAQ,CAACC,GAAY,EAAiB;EACpD,OAAO,OAAOA,GAAG,KAAK,QAAQ;AAChC;AAEA,OAAO,SAASC,SAAS,CAACC,IAAa,EAAmB;EACxD,OAAO,OAAOA,IAAI,KAAK,SAAS;AAClC;AAEA,OAAO,SAASC,WAAW,CACzBC,KAAc,EACsB;EACpC,OAAOL,QAAQ,CAACK,KAAK,CAAC,IAAIX,QAAQ,CAACW,KAAK,CAAC,IAAIH,SAAS,CAACG,KAAK,CAAC;AAC/D;AAUA,OAAO,SAASC,eAAe,CAC7BC,WAAwB,EACxBC,IAAY,EACZC,SAAc,EACdC,IAAiB,EACI;EACrB,MAAMC,MAAM,GAAG3B,cAAc,CAACyB,SAAS,CAAC;EACxC,IAAI,CAACE,MAAM,EAAE;IACX,MAAM,IAAIC,KAAK,CAAE,wCAAuCC,MAAO,IAAGL,IAAK,EAAC,CAAC;EAC3E;;EAEA;EACA;EACA,OAAOD,WAAW,CAACC,IAAI,CAAC,CAACG,MAAM,EAAE,GAAGD,IAAI,CAAC;AAC3C;AAEA,OAAO,SAASI,2BAA2B,CACzCC,QAAkD,EAElD;EAAA,IADAC,UAAqC,uEAAG,CAAC,CAAC;EAE1C,IAAI,CAACD,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,IAAIE,aAAa,GAAG,IAAI;EAExB,IAAI,CAACC,KAAK,CAACC,OAAO,CAACJ,QAAQ,CAAC,EAAE;IAC5BE,aAAa,GAAG,CAACF,QAAQ,CAAC;EAC5B,CAAC,MAAM;IACLE,aAAa,GAAGF,QAAQ;EAC1B;EAEA,MAAMK,gBAAgB,GAAGH,aAAa,CAACI,MAAM,CAAEC,KAAK,IAAK,CAAC,CAACA,KAAK,CAAC,CAAC,CAAC;EACnE,OAAOvC,KAAK,CAACwC,QAAQ,CAACC,GAAG,CAACJ,gBAAgB,EAAGE,KAAK,iBAChDvC,KAAK,CAAC0C,YAAY,CAACH,KAAK,EAAEN,UAAU,CAAC,CACtC;AACH;AAEA,OAAO,SAASU,gBAAgB,CAACC,QAA6B,EAAU;EACtE,MAAMC,GAAG,GAAG1C,KAAK,CAAC2C,kBAAkB,CAACF,QAAQ,CAAC;EAC9C,OAAOC,GAAG,CAACE,GAAG;AAChB;AAEA,OAAO,SAASC,YAAY,GAAiB;EAAA,IAAhBC,IAAS,uEAAG,EAAE;EACzC,OAAOC,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC;AAC7B"} diff --git a/lib/module/utils/nativeRef.js b/lib/module/utils/nativeRef.js new file mode 100644 index 000000000..881e85641 --- /dev/null +++ b/lib/module/utils/nativeRef.js @@ -0,0 +1,21 @@ +/** + * Helper for useRef and requireNativeComponent: + * @example + * RNMBXCamera = requireNativeComponent('RNMBXCamera'); + * const ref = useRef; + * ... + * + */ + +/** + * Helper for useRef and requireNativeComponent: + * @example + * RNMBXCamera = requireNativeComponent('RNMBXCamera'); + * const ref = nativeRef(useRef + */ +export default function nativeRef(c) { + return c; +} +//# sourceMappingURL=nativeRef.js.map \ No newline at end of file diff --git a/lib/module/utils/nativeRef.js.map b/lib/module/utils/nativeRef.js.map new file mode 100644 index 000000000..90c252134 --- /dev/null +++ b/lib/module/utils/nativeRef.js.map @@ -0,0 +1 @@ +{"version":3,"names":["nativeRef","c"],"sourceRoot":"../../../src","sources":["utils/nativeRef.ts"],"mappings":"AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,SAAS,CAC/BC,CAAqC,EAC8B;EACnE,OAAOA,CAAC;AACV"} diff --git a/lib/module/utils/styleMap.js b/lib/module/utils/styleMap.js new file mode 100644 index 000000000..0649da5dc --- /dev/null +++ b/lib/module/utils/styleMap.js @@ -0,0 +1,329 @@ +// DO NOT MODIFY +// THIS FILE IS AUTOGENERATED + +import { isAndroid } from './index'; +export const StyleTypes = { + Constant: 'constant', + Color: 'color', + Transition: 'transition', + Translation: 'translation', + Function: 'function', + Image: 'image', + Enum: 'enum' +}; +export function getStyleType(styleProp) { + if (!isAndroid() && styleExtras[styleProp]) { + return styleExtras[styleProp].iosType; + } + if (styleMap[styleProp]) { + return styleMap[styleProp]; + } + throw new Error(`${styleProp} is not a valid Mapbox layer style`); +} +const styleMap = { + fillSortKey: StyleTypes.Constant, + fillAntialias: StyleTypes.Constant, + fillOpacity: StyleTypes.Constant, + fillOpacityTransition: StyleTypes.Transition, + fillColor: StyleTypes.Color, + fillColorTransition: StyleTypes.Transition, + fillOutlineColor: StyleTypes.Color, + fillOutlineColorTransition: StyleTypes.Transition, + fillTranslate: StyleTypes.Translation, + fillTranslateTransition: StyleTypes.Transition, + fillTranslateAnchor: StyleTypes.Enum, + fillPattern: StyleTypes.Image, + fillEmissiveStrength: StyleTypes.Constant, + fillEmissiveStrengthTransition: StyleTypes.Transition, + lineCap: StyleTypes.Enum, + lineJoin: StyleTypes.Enum, + lineMiterLimit: StyleTypes.Constant, + lineRoundLimit: StyleTypes.Constant, + lineSortKey: StyleTypes.Constant, + lineOpacity: StyleTypes.Constant, + lineOpacityTransition: StyleTypes.Transition, + lineColor: StyleTypes.Color, + lineColorTransition: StyleTypes.Transition, + lineTranslate: StyleTypes.Translation, + lineTranslateTransition: StyleTypes.Transition, + lineTranslateAnchor: StyleTypes.Enum, + lineWidth: StyleTypes.Constant, + lineWidthTransition: StyleTypes.Transition, + lineGapWidth: StyleTypes.Constant, + lineGapWidthTransition: StyleTypes.Transition, + lineOffset: StyleTypes.Constant, + lineOffsetTransition: StyleTypes.Transition, + lineBlur: StyleTypes.Constant, + lineBlurTransition: StyleTypes.Transition, + lineDasharray: StyleTypes.Constant, + linePattern: StyleTypes.Image, + lineGradient: StyleTypes.Color, + lineTrimOffset: StyleTypes.Constant, + lineEmissiveStrength: StyleTypes.Constant, + lineEmissiveStrengthTransition: StyleTypes.Transition, + symbolPlacement: StyleTypes.Enum, + symbolSpacing: StyleTypes.Constant, + symbolAvoidEdges: StyleTypes.Constant, + symbolSortKey: StyleTypes.Constant, + symbolZOrder: StyleTypes.Enum, + iconAllowOverlap: StyleTypes.Constant, + iconIgnorePlacement: StyleTypes.Constant, + iconOptional: StyleTypes.Constant, + iconRotationAlignment: StyleTypes.Enum, + iconSize: StyleTypes.Constant, + iconTextFit: StyleTypes.Enum, + iconTextFitPadding: StyleTypes.Constant, + iconImage: StyleTypes.Image, + iconRotate: StyleTypes.Constant, + iconPadding: StyleTypes.Constant, + iconKeepUpright: StyleTypes.Constant, + iconOffset: StyleTypes.Constant, + iconAnchor: StyleTypes.Enum, + iconPitchAlignment: StyleTypes.Enum, + textPitchAlignment: StyleTypes.Enum, + textRotationAlignment: StyleTypes.Enum, + textField: StyleTypes.Constant, + textFont: StyleTypes.Constant, + textSize: StyleTypes.Constant, + textMaxWidth: StyleTypes.Constant, + textLineHeight: StyleTypes.Constant, + textLetterSpacing: StyleTypes.Constant, + textJustify: StyleTypes.Enum, + textRadialOffset: StyleTypes.Constant, + textVariableAnchor: StyleTypes.Constant, + textAnchor: StyleTypes.Enum, + textMaxAngle: StyleTypes.Constant, + textWritingMode: StyleTypes.Constant, + textRotate: StyleTypes.Constant, + textPadding: StyleTypes.Constant, + textKeepUpright: StyleTypes.Constant, + textTransform: StyleTypes.Enum, + textOffset: StyleTypes.Constant, + textAllowOverlap: StyleTypes.Constant, + textIgnorePlacement: StyleTypes.Constant, + textOptional: StyleTypes.Constant, + iconOpacity: StyleTypes.Constant, + iconOpacityTransition: StyleTypes.Transition, + iconColor: StyleTypes.Color, + iconColorTransition: StyleTypes.Transition, + iconHaloColor: StyleTypes.Color, + iconHaloColorTransition: StyleTypes.Transition, + iconHaloWidth: StyleTypes.Constant, + iconHaloWidthTransition: StyleTypes.Transition, + iconHaloBlur: StyleTypes.Constant, + iconHaloBlurTransition: StyleTypes.Transition, + iconTranslate: StyleTypes.Translation, + iconTranslateTransition: StyleTypes.Transition, + iconTranslateAnchor: StyleTypes.Enum, + textOpacity: StyleTypes.Constant, + textOpacityTransition: StyleTypes.Transition, + textColor: StyleTypes.Color, + textColorTransition: StyleTypes.Transition, + textHaloColor: StyleTypes.Color, + textHaloColorTransition: StyleTypes.Transition, + textHaloWidth: StyleTypes.Constant, + textHaloWidthTransition: StyleTypes.Transition, + textHaloBlur: StyleTypes.Constant, + textHaloBlurTransition: StyleTypes.Transition, + textTranslate: StyleTypes.Translation, + textTranslateTransition: StyleTypes.Transition, + textTranslateAnchor: StyleTypes.Enum, + symbolZElevate: StyleTypes.Constant, + iconEmissiveStrength: StyleTypes.Constant, + iconEmissiveStrengthTransition: StyleTypes.Transition, + textEmissiveStrength: StyleTypes.Constant, + textEmissiveStrengthTransition: StyleTypes.Transition, + iconImageCrossFade: StyleTypes.Constant, + iconImageCrossFadeTransition: StyleTypes.Transition, + circleSortKey: StyleTypes.Constant, + circleRadius: StyleTypes.Constant, + circleRadiusTransition: StyleTypes.Transition, + circleColor: StyleTypes.Color, + circleColorTransition: StyleTypes.Transition, + circleBlur: StyleTypes.Constant, + circleBlurTransition: StyleTypes.Transition, + circleOpacity: StyleTypes.Constant, + circleOpacityTransition: StyleTypes.Transition, + circleTranslate: StyleTypes.Translation, + circleTranslateTransition: StyleTypes.Transition, + circleTranslateAnchor: StyleTypes.Enum, + circlePitchScale: StyleTypes.Enum, + circlePitchAlignment: StyleTypes.Enum, + circleStrokeWidth: StyleTypes.Constant, + circleStrokeWidthTransition: StyleTypes.Transition, + circleStrokeColor: StyleTypes.Color, + circleStrokeColorTransition: StyleTypes.Transition, + circleStrokeOpacity: StyleTypes.Constant, + circleStrokeOpacityTransition: StyleTypes.Transition, + circleEmissiveStrength: StyleTypes.Constant, + circleEmissiveStrengthTransition: StyleTypes.Transition, + heatmapRadius: StyleTypes.Constant, + heatmapRadiusTransition: StyleTypes.Transition, + heatmapWeight: StyleTypes.Constant, + heatmapIntensity: StyleTypes.Constant, + heatmapIntensityTransition: StyleTypes.Transition, + heatmapColor: StyleTypes.Color, + heatmapOpacity: StyleTypes.Constant, + heatmapOpacityTransition: StyleTypes.Transition, + fillExtrusionOpacity: StyleTypes.Constant, + fillExtrusionOpacityTransition: StyleTypes.Transition, + fillExtrusionColor: StyleTypes.Color, + fillExtrusionColorTransition: StyleTypes.Transition, + fillExtrusionTranslate: StyleTypes.Translation, + fillExtrusionTranslateTransition: StyleTypes.Transition, + fillExtrusionTranslateAnchor: StyleTypes.Enum, + fillExtrusionPattern: StyleTypes.Image, + fillExtrusionHeight: StyleTypes.Constant, + fillExtrusionHeightTransition: StyleTypes.Transition, + fillExtrusionBase: StyleTypes.Constant, + fillExtrusionBaseTransition: StyleTypes.Transition, + fillExtrusionVerticalGradient: StyleTypes.Constant, + fillExtrusionRoundedRoof: StyleTypes.Constant, + fillExtrusionAmbientOcclusionWallRadius: StyleTypes.Constant, + fillExtrusionAmbientOcclusionWallRadiusTransition: StyleTypes.Transition, + fillExtrusionAmbientOcclusionGroundRadius: StyleTypes.Constant, + fillExtrusionAmbientOcclusionGroundRadiusTransition: StyleTypes.Transition, + fillExtrusionAmbientOcclusionGroundAttenuation: StyleTypes.Constant, + fillExtrusionAmbientOcclusionGroundAttenuationTransition: StyleTypes.Transition, + fillExtrusionFloodLightColor: StyleTypes.Color, + fillExtrusionFloodLightColorTransition: StyleTypes.Transition, + fillExtrusionFloodLightIntensity: StyleTypes.Constant, + fillExtrusionFloodLightIntensityTransition: StyleTypes.Transition, + fillExtrusionFloodLightWallRadius: StyleTypes.Constant, + fillExtrusionFloodLightWallRadiusTransition: StyleTypes.Transition, + fillExtrusionFloodLightGroundRadius: StyleTypes.Constant, + fillExtrusionFloodLightGroundRadiusTransition: StyleTypes.Transition, + fillExtrusionFloodLightGroundAttenuation: StyleTypes.Constant, + fillExtrusionFloodLightGroundAttenuationTransition: StyleTypes.Transition, + fillExtrusionVerticalScale: StyleTypes.Constant, + fillExtrusionVerticalScaleTransition: StyleTypes.Transition, + fillExtrusionCutoffFadeRange: StyleTypes.Constant, + rasterOpacity: StyleTypes.Constant, + rasterOpacityTransition: StyleTypes.Transition, + rasterHueRotate: StyleTypes.Constant, + rasterHueRotateTransition: StyleTypes.Transition, + rasterBrightnessMin: StyleTypes.Constant, + rasterBrightnessMinTransition: StyleTypes.Transition, + rasterBrightnessMax: StyleTypes.Constant, + rasterBrightnessMaxTransition: StyleTypes.Transition, + rasterSaturation: StyleTypes.Constant, + rasterSaturationTransition: StyleTypes.Transition, + rasterContrast: StyleTypes.Constant, + rasterContrastTransition: StyleTypes.Transition, + rasterResampling: StyleTypes.Enum, + rasterFadeDuration: StyleTypes.Constant, + rasterColor: StyleTypes.Color, + rasterColorMix: StyleTypes.Constant, + rasterColorMixTransition: StyleTypes.Transition, + rasterColorRange: StyleTypes.Constant, + rasterColorRangeTransition: StyleTypes.Transition, + hillshadeIlluminationDirection: StyleTypes.Constant, + hillshadeIlluminationAnchor: StyleTypes.Enum, + hillshadeExaggeration: StyleTypes.Constant, + hillshadeExaggerationTransition: StyleTypes.Transition, + hillshadeShadowColor: StyleTypes.Color, + hillshadeShadowColorTransition: StyleTypes.Transition, + hillshadeHighlightColor: StyleTypes.Color, + hillshadeHighlightColorTransition: StyleTypes.Transition, + hillshadeAccentColor: StyleTypes.Color, + hillshadeAccentColorTransition: StyleTypes.Transition, + modelId: StyleTypes.Constant, + modelOpacity: StyleTypes.Constant, + modelOpacityTransition: StyleTypes.Transition, + modelRotation: StyleTypes.Constant, + modelRotationTransition: StyleTypes.Transition, + modelScale: StyleTypes.Constant, + modelScaleTransition: StyleTypes.Transition, + modelTranslation: StyleTypes.Constant, + modelTranslationTransition: StyleTypes.Transition, + modelColor: StyleTypes.Color, + modelColorTransition: StyleTypes.Transition, + modelColorMixIntensity: StyleTypes.Constant, + modelColorMixIntensityTransition: StyleTypes.Transition, + modelType: StyleTypes.Enum, + modelCastShadows: StyleTypes.Constant, + modelReceiveShadows: StyleTypes.Constant, + modelAmbientOcclusionIntensity: StyleTypes.Constant, + modelAmbientOcclusionIntensityTransition: StyleTypes.Transition, + modelEmissiveStrength: StyleTypes.Constant, + modelEmissiveStrengthTransition: StyleTypes.Transition, + modelRoughness: StyleTypes.Constant, + modelRoughnessTransition: StyleTypes.Transition, + modelHeightBasedEmissiveStrengthMultiplier: StyleTypes.Constant, + modelHeightBasedEmissiveStrengthMultiplierTransition: StyleTypes.Transition, + modelCutoffFadeRange: StyleTypes.Constant, + backgroundColor: StyleTypes.Color, + backgroundColorTransition: StyleTypes.Transition, + backgroundPattern: StyleTypes.Image, + backgroundOpacity: StyleTypes.Constant, + backgroundOpacityTransition: StyleTypes.Transition, + backgroundEmissiveStrength: StyleTypes.Constant, + backgroundEmissiveStrengthTransition: StyleTypes.Transition, + skyType: StyleTypes.Enum, + skyAtmosphereSun: StyleTypes.Constant, + skyAtmosphereSunIntensity: StyleTypes.Constant, + skyGradientCenter: StyleTypes.Constant, + skyGradientRadius: StyleTypes.Constant, + skyGradient: StyleTypes.Color, + skyAtmosphereHaloColor: StyleTypes.Color, + skyAtmosphereColor: StyleTypes.Color, + skyOpacity: StyleTypes.Constant, + skyOpacityTransition: StyleTypes.Transition, + anchor: StyleTypes.Enum, + position: StyleTypes.Constant, + positionTransition: StyleTypes.Transition, + intensity: StyleTypes.Constant, + intensityTransition: StyleTypes.Transition, + range: StyleTypes.Constant, + rangeTransition: StyleTypes.Transition, + highColor: StyleTypes.Color, + highColorTransition: StyleTypes.Transition, + spaceColor: StyleTypes.Color, + spaceColorTransition: StyleTypes.Transition, + horizonBlend: StyleTypes.Constant, + horizonBlendTransition: StyleTypes.Transition, + starIntensity: StyleTypes.Constant, + starIntensityTransition: StyleTypes.Transition, + verticalRange: StyleTypes.Constant, + verticalRangeTransition: StyleTypes.Transition, + exaggeration: StyleTypes.Constant, + color: StyleTypes.Color, + colorTransition: StyleTypes.Transition, + visibility: StyleTypes.Constant +}; +export const styleExtras = { + // padding + iconTextFitPadding: { + iosType: 'edgeinsets' + }, + // offsets + iconOffset: { + iosType: 'vector' + }, + textOffset: { + iosType: 'vector' + }, + lineOffset: { + iosType: 'vector' + }, + // translates + fillTranslate: { + iosType: 'vector' + }, + lineTranslate: { + iosType: 'vector' + }, + iconTranslate: { + iosType: 'vector' + }, + textTranslate: { + iosType: 'vector' + }, + circleTranslate: { + iosType: 'vector' + }, + fillExtrusionTranslate: { + iosType: 'vector' + } +}; +//# sourceMappingURL=styleMap.js.map \ No newline at end of file diff --git a/lib/module/utils/styleMap.js.map b/lib/module/utils/styleMap.js.map new file mode 100644 index 000000000..fa01bc23c --- /dev/null +++ b/lib/module/utils/styleMap.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isAndroid","StyleTypes","Constant","Color","Transition","Translation","Function","Image","Enum","getStyleType","styleProp","styleExtras","iosType","styleMap","Error","fillSortKey","fillAntialias","fillOpacity","fillOpacityTransition","fillColor","fillColorTransition","fillOutlineColor","fillOutlineColorTransition","fillTranslate","fillTranslateTransition","fillTranslateAnchor","fillPattern","fillEmissiveStrength","fillEmissiveStrengthTransition","lineCap","lineJoin","lineMiterLimit","lineRoundLimit","lineSortKey","lineOpacity","lineOpacityTransition","lineColor","lineColorTransition","lineTranslate","lineTranslateTransition","lineTranslateAnchor","lineWidth","lineWidthTransition","lineGapWidth","lineGapWidthTransition","lineOffset","lineOffsetTransition","lineBlur","lineBlurTransition","lineDasharray","linePattern","lineGradient","lineTrimOffset","lineEmissiveStrength","lineEmissiveStrengthTransition","symbolPlacement","symbolSpacing","symbolAvoidEdges","symbolSortKey","symbolZOrder","iconAllowOverlap","iconIgnorePlacement","iconOptional","iconRotationAlignment","iconSize","iconTextFit","iconTextFitPadding","iconImage","iconRotate","iconPadding","iconKeepUpright","iconOffset","iconAnchor","iconPitchAlignment","textPitchAlignment","textRotationAlignment","textField","textFont","textSize","textMaxWidth","textLineHeight","textLetterSpacing","textJustify","textRadialOffset","textVariableAnchor","textAnchor","textMaxAngle","textWritingMode","textRotate","textPadding","textKeepUpright","textTransform","textOffset","textAllowOverlap","textIgnorePlacement","textOptional","iconOpacity","iconOpacityTransition","iconColor","iconColorTransition","iconHaloColor","iconHaloColorTransition","iconHaloWidth","iconHaloWidthTransition","iconHaloBlur","iconHaloBlurTransition","iconTranslate","iconTranslateTransition","iconTranslateAnchor","textOpacity","textOpacityTransition","textColor","textColorTransition","textHaloColor","textHaloColorTransition","textHaloWidth","textHaloWidthTransition","textHaloBlur","textHaloBlurTransition","textTranslate","textTranslateTransition","textTranslateAnchor","symbolZElevate","iconEmissiveStrength","iconEmissiveStrengthTransition","textEmissiveStrength","textEmissiveStrengthTransition","iconImageCrossFade","iconImageCrossFadeTransition","circleSortKey","circleRadius","circleRadiusTransition","circleColor","circleColorTransition","circleBlur","circleBlurTransition","circleOpacity","circleOpacityTransition","circleTranslate","circleTranslateTransition","circleTranslateAnchor","circlePitchScale","circlePitchAlignment","circleStrokeWidth","circleStrokeWidthTransition","circleStrokeColor","circleStrokeColorTransition","circleStrokeOpacity","circleStrokeOpacityTransition","circleEmissiveStrength","circleEmissiveStrengthTransition","heatmapRadius","heatmapRadiusTransition","heatmapWeight","heatmapIntensity","heatmapIntensityTransition","heatmapColor","heatmapOpacity","heatmapOpacityTransition","fillExtrusionOpacity","fillExtrusionOpacityTransition","fillExtrusionColor","fillExtrusionColorTransition","fillExtrusionTranslate","fillExtrusionTranslateTransition","fillExtrusionTranslateAnchor","fillExtrusionPattern","fillExtrusionHeight","fillExtrusionHeightTransition","fillExtrusionBase","fillExtrusionBaseTransition","fillExtrusionVerticalGradient","fillExtrusionRoundedRoof","fillExtrusionAmbientOcclusionWallRadius","fillExtrusionAmbientOcclusionWallRadiusTransition","fillExtrusionAmbientOcclusionGroundRadius","fillExtrusionAmbientOcclusionGroundRadiusTransition","fillExtrusionAmbientOcclusionGroundAttenuation","fillExtrusionAmbientOcclusionGroundAttenuationTransition","fillExtrusionFloodLightColor","fillExtrusionFloodLightColorTransition","fillExtrusionFloodLightIntensity","fillExtrusionFloodLightIntensityTransition","fillExtrusionFloodLightWallRadius","fillExtrusionFloodLightWallRadiusTransition","fillExtrusionFloodLightGroundRadius","fillExtrusionFloodLightGroundRadiusTransition","fillExtrusionFloodLightGroundAttenuation","fillExtrusionFloodLightGroundAttenuationTransition","fillExtrusionVerticalScale","fillExtrusionVerticalScaleTransition","fillExtrusionCutoffFadeRange","rasterOpacity","rasterOpacityTransition","rasterHueRotate","rasterHueRotateTransition","rasterBrightnessMin","rasterBrightnessMinTransition","rasterBrightnessMax","rasterBrightnessMaxTransition","rasterSaturation","rasterSaturationTransition","rasterContrast","rasterContrastTransition","rasterResampling","rasterFadeDuration","rasterColor","rasterColorMix","rasterColorMixTransition","rasterColorRange","rasterColorRangeTransition","hillshadeIlluminationDirection","hillshadeIlluminationAnchor","hillshadeExaggeration","hillshadeExaggerationTransition","hillshadeShadowColor","hillshadeShadowColorTransition","hillshadeHighlightColor","hillshadeHighlightColorTransition","hillshadeAccentColor","hillshadeAccentColorTransition","modelId","modelOpacity","modelOpacityTransition","modelRotation","modelRotationTransition","modelScale","modelScaleTransition","modelTranslation","modelTranslationTransition","modelColor","modelColorTransition","modelColorMixIntensity","modelColorMixIntensityTransition","modelType","modelCastShadows","modelReceiveShadows","modelAmbientOcclusionIntensity","modelAmbientOcclusionIntensityTransition","modelEmissiveStrength","modelEmissiveStrengthTransition","modelRoughness","modelRoughnessTransition","modelHeightBasedEmissiveStrengthMultiplier","modelHeightBasedEmissiveStrengthMultiplierTransition","modelCutoffFadeRange","backgroundColor","backgroundColorTransition","backgroundPattern","backgroundOpacity","backgroundOpacityTransition","backgroundEmissiveStrength","backgroundEmissiveStrengthTransition","skyType","skyAtmosphereSun","skyAtmosphereSunIntensity","skyGradientCenter","skyGradientRadius","skyGradient","skyAtmosphereHaloColor","skyAtmosphereColor","skyOpacity","skyOpacityTransition","anchor","position","positionTransition","intensity","intensityTransition","range","rangeTransition","highColor","highColorTransition","spaceColor","spaceColorTransition","horizonBlend","horizonBlendTransition","starIntensity","starIntensityTransition","verticalRange","verticalRangeTransition","exaggeration","color","colorTransition","visibility"],"sourceRoot":"../../../src","sources":["utils/styleMap.ts"],"mappings":"AAAA;AACA;;AAEA,SAASA,SAAS,QAAQ,SAAS;AAEnC,OAAO,MAAMC,UAAU,GAAG;EACxBC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,OAAO;EACdC,UAAU,EAAE,YAAY;EACxBC,WAAW,EAAE,aAAa;EAC1BC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACR,CAAC;AAED,OAAO,SAASC,YAAY,CAACC,SAAmC,EAAE;EAChE,IAAI,CAACV,SAAS,EAAE,IAAIW,WAAW,CAACD,SAAS,CAAC,EAAE;IAC1C,OAAOC,WAAW,CAACD,SAAS,CAAC,CAACE,OAAO;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H,eAAe,EAAE;IACf9H,OAAO,EAAE;EACX,CAAC;EACDuJ,sBAAsB,EAAE;IACtBvJ,OAAO,EAAE;EACX;AACF,CAAC"} diff --git a/lib/module/web/MapContext.js b/lib/module/web/MapContext.js new file mode 100644 index 000000000..093d34cf4 --- /dev/null +++ b/lib/module/web/MapContext.js @@ -0,0 +1,4 @@ +import React from 'react'; +const MapContext = /*#__PURE__*/React.createContext({}); +export default MapContext; +//# sourceMappingURL=MapContext.js.map \ No newline at end of file diff --git a/lib/module/web/MapContext.js.map b/lib/module/web/MapContext.js.map new file mode 100644 index 000000000..1ad2e776b --- /dev/null +++ b/lib/module/web/MapContext.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","MapContext","createContext"],"sourceRoot":"../../../src","sources":["web/MapContext.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,MAAMC,UAAU,gBAAGD,KAAK,CAACE,aAAa,CAAgB,CAAC,CAAC,CAAC;AAEzD,eAAeD,UAAU"} diff --git a/lib/module/web/MapboxModule.js b/lib/module/web/MapboxModule.js new file mode 100644 index 000000000..8e55ba325 --- /dev/null +++ b/lib/module/web/MapboxModule.js @@ -0,0 +1,13 @@ +import mapboxgl from 'mapbox-gl'; +const MapboxModule = { + LineJoin: {}, + StyleURL: { + Street: 'mapbox://styles/mapbox/streets-v11', + Satellite: 'mapbox://styles/mapbox/satellite-v9' + }, + setAccessToken: token => { + mapboxgl.accessToken = token; + } +}; +export default MapboxModule; +//# sourceMappingURL=MapboxModule.js.map \ No newline at end of file diff --git a/lib/module/web/MapboxModule.js.map b/lib/module/web/MapboxModule.js.map new file mode 100644 index 000000000..131549012 --- /dev/null +++ b/lib/module/web/MapboxModule.js.map @@ -0,0 +1 @@ +{"version":3,"names":["mapboxgl","MapboxModule","LineJoin","StyleURL","Street","Satellite","setAccessToken","token","accessToken"],"sourceRoot":"../../../src","sources":["web/MapboxModule.js"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,WAAW;AAEhC,MAAMC,YAAY,GAAG;EACnBC,QAAQ,EAAE,CAAC,CAAC;EAEZC,QAAQ,EAAE;IACRC,MAAM,EAAE,oCAAoC;IAC5CC,SAAS,EAAE;EACb,CAAC;EAEDC,cAAc,EAAGC,KAAK,IAAK;IACzBP,QAAQ,CAACQ,WAAW,GAAGD,KAAK;EAC9B;AACF,CAAC;AAED,eAAeN,YAAY"} diff --git a/lib/module/web/UnimplementedComponent.js b/lib/module/web/UnimplementedComponent.js new file mode 100644 index 000000000..fdc24ff02 --- /dev/null +++ b/lib/module/web/UnimplementedComponent.js @@ -0,0 +1,8 @@ +import React from 'react'; +const UnimplementedComponent = name => class SymbolLater extends React.Component { + render() { + return /*#__PURE__*/React.createElement("div", null, "TODO implement ", name); + } +}; +export default UnimplementedComponent; +//# sourceMappingURL=UnimplementedComponent.js.map \ No newline at end of file diff --git a/lib/module/web/UnimplementedComponent.js.map b/lib/module/web/UnimplementedComponent.js.map new file mode 100644 index 000000000..9b49e9a16 --- /dev/null +++ b/lib/module/web/UnimplementedComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","UnimplementedComponent","name","SymbolLater","Component","render"],"sourceRoot":"../../../src","sources":["web/UnimplementedComponent.js"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,sBAAsB,GAAIC,IAAI,IAClC,MAAMC,WAAW,SAASH,KAAK,CAACI,SAAS,CAAC;EACxCC,MAAM,GAAG;IACP,oBAAO,oDAAqBH,IAAI,CAAO;EACzC;AACF,CAAC;AAEH,eAAeD,sBAAsB"} diff --git a/lib/module/web/components/Camera.js b/lib/module/web/components/Camera.js new file mode 100644 index 000000000..a7fddf9d7 --- /dev/null +++ b/lib/module/web/components/Camera.js @@ -0,0 +1,36 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import MapContext from '../MapContext'; +class Camera extends React.Component { + componentDidMount() { + const { + map + } = this.context; + const { + centerCoordinate + } = this.props; + if (map && centerCoordinate) { + map.flyTo({ + center: centerCoordinate + }); + } + } + fitBounds(northEastCoordinates, southWestCoordinates) { + let padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + let animationDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.0; + const { + map + } = this.context; + if (map) { + map.fitBounds([northEastCoordinates, southWestCoordinates]); + } + } + render() { + return /*#__PURE__*/React.createElement(React.Fragment, null); + } +} +_defineProperty(Camera, "contextType", MapContext); +_defineProperty(Camera, "UserTrackingModes", []); +export { Camera }; +export default Camera; +//# sourceMappingURL=Camera.js.map \ No newline at end of file diff --git a/lib/module/web/components/Camera.js.map b/lib/module/web/components/Camera.js.map new file mode 100644 index 000000000..a928f97fa --- /dev/null +++ b/lib/module/web/components/Camera.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","MapContext","Camera","Component","componentDidMount","map","context","centerCoordinate","props","flyTo","center","fitBounds","northEastCoordinates","southWestCoordinates","padding","animationDuration","render"],"sourceRoot":"../../../../src","sources":["web/components/Camera.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,UAAU,MAAM,eAAe;AAEtC,MAAMC,MAAM,SAASF,KAAK,CAACG,SAAS,CAEjC;EAMDC,iBAAiB,GAAG;IAClB,MAAM;MAAEC;IAAI,CAAC,GAAG,IAAI,CAACC,OAAO;IAC5B,MAAM;MAAEC;IAAiB,CAAC,GAAG,IAAI,CAACC,KAAK;IACvC,IAAIH,GAAG,IAAIE,gBAAgB,EAAE;MAC3BF,GAAG,CAACI,KAAK,CAAC;QAAEC,MAAM,EAAEH;MAAiB,CAAC,CAAC;IACzC;EACF;EAEAI,SAAS,CACPC,oBAAsC,EACtCC,oBAAsC,EAGtC;IAAA,IAFAC,OAAO,uEAAG,CAAC;IAAA,IACXC,iBAAiB,uEAAG,GAAG;IAEvB,MAAM;MAAEV;IAAI,CAAC,GAAG,IAAI,CAACC,OAAO;IAC5B,IAAID,GAAG,EAAE;MACPA,GAAG,CAACM,SAAS,CAAC,CAACC,oBAAoB,EAAEC,oBAAoB,CAAC,CAAC;IAC7D;EACF;EAEAG,MAAM,GAAG;IACP,oBAAO,yCAAK;EACd;AACF;AAAC,gBA/BKd,MAAM,iBAKWD,UAAU;AAAA,gBAL3BC,MAAM,uBAMiB,EAAE;AA2B/B,SAASA,MAAM;AACf,eAAeA,MAAM"} diff --git a/lib/module/web/components/MapView.js b/lib/module/web/components/MapView.js new file mode 100644 index 000000000..b4537bc3e --- /dev/null +++ b/lib/module/web/components/MapView.js @@ -0,0 +1,60 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +import React from 'react'; +import mapboxgl from 'mapbox-gl'; +import MapContext from '../MapContext'; + +/** + * MapView backed by Mapbox GL KS + */ +class MapView extends React.Component { + constructor() { + super(...arguments); + _defineProperty(this, "state", { + map: null + }); + _defineProperty(this, "mapContainer", null); + _defineProperty(this, "map", null); + } + componentDidMount() { + const { + styleURL + } = this.props; + if (!this.mapContainer) { + console.error('MapView - mapContainer should is null'); + return; + } + const map = new mapboxgl.Map({ + container: this.mapContainer, + style: styleURL || 'mapbox://styles/mapbox/streets-v11' + }); + this.map = map; + this.setState({ + map + }); + } + render() { + const { + children + } = this.props; + const { + map + } = this.state; + return /*#__PURE__*/React.createElement("div", { + style: { + width: '100%', + height: '100%' + }, + ref: el => this.mapContainer = el + }, map && /*#__PURE__*/React.createElement("div", { + style: { + position: 'absolute' + } + }, /*#__PURE__*/React.createElement(MapContext.Provider, { + value: { + map + } + }, children))); + } +} +export default MapView; +//# sourceMappingURL=MapView.js.map \ No newline at end of file diff --git a/lib/module/web/components/MapView.js.map b/lib/module/web/components/MapView.js.map new file mode 100644 index 000000000..fb21a1af4 --- /dev/null +++ b/lib/module/web/components/MapView.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","mapboxgl","MapContext","MapView","Component","map","componentDidMount","styleURL","props","mapContainer","console","error","Map","container","style","setState","render","children","state","width","height","el","position"],"sourceRoot":"../../../../src","sources":["web/components/MapView.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAEhC,OAAOC,UAAU,MAAM,eAAe;;AAEtC;AACA;AACA;AACA,MAAMC,OAAO,SAASH,KAAK,CAACI,SAAS,CAGnC;EAAA;IAAA;IAAA,+BACQ;MAAEC,GAAG,EAAE;IAAK,CAAC;IAAA,sCACc,IAAI;IAAA,6BAClB,IAAI;EAAA;EAEzBC,iBAAiB,GAAG;IAClB,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,KAAK;IAC/B,IAAI,CAAC,IAAI,CAACC,YAAY,EAAE;MACtBC,OAAO,CAACC,KAAK,CAAC,uCAAuC,CAAC;MACtD;IACF;IACA,MAAMN,GAAG,GAAG,IAAIJ,QAAQ,CAACW,GAAG,CAAC;MAC3BC,SAAS,EAAE,IAAI,CAACJ,YAAY;MAC5BK,KAAK,EAAEP,QAAQ,IAAI;IACrB,CAAC,CAAC;IACF,IAAI,CAACF,GAAG,GAAGA,GAAG;IACd,IAAI,CAACU,QAAQ,CAAC;MAAEV;IAAI,CAAC,CAAC;EACxB;EAEAW,MAAM,GAAG;IACP,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACT,KAAK;IAC/B,MAAM;MAAEH;IAAI,CAAC,GAAG,IAAI,CAACa,KAAK;IAC1B,oBACE;MACE,KAAK,EAAE;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAE;MACzC,GAAG,EAAGC,EAAE,IAAM,IAAI,CAACZ,YAAY,GAAGY;IAAI,GAErChB,GAAG,iBACF;MAAK,KAAK,EAAE;QAAEiB,QAAQ,EAAE;MAAW;IAAE,gBACnC,oBAAC,UAAU,CAAC,QAAQ;MAAC,KAAK,EAAE;QAAEjB;MAAI;IAAE,GACjCY,QAAQ,CACW,CAEzB,CACG;EAEV;AACF;AAEA,eAAed,OAAO"} diff --git a/lib/module/web/index.js b/lib/module/web/index.js new file mode 100644 index 000000000..44767a914 --- /dev/null +++ b/lib/module/web/index.js @@ -0,0 +1,16 @@ +import MapboxModule from './MapboxModule'; +import Camera from './components/Camera'; +import MapView from './components/MapView'; +import Logger from './utils/Logger'; +const ExportedComponents = { + Camera, + MapView, + Logger +}; +const Mapbox = { + ...MapboxModule, + ...ExportedComponents +}; +export { Camera, MapView, Logger }; +export default Mapbox; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/module/web/index.js.map b/lib/module/web/index.js.map new file mode 100644 index 000000000..52d691261 --- /dev/null +++ b/lib/module/web/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["MapboxModule","Camera","MapView","Logger","ExportedComponents","Mapbox"],"sourceRoot":"../../../src","sources":["web/index.js"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AACzC,OAAOC,MAAM,MAAM,qBAAqB;AACxC,OAAOC,OAAO,MAAM,sBAAsB;AAC1C,OAAOC,MAAM,MAAM,gBAAgB;AAEnC,MAAMC,kBAAkB,GAAG;EACzBH,MAAM;EACNC,OAAO;EACPC;AACF,CAAC;AAED,MAAME,MAAM,GAAG;EACb,GAAGL,YAAY;EACf,GAAGI;AACL,CAAC;AAED,SAASH,MAAM,EAAEC,OAAO,EAAEC,MAAM;AAChC,eAAeE,MAAM"} diff --git a/lib/module/web/install.md b/lib/module/web/install.md new file mode 100644 index 000000000..ef03e3cf4 --- /dev/null +++ b/lib/module/web/install.md @@ -0,0 +1,25 @@ +Web support is work in progress, only basic map components works. + +Extra steps for web: +1. Add `mapbox-gl' dependency +``` +yarn add mapbox-gl +``` + +2. Configure web pack so that `rnmapbox/maps` is transpiled. `@expo/webpack-config` auto transpires packages starting with `react-native-` but `rnmapbox` has not `react-native in it's name, so it will not be transpired. See https://github.com/expo/expo-cli/issues/3744#issuecomment-893911288 and https://github.com/expo/expo-cli/tree/master/packages/webpack-config#include-modules : +``` +expo customize:web + +module.exports = async function (env, argv) { + const config = await createExpoWebpackConfigAsync( + { + ...env, + babel: { dangerouslyAddModulePathsToTranspile: ["@rnmapbox/maps"] }, + }, + argv + ); + + return config; +}; + +``` diff --git a/lib/module/web/utils/Logger.js b/lib/module/web/utils/Logger.js new file mode 100644 index 000000000..ecf31605c --- /dev/null +++ b/lib/module/web/utils/Logger.js @@ -0,0 +1,92 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* eslint-disable @typescript-eslint/no-empty-function */ + +class Logger { + static sharedInstance() { + if (this.instance === null) { + this.instance = new Logger(); + } + return this.instance; + } + constructor() { + _defineProperty(this, "level", 'info'); + _defineProperty(this, "startedCount", 0); + this.logCallback = null; + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + static setLogCallback(logCallback) { + this.sharedInstance().setLogCallback(logCallback); + } + + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + setLogCallback(logCallback) { + this.logCallback = logCallback; + } + + /** + * This callback is displayed as part of the Requester class. + * @callback Logger~logCallback + * @param {object} log + * @param {string} log.message - the message of the log + * @param {string} log.level - log level + * @param {string} log.tag - optional tag used on android + */ + + /** + * setLogLevel + * @param {LogLevel} level + */ + static setLogLevel(level) { + this.sharedInstance().level = level; + } + start() {} + stop() {} + subscribe() { + //TODO + } + unsubscribe() { + //TODO + } + effectiveLevel(log) { + const { + level, + message, + tag + } = log; + if (level === 'warning') { + if (tag === 'Mbgl-HttpRequest' && message.startsWith('Request failed due to a permanent error: Canceled')) { + // this seems to happening too much to show a warning every time + return 'info'; + } + } + return level; + } + onLog(log) { + if (!this.logCallback || !this.logCallback(log)) { + const { + message + } = log; + const level = this.effectiveLevel(log); + if (level === 'error') { + console.error('Mapbox error', message, log); + } else if (level === 'warning') { + console.warn('Mapbox warning', message, log); + } else { + console.log(`Mapbox [${level}]`, message, log); + } + } + } +} +_defineProperty(Logger, "instance", null); +Logger.sharedInstance().start(); +export default Logger; +//# sourceMappingURL=Logger.js.map \ No newline at end of file diff --git a/lib/module/web/utils/Logger.js.map b/lib/module/web/utils/Logger.js.map new file mode 100644 index 000000000..01436f0d7 --- /dev/null +++ b/lib/module/web/utils/Logger.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Logger","sharedInstance","instance","constructor","logCallback","setLogCallback","setLogLevel","level","start","stop","subscribe","unsubscribe","effectiveLevel","log","message","tag","startsWith","onLog","console","error","warn"],"sourceRoot":"../../../../src","sources":["web/utils/Logger.ts"],"mappings":";AAAA;;AASA,MAAMA,MAAM,CAAC;EAOX,OAAOC,cAAc,GAAG;IACtB,IAAI,IAAI,CAACC,QAAQ,KAAK,IAAI,EAAE;MAC1B,IAAI,CAACA,QAAQ,GAAG,IAAIF,MAAM,EAAE;IAC9B;IACA,OAAO,IAAI,CAACE,QAAQ;EACtB;EAEAC,WAAW,GAAG;IAAA,+BAXI,MAAM;IAAA,sCAET,CAAC;IAUd,IAAI,CAACC,WAAW,GAAG,IAAI;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,cAAc,CAACD,WAAwB,EAAE;IAC9C,IAAI,CAACH,cAAc,EAAE,CAACI,cAAc,CAACD,WAAW,CAAC;EACnD;;EAEA;AACF;AACA;AACA;AACA;EACEC,cAAc,CAACD,WAAwB,EAAE;IACvC,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAEE;AACF;AACA;AACA;EACE,OAAOE,WAAW,CAACC,KAAe,EAAE;IAClC,IAAI,CAACN,cAAc,EAAE,CAACM,KAAK,GAAGA,KAAK;EACrC;EAEAC,KAAK,GAAG,CAAC;EAETC,IAAI,GAAG,CAAC;EAERC,SAAS,GAAG;IACV;EACF;EAEAC,WAAW,GAAG;IACZ;EACF;EAEAC,cAAc,CAACC,GAAe,EAAY;IACxC,MAAM;MAAEN,KAAK;MAAEO,OAAO;MAAEC;IAAI,CAAC,GAAGF,GAAG;IAEnC,IAAIN,KAAK,KAAK,SAAS,EAAE;MACvB,IACEQ,GAAG,KAAK,kBAAkB,IAC1BD,OAAO,CAACE,UAAU,CAAC,mDAAmD,CAAC,EACvE;QACA;QACA,OAAO,MAAM;MACf;IACF;IACA,OAAOT,KAAK;EACd;EAEAU,KAAK,CAACJ,GAAe,EAAE;IACrB,IAAI,CAAC,IAAI,CAACT,WAAW,IAAI,CAAC,IAAI,CAACA,WAAW,CAACS,GAAG,CAAC,EAAE;MAC/C,MAAM;QAAEC;MAAQ,CAAC,GAAGD,GAAG;MACvB,MAAMN,KAAK,GAAG,IAAI,CAACK,cAAc,CAACC,GAAG,CAAC;MACtC,IAAIN,KAAK,KAAK,OAAO,EAAE;QACrBW,OAAO,CAACC,KAAK,CAAC,cAAc,EAAEL,OAAO,EAAED,GAAG,CAAC;MAC7C,CAAC,MAAM,IAAIN,KAAK,KAAK,SAAS,EAAE;QAC9BW,OAAO,CAACE,IAAI,CAAC,gBAAgB,EAAEN,OAAO,EAAED,GAAG,CAAC;MAC9C,CAAC,MAAM;QACLK,OAAO,CAACL,GAAG,CAAE,WAAUN,KAAM,GAAE,EAAEO,OAAO,EAAED,GAAG,CAAC;MAChD;IACF;EACF;AACF;AAAC,gBA7FKb,MAAM,cACuB,IAAI;AA8FvCA,MAAM,CAACC,cAAc,EAAE,CAACO,KAAK,EAAE;AAE/B,eAAeR,MAAM"} diff --git a/lib/typescript/jest.config.d.ts b/lib/typescript/jest.config.d.ts new file mode 100644 index 000000000..f785ad215 --- /dev/null +++ b/lib/typescript/jest.config.d.ts @@ -0,0 +1,4 @@ +import type { Config } from 'jest'; +declare const config: Config; +export default config; +//# sourceMappingURL=jest.config.d.ts.map \ No newline at end of file diff --git a/lib/typescript/jest.config.d.ts.map b/lib/typescript/jest.config.d.ts.map new file mode 100644 index 000000000..5c2c0dde7 --- /dev/null +++ b/lib/typescript/jest.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,QAAA,MAAM,MAAM,EAAE,MAiBb,CAAC;AAEF,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/Mapbox.d.ts b/lib/typescript/src/Mapbox.d.ts new file mode 100644 index 000000000..aab169d8e --- /dev/null +++ b/lib/typescript/src/Mapbox.d.ts @@ -0,0 +1,70 @@ +/// +export * from './RNMBXModule'; +export { Camera, UserTrackingMode, type CameraPadding, type CameraAnimationMode, type CameraBounds, type CameraStop, } from './components/Camera'; +export { Atmosphere } from './components/Atmosphere'; +export { default as MapView, type MapState } from './components/MapView'; +export { default as Light } from './components/Light'; +export { default as PointAnnotation } from './components/PointAnnotation'; +export { default as Annotation } from './components/Annotation'; +export { default as Callout } from './components/Callout'; +export { default as StyleImport } from './components/StyleImport'; +export { default as UserLocation, UserLocationRenderMode, } from './components/UserLocation'; +export { default as LocationPuck } from './components/LocationPuck'; +export { default as VectorSource } from './components/VectorSource'; +export { ShapeSource } from './components/ShapeSource'; +export { default as RasterSource } from './components/RasterSource'; +export { default as RasterDemSource } from './components/RasterDemSource'; +export { default as ImageSource } from './components/ImageSource'; +export { Viewport } from './components/Viewport'; +export { default as Models } from './components/Models'; +export { default as Images, type ImageEntry } from './components/Images'; +export { default as Image } from './components/Image'; +export { default as FillLayer } from './components/FillLayer'; +export { default as FillExtrusionLayer } from './components/FillExtrusionLayer'; +export { default as HeatmapLayer } from './components/HeatmapLayer'; +export { default as LineLayer } from './components/LineLayer'; +export { default as CircleLayer } from './components/CircleLayer'; +export { default as SkyLayer } from './components/SkyLayer'; +export { default as ModelLayer } from './components/ModelLayer'; +export { SymbolLayer } from './components/SymbolLayer'; +export { default as RasterLayer } from './components/RasterLayer'; +export { default as BackgroundLayer } from './components/BackgroundLayer'; +export { default as CustomLocationProvider } from './components/CustomLocationProvider'; +export { Terrain } from './components/Terrain'; +export { default as locationManager, type Location, } from './modules/location/locationManager'; +export { default as offlineManager, OfflineCreatePackOptions, } from './modules/offline/offlineManager'; +export { default as offlineManagerLegacy } from './modules/offline/offlineManagerLegacy'; +export { default as TileStore } from './modules/offline/TileStore'; +export { default as snapshotManager, type SnapshotOptions, } from './modules/snapshot/snapshotManager'; +export { default as MarkerView } from './components/MarkerView'; +export { default as Animated } from './utils/animated/Animated'; +export { AnimatedCoordinatesArray, AnimatedExtractCoordinateFromArray, AnimatedPoint, AnimatedRouteCoordinatesArray, AnimatedShape, } from './classes'; +export { default as Style } from './components/Style'; +export { default as Logger, type LogLevel } from './utils/Logger'; +export { requestAndroidLocationPermissions } from './requestAndroidLocationPermissions'; +export { getAnnotationsLayerID } from './utils/getAnnotationsLayerID'; +export type { FillLayerStyleProps as FillLayerStyle, LineLayerStyleProps as LineLayerStyle, SymbolLayerStyleProps as SymbolLayerStyle, CircleLayerStyleProps as CircleLayerStyle, HeatmapLayerStyleProps as HeatmapLayerStyle, FillExtrusionLayerStyleProps as FillExtrusionLayerStyle, RasterLayerStyleProps as RasterLayerStyle, HillshadeLayerStyleProps as HillshadeLayerStyle, BackgroundLayerStyleProps as BackgroundLayerStyle, SkyLayerStyleProps as SkyLayerStyle, LightLayerStyleProps as LightLayerStyle, AtmosphereLayerStyleProps as AtmosphereLayerStyle, TerrainLayerStyleProps as TerrainLayerStyle, ModelLayerStyleProps as ModelLayerStyle, } from './utils/MapboxStyles'; +import { AnimatedPoint } from './classes'; +import { UserTrackingMode } from './components/Camera'; +import MovePointShapeAnimator from './shape_animators/MovePointShapeAnimator'; +/** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */ +export declare const AnimatedMapPoint: typeof AnimatedPoint; +/** @deprecated NativeUserLocation will be removed in future release. Use `LocationPuck` instead. */ +export declare const NativeUserLocation: import("react").MemoExoticComponent<(props: import("./components/LocationPuck").Props) => JSX.Element>; +export declare enum StyleURL { + Street = "mapbox://styles/mapbox/streets-v11", + Dark = "mapbox://styles/mapbox/dark-v10", + Light = "mapbox://styles/mapbox/light-v10", + Outdoors = "mapbox://styles/mapbox/outdoors-v11", + Satellite = "mapbox://styles/mapbox/satellite-v9", + SatelliteStreet = "mapbox://styles/mapbox/satellite-streets-v11", + TrafficDay = "mapbox://styles/mapbox/navigation-preview-day-v4", + TrafficNight = "mapbox://styles/mapbox/navigation-preview-night-v4" +} +/** @deprecated UserTrackingModes is deprecated use UserTrackingMode */ +export declare const UserTrackingModes: typeof UserTrackingMode; +/** @experimental */ +export declare const __experimental: { + MovePointShapeAnimator: typeof MovePointShapeAnimator; +}; +//# sourceMappingURL=Mapbox.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/Mapbox.d.ts.map b/lib/typescript/src/Mapbox.d.ts.map new file mode 100644 index 000000000..9b45a354b --- /dev/null +++ b/lib/typescript/src/Mapbox.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Mapbox.d.ts","sourceRoot":"","sources":["../../../src/Mapbox.ts"],"names":[],"mappings":";AAAA,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAA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tE,YAAY,EACV,mBAAmB,IAAI,cAAc,EACrC,mBAAmB,IAAI,cAAc,EACrC,qBAAqB,IAAI,gBAAgB,EACzC,qBAAqB,IAAI,gBAAgB,EACzC,sBAAsB,IAAI,iBAAiB,EAC3C,4BAA4B,IAAI,uBAAuB,EACvD,qBAAqB,IAAI,gBAAgB,EACzC,wBAAwB,IAAI,mBAAmB,EAC/C,yBAAyB,IAAI,oBAAoB,EACjD,kBAAkB,IAAI,aAAa,EACnC,oBAAoB,IAAI,eAAe,EACvC,yBAAyB,IAAI,oBAAoB,EACjD,sBAAsB,IAAI,iBAAiB,EAC3C,oBAAoB,IAAI,eAAe,GACxC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,sBAAsB,MAAM,0CAA0C,CAAC;AAG9E,yFAAyF;AAEzF,eAAO,MAAM,gBAAgB,sBAG5B,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,kBAAkB,wGAAe,CAAC;AAG/C,oBAAY,QAAQ;IAClB,MAAM,uCAAuC;IAC7C,IAAI,oCAAoC;IACxC,KAAK,qCAAqC;IAC1C,QAAQ,wCAAwC;IAChD,SAAS,wCAAwC;IACjD,eAAe,iDAAiD;IAChE,UAAU,qDAAqD;IAC/D,YAAY,uDAAuD;CACpE;AAED,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,yBAAmB,CAAC;AAElD,oBAAoB;AAEpB,eAAO,MAAM,cAAc;;CAE1B,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/RNMBXModule.d.ts b/lib/typescript/src/RNMBXModule.d.ts new file mode 100644 index 000000000..fbf652ece --- /dev/null +++ b/lib/typescript/src/RNMBXModule.d.ts @@ -0,0 +1,22 @@ +export declare const StyleURL: { + Street: URL; + Outdoors: URL; + Light: URL; + Dark: URL; + Satellite: URL; + SatelliteStreet: URL; +}, OfflinePackDownloadState: { + Inactive: string | number; + Active: string | number; + Complete: string | number; + Unknown?: string | number | undefined; +}, LineJoin: { + Bevel: string | number; + Round: string | number; + Miter: string | number; +}, StyleSource: { + DefaultSourceID: string; +}, TileServers: { + Mapbox: string; +}, removeCustomHeader: (headerName: string) => void, addCustomHeader: (headerName: string, headerValue: string) => void, setAccessToken: (accessToken: string | null) => Promise, setWellKnownTileServer: (tileServer: string) => void, clearData: () => Promise, getAccessToken: () => Promise, setTelemetryEnabled: (telemetryEnabled: boolean) => void, setConnected: (connected: boolean) => void; +//# sourceMappingURL=RNMBXModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/RNMBXModule.d.ts.map b/lib/typescript/src/RNMBXModule.d.ts.map new file mode 100644 index 000000000..bf5be8c07 --- /dev/null +++ b/lib/typescript/src/RNMBXModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXModule.d.ts","sourceRoot":"","sources":["../../../src/RNMBXModule.ts"],"names":[],"mappings":"AAqDA,eAAO,MACL,QAAQ;YAlDE,GAAG;cACD,GAAG;WACN,GAAG;UACJ,GAAG;eACE,GAAG;qBACG,GAAG;GA8CtB,wBAAwB;cA3CZ,MAAM,GAAG,MAAM;YACjB,MAAM,GAAG,MAAM;cACb,MAAM,GAAG,MAAM;;GA0C3B,QAAQ;WAtCC,MAAM,GAAG,MAAM;WACf,MAAM,GAAG,MAAM;WACf,MAAM,GAAG,MAAM;GAqCxB,WAAW;qBAlCQ,MAAM;GAmCzB,WAAW;YAhCD,MAAM;GAiChB,kBAAkB,eA9Ba,MAAM,KAAG,IAAI,EA+B5C,eAAe,eA9Ba,MAAM,eAAe,MAAM,KAAG,IAAI,EA+B9D,cAAc,gBA9Bc,MAAM,GAAG,IAAI,KAAG,QAAQ,MAAM,GAAG,IAAI,CAAC,EA+BlE,sBAAsB,eA9Ba,MAAM,KAAG,IAAI,EA+BhD,SAAS,QA9BI,QAAQ,IAAI,CAAC,EA+B1B,cAAc,QA9BI,QAAQ,MAAM,CAAC,EA+BjC,mBAAmB,qBA9BmB,OAAO,KAAG,IAAI,EA+BpD,YAAY,cA9BY,OAAO,KAAG,IA+BrB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/AbstractLayer.d.ts b/lib/typescript/src/components/AbstractLayer.d.ts new file mode 100644 index 000000000..c59fbf5b4 --- /dev/null +++ b/lib/typescript/src/components/AbstractLayer.d.ts @@ -0,0 +1,35 @@ +import React from 'react'; +import { NativeMethods, processColor } from 'react-native'; +import { AllLayerStyleProps, FilterExpression } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import type { BaseProps } from '../types/BaseProps'; +declare type PropsBase = BaseProps & { + id: string; + existing?: boolean; + sourceID?: string; + minZoomLevel?: number; + maxZoomLevel?: number; + aboveLayerID?: string; + belowLayerID?: string; + layerIndex?: number; + filter?: FilterExpression; + style?: AllLayerStyleProps; +}; +declare class AbstractLayer extends React.PureComponent { + get baseProps(): Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; + }; + nativeLayer: (React.Component & Readonly) | null; + setNativeLayer: (instance: (React.Component & Readonly) | null) => void; + getStyleTypeFormatter(styleType: string): typeof processColor | undefined; + getStyle(style: AllLayerStyleProps | undefined): { + [key: string]: StyleValue; + } | undefined; + setNativeProps(props: { + [key: string]: unknown; + }): void; +} +export default AbstractLayer; +//# sourceMappingURL=AbstractLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/AbstractLayer.d.ts.map b/lib/typescript/src/components/AbstractLayer.d.ts.map new file mode 100644 index 000000000..63998ff52 --- /dev/null +++ b/lib/typescript/src/components/AbstractLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AbstractLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/AbstractLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,EAAE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AAc,CAAC,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE;CAYjD;AAED,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/AbstractSource.d.ts b/lib/typescript/src/components/AbstractSource.d.ts new file mode 100644 index 000000000..0fe4cde0d --- /dev/null +++ b/lib/typescript/src/components/AbstractSource.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +import { NativeMethods } from 'react-native'; +import type { BaseProps } from '../types/BaseProps'; +declare class AbstractSource extends React.PureComponent { + _nativeRef?: React.Component & Readonly; + setNativeProps(props: NativePropsType): void; + setNativeRef: (instance: React.Component & Readonly) => void; +} +export default AbstractSource; +//# sourceMappingURL=AbstractSource.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/AbstractSource.d.ts.map b/lib/typescript/src/components/AbstractSource.d.ts.map new file mode 100644 index 000000000..470accea1 --- /dev/null +++ b/lib/typescript/src/components/AbstractSource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AbstractSource.d.ts","sourceRoot":"","sources":["../../../../src/components/AbstractSource.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,cAAM,cAAc,CAClB,SAAS,EACT,eAAe,SAAS,MAAM,CAC9B,SAAQ,KAAK,CAAC,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;IAClD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAExE,cAAc,CAAC,KAAK,EAAE,eAAe;IAMrC,YAAY,EAAE,CACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,KACjE,IAAI,CAEP;CACH;AAED,eAAe,cAAc,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Annotation.d.ts b/lib/typescript/src/components/Annotation.d.ts new file mode 100644 index 000000000..db95458b3 --- /dev/null +++ b/lib/typescript/src/components/Annotation.d.ts @@ -0,0 +1,34 @@ +import React, { ReactElement } from 'react'; +import { Point } from 'geojson'; +import { AnimatedPoint } from '../classes'; +import { OnPressEvent } from '../types/OnPressEvent'; +import { SymbolLayerStyle } from '../Mapbox'; +declare type Props = { + id: string; + animated?: boolean; + animationDuration?: number; + animationEasingFunction?: (x: number) => number; + coordinates: number[]; + onPress?: (event: OnPressEvent) => void; + children: ReactElement | ReactElement[]; + style?: object; + icon?: string | number | object; +}; +declare type AnnotationState = { + shape: Point | AnimatedPoint | null; +}; +declare class Annotation extends React.Component { + static defaultProps: { + animated: boolean; + animationDuration: number; + animationEasingFunction: import("react-native").EasingFunction; + }; + constructor(props: Props); + componentDidUpdate(prevProps: Props): void; + onPress(event: OnPressEvent): void; + _getShapeFromProps(props?: Partial): Point; + get symbolStyle(): SymbolLayerStyle | undefined; + render(): JSX.Element | null; +} +export default Annotation; +//# sourceMappingURL=Annotation.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Annotation.d.ts.map b/lib/typescript/src/components/Annotation.d.ts.map new file mode 100644 index 000000000..be1536fae --- /dev/null +++ b/lib/typescript/src/components/Annotation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../../src/components/Annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C,aAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC,CAAC;AAEF,aAAK,eAAe,GAAG;IACrB,KAAK,EAAE,KAAK,GAAG,aAAa,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,cAAM,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC;IAC9D,MAAM,CAAC,YAAY;;;;MAIjB;gBAEU,KAAK,EAAE,KAAK;IAYxB,kBAAkB,CAAC,SAAS,EAAE,KAAK;IAqCnC,OAAO,CAAC,KAAK,EAAE,YAAY;IAM3B,kBAAkB,CAAC,KAAK,GAAE,OAAO,CAAC,KAAK,CAAM,GAAG,KAAK;IAMrD,IAAI,WAAW,IAAI,gBAAgB,GAAG,SAAS,CAO9C;IAED,MAAM;CAkCP;AAED,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Atmosphere.d.ts b/lib/typescript/src/components/Atmosphere.d.ts new file mode 100644 index 000000000..6a7c0425b --- /dev/null +++ b/lib/typescript/src/components/Atmosphere.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import type { AtmosphereLayerStyleProps } from '../utils/MapboxStyles'; +import type { BaseProps } from '../types/BaseProps'; +declare type Props = BaseProps & { + style: AtmosphereLayerStyleProps; +}; +export declare const Atmosphere: React.MemoExoticComponent<(props: Props) => JSX.Element>; +export {}; +//# sourceMappingURL=Atmosphere.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Atmosphere.d.ts.map b/lib/typescript/src/components/Atmosphere.d.ts.map new file mode 100644 index 000000000..a9a93b1fa --- /dev/null +++ b/lib/typescript/src/components/Atmosphere.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Atmosphere.d.ts","sourceRoot":"","sources":["../../../../src/components/Atmosphere.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB,KAAK,EAAE,yBAAyB,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,UAAU,oCAAgB,KAAK,iBAU1C,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/BackgroundLayer.d.ts b/lib/typescript/src/components/BackgroundLayer.d.ts new file mode 100644 index 000000000..48acbe2f6 --- /dev/null +++ b/lib/typescript/src/components/BackgroundLayer.d.ts @@ -0,0 +1,65 @@ +import React from 'react'; +import { FilterExpression, BackgroundLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +export declare type Props = { + /** + * A string that uniquely identifies the layer in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * Customizable style attributes + */ + style?: BackgroundLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +declare class BackgroundLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default BackgroundLayer; +//# sourceMappingURL=BackgroundLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/BackgroundLayer.d.ts.map b/lib/typescript/src/components/BackgroundLayer.d.ts.map new file mode 100644 index 000000000..33b65d178 --- /dev/null +++ b/lib/typescript/src/components/BackgroundLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BackgroundLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/BackgroundLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAI5C,oBAAY,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF,cAAM,eAAgB,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IACjE,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAaP;AAED,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Callout.d.ts b/lib/typescript/src/components/Callout.d.ts new file mode 100644 index 000000000..a4cf38e9a --- /dev/null +++ b/lib/typescript/src/components/Callout.d.ts @@ -0,0 +1,40 @@ +import React, { ReactNode } from 'react'; +import { ViewStyle, ViewProps } from 'react-native'; +declare type Props = Omit & { + /** + * String that gets displayed in the default callout. + */ + title: string; + /** + * Style property for the Animated.View wrapper, apply animations to this + */ + style?: ViewStyle; + /** + * Style property for the native RNMBXCallout container, set at your own risk. + */ + containerStyle?: ViewStyle; + /** + * Style property for the content bubble. + */ + contentStyle?: ViewStyle; + /** + * Style property for the triangle tip under the content. + */ + tipStyle?: ViewStyle; + /** + * Style property for the title in the content bubble. + */ + textStyle?: ViewStyle; +}; +/** + * Callout that displays information about a selected annotation near the annotation. + */ +declare class Callout extends React.PureComponent { + get _containerStyle(): ViewStyle[]; + get _hasChildren(): boolean; + _renderDefaultCallout(): ReactNode; + _renderCustomCallout(): ReactNode; + render(): JSX.Element; +} +export default Callout; +//# sourceMappingURL=Callout.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Callout.d.ts.map b/lib/typescript/src/components/Callout.d.ts.map new file mode 100644 index 000000000..c58df817a --- /dev/null +++ b/lib/typescript/src/components/Callout.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../../src/components/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAKL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAwCtB,aAAK,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,cAAM,OAAQ,SAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;IAC9C,IAAI,eAAe,gBAclB;IAED,IAAI,YAAY,YAEf;IAED,qBAAqB,IAAI,SAAS;IAalC,oBAAoB,IAAI,SAAS;IAQjC,MAAM;CAUP;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Camera.d.ts b/lib/typescript/src/components/Camera.d.ts new file mode 100644 index 000000000..66ecf7629 --- /dev/null +++ b/lib/typescript/src/components/Camera.d.ts @@ -0,0 +1,123 @@ +import React from 'react'; +import { MapboxGLEvent } from '../types'; +import { type Position } from '../types/Position'; +export declare enum UserTrackingMode { + Follow = "normal", + FollowWithHeading = "compass", + FollowWithCourse = "course" +} +export declare type UserTrackingModeChangeCallback = (event: MapboxGLEvent<'usertrackingmodechange', { + followUserLocation: boolean; + followUserMode: UserTrackingMode | null; +}>) => void; +export interface CameraRef { + setCamera: (config: CameraStop | CameraStops, ignoreFollowUserLocation?: boolean) => void; + fitBounds: (ne: Position, sw: Position, paddingConfig?: number | number[], animationDuration?: number) => void; + flyTo: (centerCoordinate: Position, animationDuration?: number) => void; + moveTo: (centerCoordinate: Position, animationDuration?: number) => void; + zoomTo: (zoomLevel: number, animationDuration?: number) => void; +} +export declare type CameraStop = { + /** Allows static check of the data type. For internal use only. */ + readonly type?: 'CameraStop'; + /** The location on which the map should center. */ + centerCoordinate?: Position; + /** The corners of a box around which the map should bound. Contains padding props for backwards + * compatibility; the root `padding` prop should be used instead. */ + bounds?: CameraBoundsWithPadding; + /** The heading (orientation) of the map. */ + heading?: number; + /** The pitch of the map. */ + pitch?: number; + /** The zoom level of the map. */ + zoomLevel?: number; + /** The viewport padding in points. */ + padding?: CameraPadding; + /** The duration the map takes to animate to a new configuration. */ + animationDuration?: number; + /** The easing or path the camera uses to animate to a new configuration. */ + animationMode?: CameraAnimationMode; +}; +export declare type CameraFollowConfig = { + /** Whether the map orientation follows the user location. */ + followUserLocation?: boolean; + /** The mode used to track the user location on the map. */ + followUserMode?: UserTrackingMode; + /** The zoom level used when following the user location. */ + followZoomLevel?: number; + /** The pitch used when following the user location. */ + followPitch?: number; + /** The heading used when following the user location. */ + followHeading?: number; + /** The padding used to position the user location when following. */ + followPadding?: Partial; +}; +export declare type CameraMinMaxConfig = { + /** The lowest allowed zoom level. */ + minZoomLevel?: number; + /** The highest allowed zoom level. */ + maxZoomLevel?: number; + /** The corners of a box defining the limits of where the camera can pan or zoom. */ + maxBounds?: { + ne: Position; + sw: Position; + }; +}; +export interface CameraProps extends CameraStop, CameraFollowConfig, CameraMinMaxConfig { + /** The configuration that the camera falls back on, if no other values are specified. */ + defaultSettings?: CameraStop; + /** Whether the camera should send any configuration to the native module. Prevents unnecessary tile + * fetching and improves performance when the map is not visible. Defaults to `true`. */ + allowUpdates?: boolean; + /** Any arbitrary primitive value that, when changed, causes the camera to retry moving to its target + * configuration. (Not yet implemented.) */ + triggerKey?: string | number; + /** + * Executes when user tracking mode changes. + * @deprecated use Viewport#onStatusChanged instead. + */ + onUserTrackingModeChange?: UserTrackingModeChangeCallback; +} +export declare type CameraBounds = { + ne: Position; + sw: Position; +}; +export declare type CameraPadding = { + /** Left padding in points */ + paddingLeft: number; + /** Right padding in points */ + paddingRight: number; + /** Top padding in points */ + paddingTop: number; + /** Bottom padding in points */ + paddingBottom: number; +}; +export declare type CameraBoundsWithPadding = Partial & CameraBounds; +export declare type CameraStops = { + /** Allows static check of the data type. For internal use only. */ + readonly type: 'CameraStops'; + stops: CameraStop[]; +}; +export declare type CameraAnimationMode = 'flyTo' | 'easeTo' | 'linearTo' | 'moveTo' | 'none'; +/** + * Controls the perspective from which the user sees the map. + * + * To use imperative methods, pass in a ref object: + * + * ```tsx + * const camera = useRef(null); + * + * useEffect(() => { + * camera.current?.setCamera({ + * centerCoordinate: [lon, lat], + * }); + * }, []); + * + * return ( + * + * ); + * ``` + */ +export declare const Camera: React.MemoExoticComponent>>; +export declare type Camera = CameraRef; +//# sourceMappingURL=Camera.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Camera.d.ts.map b/lib/typescript/src/components/Camera.d.ts.map new file mode 100644 index 000000000..ce0bb7afb --- /dev/null +++ b/lib/typescript/src/components/Camera.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../../../src/components/Camera.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAOlD,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,iBAAiB,YAAY;IAC7B,gBAAgB,WAAW;CAC5B;AAED,oBAAY,8BAA8B,GAAG,CAC3C,KAAK,EAAE,aAAa,CAClB,wBAAwB,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AAuB,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC;AAE5E,oBAAY,WAAW,GAAG;IACxB,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB,CAAC;AAEF,oBAAY,mBAAmB,GAC3B,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,MAAM,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,0GAmXlB,CAAC;AAMF,oBAAY,MAAM,GAAG,SAAS,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/CircleLayer.d.ts b/lib/typescript/src/components/CircleLayer.d.ts new file mode 100644 index 000000000..bc6199803 --- /dev/null +++ b/lib/typescript/src/components/CircleLayer.d.ts @@ -0,0 +1,77 @@ +import React from 'react'; +import { FilterExpression, CircleLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style?: CircleLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * CircleLayer is a style layer that renders one or more filled circles on the map. + */ +declare class CircleLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default CircleLayer; +//# sourceMappingURL=CircleLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/CircleLayer.d.ts.map b/lib/typescript/src/components/CircleLayer.d.ts.map new file mode 100644 index 000000000..9655bc9ec --- /dev/null +++ b/lib/typescript/src/components/CircleLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CircleLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/CircleLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC;CAC/B,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,cAAM,WAAY,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC7D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAWP;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/CustomLocationProvider.d.ts b/lib/typescript/src/components/CustomLocationProvider.d.ts new file mode 100644 index 000000000..264864523 --- /dev/null +++ b/lib/typescript/src/components/CustomLocationProvider.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; +import { Position } from '../types/Position'; +export declare type Props = { + /** + * longitude and latitude to use for the custom location provider that gets applied to the NativeUserLocation + */ + coordinate?: Position; + /** + * heading/bearing to use for custom location provider that gets applied to the NativeUserLocation + */ + heading?: number; +}; +declare const CustomLocationProvider: React.MemoExoticComponent<(props: Props) => JSX.Element>; +export default CustomLocationProvider; +//# sourceMappingURL=CustomLocationProvider.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/CustomLocationProvider.d.ts.map b/lib/typescript/src/components/CustomLocationProvider.d.ts.map new file mode 100644 index 000000000..6e8de216a --- /dev/null +++ b/lib/typescript/src/components/CustomLocationProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CustomLocationProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomLocationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,oBAAY,KAAK,GAAG;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,sBAAsB,oCAAgB,KAAK,iBAE/C,CAAC;AAEH,eAAe,sBAAsB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/FillExtrusionLayer.d.ts b/lib/typescript/src/components/FillExtrusionLayer.d.ts new file mode 100644 index 000000000..19c2bfc88 --- /dev/null +++ b/lib/typescript/src/components/FillExtrusionLayer.d.ts @@ -0,0 +1,68 @@ +import React from 'react'; +import { FilterExpression, FillExtrusionLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +export declare type Props = { + /** + * A string that uniquely identifies the layer in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel: number; + /** + * Customizable style attributes + */ + style?: FillExtrusionLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map. + */ +declare class FillExtrusionLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default FillExtrusionLayer; +//# sourceMappingURL=FillExtrusionLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/FillExtrusionLayer.d.ts.map b/lib/typescript/src/components/FillExtrusionLayer.d.ts.map new file mode 100644 index 000000000..4d50605d1 --- /dev/null +++ b/lib/typescript/src/components/FillExtrusionLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FillExtrusionLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/FillExtrusionLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAI5C,oBAAY,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,4BAA4B,CAAC;CACtC,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,cAAM,kBAAmB,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IACpE,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAcP;AAED,eAAe,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/FillLayer.d.ts b/lib/typescript/src/components/FillLayer.d.ts new file mode 100644 index 000000000..143db4845 --- /dev/null +++ b/lib/typescript/src/components/FillLayer.d.ts @@ -0,0 +1,77 @@ +import React from 'react'; +import { FilterExpression, FillLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style?: FillLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map. + */ +declare class FillLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default FillLayer; +//# sourceMappingURL=FillLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/FillLayer.d.ts.map b/lib/typescript/src/components/FillLayer.d.ts.map new file mode 100644 index 000000000..00a7da703 --- /dev/null +++ b/lib/typescript/src/components/FillLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FillLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/FillLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,cAAM,SAAU,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC3D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAUP;AAED,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/HeadingIndicator.d.ts b/lib/typescript/src/components/HeadingIndicator.d.ts new file mode 100644 index 000000000..697be5090 --- /dev/null +++ b/lib/typescript/src/components/HeadingIndicator.d.ts @@ -0,0 +1,8 @@ +/// +import { BaseProps } from '../types/BaseProps'; +declare type Props = BaseProps & { + heading?: number; +}; +declare const HeadingIndicator: ({ heading }: Props) => JSX.Element; +export default HeadingIndicator; +//# sourceMappingURL=HeadingIndicator.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/HeadingIndicator.d.ts.map b/lib/typescript/src/components/HeadingIndicator.d.ts.map new file mode 100644 index 000000000..aaf4f5c38 --- /dev/null +++ b/lib/typescript/src/components/HeadingIndicator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"HeadingIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/HeadingIndicator.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAY/C,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,gBAAgB,gBAAiB,KAAK,gBAmB3C,CAAC;AAEF,eAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/HeatmapLayer.d.ts b/lib/typescript/src/components/HeatmapLayer.d.ts new file mode 100644 index 000000000..0fd94e7ce --- /dev/null +++ b/lib/typescript/src/components/HeatmapLayer.d.ts @@ -0,0 +1,77 @@ +import React from 'react'; +import { FilterExpression, HeatmapLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style?: HeatmapLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * HeatmapLayer is a style layer that renders one or more filled circles on the map. + */ +declare class HeatmapLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default HeatmapLayer; +//# sourceMappingURL=HeatmapLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/HeatmapLayer.d.ts.map b/lib/typescript/src/components/HeatmapLayer.d.ts.map new file mode 100644 index 000000000..1e070c92f --- /dev/null +++ b/lib/typescript/src/components/HeatmapLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"HeatmapLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/HeatmapLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,cAAM,YAAa,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC9D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAWP;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Image.d.ts b/lib/typescript/src/components/Image.d.ts new file mode 100644 index 000000000..504d2492a --- /dev/null +++ b/lib/typescript/src/components/Image.d.ts @@ -0,0 +1,25 @@ +import React, { ReactElement } from 'react'; +interface Props { + /** ID of the image */ + name: string; + /** Make image an sdf optional - see [SDF icons](https://docs.mapbox.com/help/troubleshooting/using-recolorable-images-in-mapbox-maps/) */ + sdf?: boolean; + /** An array of two-element arrays, consisting of two numbers that represent, the from position and the to position of areas that can be stretched horizontally. */ + stretchX?: [number, number][]; + /** An array of two-element arrays, consisting of two numbers that represent, the from position and the to position of areas that can be stretched vertically. */ + stretchY?: [number, number][]; + /** An array of four numbers, with the first two specifying the left, top + * corner, and the last two specifying the right, bottom corner. If present, and if the + * icon uses icon-text-fit, the symbol's text will be fit inside the content box. */ + content?: [number, number, number, number]; + /** Scale factor for the image. */ + scale?: number; + /** Single react native view rendering the image */ + children: ReactElement; +} +interface Ref { + refresh: () => void; +} +declare const Image: React.MemoExoticComponent>>; +export default Image; +//# sourceMappingURL=Image.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Image.d.ts.map b/lib/typescript/src/components/Image.d.ts.map new file mode 100644 index 000000000..7fc028ce1 --- /dev/null +++ b/lib/typescript/src/components/Image.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,YAAY,EAAE,MAAM,OAAO,CAAC;AAM9D,UAAU,KAAK;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IAEb,0IAA0I;IAC1I,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,mKAAmK;IACnK,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAE9B,iKAAiK;IACjK,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAE9B;;wFAEoF;IACpF,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE3C,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,mDAAmD;IACnD,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,UAAU,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,KAAK,8FA2BV,CAAC;AAIF,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/ImageSource.d.ts b/lib/typescript/src/components/ImageSource.d.ts new file mode 100644 index 000000000..6a4d7659d --- /dev/null +++ b/lib/typescript/src/components/ImageSource.d.ts @@ -0,0 +1,36 @@ +import React from 'react'; +import { BaseProps } from '../types/BaseProps'; +import AbstractSource from './AbstractSource'; +export declare const NATIVE_MODULE_NAME = "RNMBXImageSource"; +declare type Position = [number, number]; +declare type Props = BaseProps & { + /** + * A string that uniquely identifies the source. + */ + id: string; + /** + * The id refers to en existing source in the style. Does not create a new source. + */ + existing?: boolean; + /** + * An HTTP(S) URL, absolute file URL, or local file URL to the source image. + * Gifs are currently not supported. + */ + url?: number | string; + /** + * The top left, top right, bottom right, and bottom left coordinates for the image. + */ + coordinates?: [Position, Position, Position, Position]; + children?: React.ReactElement | React.ReactElement[]; +}; +declare type NativeProps = Props; +/** + * ImageSource is a content source that is used for a georeferenced raster image to be shown on the map. + * The georeferenced image scales and rotates as the user zooms and rotates the map + */ +declare class ImageSource extends AbstractSource { + _getURL(): string | undefined; + render(): JSX.Element | null; +} +export default ImageSource; +//# sourceMappingURL=ImageSource.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/ImageSource.d.ts.map b/lib/typescript/src/components/ImageSource.d.ts.map new file mode 100644 index 000000000..b731f33f3 --- /dev/null +++ b/lib/typescript/src/components/ImageSource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImageSource.d.ts","sourceRoot":"","sources":["../../../../src/components/ImageSource.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,aAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjC,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEvD,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;CACtD,CAAC;AAEF,aAAK,WAAW,GAAG,KAAK,CAAC;AAEzB;;;GAGG;AACH,cAAM,WAAY,SAAQ,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC;IAC1D,OAAO,IAAI,MAAM,GAAG,SAAS;IAU7B,MAAM;CAuBP;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Images.d.ts b/lib/typescript/src/components/Images.d.ts new file mode 100644 index 000000000..40e520d07 --- /dev/null +++ b/lib/typescript/src/components/Images.d.ts @@ -0,0 +1,80 @@ +import React, { ReactElement } from 'react'; +import { ImageSourcePropType, ImageResolvedAssetSource } from 'react-native'; +import Image from './Image'; +export declare const NATIVE_MODULE_NAME = "RNMBXImages"; +export declare type RNMBEvent = { + payload: PayloadType; + type: string; +}; +declare type TypedReactNode = ReactElement | Array> | never; +declare type NativeImage = string | { + name: string; + sdf?: boolean; + stretchX?: [number, number][]; + stretchY?: [number, number][]; + content?: [number, number, number, number]; + scale?: number; +}; +export declare type ImageEntryData = { + url?: string; + image?: ImageSourcePropType; + resolvedImage?: ImageResolvedAssetSource; + sdf?: boolean; + stretchX?: [number, number][]; + stretchY?: [number, number][]; + content?: [number, number, number, number]; + scale?: number; +}; +declare type ResolvedImageEntryData = { + url?: string; + resolvedImage?: ImageResolvedAssetSource; + sdf?: boolean; + stretchX?: [number, number][]; + stretchY?: [number, number][]; + content?: [number, number, number, number]; + scale?: number; +}; +export declare type ImageEntry = string | ImageSourcePropType | ImageEntryData; +interface Props { + /** + * Specifies the external images in key-value pairs required for the shape source. + * Keys are names - see iconImage expressions, values can be either urls-s objects + * with format `{uri: 'http://...'}` or `require('image.png')` or `import 'image.png'` + */ + images?: { + [key: string]: ImageEntry; + }; + /** + * If you have an asset under Image.xcassets on iOS and the drawables directory on android + * you can specify an array of string names with assets as the key `['pin']`. + * Additionally object with keys sdf, and strechX, strechY is supported for [SDF icons](https://docs.mapbox.com/help/troubleshooting/using-recolorable-images-in-mapbox-maps/) + */ + nativeAssetImages?: NativeImage[]; + /** + * Gets called when a Layer is trying to render an image whose key is not present in + * any of the `Images` component of the Map. + */ + onImageMissing?: (imageKey: string) => void; + children?: TypedReactNode; +} +/** + * Images defines the images used in Symbol etc. layers. + */ +declare class Images extends React.PureComponent { + static NATIVE_ASSETS_KEY: string; + _getImages(): { + images?: undefined; + nativeImages?: undefined; + } | { + images: { + [key: string]: string | ImageResolvedAssetSource | ResolvedImageEntryData; + }; + nativeImages: NativeImage[]; + }; + _onImageMissing(event: React.SyntheticEvent): void; + render(): JSX.Element; +} +export default Images; +//# sourceMappingURL=Images.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Images.d.ts.map b/lib/typescript/src/components/Images.d.ts.map new file mode 100644 index 000000000..ee8204676 --- /dev/null +++ b/lib/typescript/src/components/Images.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../../src/components/Images.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAK7E,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,oBAAY,SAAS,CAAC,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,IAAI;IAC/D,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwBF,aAAK,cAAc,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAE5E,aAAK,WAAW,GACZ,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC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AAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;IAEvC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC;IAElC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C,QAAQ,CAAC,EAAE,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,cAAM,MAAO,SAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;IAC7C,MAAM,CAAC,iBAAiB,SAAY;IAEpC,UAAU;;;;;;;;;IAiEV,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC;IAM/D,MAAM;CAcP;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Light.d.ts b/lib/typescript/src/components/Light.d.ts new file mode 100644 index 000000000..e551b9fec --- /dev/null +++ b/lib/typescript/src/components/Light.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import { LightLayerStyleProps } from '../utils/MapboxStyles'; +import { type BaseProps } from '../types/BaseProps'; +interface LightMethods { + setNativeProps(props: { + [key: string]: unknown; + }): void; +} +declare const _default: React.MemoExoticComponent>>; +export default _default; +//# sourceMappingURL=Light.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Light.d.ts.map b/lib/typescript/src/components/Light.d.ts.map new file mode 100644 index 000000000..3fd288173 --- /dev/null +++ b/lib/typescript/src/components/Light.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Light.d.ts","sourceRoot":"","sources":["../../../../src/components/Light.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAG7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAWpD,UAAU,YAAY;IACpB,cAAc,CAAC,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACzD;;IARC;;OAEG;;;AAwCL,wBAAuC"} \ No newline at end of file diff --git a/lib/typescript/src/components/LineLayer.d.ts b/lib/typescript/src/components/LineLayer.d.ts new file mode 100644 index 000000000..4f23f3591 --- /dev/null +++ b/lib/typescript/src/components/LineLayer.d.ts @@ -0,0 +1,77 @@ +/// +import { FilterExpression, LineLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style?: LineLayerStyleProps; +}; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * LineLayer is a style layer that renders one or more stroked polylines on the map. + */ +declare class LineLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default LineLayer; +//# sourceMappingURL=LineLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/LineLayer.d.ts.map b/lib/typescript/src/components/LineLayer.d.ts.map new file mode 100644 index 000000000..63fab1acf --- /dev/null +++ b/lib/typescript/src/components/LineLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LineLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/LineLayer.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,cAAM,SAAU,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC3D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAUP;AAED,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/LocationPuck.d.ts b/lib/typescript/src/components/LocationPuck.d.ts new file mode 100644 index 000000000..ce4c76c2c --- /dev/null +++ b/lib/typescript/src/components/LocationPuck.d.ts @@ -0,0 +1,85 @@ +import React from 'react'; +import { type ColorValue } from 'react-native'; +import type { Expression } from '../utils/MapboxStyles'; +declare type Value = T | Expression; +export declare type Props = { + /** + * Android render mode. + * + * - normal: just a circle + * - compass: triangle with heading + * - gps: large arrow + * + * @deprecated use `puckBearing` for source and `bearingImage` for image + * @platform android + */ + androidRenderMode?: 'normal' | 'compass' | 'gps'; + /** + * The bearing of the puck. + * + * - heading: Orients the puck to match the direction in which the device is facing. + * - course: Orients the puck to match the direction in which the device is moving. + */ + puckBearing?: 'heading' | 'course'; + /** + * Whether the puck rotates to track the bearing source. + */ + puckBearingEnabled?: boolean; + /** + * iOS only. A Boolean value indicating whether the user location annotation may display a permanent heading indicator. + * + * @platform ios + * @deprecated use `puckBearingEnabled={true} puckBrearing="heading"` instead + */ + iosShowsUserHeadingIndicator?: boolean; + /** + * The name of image to use as the top layer for the location indicator. Images component should define this image. + */ + topImage?: string; + /** + * The name of image to use as the middle layer for the location indicator. Images component should define this image. + */ + bearingImage?: string; + /** + * The name of image to use as the background for the location indicator. Images component should define this image. + */ + shadowImage?: string; + /** + * The size of the images, as a scale factor applied to the size of the specified image. Supports expressions based on zoom. + * + * @example + * ["interpolate",["linear"], ["zoom"], 10.0, 1.0, 20.0, 4.0]] + * @example + * 2.0 + */ + scale?: Value; + /** + * The configration parameters for sonar-like pulsing circle animation shown around the 2D puck. + */ + pulsing?: { + /** + * Flag determining whether the pulsing circle animation. + */ + isEnabled?: boolean; + /** + * The color of the pulsing circle. + */ + color?: number | ColorValue; + /** + * Circle radius configuration for the pulsing circle animation. + * - accuracy: Pulsing circle animates with the `horizontalAccuracy` form the latest puck location. + * - number: Pulsing circle should animate with the constant radius. + */ + radius?: 'accuracy' | number; + } | 'default'; + /** + * Whether location icon is visible, defaults to true + */ + visible?: boolean; +}; +/** + * Renders a puck on the map that shows the device's current location. + */ +declare const LocationPuck: React.MemoExoticComponent<(props: Props) => JSX.Element>; +export default LocationPuck; +//# sourceMappingURL=LocationPuck.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/LocationPuck.d.ts.map b/lib/typescript/src/components/LocationPuck.d.ts.map new file mode 100644 index 000000000..e20f4e46f --- /dev/null +++ b/lib/typescript/src/components/LocationPuck.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LocationPuck.d.ts","sourceRoot":"","sources":["../../../../src/components/LocationPuck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAK7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,aAAK,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;AAE/B,oBAAY,KAAK,GAAG;IAClB;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IAEjD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAEnC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;OAKG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EACJ;QACE;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QAEpB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;QAE5B;;;;WAIG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;KAC9B,GACD,SAAS,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAMF;;GAEG;AACH,QAAA,MAAM,YAAY,oCAAgB,KAAK,iBAiBrC,CAAC;AAmBH,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/MapView.d.ts b/lib/typescript/src/components/MapView.d.ts new file mode 100644 index 000000000..e428f008b --- /dev/null +++ b/lib/typescript/src/components/MapView.d.ts @@ -0,0 +1,586 @@ +import React, { Component } from 'react'; +import { ViewProps, NativeSyntheticEvent, NativeMethods, LayoutChangeEvent } from 'react-native'; +import { type NativeMapViewActual } from '../specs/RNMBXMapViewNativeComponent'; +import { type NativeArg, type OrnamentPositonProp } from '../utils'; +import Logger from '../utils/Logger'; +import { FilterExpression } from '../utils/MapboxStyles'; +import { type Position } from '../types/Position'; +import { type Location } from '../modules/location/locationManager'; +export declare type Point = { + x: number; + y: number; +}; +declare type BBox = [number, number, number, number]; +export declare type RegionPayload = { + zoomLevel: number; + heading: number; + animated: boolean; + isUserInteraction: boolean; + visibleBounds: GeoJSON.Position[]; + pitch: number; +}; +export declare type GestureSettings = { + /** + * Whether double tapping the map with one touch results in a zoom-in animation. + */ + doubleTapToZoomInEnabled?: boolean; + /** + * Whether single tapping the map with two touches results in a zoom-out animation. + */ + doubleTouchToZoomOutEnabled?: boolean; + /** + * Whether pan/scroll is enabled for the pinch gesture. + */ + pinchPanEnabled?: boolean; + /** + * Whether zoom is enabled for the pinch gesture. + */ + pinchZoomEnabled?: boolean; + /** + * Whether a deceleration animation following a pinch-zoom gesture is enabled. True by default. + * (Android only) + */ + pinchZoomDecelerationEnabled?: boolean; + /** + * Whether the pitch gesture is enabled. + */ + pitchEnabled?: boolean; + /** + * Whether the quick zoom gesture is enabled. + */ + quickZoomEnabled?: boolean; + /** + * Whether the rotate gesture is enabled. + */ + rotateEnabled?: boolean; + /** + * Whether a deceleration animation following a rotate gesture is enabled. True by default. + * (Android only) + */ + rotateDecelerationEnabled?: boolean; + /** + * Whether the single-touch pan/scroll gesture is enabled. + */ + panEnabled?: boolean; + /** + * A constant factor that determines how quickly pan deceleration animations happen. Multiplied with the velocity vector once per millisecond during deceleration animations. + * + * On iOS Defaults to UIScrollView.DecelerationRate.normal.rawValue + * On android set to 0 to disable deceleration, and non zero to enabled it. + */ + panDecelerationFactor?: number; + /** + * Whether rotation is enabled for the pinch zoom gesture. + */ + simultaneousRotateAndPinchZoomEnabled?: boolean; + /** + * The amount by which the zoom level increases or decreases during a double-tap-to-zoom-in or double-touch-to-zoom-out gesture. 1.0 by default. Must be positive. + * (Android only) + */ + zoomAnimationAmount?: number; +}; +/** + * v10 only + */ +export declare type MapState = { + properties: { + center: GeoJSON.Position; + bounds: { + ne: GeoJSON.Position; + sw: GeoJSON.Position; + }; + zoom: number; + heading: number; + pitch: number; + }; + gestures: { + isGestureActive: boolean; + }; + timestamp?: number; +}; +/** + * label localization settings (v10 only). `true` is equivalent to current locale. + */ +declare type LocalizeLabels = { + /** locale code like `es` or `current` for the device's current locale */ + locale: string; + /** layer id to localize. If not specified, all layers will be localized */ + layerIds?: string[]; +} | true; +declare type Props = ViewProps & { + /** + * The distance from the edges of the map view’s frame to the edges of the map view’s logical viewport. + * @deprecated use Camera `padding` instead + */ + contentInset?: number | number[]; + /** + * The projection used when rendering the map + */ + projection?: 'mercator' | 'globe'; + /** + * Style URL for map - notice, if non is set it _will_ default to `Mapbox.StyleURL.Street` + */ + styleURL?: string; + /** + * StyleJSON for map - according to TileJSON specs: https://github.com/mapbox/tilejson-spec + */ + styleJSON?: string; + /** + * iOS: The preferred frame rate at which the map view is rendered. + * The default value for this property is MGLMapViewPreferredFramesPerSecondDefault, + * which will adaptively set the preferred frame rate based on the capability of + * the user’s device to maintain a smooth experience. This property can be set to arbitrary integer values. + * + * Android: The maximum frame rate at which the map view is rendered, but it can't exceed the ability of device hardware. + * This property can be set to arbitrary integer values. + */ + preferredFramesPerSecond?: number; + /** + * Enable/Disable zoom on the map + */ + zoomEnabled?: boolean; + /** + * Enable/Disable scroll on the map + */ + scrollEnabled?: boolean; + /** + * Enable/Disable pitch on map + */ + pitchEnabled?: boolean; + /** + * Enable/Disable rotation on map + */ + rotateEnabled?: boolean; + /** + * The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles, + * [requires](https://www.mapbox.com/help/how-attribution-works/) these copyright notices to accompany any map that features Mapbox-designed styles, OpenStreetMap data, or other Mapbox data such as satellite or terrain data. + * If that applies to this map view, do not hide this view or remove any notices from it. + * + * You are additionally [required](https://www.mapbox.com/help/how-mobile-apps-work/#telemetry) to provide users with the option to disable anonymous usage and location sharing (telemetry). + * If this view is hidden, you must implement this setting elsewhere in your app. See our website for [Android](https://www.mapbox.com/android-docs/map-sdk/overview/#telemetry-opt-out) and [iOS](https://www.mapbox.com/ios-sdk/#telemetry_opt_out) for implementation details. + * + * Enable/Disable attribution on map. For iOS you need to add MGLMapboxMetricsEnabledSettingShownInApp=YES + * to your Info.plist + */ + attributionEnabled?: boolean; + /** + * Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map. By default on Android, the attribution with information icon (i) will be on the bottom left, while on iOS the mapbox logo will be on bottom left with information icon (i) on bottom right. Read more about mapbox attribution [here](https://docs.mapbox.com/help/getting-started/attribution/) + */ + attributionPosition?: OrnamentPositonProp; + /** + * MapView's tintColor + */ + tintColor?: string | number[]; + /** + * Enable/Disable the logo on the map. + */ + logoEnabled?: boolean; + /** + * Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map + */ + logoPosition?: OrnamentPositonProp; + /** + * Enable/Disable the compass from appearing on the map + */ + compassEnabled?: boolean; + /** + * [`mapbox` (v10) implementation only] Enable/Disable if the compass should fade out when the map is pointing north + */ + compassFadeWhenNorth?: boolean; + /** + * [`mapbox` (v10) implementation only] Adds compass offset, e.g. `{top: 8, left: 8}` will put the compass in top-left corner of the map + */ + compassPosition?: OrnamentPositonProp; + /** + * Change corner of map the compass starts at. 0: TopLeft, 1: TopRight, 2: BottomLeft, 3: BottomRight + */ + compassViewPosition?: number; + /** + * Add margins to the compass with x and y values + */ + compassViewMargins?: Point; + /** + * [iOS, `mapbox` (v10) implementation only] A string referencing an image key. Requires an `Images` component. + */ + compassImage?: string; + /** + * [`mapbox` (v10) implementation only] Enable/Disable the scale bar from appearing on the map + */ + scaleBarEnabled?: boolean; + /** + * [`mapbox` (v10) implementation only] Adds scale bar offset, e.g. `{top: 8, left: 8}` will put the scale bar in top-left corner of the map + */ + scaleBarPosition?: OrnamentPositonProp; + /** + * [Android only] Enable/Disable use of GLSurfaceView instead of TextureView. + */ + surfaceView?: boolean; + /** + * [Android only] Experimental, call requestDisallowInterceptTouchEvent on parent with onTochEvent, this allows touch interaction to work + * when embedded into a scroll view + */ + requestDisallowInterceptTouchEvent?: boolean; + /** + * [`mapbox` (v10) implementation only] + * Set map's label locale, e.g. `{ "locale": "es" }` will localize labels to Spanish, `{ "locale": "current" }` will localize labels to system locale. + */ + localizeLabels?: LocalizeLabels; + /** + * Gesture configuration allows to control the user touch interaction. + */ + gestureSettings?: GestureSettings; + /** + * Map press listener, gets called when a user presses the map + */ + onPress?: (feature: GeoJSON.Feature) => void; + /** + * Map long press listener, gets called when a user long presses the map + */ + onLongPress?: (feature: GeoJSON.Feature) => void; + /** + * ) => void; + /** + * + * This event is triggered whenever the currently displayed map region is changing. + * + * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds + */ + onRegionIsChanging?: (feature: GeoJSON.Feature) => void; + /** + * + * This event is triggered whenever the currently displayed map region finished changing. + * + * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds + */ + onRegionDidChange?: (feature: GeoJSON.Feature) => void; + /** + * v10 only, replaces onRegionIsChanging + */ + onCameraChanged?: (state: MapState) => void; + /** + * v10 only, replaces onRegionDidChange + */ + onMapIdle?: (state: MapState) => void; + /** + * This event is triggered when the map is about to start loading a new map style. + */ + onWillStartLoadingMap?: () => void; + /** + * This is triggered when the map has successfully loaded a new map style. + */ + onDidFinishLoadingMap?: () => void; + /** + * This event is triggered when the map has failed to load a new map style. On v10 it's deprecated and replaced by onMapLoadingError + * @deprecated use onMapLoadingError + */ + onDidFailLoadingMap?: () => void; + /** + * This event is tiggered when there is an error during map load. V10 only, replaces onDidFailLoadingMap, might be called multiple times and not exclusive with onDidFinishLoadingMap. + */ + onMapLoadingError?: () => void; + /** + * This event is triggered when the map will start rendering a frame. + */ + onWillStartRenderingFrame?: () => void; + /** + * This event is triggered when the map finished rendering a frame. + */ + onDidFinishRenderingFrame?: () => void; + /** + * This event is triggered when the map fully finished rendering a frame. + */ + onDidFinishRenderingFrameFully?: () => void; + /** + * This event is triggered when the map will start rendering the map. + */ + onWillStartRenderingMap?: () => void; + /** + * This event is triggered when the map finished rendering the map. + */ + onDidFinishRenderingMap?: () => void; + /** + * This event is triggered when the map fully finished rendering the map. + */ + onDidFinishRenderingMapFully?: () => void; + /** + * This event is triggered when the user location is updated. + */ + onUserLocationUpdate?: (feature: Location) => void; + /** + * This event is triggered when a style has finished loading. + */ + onDidFinishLoadingStyle?: () => void; + /** + * The emitted frequency of regionwillchange events + */ + regionWillChangeDebounceTime?: number; + /** + * The emitted frequency of regiondidchange events + */ + regionDidChangeDebounceTime?: number; + /** + * Set to true to deselect any selected annotation when the map is tapped. If set to true you will not receive + * the onPress event for the taps that deselect the annotation. Default is false. + */ + deselectAnnotationOnTap?: boolean; + /** + * @private Experimental support for custom MapView instances + */ + mapViewImpl?: string; + /** + * @private Experimental support for custom MapView instances + */ + _nativeImpl?: NativeMapViewActual; +}; +declare type CallbablePropKeys = 'onRegionWillChange' | 'onRegionIsChanging' | 'onRegionDidChange' | 'onUserLocationUpdate' | 'onWillStartLoadingMap' | 'onMapLoadingError' | 'onDidFinishLoadingMap' | 'onDidFailLoadingMap' | 'onWillStartRenderingFrame' | 'onDidFinishRenderingFrame' | 'onDidFinishRenderingFrameFully' | 'onWillStartRenderingMap' | 'onDidFinishRenderingMap' | 'onDidFinishRenderingMapFully' | 'onDidFinishLoadingStyle' | 'onMapIdle' | 'onCameraChanged'; +declare type Debounced = F & { + clear(): void; + flush(): void; +}; +declare const MapView_base: { + new (...args: any[]): { + _turboModule: import("react-native").TurboModule; + _preRefMapMethodQueue: { + method: { + name: string; + args: NativeArg[]; + }; + resolver: (value: NativeArg) => void; + }[]; + _runPendingNativeMethods(nativeRef: RefType): Promise; + _runNativeMethod(methodName: string, nativeRef: RefType_1 | undefined, args?: NativeArg[]): Promise; + context: unknown; + setState(state: {} | ((prevState: Readonly<{}>, props: object) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; + forceUpdate(callback?: (() => void) | undefined): void; + render(): React.ReactNode; + readonly props: object; + state: Readonly<{}>; + refs: { + [key: string]: React.ReactInstance; + }; + componentDidMount?(): void; + shouldComponentUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): boolean; + componentWillUnmount?(): void; + componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; + getSnapshotBeforeUpdate?(prevProps: object, prevState: Readonly<{}>): any; + componentDidUpdate?(prevProps: object, prevState: Readonly<{}>, snapshot?: any): void; + componentWillMount?(): void; + UNSAFE_componentWillMount?(): void; + componentWillReceiveProps?(nextProps: object, nextContext: any): void; + UNSAFE_componentWillReceiveProps?(nextProps: object, nextContext: any): void; + componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void; + UNSAFE_componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void; + }; +} & { + new (props: Props | Readonly): React.PureComponent; + new (props: Props, context: any): React.PureComponent; + contextType?: React.Context | undefined; +}; +/** + * MapView backed by Mapbox Native GL + */ +declare class MapView extends MapView_base { + static defaultProps: Props; + deprecationLogged: { + contentInset: boolean; + regionDidChange: boolean; + regionIsChanging: boolean; + }; + logger: Logger; + _onDebouncedRegionWillChange: Debounced<(payload: GeoJSON.Feature) => void>; + _onDebouncedRegionDidChange: Debounced<(payload: GeoJSON.Feature) => void>; + _nativeRef?: RNMBXMapViewRefType; + state: { + isReady: boolean | null; + region: null; + width: number; + height: number; + isUserInteraction: boolean; + }; + constructor(props: Props); + componentDidMount(): void; + componentWillUnmount(): void; + UNSAFE_componentWillReceiveProps(nextProps: Props): void; + _setHandledMapChangedEvents(props: Props): void; + /** + * Converts a geographic coordinate to a point in the given view’s coordinate system. + * + * @example + * const pointInView = await this._map.getPointInView([-37.817070, 144.949901]); + * + * @param {Array} coordinate - A point expressed in the map view's coordinate system. + * @return {Array} + */ + getPointInView(coordinate: Position): Promise; + /** + * Converts a point in the given view’s coordinate system to a geographic coordinate. + * + * @example + * const coordinate = await this._map.getCoordinateFromView([100, 100]); + * + * @param {Array} point - A point expressed in the given view’s coordinate system. + * @return {Array} + */ + getCoordinateFromView(point: Position): Promise; + /** + * The coordinate bounds (ne, sw) visible in the user’s viewport. + * + * @example + * const visibleBounds = await this._map.getVisibleBounds(); + * + * @return {Array} + */ + getVisibleBounds(): Promise<[Position, Position]>; + /** + * Returns an array of rendered map features that intersect with a given point. + * + * @example + * this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2']) + * + * @param {Array} coordinate - A point expressed in the map view’s coordinate system. + * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. + * @param {Array=} layerIDs - A array of layer id's to filter the features by + * @return {FeatureCollection} + */ + queryRenderedFeaturesAtPoint(coordinate: Position, filter?: FilterExpression | [], layerIDs?: string[]): Promise; + /** + * Returns an array of rendered map features that intersect with the given rectangle, + * restricted to the given style layers and filtered by the given predicate. In v10, + * passing an empty array will query the entire visible bounds of the map. + * + * @example + * this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2']) + * + * @param {Array} bbox - A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area. + * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. + * @param {Array=} layerIDs - A array of layer id's to filter the features by + * @return {FeatureCollection} + */ + queryRenderedFeaturesInRect(bbox: BBox | [], filter?: FilterExpression | [], layerIDs?: string[] | null): Promise; + /** + * Returns an array of GeoJSON Feature objects representing features within the specified vector tile or GeoJSON source that satisfy the query parameters. + * + * @example + * this._map.querySourceFeatures('your-source-id', [], ['your-source-layer']) + * + * @param {String} sourceId - Style source identifier used to query for source features. + * @param {Array=} filter - A filter to limit query results. + * @param {Array=} sourceLayerIDs - The name of the source layers to query. For vector tile sources, this parameter is required. For GeoJSON sources, it is ignored. + * @return {FeatureCollection} + */ + querySourceFeatures(sourceId: string, filter?: FilterExpression | [], sourceLayerIDs?: string[]): Promise; + /** + * Map camera will perform updates based on provided config. Deprecated use Camera#setCamera. + * @deprecated use Camera#setCamera + */ + setCamera(): void; + _runNative(methodName: string, args?: NativeArg[]): Promise; + /** + * Takes snapshot of map with current tiles and returns a URI to the image + * @param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64 + * @return {String} + */ + takeSnap(writeToDisk?: boolean): Promise; + /** + * Returns the current zoom of the map view. + * + * @example + * const zoom = await this._map.getZoom(); + * + * @return {Number} + */ + getZoom(): Promise; + /** + * Returns the map's geographical centerpoint + * + * @example + * const center = await this._map.getCenter(); + * + * @return {Array} Coordinates + */ + getCenter(): Promise; + /** + * + * Clears temporary map data from the data path defined in the given resource + * options. Useful to reduce the disk usage or in case the disk cache contains + * invalid data. + * + * v10 only + */ + clearData(): Promise; + /** + * Queries the currently loaded data for elevation at a geographical location. + * The elevation is returned in meters relative to mean sea-level. + * Returns null if terrain is disabled or if terrain data for the location hasn't been loaded yet. + * + * @param {Array} coordinate - the coordinates to query elevation at + * @return {Number} + */ + queryTerrainElevation(coordinate: Position): Promise; + /** + * Sets the visibility of all the layers referencing the specified `sourceLayerId` and/or `sourceId` + * + * @example + * await this._map.setSourceVisibility(false, 'composite', 'building') + * + * @param {boolean} visible - Visibility of the layers + * @param {String} sourceId - Identifier of the target source (e.g. 'composite') + * @param {String=} sourceLayerId - Identifier of the target source-layer (e.g. 'building') + */ + setSourceVisibility(visible: boolean, sourceId: string, sourceLayerId?: string | null): void; + _decodePayload(payload: T | string): T; + _onPress(e: NativeSyntheticEvent<{ + payload: GeoJSON.Feature | string; + }>): void; + _onLongPress(e: NativeSyntheticEvent<{ + payload: GeoJSON.Feature | string; + }>): void; + _onRegionWillChange(payload: GeoJSON.Feature): void; + _onRegionDidChange(payload: GeoJSON.Feature): void; + _onCameraChanged(e: NativeSyntheticEvent<{ + payload: MapState | string; + }>): void; + _onChange(e: NativeSyntheticEvent<{ + type: string; + payload: GeoJSON.Feature | string; + }>): void; + _onLayout(e: LayoutChangeEvent): void; + _handleOnChange(propName: CallbablePropKeys, payload: object): void; + _getContentInset(): number[] | undefined; + _setNativeRef(nativeRef: RNMBXMapViewRefType | null): void; + setNativeProps(props: NativeProps): void; + _setStyleURL(props: Props): void; + _setLocalizeLabels(props: Props): void; + render(): JSX.Element; +} +declare type NativeProps = Omit & { + onPress?: (event: NativeSyntheticEvent<{ + type: string; + payload: string; + }>) => void; + onLongPress?: (event: NativeSyntheticEvent<{ + type: string; + payload: string; + }>) => void; + onCameraChanged?: (event: NativeSyntheticEvent<{ + type: string; + payload: string; + }>) => void; +}; +declare type RNMBXMapViewRefType = Component & Readonly; +export default MapView; +//# sourceMappingURL=MapView.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/MapView.d.ts.map b/lib/typescript/src/components/MapView.d.ts.map new file mode 100644 index 000000000..5cdb83cdb --- /dev/null +++ b/lib/typescript/src/components/MapView.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/components/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAIL,SAAS,EACT,oBAAoB,EACpB,aAAa,EAEb,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAGtB,OAAsB,EACpB,KAAK,mBAAmB,EACzB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,UAAU,CAAC;AAElB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAwBpE,oBAAY,KAAK,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,aAAK,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7C,oBAAY,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,wBAAwB,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;KAAE,CAAC,KAC3D,IAAI,CAAC;IACV,WAAW,CAAC,EAAE,CACZ,KAAK,EAAE,oBAAoB,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,KAC3D,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,CAChB,KAAK,EAAE,oBAAoB,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,KAC3D,IAAI,CAAC;CACX,CAAC;AAEF,aAAK,mBAAmB,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAI5E,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/MarkerView.d.ts b/lib/typescript/src/components/MarkerView.d.ts new file mode 100644 index 000000000..ddf9b4a2b --- /dev/null +++ b/lib/typescript/src/components/MarkerView.d.ts @@ -0,0 +1,57 @@ +import React from 'react'; +import { type ViewProps } from 'react-native'; +import { type Position } from '../types/Position'; +declare type Props = ViewProps & { + /** + * The center point (specified as a map coordinate) of the marker. + */ + coordinate: Position; + /** + * Any coordinate between (0, 0) and (1, 1), where (0, 0) is the top-left corner of + * the view, and (1, 1) is the bottom-right corner. Defaults to the center at (0.5, 0.5). + */ + anchor: { + x: number; + y: number; + }; + /** + * @v10 + * + * Whether or not nearby markers on the map should all be displayed. If false, adjacent + * markers will 'collapse' and only one will be shown. Defaults to false. + */ + allowOverlap: boolean; + /** + * Whether or not nearby markers on the map should be hidden if close to a + * UserLocation puck. Defaults to false. + */ + allowOverlapWithPuck: boolean; + isSelected: boolean; + /** + * One or more valid React Native views. + */ + children: React.ReactElement; +}; +/** + * MarkerView represents an interactive React Native marker on the map. + * + * If you have static views, consider using PointAnnotation or SymbolLayer to display + * an image, as they'll offer much better performance. Mapbox suggests using this + * component for a maximum of around 100 views displayed at one time. + * + * This is implemented with view annotations on [Android](https://docs.mapbox.com/android/maps/guides/annotations/view-annotations/) + * and [iOS](https://docs.mapbox.com/ios/maps/guides/annotations/view-annotations). + * + * This component has no dedicated `onPress` method. Instead, you should handle gestures + * with the React views passed in as `children`. + */ +declare class MarkerView extends React.PureComponent { + static defaultProps: Partial; + static lastId: number; + __idForPointAnnotation?: string; + _idForPointAnnotation(): string; + _getCoordinate(coordinate: Position): string | undefined; + render(): JSX.Element; +} +export default MarkerView; +//# sourceMappingURL=MarkerView.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/MarkerView.d.ts.map b/lib/typescript/src/components/MarkerView.d.ts.map new file mode 100644 index 000000000..a798fc6fb --- /dev/null +++ b/lib/typescript/src/components/MarkerView.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkerView.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIvE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB;;OAEG;IACH,UAAU,EAAE,QAAQ,CAAC;IAErB;;;OAGG;IACH,MAAM,EAAE;QACN,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IAEF;;;;;OAKG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,cAAM,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;IACjD,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,CAKjC;IAEF,MAAM,CAAC,MAAM,SAAK;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,qBAAqB,IAAI,MAAM;IAQ/B,cAAc,CAAC,UAAU,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;IAOxD,MAAM;CAuDP;AAID,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/ModelLayer.d.ts b/lib/typescript/src/components/ModelLayer.d.ts new file mode 100644 index 000000000..9290de687 --- /dev/null +++ b/lib/typescript/src/components/ModelLayer.d.ts @@ -0,0 +1,77 @@ +/// +import { FilterExpression, ModelLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style?: ModelLayerStyleProps; +}; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * ModelLayer is a style layer that renders one or more stroked polylines on the map. + */ +declare class ModelLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default ModelLayer; +//# sourceMappingURL=ModelLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/ModelLayer.d.ts.map b/lib/typescript/src/components/ModelLayer.d.ts.map new file mode 100644 index 000000000..986bc418e --- /dev/null +++ b/lib/typescript/src/components/ModelLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ModelLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/ModelLayer.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAEF,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,cAAM,UAAW,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC5D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CASP;AAED,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Models.d.ts b/lib/typescript/src/components/Models.d.ts new file mode 100644 index 000000000..9d1bf8d89 --- /dev/null +++ b/lib/typescript/src/components/Models.d.ts @@ -0,0 +1,15 @@ +/// +declare type Props = { + /** + * pair odf model name to gltf and gbl file path/url, or asset id. + */ + models: { + [key: string]: string | number; + }; +}; +/** + * Name of 3D model assets to be used in the map + */ +export default function Models(props: Props): JSX.Element; +export {}; +//# sourceMappingURL=Models.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Models.d.ts.map b/lib/typescript/src/components/Models.d.ts.map new file mode 100644 index 000000000..fba651234 --- /dev/null +++ b/lib/typescript/src/components/Models.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Models.d.ts","sourceRoot":"","sources":["../../../../src/components/Models.tsx"],"names":[],"mappings":";AAKA,aAAK,KAAK,GAAG;IACX;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC5C,CAAC;AA2BF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,KAAK,eAG1C"} \ No newline at end of file diff --git a/lib/typescript/src/components/NativeBridgeComponent.d.ts b/lib/typescript/src/components/NativeBridgeComponent.d.ts new file mode 100644 index 000000000..dd5e28836 --- /dev/null +++ b/lib/typescript/src/components/NativeBridgeComponent.d.ts @@ -0,0 +1,46 @@ +import React from 'react'; +import { TurboModule } from 'react-native'; +import { type NativeArg } from '../utils'; +export declare type RNMBEvent = { + payload: PayloadType; + type: string; +}; +declare const NativeBridgeComponent: React.Component>(Base: BaseComponent, turboModule: TurboModule) => { + new (...args: any[]): { + _turboModule: TurboModule; + _preRefMapMethodQueue: { + method: { + name: string; + args: NativeArg[]; + }; + resolver: (value: NativeArg) => void; + }[]; + _runPendingNativeMethods(nativeRef: RefType): Promise; + _runNativeMethod(methodName: string, nativeRef: RefType_1 | undefined, args?: NativeArg[]): Promise; + context: unknown; + setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; + forceUpdate(callback?: (() => void) | undefined): void; + render(): React.ReactNode; + readonly props: Readonly; + state: Readonly<{}>; + refs: { + [key: string]: React.ReactInstance; + }; + componentDidMount?(): void; + shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean; + componentWillUnmount?(): void; + componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; + getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{}>): any; + componentDidUpdate?(prevProps: Readonly, prevState: Readonly<{}>, snapshot?: any): void; + componentWillMount?(): void; + UNSAFE_componentWillMount?(): void; + componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; + UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; + componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void; + UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void; + }; +} & BaseComponent; +export default NativeBridgeComponent; +//# sourceMappingURL=NativeBridgeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/NativeBridgeComponent.d.ts.map b/lib/typescript/src/components/NativeBridgeComponent.d.ts.map new file mode 100644 index 000000000..17a6ca980 --- /dev/null +++ b/lib/typescript/src/components/NativeBridgeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeBridgeComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/NativeBridgeComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,UAAU,CAAC;AAE3D,oBAAY,SAAS,CAAC,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,IAAI;IAC/D,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,qBAAqB,4DAEU,GAAG,EAAE,wEAG3B,WAAW;kBASD,GAAG,EAAE;sBANZ,WAAW;;oBAEf;gBAAE,MAAM,MAAM,CAAC;gBAAC,IAAI,EAAE,SAAS,EAAE,CAAA;aAAE;8BACzB,SAAS,KAAK,IAAI;;;0EA4BxB,MAAM,2CAEZ,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;iBAapB,CAAC;AAEJ,eAAe,qBAAqB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/PointAnnotation.d.ts b/lib/typescript/src/components/PointAnnotation.d.ts new file mode 100644 index 000000000..c3f6ae56f --- /dev/null +++ b/lib/typescript/src/components/PointAnnotation.d.ts @@ -0,0 +1,160 @@ +import React, { SyntheticEvent, type Component } from 'react'; +import { type ViewProps } from 'react-native'; +import { Feature, GeoJsonProperties, Geometry, Point } from 'geojson'; +import { type BaseProps } from '../types/BaseProps'; +import { Position } from '../types/Position'; +import { type RNMBEvent } from './NativeBridgeComponent'; +export declare const NATIVE_MODULE_NAME = "RNMBXPointAnnotation"; +declare type FeaturePayload = Feature; +declare type Props = BaseProps & { + /** + * A string that uniquely identifies the annotation + */ + id: string; + /** + * The string containing the annotation’s title. Note this is required to be set if you want to see a callout appear on iOS. + */ + title?: string; + /** + * The string containing the annotation’s snippet(subtitle). Not displayed in the default callout. + */ + snippet?: string; + /** + * Manually selects/deselects annotation + */ + selected?: boolean; + /** + * Enable or disable dragging. Defaults to false. + */ + draggable?: boolean; + /** + * The center point (specified as a map coordinate) of the annotation. + */ + coordinate: Position; + /** + * Specifies the anchor being set on a particular point of the annotation. + * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], + * where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner. + * Note this is only for custom annotations not the default pin view. + * Defaults to the center of the view. + */ + anchor?: { + /** + * See anchor + */ + x: number; + /** + * See anchor + */ + y: number; + }; + /** + * This callback is fired once this annotation is selected. Returns a Feature as the first param. + */ + onSelected?: (payload: FeaturePayload) => void; + /** + * This callback is fired once this annotation is deselected. + */ + onDeselected?: (payload: FeaturePayload) => void; + /** + * This callback is fired once this annotation has started being dragged. + */ + onDragStart?: (payload: FeaturePayload) => void; + /** + * This callback is fired once this annotation has stopped being dragged. + */ + onDragEnd?: (payload: FeaturePayload) => void; + /** + * This callback is fired while this annotation is being dragged. + */ + onDrag?: (payload: FeaturePayload) => void; + /** + * Expects one child, and an optional callout can be added as well + */ + children: React.ReactElement | [React.ReactElement, React.ReactElement]; + style?: ViewProps['style']; +}; +declare const PointAnnotation_base: { + new (...args: any[]): { + _turboModule: import("react-native").TurboModule; + _preRefMapMethodQueue: { + method: { + name: string; + args: import("../utils").NativeArg[]; + }; + resolver: (value: import("../utils").NativeArg) => void; + }[]; + _runPendingNativeMethods(nativeRef: RefType): Promise; + _runNativeMethod(methodName: string, nativeRef: RefType_1 | undefined, args?: import("../utils").NativeArg[]): Promise; + context: unknown; + setState(state: {} | ((prevState: Readonly<{}>, props: object) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; + forceUpdate(callback?: (() => void) | undefined): void; + render(): React.ReactNode; + readonly props: object; + state: Readonly<{}>; + refs: { + [key: string]: React.ReactInstance; + }; + componentDidMount?(): void; + shouldComponentUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): boolean; + componentWillUnmount?(): void; + componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; + getSnapshotBeforeUpdate?(prevProps: object, prevState: Readonly<{}>): any; + componentDidUpdate?(prevProps: object, prevState: Readonly<{}>, snapshot?: any): void; + componentWillMount?(): void; + UNSAFE_componentWillMount?(): void; + componentWillReceiveProps?(nextProps: object, nextContext: any): void; + UNSAFE_componentWillReceiveProps?(nextProps: object, nextContext: any): void; + componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void; + UNSAFE_componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void; + }; +} & { + new (props: Props | Readonly): React.PureComponent; + new (props: Props, context: any): React.PureComponent; + contextType?: React.Context | undefined; +}; +/** + * PointAnnotation represents a one-dimensional shape located at a single geographical coordinate. + * + * Consider using ShapeSource and SymbolLayer instead, if you have many points and static images, + * they'll offer much better performance. + * + * If you need interactive views please use MarkerView because PointAnnotation will render children onto a bitmap. + * Also disable any kind of animations like `fadeDuration` of `Image`. + * Otherwise, the bitmap might be rendered at an unknown state of the animation. + */ +declare class PointAnnotation extends PointAnnotation_base { + static defaultProps: { + anchor: { + x: number; + y: number; + }; + draggable: boolean; + }; + _nativeRef: NativePointAnnotationRef | null; + constructor(props: Props); + _decodePayload(payload: GeoJSON.Feature | string): GeoJSON.Feature; + _onSelected(e: SyntheticEvent>): void; + _onDeselected(e: SyntheticEvent>): void; + _onDragStart(e: SyntheticEvent>): void; + _onDrag(e: SyntheticEvent>): void; + _onDragEnd(e: SyntheticEvent>): void; + _getCoordinate(): string | undefined; + /** + * On v10 and pre v10 android point annotation is rendered offscreen with a canvas into an image. + * To rerender the image from the current state of the view call refresh. + * Call this for example from Image#onLoad. + */ + refresh(): void; + _setNativeRef(nativeRef: NativePointAnnotationRef | null): void; + render(): JSX.Element; +} +declare type NativeProps = Omit & { + coordinate: string | undefined; +}; +declare type NativePointAnnotationRef = Component; +export default PointAnnotation; +//# sourceMappingURL=PointAnnotation.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/PointAnnotation.d.ts.map b/lib/typescript/src/components/PointAnnotation.d.ts.map new file mode 100644 index 000000000..e724a9233 --- /dev/null +++ b/lib/typescript/src/components/PointAnnotation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PointAnnotation.d.ts","sourceRoot":"","sources":["../../../../src/components/PointAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAA8B,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEhF,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAUzD,aAAK,cAAc,GAAG,OAAO,CAC3B,KAAK,EACL;IACE,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CACF,CAAC;AAEF,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,QAAQ,CAAC;IAErB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QACP;;WA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AAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAOnE,YAAY,CAAC,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAOlE,OAAO,CAAC,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAO7D,UAAU,CAAC,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAOhE,cAAc,IAAI,MAAM,GAAG,SAAS;IAOpC;;;;OAIG;IACH,OAAO;IAIP,aAAa,CAAC,SAAS,EAAE,wBAAwB,GAAG,IAAI;IAKxD,MAAM;CA0BP;AAED,aAAK,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG;IAC7C,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,aAAK,wBAAwB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AAEvD,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/RasterDemSource.d.ts b/lib/typescript/src/components/RasterDemSource.d.ts new file mode 100644 index 000000000..463165dc5 --- /dev/null +++ b/lib/typescript/src/components/RasterDemSource.d.ts @@ -0,0 +1,49 @@ +import React from 'react'; +import AbstractSource from './AbstractSource'; +declare type Props = { + /** + * A string that uniquely identifies the source. + */ + id: string; + /** + * The id refers to en existing source in the style. Does not create a new source. + */ + existing?: boolean; + /** + * A URL to a TileJSON configuration file describing the source’s contents and other metadata. + */ + url?: string; + /** + * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints. + * Example: https://example.com/raster-tiles/{z}/{x}/{y}.png + */ + tileUrlTemplates?: string[]; + /** + * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source. + * The value should be between 0 and 22, inclusive, and less than + * maxZoomLevel, if specified. The default value for this option is 0. + */ + minZoomLevel?: number; + /** + * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source. + * The value should be between 0 and 22, inclusive, and less than + * minZoomLevel, if specified. The default value for this option is 22. + */ + maxZoomLevel?: number; + /** + * Size of the map tiles. + * Mapbox urls default to 256, all others default to 512. + */ + tileSize?: number; + children?: React.ReactElement | React.ReactElement[]; +}; +declare type NativeProps = Props; +declare class RasterDemSource extends AbstractSource { + static defaultProps: { + id: any; + }; + constructor(props: Props); + render(): JSX.Element; +} +export default RasterDemSource; +//# sourceMappingURL=RasterDemSource.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/RasterDemSource.d.ts.map b/lib/typescript/src/components/RasterDemSource.d.ts.map new file mode 100644 index 000000000..dde57a655 --- /dev/null +++ b/lib/typescript/src/components/RasterDemSource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RasterDemSource.d.ts","sourceRoot":"","sources":["../../../../src/components/RasterDemSource.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAQ9C,aAAK,KAAK,GAAG;IACX;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;CACtD,CAAC;AAEF,aAAK,WAAW,GAAG,KAAK,CAAC;AAEzB,cAAM,eAAgB,SAAQ,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC;IAC9D,MAAM,CAAC,YAAY;;MAEjB;gBAEU,KAAK,EAAE,KAAK;IASxB,MAAM;CA8BP;AAED,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/RasterLayer.d.ts b/lib/typescript/src/components/RasterLayer.d.ts new file mode 100644 index 000000000..3f9b81e67 --- /dev/null +++ b/lib/typescript/src/components/RasterLayer.d.ts @@ -0,0 +1,74 @@ +import React from 'react'; +import { FilterExpression, RasterLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style: RasterLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +declare class RasterLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default RasterLayer; +//# sourceMappingURL=RasterLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/RasterLayer.d.ts.map b/lib/typescript/src/components/RasterLayer.d.ts.map new file mode 100644 index 000000000..939982902 --- /dev/null +++ b/lib/typescript/src/components/RasterLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RasterLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/RasterLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAK5C,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,EAAE,qBAAqB,CAAC;CAC9B,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF,cAAM,WAAY,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC7D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAUP;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/RasterSource.d.ts b/lib/typescript/src/components/RasterSource.d.ts new file mode 100644 index 000000000..5f21062f7 --- /dev/null +++ b/lib/typescript/src/components/RasterSource.d.ts @@ -0,0 +1,62 @@ +import React from 'react'; +import { BaseProps } from '../types/BaseProps'; +import AbstractSource from './AbstractSource'; +declare type Props = BaseProps & { + /** + * A string that uniquely identifies the source. + */ + id: string; + /** + * The id refers to en existing source in the style. Does not create a new source. + */ + existing?: boolean; + /** + * A URL to a TileJSON configuration file describing the source’s contents and other metadata. + */ + url?: string; + /** + * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints. + * Example: https://example.com/raster-tiles/{z}/{x}/{y}.png + */ + tileUrlTemplates?: string[]; + /** + * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source. + * The value should be between 0 and 22, inclusive, and less than + * maxZoomLevel, if specified. The default value for this option is 0. + */ + minZoomLevel?: number; + /** + * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source. + * The value should be between 0 and 22, inclusive, and less than + * minZoomLevel, if specified. The default value for this option is 22. + */ + maxZoomLevel?: number; + /** + * Size of the map tiles. + * Mapbox urls default to 256, all others default to 512. + */ + tileSize?: number; + /** + * Influences the y direction of the tile coordinates. (tms inverts y axis) + */ + tms?: boolean; + /** + * An HTML or literal text string defining the buttons to be displayed in an action sheet when the + * source is part of a map view’s style and the map view’s attribution button is pressed. + */ + attribution?: string; + children?: React.ReactElement | React.ReactElement[]; +}; +declare type NativeProps = Props; +/** + * RasterSource is a map content source that supplies raster image tiles to be shown on the map. + * The location of and metadata about the tiles are defined either by an option dictionary + * or by an external file that conforms to the TileJSON specification. + */ +declare class RasterSource extends AbstractSource { + static defaultProps: Props; + constructor(props: Props); + render(): JSX.Element; +} +export default RasterSource; +//# sourceMappingURL=RasterSource.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/RasterSource.d.ts.map b/lib/typescript/src/components/RasterSource.d.ts.map new file mode 100644 index 000000000..4c3360736 --- /dev/null +++ b/lib/typescript/src/components/RasterSource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RasterSource.d.ts","sourceRoot":"","sources":["../../../../src/components/RasterSource.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAQ9C,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;CACtD,CAAC;AAEF,aAAK,WAAW,GAAG,KAAK,CAAC;AAEzB;;;;GAIG;AACH,cAAM,YAAa,SAAQ,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC;IAC3D,MAAM,CAAC,YAAY,EAAE,KAAK,CAExB;gBAEU,KAAK,EAAE,KAAK;IASxB,MAAM;CAgCP;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/ShapeSource.d.ts b/lib/typescript/src/components/ShapeSource.d.ts new file mode 100644 index 000000000..5696117ac --- /dev/null +++ b/lib/typescript/src/components/ShapeSource.d.ts @@ -0,0 +1,198 @@ +import React from 'react'; +import { NativeMethods, NativeSyntheticEvent } from 'react-native'; +import { OnPressEvent } from '../types/OnPressEvent'; +import AbstractSource from './AbstractSource'; +export declare type Props = { + /** + * A string that uniquely identifies the source. + */ + id: string; + /** + * The id refers to en existing source in the style. Does not create a new source. + */ + existing?: boolean; + /** + * An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle. + */ + url?: string; + /** + * The contents of the source. A shape can represent a GeoJSON geometry, a feature, or a feature collection. + */ + shape?: GeoJSON.GeometryCollection | GeoJSON.Feature | GeoJSON.FeatureCollection | GeoJSON.Geometry; + /** + * Enables clustering on the source for point shapes. + */ + cluster?: boolean; + /** + * Specifies the radius of each cluster if clustering is enabled. + * A value of 512 produces a radius equal to the width of a tile. + * The default value is 50. + */ + clusterRadius?: number; + /** + * Specifies the maximum zoom level at which to cluster points if clustering is enabled. + * Defaults to one zoom level less than the value of maxZoomLevel so that, at the maximum zoom level, + * the shapes are not clustered. + */ + clusterMaxZoomLevel?: number; + /** + * [`mapbox-gl` (v8) implementation only] + * Specifies custom properties on the generated clusters if clustering + * is enabled, aggregating values from clustered points. + * + * Has the form `{ "property_name": [operator, map_expression]}`, where + * `operator` is a custom reduce expression that references a special `["accumulated"]` value - + * it accumulates the property value from clusters/points the cluster contains + * `map_expression` produces the value of a single point + * + * Example: `{ "resultingSum": [["+", ["accumulated"], ["get", "resultingSum"]], ["get", "scalerank"]] }` + * + */ + clusterProperties?: object; + /** + * Specifies the maximum zoom level at which to create vector tiles. + * A greater value produces greater detail at high zoom levels. + * The default value is 18. + */ + maxZoomLevel?: number; + /** + * Specifies the size of the tile buffer on each side. + * A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. + * Larger values produce fewer rendering artifacts near tile edges and slower performance. + * The default value is 128. + */ + buffer?: number; + /** + * Specifies the Douglas-Peucker simplification tolerance. + * A greater value produces simpler geometries and improves performance. + * The default value is 0.375. + */ + tolerance?: number; + /** + * Whether to calculate line distance metrics. + * This is required for line layers that specify lineGradient values. + * The default value is false. + */ + lineMetrics?: boolean; + /** + * Source press listener, gets called when a user presses one of the children layers only + * if that layer has a higher z-index than another source layers + * + * @param {Object} event + * @param {Object[]} event.features - the geojson features that have hit by the press (might be multiple) + * @param {Object} event.coordinates - the coordinates of the click + * @param {Object} event.point - the point of the click + * @return void + */ + onPress?: (event: OnPressEvent) => void; + /** + * Overrides the default touch hitbox(44x44 pixels) for the source layers + */ + hitbox?: { + /** + * `width` of hitbox + */ + width: number; + /** + * `height` of hitbox + */ + height: number; + }; + children?: React.ReactElement | React.ReactElement[]; +}; +declare const ShapeSource_base: { + new (...args: any[]): { + _turboModule: import("react-native").TurboModule; + _preRefMapMethodQueue: { + method: { + name: string; + args: import("../utils").NativeArg[]; + }; + resolver: (value: import("../utils").NativeArg) => void; + }[]; + _runPendingNativeMethods(nativeRef: RefType): Promise; + _runNativeMethod(methodName: string, nativeRef: RefType_1 | undefined, args?: import("../utils").NativeArg[]): Promise; + context: unknown; + setState(state: {} | ((prevState: Readonly<{}>, props: object) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; + forceUpdate(callback?: (() => void) | undefined): void; + render(): React.ReactNode; + readonly props: object; + state: Readonly<{}>; + refs: { + [key: string]: React.ReactInstance; + }; + componentDidMount?(): void; + shouldComponentUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): boolean; + componentWillUnmount?(): void; + componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; + getSnapshotBeforeUpdate?(prevProps: object, prevState: Readonly<{}>): any; + componentDidUpdate?(prevProps: object, prevState: Readonly<{}>, snapshot?: any): void; + componentWillMount?(): void; + UNSAFE_componentWillMount?(): void; + componentWillReceiveProps?(nextProps: object, nextContext: any): void; + UNSAFE_componentWillReceiveProps?(nextProps: object, nextContext: any): void; + componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void; + UNSAFE_componentWillUpdate?(nextProps: object, nextState: Readonly<{}>, nextContext: any): void; + }; +} & { + new (props: (Props & import("../types/BaseProps").BaseProps) | Readonly): AbstractSource; + new (props: Props & import("../types/BaseProps").BaseProps, context: any): AbstractSource; + contextType?: React.Context | undefined; +}; +/** + * ShapeSource is a map content source that supplies vector shapes to be shown on the map. + * The shape may be an url or a GeoJSON object + */ +export declare class ShapeSource extends ShapeSource_base { + static NATIVE_ASSETS_KEY: string; + static defaultProps: { + id: any; + }; + constructor(props: Props); + _setNativeRef(nativeRef: React.Component & Readonly): void; + /** + * Returns the zoom needed to expand the cluster. + * + * @example + * const zoom = await shapeSource.getClusterExpansionZoom(clusterId); + * + * @param {Feature} feature - The feature cluster to expand. + * @return {number} + */ + getClusterExpansionZoom(feature: string | GeoJSON.Feature): Promise; + /** + * Returns the FeatureCollection from the cluster. + * + * @example + * const collection = await shapeSource.getClusterLeaves(clusterId, limit, offset); + * + * @param {GeoJSON.Feature} feature - The feature cluster to expand. + * @param {number} limit - The number of points to return. + * @param {number} offset - The amount of points to skip (for pagination). + * @return {FeatureCollection} + */ + getClusterLeaves(feature: number | GeoJSON.Feature, limit: number, offset: number): Promise; + /** + * Returns the FeatureCollection from the cluster (on the next zoom level). + * + * @example + * const collection = await shapeSource.getClusterChildren(clusterId); + * + * @param {GeoJSON.Feature} feature - The feature cluster to expand. + * @return {FeatureCollection} + */ + getClusterChildren(feature: number | GeoJSON.Feature): Promise; + setNativeProps(props: NativeProps): void; + _getShape(): string | undefined; + _decodePayload(payload: OnPressEvent | string): OnPressEvent; + onPress(event: NativeSyntheticEvent<{ + payload: OnPressEvent; + }>): void; + render(): JSX.Element; +} +declare type NativeProps = { + id: string; + shape?: string; +}; +export {}; +//# sourceMappingURL=ShapeSource.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/ShapeSource.d.ts.map b/lib/typescript/src/components/ShapeSource.d.ts.map new file mode 100644 index 000000000..136fcbc3c --- /dev/null +++ b/lib/typescript/src/components/ShapeSource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ShapeSource.d.ts","sourceRoot":"","sources":["../../../../src/components/ShapeSource.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,aAAa,EAEb,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAWtB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAS9C,oBAAY,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EACF,OAAO,CAAC,kBAAkB,GAC1B,OAAO,CAAC,OAAO,GACf,OAAO,CAAC,iBAAiB,GACzB,OAAO,CAAC,QAAQ,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,WAAW,C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AAE,MAAM,CAAC;CAChB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/SkyLayer.d.ts b/lib/typescript/src/components/SkyLayer.d.ts new file mode 100644 index 000000000..06921692f --- /dev/null +++ b/lib/typescript/src/components/SkyLayer.d.ts @@ -0,0 +1,55 @@ +import React from 'react'; +import { FilterExpression, SkyLayerStyleProps } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +export declare type Props = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + */ + sourceID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * Customizable style attributes + */ + style?: SkyLayerStyleProps; +} & React.ComponentProps; +declare type NativeTypeProps = Omit & { + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * SkyLayer is a spherical dome around the map that is always rendered behind all other layers + */ +declare class SkyLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + render(): JSX.Element; +} +export default SkyLayer; +//# sourceMappingURL=SkyLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/SkyLayer.d.ts.map b/lib/typescript/src/components/SkyLayer.d.ts.map new file mode 100644 index 000000000..d198cb8eb --- /dev/null +++ b/lib/typescript/src/components/SkyLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SkyLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/SkyLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAI5C,oBAAY,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAE/C,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AACF;;GAEG;AACH,cAAM,QAAS,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IAC1D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CASP;AAED,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Style.d.ts b/lib/typescript/src/components/Style.d.ts new file mode 100644 index 000000000..da43217ac --- /dev/null +++ b/lib/typescript/src/components/Style.d.ts @@ -0,0 +1,74 @@ +/// +import { FilterExpression } from '../utils/MapboxStyles'; +declare type MapboxJSONLayer = { + type: string; + id: string; + paint?: { + [k: string]: unknown; + }; + layout?: { + [k: string]: unknown; + }; + source?: string; + minzoom?: number; + maxzoom?: number; + filter?: FilterExpression; + style?: object; + ['source-layer']: string; +}; +declare type MapboxJSONSource = { + type: string; + url?: string; + tiles?: string[]; + minzoom?: number; + maxzoom?: number; + attribution?: string; + scheme?: string; + tileSize?: number; + coordinates?: [ + [ + number, + number + ], + [ + number, + number + ], + [ + number, + number + ], + [ + number, + number + ] + ]; + data?: string | object; + buffer: number; + cluster?: boolean; + clusterRadius?: number; + clusterMaxZoom?: number; + clusterProperties?: object; + tolerance?: number; + lineMetrics?: boolean; +}; +declare type MapboxJSON = { + layers?: MapboxJSONLayer[]; + sources?: { + [key: string]: MapboxJSONSource; + }; +}; +declare type Props = { + /** + * A JSON object conforming to the schema described in the Mapbox Style Specification , or a URL to such JSON. + */ + json: MapboxJSON | URL; +}; +/** + * Style is a component that automatically adds sources / layers to the map using Mapbox GL Style Spec. + * Only [`sources`](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources) & [`layers`](https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/) are supported. + * Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/rnmapbox/maps/tree/main/docs. + */ +declare const Style: (props: Props) => JSX.Element; +export default Style; +//# sourceMappingURL=Style.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Style.d.ts.map b/lib/typescript/src/components/Style.d.ts.map new file mode 100644 index 000000000..e116d13c3 --- /dev/null +++ b/lib/typescript/src/components/Style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Style.d.ts","sourceRoot":"","sources":["../../../../src/components/Style.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAsOzD,aAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACjC,MAAM,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE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K,GAAG;IACX;;OAEG;IACH,IAAI,EAAE,UAAU,GAAG,GAAG,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,KAAK,UAAW,KAAK,gBAwD1B,CAAC;AAEF,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/StyleImport.d.ts b/lib/typescript/src/components/StyleImport.d.ts new file mode 100644 index 000000000..35fd53605 --- /dev/null +++ b/lib/typescript/src/components/StyleImport.d.ts @@ -0,0 +1,27 @@ +import React from 'react'; +declare type Props = { + /** + * id of the style import (eg. basemap) + */ + id: string; + /** + * existing is now always required as true + */ + existing: boolean; + /** + * config is a dictionary of configuration options for the style import. + * + * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style + */ + config: { + [key: string]: string; + }; +}; +/** + * Use StyleImport to set configuration options on the new standard style. **V11 only.** + * + * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style + */ +declare const _default: React.MemoExoticComponent<(props: Props) => JSX.Element>; +export default _default; +//# sourceMappingURL=StyleImport.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/StyleImport.d.ts.map b/lib/typescript/src/components/StyleImport.d.ts.map new file mode 100644 index 000000000..733e1c565 --- /dev/null +++ b/lib/typescript/src/components/StyleImport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StyleImport.d.ts","sourceRoot":"","sources":["../../../../src/components/StyleImport.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,aAAK,KAAK,GAAG;IACX;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAEF;;;;GAIG;0DACyB,KAAK;AAAjC,wBAEG"} \ No newline at end of file diff --git a/lib/typescript/src/components/SymbolLayer.d.ts b/lib/typescript/src/components/SymbolLayer.d.ts new file mode 100644 index 000000000..ee3b0ad7b --- /dev/null +++ b/lib/typescript/src/components/SymbolLayer.d.ts @@ -0,0 +1,88 @@ +/// +import { type FilterExpression, type SymbolLayerStyleProps } from '../utils/MapboxStyles'; +import { type StyleValue } from '../utils/StyleValue'; +import AbstractLayer from './AbstractLayer'; +export declare const NATIVE_MODULE_NAME = "RNMBXSymbolLayer"; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type LayerPropsCommon = { + /** + * A string that uniquely identifies the source in the style to which it is added. + */ + id: string; + /** + * The id refers to en existing layer in the style. Does not create a new layer. + */ + existing?: boolean; + /** + * The source from which to obtain the data to style. + * If the source has not yet been added to the current style, the behavior is undefined. + * Inferred from parent source only if the layer is a direct child to it. + */ + sourceID?: string; + /** + * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. + */ + sourceLayerID?: string; + /** + * Inserts a layer above aboveLayerID. + */ + aboveLayerID?: string; + /** + * Inserts a layer below belowLayerID + */ + belowLayerID?: string; + /** + * Inserts a layer at a specified index + */ + layerIndex?: number; + /** + * Filter only the features in the source layer that satisfy a condition that you define + */ + filter?: FilterExpression; + /** + * The minimum zoom level at which the layer gets parsed and appears. + */ + minZoomLevel?: number; + /** + * The maximum zoom level at which the layer gets parsed and appears. + */ + maxZoomLevel?: number; + /** + * The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order. + * + * v11 only + */ + slot?: Slot; +}; +export declare type Props = LayerPropsCommon & { + /** + * Customizable style attributes + */ + style: SymbolLayerStyleProps; + /** + * @deprecated passed children used to create an image with id of symbol in style and also set the iconImageName property accordingly. + * This is now deprecated, use Image component instead. + */ + children?: JSX.Element | JSX.Element[]; +}; +declare type NativeTypeProps = Omit & { + snapshot: boolean; + reactStyle?: { + [key: string]: StyleValue; + }; +}; +/** + * SymbolLayer is a style layer that renders icon and text labels at points or along lines on the map. + */ +export declare class SymbolLayer extends AbstractLayer { + static defaultProps: { + sourceID: any; + }; + deprecationLogged: { + snapshot: boolean; + }; + _shouldSnapshot(): boolean; + render(): JSX.Element; +} +export {}; +//# sourceMappingURL=SymbolLayer.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/SymbolLayer.d.ts.map b/lib/typescript/src/components/SymbolLayer.d.ts.map new file mode 100644 index 000000000..3485ab92f --- /dev/null +++ b/lib/typescript/src/components/SymbolLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SymbolLayer.d.ts","sourceRoot":"","sources":["../../../../src/components/SymbolLayer.tsx"],"names":[],"mappings":";AAGA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAKrD,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAGF,oBAAY,KAAK,GAAG,gBAAgB,GAAG;IACrC;;OAEG;IACH,KAAK,EAAE,qBAAqB,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxC,CAAC;AAEF,aAAK,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,qBAAa,WAAY,SAAQ,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC;IACpE,MAAM,CAAC,YAAY;;MAEjB;IACF,iBAAiB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAuB;IAE/D,eAAe;IAsBf,MAAM;CAcP"} \ No newline at end of file diff --git a/lib/typescript/src/components/Terrain.d.ts b/lib/typescript/src/components/Terrain.d.ts new file mode 100644 index 000000000..aa0d5672f --- /dev/null +++ b/lib/typescript/src/components/Terrain.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; +import type { TerrainLayerStyleProps, Value } from '../utils/MapboxStyles'; +import type { BaseProps } from '../types/BaseProps'; +declare type Props = BaseProps & { + /** + * Name of a source of raster_dem type to be used for terrain elevation. + */ + sourceID?: string; + /** + * Deprecated, use exaggeration in style instead + */ + exaggeration?: Value; + /** + * Customizable style attributes + */ + style?: TerrainLayerStyleProps; +}; +export declare const Terrain: React.MemoExoticComponent<(props: Props) => JSX.Element>; +export {}; +//# sourceMappingURL=Terrain.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Terrain.d.ts.map b/lib/typescript/src/components/Terrain.d.ts.map new file mode 100644 index 000000000..1694ada4b --- /dev/null +++ b/lib/typescript/src/components/Terrain.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Terrain.d.ts","sourceRoot":"","sources":["../../../../src/components/Terrain.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,aAAK,KAAK,GAAG,SAAS,GAAG;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC;;OAEG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,OAAO,oCAAgB,KAAK,iBAmBvC,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/UserLocation.d.ts b/lib/typescript/src/components/UserLocation.d.ts new file mode 100644 index 000000000..0ee17e7f1 --- /dev/null +++ b/lib/typescript/src/components/UserLocation.d.ts @@ -0,0 +1,103 @@ +import React, { ReactElement } from 'react'; +import { type Location } from '../modules/location/locationManager'; +export declare enum UserLocationRenderMode { + Native = "native", + Normal = "normal" +} +declare type Props = { + /** + * native/android only render mode + * + * - normal: just a circle + * - compass: triangle with heading + * - gps: large arrow + * + * @platform android + */ + androidRenderMode?: 'normal' | 'compass' | 'gps'; + /** + * Whether location icon is animated between updates + */ + animated?: boolean; + /** + * Custom location icon of type mapbox-gl-native components + */ + children?: ReactElement | ReactElement[]; + /** + * Minimum amount of movement before GPS location is updated in meters + */ + minDisplacement?: number; + /** + * Callback that is triggered on location icon press + */ + onPress?: () => void; + /** + * Callback that is triggered on location update + */ + onUpdate?: (location: Location) => void; + /** + * @deprecated use NativeUserLocation component instead of UserLocationRenderMode.Native + * Which render mode to use. + */ + renderMode?: UserLocationRenderMode; + /** + * Request the always location permission, and listen to the location even when the app is in background + * + * @platform ios + */ + requestsAlwaysUse?: boolean; + /** + * Show or hide small arrow which indicates direction the device is pointing relative to north. + */ + showsUserHeadingIndicator?: boolean; + /** + * Whether location icon is visible + */ + visible?: boolean; +}; +declare type UserLocationState = { + shouldShowUserLocation: false; + coordinates: number[] | null; + heading: number | null; +}; +declare class UserLocation extends React.Component { + static defaultProps: { + animated: boolean; + visible: boolean; + showsUserHeadingIndicator: boolean; + requestsAlwaysUse: boolean; + minDisplacement: number; + renderMode: UserLocationRenderMode; + }; + constructor(props: Props); + _isMounted?: boolean; + locationManagerRunning?: boolean; + componentDidMount(): Promise; + componentDidUpdate(prevProps: Props): Promise; + componentWillUnmount(): Promise; + /** + * Whether to start or stop listening to the locationManager + * + * Notice, that listening will start automatically when + * either `onUpdate` or `visible` are set + * + * @async + * @param {Object} running - Object with key `running` and `boolean` value + * @return {Promise} + */ + setLocationManager({ running }: { + running?: boolean; + }): Promise; + /** + * + * If locationManager should be running + * + * @return {boolean} + */ + needsLocationManagerRunning(): boolean | undefined; + _onLocationUpdate(location: Location | null): void; + _renderNative(): JSX.Element; + render(): JSX.Element | null; +} +export default UserLocation; +//# sourceMappingURL=UserLocation.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/UserLocation.d.ts.map b/lib/typescript/src/components/UserLocation.d.ts.map new file mode 100644 index 000000000..1e2c979a8 --- /dev/null +++ b/lib/typescript/src/components/UserLocation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../src/components/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAwDpE,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,aAAK,K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Q,EAAE,QAAQ,GAAG,IAAI;IAuB3C,aAAa;IAUb,MAAM;CA+BP;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/VectorSource.d.ts b/lib/typescript/src/components/VectorSource.d.ts new file mode 100644 index 000000000..737fd3191 --- /dev/null +++ b/lib/typescript/src/components/VectorSource.d.ts @@ -0,0 +1,87 @@ +import React from 'react'; +import { NativeSyntheticEvent } from 'react-native'; +import { OnPressEvent } from '../types/OnPressEvent'; +import AbstractSource from './AbstractSource'; +export declare const NATIVE_MODULE_NAME = "RNMBXVectorSource"; +interface Props { + /** + * A string that uniquely identifies the source. + */ + id: string; + /** + * The id refers to en existing source in the style. Does not create a new source. + */ + existing?: boolean; + /** + * A URL to a TileJSON configuration file describing the source’s contents and other metadata. + */ + url?: string; + /** + * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints. + * Example: https://example.com/vector-tiles/{z}/{x}/{y}.pbf + */ + tileUrlTemplates?: string[]; + /** + * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source. + * The value should be between 0 and 22, inclusive, and less than + * maxZoomLevel, if specified. The default value for this option is 0. + */ + minZoomLevel?: number; + /** + * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source. + * The value should be between 0 and 22, inclusive, and less than + * minZoomLevel, if specified. The default value for this option is 22. + */ + maxZoomLevel?: number; + /** + * Influences the y direction of the tile coordinates. (tms inverts y axis) + */ + tms?: boolean; + /** + * An HTML or literal text string defining the buttons to be displayed in an action sheet when the + * source is part of a map view’s style and the map view’s attribution button is pressed. + */ + attribution?: string; + /** + * Source press listener, gets called when a user presses one of the children layers only + * if that layer has a higher z-index than another source layers + * + * @param {Object} event + * @param {Object[]} event.features - the geojson features that have hit by the press (might be multiple) + * @param {Object} event.coordinates - the coordinates of the click + * @param {Object} event.point - the point of the click + */ + onPress?: (event: OnPressEvent) => void; + /** + * Overrides the default touch hitbox(44x44 pixels) for the source layers + */ + hitbox?: { + /** + * `width` of hitbox + */ + width: number; + /** + * `height` of hitbox + */ + height: number; + }; + children?: React.ReactElement | React.ReactElement[]; +} +declare type NativeProps = Props; +/** + * VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map. + * The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. + */ +declare class VectorSource extends AbstractSource { + static defaultProps: { + id: any; + }; + constructor(props: Props); + _decodePayload(payload: OnPressEvent | string): OnPressEvent; + onPress(event: NativeSyntheticEvent<{ + payload: OnPressEvent | string; + }>): void; + render(): JSX.Element; +} +export default VectorSource; +//# sourceMappingURL=VectorSource.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/VectorSource.d.ts.map b/lib/typescript/src/components/VectorSource.d.ts.map new file mode 100644 index 000000000..bc526dbab --- /dev/null +++ b/lib/typescript/src/components/VectorSource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VectorSource.d.ts","sourceRoot":"","sources":["../../../../src/components/VectorSource.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAKnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAI9C,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAExC;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;CACtD;AAGD,aAAK,WAAW,GAAG,KAAK,CAAC;AACzB;;;GAGG;AACH,cAAM,YAAa,SAAQ,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC;IAC3D,MAAM,CAAC,YAAY;;MAEjB;gBAEU,KAAK,EAAE,KAAK;IAIxB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,GAAG,YAAY;IAU5D,OAAO,CACL,KAAK,EAAE,oBAAoB,CAAC;QAC1B,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC;KAChC,CAAC;IA8BJ,MAAM;CAwBP;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/components/Viewport.d.ts b/lib/typescript/src/components/Viewport.d.ts new file mode 100644 index 000000000..8e2366a90 --- /dev/null +++ b/lib/typescript/src/components/Viewport.d.ts @@ -0,0 +1,136 @@ +import React from 'react'; +declare type FollowPuckOptions = { + /** + * The value to use for setting zoom. If 'keep', zoom will not be modified by the FollowPuckViewportState. + * @default DEFAULT_FOLLOW_PUCK_VIEWPORT_STATE_ZOOM. + */ + zoom?: number | 'keep'; + /** + * The value to use for setting pitch. If 'keep', pitch will not be modified by the FollowPuckViewportState. + * @default DEFAULT_FOLLOW_PUCK_VIEWPORT_STATE_PITCH degrees. + */ + pitch?: number | 'keep'; + /** + * Indicates how to obtain the value to use for bearing when setting the camera. + * If set to 'keep', bearing will not be modified by the FollowPuckViewportState. + * - heading: sets bearing to the heading of the device + * - course: sets bearing based on the direction of travel + * - number: sets the camera bearing to the constant value on every frame + * + * On Android, 'heading' and 'coruse' sets the camera bearing to the same as the location puck's bearing. See + * [syncWithLocationPuck](https://docs.mapbox.com/android/maps/api/11.0.0/mapbox-maps-android/com.mapbox.maps.plugin.viewport.data/-follow-puck-viewport-state-bearing/-sync-with-location-puck/) + * + * @default 'heading' + */ + bearing?: 'heading' | 'course' | number | 'keep'; + /** + * The value to use for setting CameraOptions.padding. If 'keep', padding will not be modified by the FollowPuckViewportState. + * + * @default 0 padding + */ + padding?: { + top?: number; + left?: number; + bottom?: number; + right?: number; + } | 'keep'; +}; +declare type OverviewOptions = { + /** + * The geometry that the ``OverviewViewportState`` should use when calculating its camera. + */ + geometry: GeoJSON.Geometry; + /** + * The padding that ``OverviewViewportState`` should use when calculating its camera. + * + * @default 0 padding + */ + padding?: { + top?: number; + left?: number; + bottom?: number; + right?: number; + }; + /** + * The bearing that ``OverviewViewportState`` should use when calcualting its camera. + */ + bearing?: number; + /** + * The pitch that ``OverviewViewportState`` should use when calculating its camera. + */ + pitch?: number; + /** + * The length of the animation performed by in seconds ``OverviewViewportState`` when it starts updating + * the camera. + */ + animationDuration?: number; +}; +declare type ViewportState = { + kind: 'followPuck'; + options?: FollowPuckOptions; +} | { + kind: 'overview'; + options?: OverviewOptions; +}; +declare type ViewportStatus = { + kind: 'idle'; +} | { + kind: 'transition'; + toState: ViewportState; + transition: ViewportTransition; +}; +declare type ViewportTransition = { + kind: 'immediate'; +} | { + kind: 'default'; + maxDurationMs?: number; +}; +declare type ViewportStatusChangeReason = 'TransitionStarted' | 'TransitionSucceeded' | 'IdleRequested' | 'UserInteraction'; +declare type ViewportStatusChangedEvent = { + from: ViewportStatus; + to: ViewportStatus; + reason: ViewportStatusChangeReason; +}; +declare type Props = { + /** + * Indicates whether the Viewport should idle when the MapView receives touch input. + * + * Set this property to false to enable building custom ViewportStates that can work simultaneously with certain types of gestures. + * + * Defaults to true. + */ + transitionsToIdleUponUserInteraction?: boolean; + /** + * Subscribes to status changes, will be called when the status changes. + * + * Observers are notified of status changes asynchronously on the main queue. + * This means that by the time the notification is delivered, the status may have already changed again. + * This behavior is necessary to allow observers to trigger further transitions while avoiding out-of-order + * delivery of status changed notifications. + * + */ + onStatusChanged?: (event: ViewportStatusChangedEvent) => void; +}; +export interface Ref { + getState(): Promise; + idle(): Promise; + transitionTo(state: ViewportState, transition?: ViewportTransition): Promise; +} +/** + * provides a structured approach to organizing camera management logic into states and transitions between them. + * + * At any given time, the viewport is either: + * - idle + * - in a state (camera is being managed by a ViewportState) + * - transitioning between states + * + * See [android](https://docs.mapbox.com/android/maps/api/${ANDROID_SDK_VERSION}/mapbox-maps-android/com.mapbox.maps.plugin.viewport/viewport.html), + * [ios](https://docs.mapbox.com/ios/maps/api/${IOS_SDK_VERSION}/Viewport.html#/s:10MapboxMaps8ViewportC) + */ +export declare const Viewport: React.MemoExoticComponent>>; +export declare type Viewport = Ref; +export declare type NativeArg = string | number | boolean | null | { + [k: string]: NativeArg; +} | NativeArg[] | Function | GeoJSON.Geometry | undefined; +export {}; +//# sourceMappingURL=Viewport.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/components/Viewport.d.ts.map b/lib/typescript/src/components/Viewport.d.ts.map new file mode 100644 index 000000000..ebe5eae27 --- /dev/null +++ b/lib/typescript/src/components/Viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Viewport.d.ts","sourceRoot":"","sources":["../../../../src/components/Viewport.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAcf,aAAK,iBAAiB,GAAG;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAEjD;;;;O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AAG;IAChC,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,cAAc,CAAC;IACnB,MAAM,EAAE,0BAA0B,CAAC;CACpC,CAAC;AAEF,aAAK,KAAK,GAAG;IACX;;;;;;OAMG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAC;IAE/C;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;CAC/D,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,YAAY,CACV,KAAK,EAAE,aAAa,EACpB,UAAU,CAAC,EAAE,kBAAkB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,8FA4CpB,CAAC;AACF,oBAAY,QAAQ,GAAG,GAAG,CAAC;AAgB3B,oBAAY,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC1B,SAAS,EAAE,GAEX,QAAQ,GACR,OAAO,CAAC,QAAQ,GAChB,SAAS,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/index.d.ts b/lib/typescript/src/index.d.ts new file mode 100644 index 000000000..edc56fbb3 --- /dev/null +++ b/lib/typescript/src/index.d.ts @@ -0,0 +1,4 @@ +export * from './Mapbox'; +import * as Mapbox from './Mapbox'; +export default Mapbox; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/index.d.ts.map b/lib/typescript/src/index.d.ts.map new file mode 100644 index 000000000..c83d33d5d --- /dev/null +++ b/lib/typescript/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/location/locationManager.d.ts b/lib/typescript/src/modules/location/locationManager.d.ts new file mode 100644 index 000000000..238b12eb2 --- /dev/null +++ b/lib/typescript/src/modules/location/locationManager.d.ts @@ -0,0 +1,87 @@ +import { NativeEventEmitter, NativeEventSubscription, EmitterSubscription, type AppStateStatus } from 'react-native'; +export declare const LocationModuleEventEmitter: NativeEventEmitter; +/** + * Location sent by locationManager + */ +export interface Location { + coords: Coordinates; + timestamp?: number; +} +/** + * Coorinates sent by locationManager + */ +interface Coordinates { + /** + * The heading (measured in degrees) relative to true north. + * Heading is used to describe the direction the device is pointing to (the value of the compass). + * Note that on Android this is incorrectly reporting the course value as mentioned in issue https://github.com/rnmapbox/maps/issues/1213 + * and will be corrected in a future update. + */ + heading?: number; + /** + * The direction in which the device is traveling, measured in degrees and relative to due north. + * The course refers to the direction the device is actually moving (not the same as heading). + */ + course?: number; + /** + * The instantaneous speed of the device, measured in meters per second. + */ + speed?: number; + /** + * The latitude in degrees. + */ + latitude: number; + /** + * The longitude in degrees. + */ + longitude: number; + /** + * The radius of uncertainty for the location, measured in meters. + */ + accuracy?: number; + /** + * The altitude, measured in meters. + */ + altitude?: number; +} +/** + * LocationManager is a singleton, see `locationManager` + */ +export declare class LocationManager { + _listeners: ((location: Location) => void)[]; + _lastKnownLocation: Location | null; + _isListening: boolean; + _requestsAlwaysUse: boolean; + subscription: EmitterSubscription | null; + _appStateListener: NativeEventSubscription; + _minDisplacement?: number; + constructor(); + getLastKnownLocation(): Promise; + addListener(listener: (location: Location) => void): void; + removeListener(listener: (location: Location) => void): void; + removeAllListeners(): void; + _handleAppStateChange(appState: AppStateStatus): void; + start(displacement?: number): void; + stop(): void; + setMinDisplacement(minDisplacement: number): void; + setRequestsAlwaysUse(requestsAlwaysUse: boolean): void; + _onUpdate(location: Location): void; + /** + * simulates location updates, experimental [V10, iOS only] + */ + _simulateHeading(changesPerSecond: number, increment: number): void; + /** + * Sets the period at which location events will be sent over the React Native bridge. + * The default is 0, aka no limit. [V10, iOS only] + * + * @example + * locationManager.setLocationEventThrottle(500); + * + * @param {Number} throttleValue event throttle value in ms. + * @return {void} + */ + setLocationEventThrottle(throttleValue: number): void; +} +declare const _default: LocationManager; +export default _default; +//# sourceMappingURL=locationManager.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/location/locationManager.d.ts.map b/lib/typescript/src/modules/location/locationManager.d.ts.map new file mode 100644 index 000000000..a960850b4 --- /dev/null +++ b/lib/typescript/src/modules/location/locationManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"locationManager.d.ts","sourceRoot":"","sources":["../../../../../src/modules/location/locationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAKtB,eAAO,MAAM,0BAA0B,oBAEtC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,WAAW;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,eAAe;IAC1B,UAAU,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC;IAC7C,kBAAkB,EAAE,QAAQ,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzC,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;;IAgBpB,oBAAoB;IAuB1B,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI;IAalD,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI;IAOrD,kBAAkB;IAKlB,qBAAqB,CAAC,QAAQ,EAAE,cAAc;IAY9C,KAAK,CAAC,YAAY,SAAK;IAwBvB,IAAI;IAUJ,kBAAkB,CAAC,eAAe,EAAE,MAAM;IAK1C,oBAAoB,CAAC,iBAAiB,EAAE,OAAO;IAK/C,SAAS,CAAC,QAAQ,EAAE,QAAQ;IAM5B;;OAEG;IACH,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI5D;;;;;;;;;OASG;IACH,wBAAwB,CAAC,aAAa,EAAE,MAAM;CAG/C;;AAED,wBAAqC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts b/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts new file mode 100644 index 000000000..8f806ab34 --- /dev/null +++ b/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts @@ -0,0 +1,22 @@ +export declare type OfflineCreatePackOptionsArgs = { + name: string; + styleURL: string; + bounds: [GeoJSON.Position, GeoJSON.Position]; + minZoom?: number; + maxZoom?: number; + metadata?: Record; +}; +declare class OfflineCreatePackOptions { + readonly name: string; + readonly styleURL: string; + readonly bounds: string; + readonly minZoom: number | undefined; + readonly maxZoom: number | undefined; + readonly metadata: string | undefined; + constructor(options: OfflineCreatePackOptionsArgs); + _assert(options: OfflineCreatePackOptionsArgs): void; + _makeLatLngBounds(bounds: [GeoJSON.Position, GeoJSON.Position]): string; + _makeMetadata(metadata: Record | undefined): string; +} +export default OfflineCreatePackOptions; +//# sourceMappingURL=OfflineCreatePackOptions.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts.map b/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts.map new file mode 100644 index 000000000..135621e03 --- /dev/null +++ b/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OfflineCreatePackOptions.d.ts","sourceRoot":"","sources":["../../../../../src/modules/offline/OfflineCreatePackOptions.ts"],"names":[],"mappings":"AAGA,oBAAY,4BAA4B,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,cAAM,wBAAwB;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,SAAgB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,SAAgB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEjC,OAAO,EAAE,4BAA4B;IAWjD,OAAO,CAAC,OAAO,EAAE,4BAA4B;IAgB7C,iBAAiB,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM;IAKvE,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;CAM5D;AAED,eAAe,wBAAwB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/OfflinePack.d.ts b/lib/typescript/src/modules/offline/OfflinePack.d.ts new file mode 100644 index 000000000..d08f07ef5 --- /dev/null +++ b/lib/typescript/src/modules/offline/OfflinePack.d.ts @@ -0,0 +1,24 @@ +import OfflineCreatePackOptions from './OfflineCreatePackOptions'; +declare type OfflinePackStatus = { + name: string; + state: number; + percentage: number; + completedResourceCount: number; + completedResourceSize: number; + completedTileSize: number; + completedTileCount: number; + requiredResourceCount: number; +}; +declare class OfflinePack { + private pack; + private _metadata; + constructor(pack: OfflineCreatePackOptions); + get name(): any; + get bounds(): string; + get metadata(): any; + status(): Promise; + resume(): Promise; + pause(): Promise; +} +export default OfflinePack; +//# sourceMappingURL=OfflinePack.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/OfflinePack.d.ts.map b/lib/typescript/src/modules/offline/OfflinePack.d.ts.map new file mode 100644 index 000000000..a9e40f128 --- /dev/null +++ b/lib/typescript/src/modules/offline/OfflinePack.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OfflinePack.d.ts","sourceRoot":"","sources":["../../../../../src/modules/offline/OfflinePack.ts"],"names":[],"mappings":"AAEA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAIlE,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,cAAM,WAAW;IACf,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,SAAS,CAAM;gBACX,IAAI,EAAE,wBAAwB;IAK1C,IAAI,IAAI,QAGP;IAED,IAAI,MAAM,WAET;IAED,IAAI,QAAQ,QAKX;IAED,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIpC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGvB;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts b/lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts new file mode 100644 index 000000000..31de57384 --- /dev/null +++ b/lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts @@ -0,0 +1,24 @@ +import OfflineCreatePackOptions from './OfflineCreatePackOptions'; +declare type OfflinePackStatus = { + name: string; + state: number; + percentage: number; + completedResourceCount: number; + completedResourceSize: number; + completedTileSize: number; + completedTileCount: number; + requiredResourceCount: number; +}; +declare class OfflinePackLegacy { + private pack; + private _metadata; + constructor(pack: OfflineCreatePackOptions); + get name(): any; + get bounds(): string; + get metadata(): any; + status(): Promise; + resume(): Promise; + pause(): Promise; +} +export default OfflinePackLegacy; +//# sourceMappingURL=OfflinePackLegacy.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts.map b/lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts.map new file mode 100644 index 000000000..a5bfa45af --- /dev/null +++ b/lib/typescript/src/modules/offline/OfflinePackLegacy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OfflinePackLegacy.d.ts","sourceRoot":"","sources":["../../../../../src/modules/offline/OfflinePackLegacy.ts"],"names":[],"mappings":"AAEA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAIlE,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,cAAM,iBAAiB;IACrB,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,SAAS,CAAM;gBACX,IAAI,EAAE,wBAAwB;IAK1C,IAAI,IAAI,QAGP;IAED,IAAI,MAAM,WAET;IAED,IAAI,QAAQ,QAKX;IAED,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIpC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/TileStore.d.ts b/lib/typescript/src/modules/offline/TileStore.d.ts new file mode 100644 index 000000000..197e9cb8b --- /dev/null +++ b/lib/typescript/src/modules/offline/TileStore.d.ts @@ -0,0 +1,30 @@ +declare type TileDataDomain = 'Maps' | 'Navigation' | 'Search' | 'ADAS'; +declare type TileDataValue = string | number; +/** + * TileStore manages downloads and storage for requests to tile-related API endpoints, + * enforcing a disk usage quota: tiles available on disk may be deleted to make room for a new download. + * This interface can be used by an app developer to set the disk quota. + */ +export default class TileStore { + __nativeTag: number; + /** + * Creates a TileStore instance for the given storage path. The returned instance exists as long as it is retained by the client. + * If the tile store instance already exists for the given path this method will return it without creating a new instance, + * thus making sure that there is only one tile store instance for a path at a time. If the given path is empty, the tile + * store at the default location is returned. On iOS, this storage path is excluded from automatic cloud backup. On Android, + * please exclude the storage path in your Manifest. + * Please refer to the [Android Documentation](https://developer.android.com/guide/topics/data/autobackup.html#IncludingFiles) for detailed information. + * + * @param path The path on disk where tiles and metadata will be stored + */ + static shared(path?: string): Promise; + private constructor(); + /** + * Sets additional options for this instance that are specific to a data type. + Params: + key – The configuration option that should be changed. Valid keys are listed in \c TileStoreOptions. domain – The data type this setting should be applied for. value – The value for the configuration option, or null if it should be reset. + */ + setOption(key: string, domain: TileDataDomain, value: TileDataValue): Promise; +} +export {}; +//# sourceMappingURL=TileStore.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/TileStore.d.ts.map b/lib/typescript/src/modules/offline/TileStore.d.ts.map new file mode 100644 index 000000000..c032b4358 --- /dev/null +++ b/lib/typescript/src/modules/offline/TileStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TileStore.d.ts","sourceRoot":"","sources":["../../../../../src/modules/offline/TileStore.ts"],"names":[],"mappings":"AAEA,aAAK,cAAc,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;AAChE,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC;;;;GAIG;AAEH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;OASG;WACU,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAKtD,OAAO;IAIP;;;;OAIG;IACG,SAAS,CACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,IAAI,CAAC;CAKjB"} \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/offlineManager.d.ts b/lib/typescript/src/modules/offline/offlineManager.d.ts new file mode 100644 index 000000000..0ee1769e7 --- /dev/null +++ b/lib/typescript/src/modules/offline/offlineManager.d.ts @@ -0,0 +1,276 @@ +import { NativeEventEmitter, EventSubscription } from 'react-native'; +export { default as OfflineCreatePackOptions, type OfflineCreatePackOptionsArgs, } from './OfflineCreatePackOptions'; +import { type OfflineCreatePackOptionsArgs } from './OfflineCreatePackOptions'; +import OfflinePack from './OfflinePack'; +export declare const OfflineModuleEventEmitter: NativeEventEmitter; +export declare type OfflineProgressStatus = { + name: string; + state: number; + percentage: number; + completedResourceSize: number; + completedTileCount: number; + completedResourceCount: number; + requiredResourceCount: number; + completedTileSize: number; +}; +export declare type OfflinePackError = { + name: string; + message: string; +}; +declare type ErrorEvent = { + payload: OfflinePackError; +}; +declare type ProgressEvent = { + payload: OfflineProgressStatus; +}; +declare type ProgressListener = (pack: OfflinePack, status: OfflineProgressStatus) => void; +declare type ErrorListener = (pack: OfflinePack, err: OfflinePackError) => void; +/** + * OfflineManager implements a singleton (shared object) that manages offline packs. + * All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. + * The shared object maintains a canonical collection of offline packs. + */ +declare class OfflineManager { + private _hasInitialized; + private _offlinePacks; + private _progressListeners; + private _errorListeners; + subscriptionProgress: EventSubscription | null; + subscriptionError: EventSubscription | null; + constructor(); + /** + * Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); + * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); + * + * await Mapbox.offlineManager.createPack({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }, progressListener, errorListener) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @param {Callback=} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback=} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + createPack(options: OfflineCreatePackOptionsArgs, progressListener: ProgressListener, errorListener?: ErrorListener): Promise; + /** + * Legacy Download Method - Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * const progressListener = (offlineRegion, status) => console.log(offlineRegion, status); + * const errorListener = (offlineRegion, err) => console.log(offlineRegion, err); + * + * await MapboxGL.offlineManager.createPackLegacy({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }, progressListener, errorListener) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @param {Callback=} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback=} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + createPackLegacy(options: OfflineCreatePackOptionsArgs, progressListener: ProgressListener, errorListener: ErrorListener): Promise; + /** + * Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated. + * + * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. + * + * @example + * await Mapbox.offlineManager.invalidatePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + invalidatePack(name: string): Promise; + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await Mapbox.offlineManager.deletePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + deletePack(name: string): Promise; + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await MapboxGL.offlineManager.deletePackLegacy('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + deletePackLegacy(name?: string): Promise; + /** + * Forces a revalidation of the tiles in the ambient cache and downloads a fresh version of the tiles from the tile server. + * This is the recommend method for clearing the cache. + * This is the most efficient method because tiles in the ambient cache are re-downloaded to remove outdated data from a device. + * It does not erase resources from the ambient cache or delete the database, which can be computationally expensive operations that may carry unintended side effects. + * + * @deprecated Not implemented in v10 + * + * @example + * await Mapbox.offlineManager.invalidateAmbientCache(); + * + * @return {void} + */ + invalidateAmbientCache(): Promise; + /** + * Erases resources from the ambient cache. + * This method clears the cache and decreases the amount of space that map resources take up on the device. + * + * @deprecated Not implemented in v10 + * + * @example + * await Mapbox.offlineManager.clearAmbientCache(); + * + * @return {void} + */ + clearAmbientCache(): Promise; + /** + * Migrates the offline cache from pre-v10 SDKs to the new v10 cache location + * + * @example + * await Mapbox.offlineManager.migrateOfflineCache() + * + * @return {void} + */ + migrateOfflineCache(): Promise; + /** + * Sets the maximum size of the ambient cache in bytes. Disables the ambient cache if set to 0. + * This method may be computationally expensive because it will erase resources from the ambient cache if its size is decreased. + * + * @example + * await Mapbox.offlineManager.setMaximumAmbientCacheSize(5000000); + * + * @param {Number} size Size of ambient cache. + * @return {void} + */ + setMaximumAmbientCacheSize(size: number): Promise; + /** + * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. + * + * @example + * await Mapbox.offlineManager.resetDatabase(); + * + * @return {void} + */ + resetDatabase(): Promise; + /** + * Retrieves all the current offline packs that are stored in the database. + * + * @example + * const offlinePacks = await Mapbox.offlineManager.getPacks(); + * + * @return {Array} + */ + getPacks(): Promise; + /** + * Retrieves all the current offline legacy packs that are stored in the database. + * + * @example + * const offlinePacks = await MapboxGL.offlineManager.getPacksLegacy(); + * + * @return {Array} + */ + getPacksLegacy(): Promise; + /** + * Retrieves an offline pack that is stored in the database by name. + * + * @example + * const offlinePack = await Mapbox.offlineManager.getPack(); + * + * @param {String} name Name of the offline pack. + * @return {OfflinePack} + */ + getPack(name: string): Promise; + /** + * Sideloads offline db + * + * @example + * await Mapbox.offlineManager.mergeOfflineRegions(path); + * + * @param {String} path Path to offline tile db on file system. + * @return {void} + */ + mergeOfflineRegions(path: string): Promise; + /** + * Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. + * + * @example + * Mapbox.offlineManager.setTileCountLimit(1000); + * + * @param {Number} limit Map tile limit count. + * @return {void} + */ + setTileCountLimit(limit: number): void; + /** + * Legacy Download Method - Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * The Mapbox Terms of Service prohibit changing or bypassing this limit without permission from Mapbox. + * + * @example + * MapboxGL.offlineManager.setTileCountLimitLegacy(1000); + * + * @param {Number} limit Map tile limit count. + * @return {void} + */ + setTileCountLimitLegacy(limit: number): void; + /** + * Sets the period at which download status events will be sent over the React Native bridge. + * The default is 300ms. + * + * @example + * Mapbox.offlineManager.setProgressEventThrottle(500); + * + * @param {Number} throttleValue event throttle value in ms. + * @return {void} + */ + setProgressEventThrottle(throttleValue: number): void; + /** + * Subscribe to download status/error events for the requested offline pack. + * Note that createPack calls this internally if listeners are provided. + * + * @example + * const progressListener = (offlinePack, status) => console.log(offlinePack, status) + * const errorListener = (offlinePack, err) => console.log(offlinePack, err) + * Mapbox.offlineManager.subscribe('packName', progressListener, errorListener) + * + * @param {String} packName Name of the offline pack. + * @param {Callback} progressListener Callback that listens for status events while downloading the offline resource. + * @param {Callback} errorListener Callback that listens for status events while downloading the offline resource. + * @return {void} + */ + subscribe(packName: string, progressListener: ProgressListener, errorListener?: ErrorListener): Promise; + /** + * Unsubscribes any listeners associated with the offline pack. + * It's a good idea to call this on componentWillUnmount. + * + * @example + * Mapbox.offlineManager.unsubscribe('packName') + * + * @param {String} packName Name of the offline pack. + * @return {void} + */ + unsubscribe(packName: string): void; + _initialize(forceInit?: boolean): Promise; + _onProgress(e: ProgressEvent): void; + _onError(e: ErrorEvent): void; + _hasListeners(name: string, listenerMap: Record | Record): boolean; +} +declare const offlineManager: OfflineManager; +export default offlineManager; +//# sourceMappingURL=offlineManager.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/offlineManager.d.ts.map b/lib/typescript/src/modules/offline/offlineManager.d.ts.map new file mode 100644 index 000000000..d18a0ceb4 --- /dev/null +++ b/lib/typescript/src/modules/offline/offlineManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"offlineManager.d.ts","sourceRoot":"","sources":["../../../../../src/modules/offline/offlineManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,OAAO,IAAI,wBAAwB,EACnC,KAAK,4BAA4B,GAClC,MAAM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AwB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAIrD;;;;;;;;;;;;;OAaG;IACG,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,IAAI,CAAC;IAmChB;;;;;;;;;OASG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAmB7B,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBxD,WAAW,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAgBnC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAW7B,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,WAAW,EACP,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAChC,OAAO;CAKX;AAED,QAAA,MAAM,cAAc,gBAAuB,CAAC;AAC5C,eAAe,cAAc,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts b/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts new file mode 100644 index 000000000..6ddef6e15 --- /dev/null +++ b/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts @@ -0,0 +1,93 @@ +export { default as OfflineCreatePackOptions, type OfflineCreatePackOptionsArgs, } from './OfflineCreatePackOptions'; +import { type OfflineCreatePackOptionsArgs } from './OfflineCreatePackOptions'; +import OfflinePack from './OfflinePackLegacy'; +/** + * OfflineManagerLegacy implements a singleton (shared object) that manages offline packs. + * All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. + * The shared object maintains a canonical collection of offline packs. + */ +declare class OfflineManagerLegacy { + private _hasInitialized; + private _offlinePacks; + constructor(); + /** + * Creates and registers an offline pack that downloads the resources needed to use the given region offline. + * + * @example + * + * await Mapbox.offlineManager.createPack({ + * name: 'offlinePack', + * styleURL: 'mapbox://...', + * minZoom: 14, + * maxZoom: 20, + * bounds: [[neLng, neLat], [swLng, swLat]] + * }) + * + * @param {OfflineCreatePackOptions} options Create options for a offline pack that specifices zoom levels, style url, and the region to download. + * @return {void} + */ + createPack(options: OfflineCreatePackOptionsArgs): Promise; + /** + * Invalidates the specified offline pack. This method checks that the tiles in the specified offline pack match those from the server. Local tiles that do not match the latest version on the server are updated. + * + * This is more efficient than deleting the offline pack and downloading it again. If the data stored locally matches that on the server, new data will not be downloaded. + * + * @example + * await Mapbox.offlineManagerLegacy.invalidatePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + invalidatePack(name: string): Promise; + /** + * Unregisters the given offline pack and allows resources that are no longer required by any remaining packs to be potentially freed. + * + * @example + * await Mapbox.offlineManagerLegacy.deletePack('packName') + * + * @param {String} name Name of the offline pack. + * @return {void} + */ + deletePack(name: string): Promise; + /** + * Migrates the offline cache from pre-v10 SDKs to the new v10 cache location + * + * @example + * await Mapbox.offlineManager.migrateOfflineCache() + * + * @return {void} + */ + migrateOfflineCache(): Promise; + /** + * Deletes the existing database, which includes both the ambient cache and offline packs, then reinitializes it. + * + * @example + * await Mapbox.offlineManager.resetDatabase(); + * + * @return {void} + */ + resetDatabase(): Promise; + /** + * Retrieves all the current offline packs that are stored in the database. + * + * @example + * const offlinePacks = await Mapbox.offlineManagerLegacy.getPacks(); + * + * @return {Array} + */ + getPacks(): Promise; + /** + * Retrieves an offline pack that is stored in the database by name. + * + * @example + * const offlinePack = await Mapbox.offlineManagerLegacy.getPack(); + * + * @param {String} name Name of the offline pack. + * @return {OfflinePack} + */ + getPack(name: string): Promise; + _initialize(forceInit?: boolean): Promise; +} +declare const offlineManagerLegacy: OfflineManagerLegacy; +export default offlineManagerLegacy; +//# sourceMappingURL=offlineManagerLegacy.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts.map b/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts.map new file mode 100644 index 000000000..790b1f1f5 --- /dev/null +++ b/lib/typescript/src/modules/offline/offlineManagerLegacy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"offlineManagerLegacy.d.ts","sourceRoot":"","sources":["../../../../../src/modules/offline/offlineManagerLegacy.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,IAAI,wBAAwB,EACnC,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAC;AACpC,OAAiC,EAC/B,KAAK,4BAA4B,EAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAI9C;;;;GAIG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,aAAa,CAA8B;;IAOnD;;;;;;;;;;;;;;;OAeG;IACG,UAAU,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBtE;;;;;;;;;;OAUG;IACG,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAajD;;;;;;;;OAQG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAc7C;;;;;;;OAOG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C;;;;;;;OAOG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAMpC;;;;;;;OAOG;IACG,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAOxC;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAKvD,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAezD;AAED,QAAA,MAAM,oBAAoB,sBAA6B,CAAC;AACxD,eAAe,oBAAoB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts b/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts new file mode 100644 index 000000000..42a36695a --- /dev/null +++ b/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts @@ -0,0 +1,41 @@ +export declare type SnapshotOptionsArgs = { + centerCoordinate?: GeoJSON.Position; + width?: number; + height?: number; + zoomLevel?: number; + pitch?: number; + heading?: number; + styleURL?: string; + writeToDisk?: boolean; + bounds?: number[][]; + withLogo?: boolean; +}; +declare class SnapshotOptions { + readonly styleURL: string; + readonly heading: number; + readonly pitch: number; + readonly zoomLevel: number; + readonly width: number; + readonly height: number; + readonly writeToDisk: boolean; + readonly withLogo: boolean; + readonly centerCoordinate: string | undefined; + readonly bounds: string | undefined; + constructor(options?: SnapshotOptionsArgs); + toJSON(): { + styleURL: string; + heading: number; + pitch: number; + zoomLevel: number; + width: number; + height: number; + writeToDisk: boolean; + centerCoordinate: string | undefined; + bounds: string | undefined; + withLogo: boolean; + }; + _createCenterCoordPoint(centerCoordinate: number[]): string; + _createBoundsCollection(bounds: number[][]): string; +} +export default SnapshotOptions; +//# sourceMappingURL=SnapshotOptions.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts.map b/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts.map new file mode 100644 index 000000000..ea52263dc --- /dev/null +++ b/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SnapshotOptions.d.ts","sourceRoot":"","sources":["../../../../../src/modules/snapshot/SnapshotOptions.ts"],"names":[],"mappings":"AAOA,oBAAY,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,cAAM,eAAe;IACnB,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,WAAW,EAAE,OAAO,CAAC;IACrC,SAAgB,QAAQ,EAAE,OAAO,CAAC;IAClC,SAAgB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrD,SAAgB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE/B,OAAO,GAAE,mBAAwB;IA2B7C,MAAM;;;;;;;;;;;;IAeN,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,EAAE;IAKlD,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;CAS3C;AAED,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/modules/snapshot/snapshotManager.d.ts b/lib/typescript/src/modules/snapshot/snapshotManager.d.ts new file mode 100644 index 000000000..ba7313671 --- /dev/null +++ b/lib/typescript/src/modules/snapshot/snapshotManager.d.ts @@ -0,0 +1,52 @@ +export type { default as SnapshotOptions } from './SnapshotOptions'; +/** + * The snapshotManager generates static raster images of the map. + * Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide. + * The snapshotter generates the snapshot asynchronous. + */ +declare class SnapshotManager { + /** + * Takes a snapshot of the base map using the provided Snapshot options. NOTE pitch, heading, zoomLevel only works when centerCoordinate is set! + * + * @example + * + * // creates a temp file png of base map + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * centerCoordinate: [-74.126410, 40.797968], + * width: width, + * height: height, + * zoomLevel: 12, + * pitch: 30, + * heading: 20, + * styleURL: MapboxGL.StyleURL.Dark, + * writeToDisk: true, // Create a temporary file + * }); + * + * // creates base64 png of base map without logo + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * centerCoordinate: [-74.126410, 40.797968], + * width: width, + * height: height, + * zoomLevel: 12, + * pitch: 30, + * heading: 20, + * styleURL: MapboxGL.StyleURL.Dark, + * withLogo: false, // Disable Mapbox logo (Android only) + * }); + * + * // creates snapshot with bounds + * const uri = await MapboxGL.snapshotManager.takeSnap({ + * bounds: [[-74.126410, 40.797968], [-74.143727, 40.772177]], + * width: width, + * height: height, + * styleURL: MapboxGL.StyleURL.Dark, + * }); + * + * @param {SnapshotOptions} options Snapshot options for create a static image of the base map + * @return {Promise} + */ + takeSnap(options?: {}): Promise; +} +declare const snapshotManager: SnapshotManager; +export default snapshotManager; +//# sourceMappingURL=snapshotManager.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/modules/snapshot/snapshotManager.d.ts.map b/lib/typescript/src/modules/snapshot/snapshotManager.d.ts.map new file mode 100644 index 000000000..c7f966ec1 --- /dev/null +++ b/lib/typescript/src/modules/snapshot/snapshotManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"snapshotManager.d.ts","sourceRoot":"","sources":["../../../../../src/modules/snapshot/snapshotManager.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpE;;;;GAIG;AACH,cAAM,eAAe;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACG,QAAQ,CAAC,OAAO,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;CAM9C;AAED,QAAA,MAAM,eAAe,iBAAwB,CAAC;AAC9C,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/requestAndroidLocationPermissions.d.ts b/lib/typescript/src/requestAndroidLocationPermissions.d.ts new file mode 100644 index 000000000..4dfa874ea --- /dev/null +++ b/lib/typescript/src/requestAndroidLocationPermissions.d.ts @@ -0,0 +1,2 @@ +export declare function requestAndroidLocationPermissions(): Promise; +//# sourceMappingURL=requestAndroidLocationPermissions.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/requestAndroidLocationPermissions.d.ts.map b/lib/typescript/src/requestAndroidLocationPermissions.d.ts.map new file mode 100644 index 000000000..1bee395bd --- /dev/null +++ b/lib/typescript/src/requestAndroidLocationPermissions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"requestAndroidLocationPermissions.d.ts","sourceRoot":"","sources":["../../../src/requestAndroidLocationPermissions.ts"],"names":[],"mappings":"AAIA,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,OAAO,CAAC,CAwB1E"} \ No newline at end of file diff --git a/lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts b/lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts new file mode 100644 index 000000000..284feb33e --- /dev/null +++ b/lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts @@ -0,0 +1,7 @@ +import { Position } from '../types/Position'; +export default class MovePointShapeAnimator { + __nativeTag: number; + constructor(from: Position); + start(): void; +} +//# sourceMappingURL=MovePointShapeAnimator.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts.map b/lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts.map new file mode 100644 index 000000000..fc376579f --- /dev/null +++ b/lib/typescript/src/shape_animators/MovePointShapeAnimator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MovePointShapeAnimator.d.ts","sourceRoot":"","sources":["../../../../src/shape_animators/MovePointShapeAnimator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC,WAAW,EAAE,MAAM,CAAC;gBAER,IAAI,EAAE,QAAQ;IAM1B,KAAK;CAGN"} \ No newline at end of file diff --git a/lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts b/lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts new file mode 100644 index 000000000..60b67aeeb --- /dev/null +++ b/lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts @@ -0,0 +1,5 @@ +export default class ShapeAnimatorManager { + static tag: number; + static nextTag(): number; +} +//# sourceMappingURL=ShapeAnimatorManager.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts.map b/lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts.map new file mode 100644 index 000000000..4467fd5fa --- /dev/null +++ b/lib/typescript/src/shape_animators/ShapeAnimatorManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ShapeAnimatorManager.d.ts","sourceRoot":"","sources":["../../../../src/shape_animators/ShapeAnimatorManager.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,MAAM,CAAC,GAAG,SAAM;IAEhB,MAAM,CAAC,OAAO,IAAI,MAAM;CAIzB"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeMapViewModule.d.ts b/lib/typescript/src/specs/NativeMapViewModule.d.ts new file mode 100644 index 000000000..8ccb8f499 --- /dev/null +++ b/lib/typescript/src/specs/NativeMapViewModule.d.ts @@ -0,0 +1,20 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +export interface Spec extends TurboModule { + takeSnap: (viewRef: Int32 | null, writeToDisk: boolean) => Promise; + queryTerrainElevation: (viewRef: Int32 | null, coordinates: ReadonlyArray) => Promise; + setSourceVisibility: (viewRef: Int32 | null, visible: boolean, sourceId: string, sourceLayerId: string) => Promise; + getCenter: (viewRef: Int32 | null) => Promise; + getCoordinateFromView: (viewRef: Int32 | null, atPoint: ReadonlyArray) => Promise; + getPointInView: (viewRef: Int32 | null, atCoordinate: ReadonlyArray) => Promise; + getZoom: (viewRef: Int32 | null) => Promise; + getVisibleBounds: (viewRef: Int32 | null) => Promise; + queryRenderedFeaturesAtPoint: (viewRef: Int32 | null, atPoint: ReadonlyArray, withFilter: ReadonlyArray, withLayerIDs: ReadonlyArray) => Promise; + queryRenderedFeaturesInRect: (viewRef: Int32 | null, withBBox: ReadonlyArray, withFilter: ReadonlyArray, withLayerIDs: ReadonlyArray) => Promise; + setHandledMapChangedEvents: (viewRef: Int32 | null, events: ReadonlyArray) => Promise; + clearData: (viewRef: Int32 | null) => Promise; + querySourceFeatures: (viewRef: Int32 | null, sourceId: string, withFilter: ReadonlyArray, withSourceLayerIDs: ReadonlyArray) => Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeMapViewModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeMapViewModule.d.ts.map b/lib/typescript/src/specs/NativeMapViewModule.d.ts.map new file mode 100644 index 000000000..9c78b5351 --- /dev/null +++ b/lib/typescript/src/specs/NativeMapViewModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeMapViewModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeMapViewModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3E,qBAAqB,EAAE,CACrB,OAAO,EAAE,KAAK,GAAG,IAAI,EACrB,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,KAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,mBAAmB,EAAE,CACnB,OAAO,EAAE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,MAAM,CAAC,CAAC;IACrB,SAAS,EAAE,CAAC,OAAO,EAAE,KAAK,GAAG,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,mBAAmB,EAAE,CACnB,OAAO,EAAE,KAAK,GAAG,IAAI,EACrB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,EACjC,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,KACtC,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;;AAED,wBAA4E"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts b/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts new file mode 100644 index 000000000..27391ee2c --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts @@ -0,0 +1,8 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +export interface Spec extends TurboModule { + refresh: (viewRef: Int32 | null) => Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeRNMBXImageModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map b/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map new file mode 100644 index 000000000..85531d51a --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeRNMBXImageModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXImageModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,GAAG,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD;;AAED,wBAA0E"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts b/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts new file mode 100644 index 000000000..22f2d3ac5 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts @@ -0,0 +1,10 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes'; +declare type AnimatorTag = Int32; +export interface Spec extends TurboModule { + create(tag: AnimatorTag, from: ReadonlyArray): Promise; + start(tag: AnimatorTag): Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeRNMBXMovePointShapeAnimatorModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts.map b/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts.map new file mode 100644 index 000000000..03add8839 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeRNMBXMovePointShapeAnimatorModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAK1E,aAAK,WAAW,GAAG,KAAK,CAAC;AAEzB,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,KAAK,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;;AAED,wBAEE"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts b/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts new file mode 100644 index 000000000..2948c8faa --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts @@ -0,0 +1,8 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +export interface Spec extends TurboModule { + refresh: (viewRef: Int32 | null) => Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeRNMBXPointAnnotationModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map b/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map new file mode 100644 index 000000000..8febf1202 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeRNMBXPointAnnotationModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXPointAnnotationModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,GAAG,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD;;AAED,wBAEE"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts b/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts new file mode 100644 index 000000000..bc26e42fd --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts @@ -0,0 +1,10 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +export interface Spec extends TurboModule { + getClusterExpansionZoom: (viewRef: Int32 | null, featureJSON: string) => Promise; + getClusterLeaves: (viewRef: Int32 | null, featureJSON: string, number: Int32, offset: Int32) => Promise; + getClusterChildren: (viewRef: Int32 | null, featureJSON: string) => Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeRNMBXShapeSourceModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts.map b/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts.map new file mode 100644 index 000000000..337dcb181 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeRNMBXShapeSourceModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXShapeSourceModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,uBAAuB,EAAE,CACvB,OAAO,EAAE,KAAK,GAAG,IAAI,EACrB,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,gBAAgB,EAAE,CAChB,OAAO,EAAE,KAAK,GAAG,IAAI,EACrB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,KAAK,KACV,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,kBAAkB,EAAE,CAClB,OAAO,EAAE,KAAK,GAAG,IAAI,EACrB,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;;AAED,wBAAgF"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts b/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts new file mode 100644 index 000000000..2cda66c2b --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts @@ -0,0 +1,16 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +declare type ObjectOr = Object; +declare type StringOr<_T> = string; +declare type Domain = 'Maps' | 'Navigation' | 'Search' | 'ADAS'; +declare type Tag = Int32; +declare type Value = { + value: string | number; +}; +export interface Spec extends TurboModule { + shared(path?: string): Promise; + setOption(tag: Tag, key: string, domain: StringOr, value: ObjectOr): Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeRNMBXTileStoreModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts.map b/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts.map new file mode 100644 index 000000000..9b8b87b95 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeRNMBXTileStoreModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXTileStoreModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAIlE,aAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC;AAG1B,aAAK,QAAQ,CAAC,EAAE,IAAI,MAAM,CAAC;AAE3B,aAAK,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;AAExD,aAAK,GAAG,GAAG,KAAK,CAAC;AAEjB,aAAK,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,SAAS,CACP,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GACrB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;;AAED,wBAA8E"} \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts b/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts new file mode 100644 index 000000000..e2ebb52a8 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts @@ -0,0 +1,35 @@ +import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +declare type StateInfo = { + kind: 'idle'; +} | { + kind: 'state'; + status: string; +} | { + kind: 'transition'; + toState: string; + transition: string; +}; +declare type ObjectOr = Object; +declare type StateReal = { + kind: 'followPuck'; +}; +declare type State = ObjectOr; +declare type TransitionReal = { + kind: 'immediate'; +} | { + kind: 'default'; + options: { + maxDurationMs?: number; + }; +}; +declare type Transition = ObjectOr; +declare type ViewRef = Int32 | null; +export interface Spec extends TurboModule { + getState(viewRef: ViewRef): Promise; + transitionTo(viewRef: ViewRef, state: State, transition: Transition): Promise; + idle(viewRef: ViewRef): Promise; +} +declare const _default: Spec; +export default _default; +//# sourceMappingURL=NativeRNMBXViewportModule.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts.map b/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts.map new file mode 100644 index 000000000..931e6e860 --- /dev/null +++ b/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeRNMBXViewportModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXViewportModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,aAAK,SAAS,GACV;IACE,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAGN,aAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC;AAE1B,aAAK,SAAS,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAA8B;AACrE,aAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AACjC,aAAK,cAAc,GACf;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAC7D,aAAK,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;AAE3C,aAAK,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;AAE5B,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/C,YAAY,CACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;;AAED,wBAA6E"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts new file mode 100644 index 000000000..3b8aab5be --- /dev/null +++ b/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts @@ -0,0 +1,8 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import type { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXAtmosphereNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map new file mode 100644 index 000000000..9cb2870f1 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXAtmosphereNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXAtmosphereNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts new file mode 100644 index 000000000..55e6caa1f --- /dev/null +++ b/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts @@ -0,0 +1,19 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +export interface NativeProps extends ViewProps { + id: UnsafeMixed; + sourceID: UnsafeMixed; + existing?: OptionalProp; + filter: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + reactStyle: UnsafeMixed; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXBackgroundLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..2e43e5c38 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXBackgroundLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXBackgroundLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3B,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAE7B,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CACrC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts new file mode 100644 index 000000000..ca4e345a6 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts @@ -0,0 +1,6 @@ +import type { HostComponent, ViewProps } from 'react-native'; +export interface NativeProps extends ViewProps { +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXCalloutNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map new file mode 100644 index 000000000..938e9b312 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXCalloutNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXCalloutNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,WAAY,SAAQ,SAAS;CAAG;;AAEjD,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts new file mode 100644 index 000000000..2e3de4341 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts @@ -0,0 +1,32 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { NativeCameraStop, UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type UserTrackingModeChangeEventType = { + type: string; + payloadRenamed: { + followUserLocation: boolean; + followUserMode: string; + }; +}; +export interface NativeProps extends ViewProps { + maxBounds?: UnsafeMixed; + animationDuration?: OptionalProp; + animationMode?: OptionalProp; + defaultStop?: UnsafeMixed; + userTrackingMode?: OptionalProp; + followUserLocation?: OptionalProp; + followUserMode?: OptionalProp; + followZoomLevel?: OptionalProp; + followPitch?: OptionalProp; + followHeading?: OptionalProp; + followPadding?: UnsafeMixed; + zoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + stop?: UnsafeMixed; + onUserTrackingModeChange?: DirectEventHandler; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXCameraNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map new file mode 100644 index 000000000..27b47f6ff --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXCameraNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXCameraNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,KAAK,EACN,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGpE,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,aAAK,+BAA+B,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE;QACd,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,iBAAiB,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC5C,gBAAgB,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEvC,kBAAkB,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAEjC,SAAS,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAErC,wBAAwB,CAAC,EAAE,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;CAChF;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts new file mode 100644 index 000000000..b9ff5cea8 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts @@ -0,0 +1,25 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id?: OptionalProp; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXCircleLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..7d8b1bc42 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXCircleLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXCircleLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts new file mode 100644 index 000000000..aae585172 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts @@ -0,0 +1,12 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { Position } from '../types/Position'; +import { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +export interface NativeProps extends ViewProps { + coordinate?: OptionalProp; + heading?: OptionalProp; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXCustomLocationProviderNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts.map new file mode 100644 index 000000000..6c49c55b3 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXCustomLocationProviderNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXCustomLocationProviderNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAChC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts new file mode 100644 index 000000000..caffd5001 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts @@ -0,0 +1,20 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +export interface NativeProps extends ViewProps { + id?: UnsafeMixed; + sourceID?: OptionalProp; + existing?: OptionalProp; + filter: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + reactStyle: UnsafeMixed; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXFillExtrusionLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..ba38d6ad3 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXFillExtrusionLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXFillExtrusionLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3B,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAE7B,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CACtC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts new file mode 100644 index 000000000..e04ce2eac --- /dev/null +++ b/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts @@ -0,0 +1,25 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id?: OptionalProp; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXFillLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..7fe7e9a2e --- /dev/null +++ b/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXFillLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXFillLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts new file mode 100644 index 000000000..8029be5e2 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts @@ -0,0 +1,25 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id?: OptionalProp; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXHeatmapLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..16d9dac8a --- /dev/null +++ b/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXHeatmapLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXHeatmapLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts new file mode 100644 index 000000000..8da07aeda --- /dev/null +++ b/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts @@ -0,0 +1,14 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import type { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + stretchX: UnsafeMixed>; + stretchY: UnsafeMixed>; + content: UnsafeMixed>; + sdf: UnsafeMixed; + name: UnsafeMixed; + scale?: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXImageNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map new file mode 100644 index 000000000..61d754b2f --- /dev/null +++ b/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXImageNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXImageNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACpC,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC7B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts new file mode 100644 index 000000000..e4f1cc398 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts @@ -0,0 +1,11 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + id: UnsafeMixed; + existing: UnsafeMixed; + url: UnsafeMixed; + coordinates: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXImageSourceNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts.map new file mode 100644 index 000000000..aff8de89f --- /dev/null +++ b/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXImageSourceNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXImageSourceNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC/B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts new file mode 100644 index 000000000..9b1b2b221 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts @@ -0,0 +1,18 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OnImageMissingEventType = { + type: string; + payload: { + imageKey: string; + }; +}; +export interface NativeProps extends ViewProps { + images: UnsafeMixed; + nativeImages: UnsafeMixed>; + hasOnImageMissing: UnsafeMixed; + onImageMissing: DirectEventHandler; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXImagesNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map new file mode 100644 index 000000000..2c5b74b65 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXImagesNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXImagesNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,aAAK,uBAAuB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAE/E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACzB,YAAY,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,iBAAiB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACxC,cAAc,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;CAC7D;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts new file mode 100644 index 000000000..02650fd0e --- /dev/null +++ b/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts @@ -0,0 +1,8 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import type { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXLightNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map new file mode 100644 index 000000000..78d031cc5 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXLightNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXLightNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts new file mode 100644 index 000000000..a5a323062 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts @@ -0,0 +1,25 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id?: OptionalProp; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXLineLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..597086522 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXLineLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXLineLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts new file mode 100644 index 000000000..20c9bbfbf --- /dev/null +++ b/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts @@ -0,0 +1,106 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { DirectEventHandler, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { Point, UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type GestureSettings = { + doubleTapToZoomInEnabled?: boolean; + doubleTouchToZoomOutEnabled?: boolean; + pinchScrollEnabled?: boolean; + pinchToZoomDecelerationEnabled?: boolean; +}; +declare type LocalizeLabels = { + locale: string; + layerIds?: string[]; +} | true; +declare type OnCameraChangedEventType = { + type: string; + payload: string; +}; +declare type OnPressEventType = { + type: string; + payload: string; +}; +declare type OnMapChangeEventType = { + type: string; + payload: string; +}; +export interface NativeProps extends ViewProps { + attributionEnabled?: OptionalProp; + attributionPosition?: UnsafeMixed; + logoEnabled?: OptionalProp; + logoPosition?: UnsafeMixed; + compassEnabled?: OptionalProp; + compassFadeWhenNorth?: OptionalProp; + compassPosition?: UnsafeMixed; + compassViewPosition?: OptionalProp; + compassViewMargins?: OptionalProp; + scaleBarEnabled?: OptionalProp; + scaleBarPosition?: UnsafeMixed; + zoomEnabled?: OptionalProp; + scrollEnabled?: OptionalProp; + rotateEnabled?: OptionalProp; + pitchEnabled?: OptionalProp; + deselectAnnotationOnTap?: OptionalProp; + requestDisallowInterceptTouchEvent?: OptionalProp; + projection?: OptionalProp<'mercator' | 'globe'>; + localizeLabels?: UnsafeMixed; + styleURL?: OptionalProp; + gestureSettings?: UnsafeMixed; + surfaceView?: OptionalProp; + scaleBarViewMargins?: UnsafeMixed; + attributionViewMargins?: UnsafeMixed; + attributionViewPosition?: UnsafeMixed; + compassImage?: OptionalProp; + onPress?: DirectEventHandler; + onLongPress?: DirectEventHandler; + onMapChange?: DirectEventHandler; + onCameraChanged?: DirectEventHandler; + mapViewImpl?: OptionalProp; +} +declare const _default: HostComponent; +export default _default; +declare type MapState = { + properties: { + center: GeoJSON.Position; + bounds: { + ne: GeoJSON.Position; + sw: GeoJSON.Position; + }; + zoom: number; + heading: number; + pitch: number; + }; + gestures: { + isGestureActive: boolean; + }; + timestamp?: number; +}; +declare type RegionPayload = { + zoomLevel: number; + heading: number; + animated: boolean; + isUserInteraction: boolean; + visibleBounds: GeoJSON.Position[]; + pitch: number; +}; +declare type OnPressEventTypeActual = { + type: string; + payload: GeoJSON.Feature | string; +}; +declare type OnCameraChangedEventTypeActual = { + type: string; + payload: MapState | string; +}; +declare type OnMapChangeEventTypeActual = { + type: string; + payload: GeoJSON.Feature | string; +}; +export declare type NativeMapViewActual = HostComponent & { + onCameraChanged?: DirectEventHandler; + onLongPress?: DirectEventHandler; + onPress?: DirectEventHandler; + onMapChange?: DirectEventHandler; +}>; +//# sourceMappingURL=RNMBXMapViewNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map new file mode 100644 index 000000000..3c825ab57 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXMapViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EACL,kBAAkB,EAClB,KAAK,EACN,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;A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C,EAAE,kBAAkB,CAAC,8BAA8B,CAAC,CAAC;IACrE,WAAW,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;CAC9D,CACF,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts new file mode 100644 index 000000000..34d8f1e76 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts @@ -0,0 +1,6 @@ +import type { HostComponent, ViewProps } from 'react-native'; +export interface NativeProps extends ViewProps { +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXMarkerViewContentNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts.map new file mode 100644 index 000000000..fd69c7d40 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXMarkerViewContentNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXMarkerViewContentNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,WAAY,SAAQ,SAAS;CAAG;;AAEjD,wBAE8B"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts new file mode 100644 index 000000000..33e6337d1 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts @@ -0,0 +1,18 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { Position } from '../types/Position'; +import { UnsafeMixed } from './codegenUtils'; +declare type Point = { + x: Int32; + y: Int32; +}; +export interface NativeProps extends ViewProps { + coordinate?: UnsafeMixed; + anchor: UnsafeMixed; + allowOverlap: UnsafeMixed; + allowOverlapWithPuck: UnsafeMixed; + isSelected: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXMarkerViewNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map new file mode 100644 index 000000000..15ed53199 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXMarkerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXMarkerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,aAAK,KAAK,GAAG;IACX,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,KAAK,CAAC;CACV,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC3B,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,oBAAoB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3C,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAClC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts new file mode 100644 index 000000000..f7dd206e9 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts @@ -0,0 +1,28 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import { StyleValue } from '../utils/StyleValue'; +import { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id: OptionalProp; + reactStyle?: UnsafeMixed<{ + [key: string]: StyleValue; + }>; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXModelLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..f6bcb41db --- /dev/null +++ b/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXModelLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXModelLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,WAAW,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC,CAAC;CACzD;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts new file mode 100644 index 000000000..6d52497cb --- /dev/null +++ b/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts @@ -0,0 +1,15 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { UnsafeMixed } from './codegenUtils'; +declare type Asset = { + __packager_asset?: boolean; + uri?: string; + url?: string; +}; +export interface NativeProps extends ViewProps { + models: UnsafeMixed<{ + [key: string]: Asset; + }>; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXModelsNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts.map new file mode 100644 index 000000000..4ab2d64a9 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXModelsNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXModelsNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,aAAK,KAAK,GAAG;IACX,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,MAAM,EAAE,WAAW,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;KAAE,CAAC,CAAC;CAC/C;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts new file mode 100644 index 000000000..b2227aa35 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts @@ -0,0 +1,26 @@ +import type { HostComponent, ProcessedColorValue, ViewProps } from 'react-native'; +import type { Expression } from '../utils/MapboxStyles'; +import { UnsafeMixed } from './codegenUtils'; +declare type Value = T | Expression; +declare type OptionalProp = UnsafeMixed; +declare type Pulsing = { + isEnabled?: boolean; + radius?: 'accuracy' | number; + color?: ProcessedColorValue | null | undefined; +} | { + kind: 'default'; +}; +export interface NativeProps extends ViewProps { + androidRenderMode?: OptionalProp; + puckBearing?: OptionalProp<'heading' | 'course'>; + puckBearingEnabled?: OptionalProp; + bearingImage?: OptionalProp; + shadowImage?: OptionalProp; + topImage?: OptionalProp; + scale?: UnsafeMixed>; + visible?: boolean; + pulsing?: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXNativeUserLocationNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map new file mode 100644 index 000000000..a43554eb6 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXNativeUserLocationNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXNativeUserLocationNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,aAAK,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;AAG/B,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,aAAK,OAAO,GACR;IACE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;CAChD,GACD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,iBAAiB,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,YAAY,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC;IACjD,kBAAkB,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAChC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts new file mode 100644 index 000000000..025b0a692 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts @@ -0,0 +1,37 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OnMapboxPointAnnotationDeselectedEventType = { + type: string; + payload: string; +}; +declare type OnMapboxPointAnnotationDragEventType = { + type: string; + payload: string; +}; +declare type OnMapboxPointAnnotationDragEndEventType = { + type: string; + payload: string; +}; +declare type OnMapboxPointAnnotationDragStartEventType = { + type: string; + payload: string; +}; +declare type OnMapboxPointAnnotationSelectedEventType = { + type: string; + payload: string; +}; +export interface NativeProps extends ViewProps { + coordinate: UnsafeMixed; + draggable: UnsafeMixed; + id: UnsafeMixed; + anchor: UnsafeMixed; + onMapboxPointAnnotationDeselected: DirectEventHandler; + onMapboxPointAnnotationDrag: DirectEventHandler; + onMapboxPointAnnotationDragEnd: DirectEventHandler; + onMapboxPointAnnotationDragStart: DirectEventHandler; + onMapboxPointAnnotationSelected: DirectEventHandler; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXPointAnnotationNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map new file mode 100644 index 000000000..9afab1e42 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXPointAnnotationNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXPointAnnotationNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,aAAK,0CAA0C,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,aAAK,oCAAoC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9E,aAAK,uCAAuC,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,aAAK,yCAAyC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,aAAK,wCAAwC,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAEzB,iCAAiC,EAAE,kBAAkB,CAAC,0CAA0C,CAAC,CAAC;IAClG,2BAA2B,EAAE,kBAAkB,CAAC,oCAAoC,CAAC,CAAC;IACtF,8BAA8B,EAAE,kBAAkB,CAAC,uCAAuC,CAAC,CAAC;IAC5F,gCAAgC,EAAE,kBAAkB,CAAC,yCAAyC,CAAC,CAAC;IAChG,+BAA+B,EAAE,kBAAkB,CAAC,wCAAwC,CAAC,CAAC;CAC/F;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts new file mode 100644 index 000000000..8be3ab9bd --- /dev/null +++ b/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts @@ -0,0 +1,15 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + id: UnsafeMixed; + existing: UnsafeMixed; + url: UnsafeMixed; + tileUrlTemplates: UnsafeMixed>; + minZoomLevel: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + tileSize: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXRasterDemSourceNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts.map new file mode 100644 index 000000000..24bd69e6d --- /dev/null +++ b/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXRasterDemSourceNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXRasterDemSourceNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts new file mode 100644 index 000000000..fbef83442 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts @@ -0,0 +1,25 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id?: OptionalProp; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXRasterLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..827c463a4 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXRasterLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXRasterLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts new file mode 100644 index 000000000..976bc8a38 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts @@ -0,0 +1,17 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + id: UnsafeMixed; + existing: UnsafeMixed; + url: UnsafeMixed; + tileUrlTemplates: UnsafeMixed>; + minZoomLevel: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + tileSize: UnsafeMixed; + tms: UnsafeMixed; + attribution: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXRasterSourceNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map new file mode 100644 index 000000000..94c734022 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXRasterSourceNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXRasterSourceNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts new file mode 100644 index 000000000..8a57a8566 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts @@ -0,0 +1,27 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OnMapboxShapeSourcePressEventType = { + type: string; + payload: string; +}; +export interface NativeProps extends ViewProps { + id: UnsafeMixed; + existing: UnsafeMixed; + url: UnsafeMixed; + shape: UnsafeMixed; + cluster: UnsafeMixed; + clusterRadius: UnsafeMixed; + clusterMaxZoomLevel: UnsafeMixed; + clusterProperties: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + buffer: UnsafeMixed; + tolerance: UnsafeMixed; + lineMetrics: UnsafeMixed; + hasPressListener: UnsafeMixed; + hitbox: UnsafeMixed; + onMapboxShapeSourcePress: DirectEventHandler; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXShapeSourceNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map new file mode 100644 index 000000000..60423d5e3 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXShapeSourceNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXShapeSourceNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,KAAK,EACN,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,aAAK,iCAAiC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,iBAAiB,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,gBAAgB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACzB,wBAAwB,EAAE,kBAAkB,CAAC,iCAAiC,CAAC,CAAC;CACjF;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts new file mode 100644 index 000000000..a3c2ac174 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts @@ -0,0 +1,19 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +export interface NativeProps extends ViewProps { + id?: OptionalProp; + sourceID?: OptionalProp; + existing?: OptionalProp; + filter: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + reactStyle?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXSkyLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..ccea7d6f9 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXSkyLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXSkyLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3B,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IAE/B,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CACrC;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts new file mode 100644 index 000000000..14236266d --- /dev/null +++ b/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts @@ -0,0 +1,12 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import type { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + id: string; + existing: boolean; + config: UnsafeMixed<{ + [key: string]: string; + }>; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXStyleImportNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map new file mode 100644 index 000000000..c3fb8856c --- /dev/null +++ b/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXStyleImportNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXStyleImportNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts new file mode 100644 index 000000000..77e3ffecc --- /dev/null +++ b/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts @@ -0,0 +1,25 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import { FilterExpression } from '../utils/MapboxStyles'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +declare type Slot = 'bottom' | 'middle' | 'top'; +declare type CommonProps = { + sourceID?: OptionalProp; + existing?: OptionalProp; + filter?: UnsafeMixed; + aboveLayerID?: OptionalProp; + belowLayerID?: OptionalProp; + layerIndex?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; + sourceLayerID?: OptionalProp; + slot?: OptionalProp; +}; +export interface NativeProps extends ViewProps, CommonProps { + id?: OptionalProp; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXSymbolLayerNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map new file mode 100644 index 000000000..51ea99886 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXSymbolLayerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXSymbolLayerNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,aAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AACtC,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExC,aAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEvC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAGF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts new file mode 100644 index 000000000..17aa7c22b --- /dev/null +++ b/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts @@ -0,0 +1,9 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import type { UnsafeMixed } from './codegenUtils'; +export interface NativeProps extends ViewProps { + sourceID?: UnsafeMixed; + reactStyle: UnsafeMixed; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXTerrainNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map new file mode 100644 index 000000000..19e334e33 --- /dev/null +++ b/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXTerrainNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXTerrainNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9B;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts new file mode 100644 index 000000000..314fa4f2d --- /dev/null +++ b/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts @@ -0,0 +1,23 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { DirectEventHandler, Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OnMapboxVectorSourcePressEventType = { + type: string; + payload: string; +}; +export interface NativeProps extends ViewProps { + id: UnsafeMixed; + existing: UnsafeMixed; + url: UnsafeMixed; + tileUrlTemplates: UnsafeMixed>; + attribution: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + minZoomLevel: UnsafeMixed; + tms: UnsafeMixed; + hasPressListener: UnsafeMixed; + hitbox: UnsafeMixed; + onMapboxVectorSourcePress: DirectEventHandler; +} +declare const _default: HostComponent; +export default _default; +//# sourceMappingURL=RNMBXVectorSourceNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts.map new file mode 100644 index 000000000..b37459cea --- /dev/null +++ b/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXVectorSourceNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXVectorSourceNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACP,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,aAAK,kCAAkC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1B,gBAAgB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACzB,yBAAyB,EAAE,kBAAkB,CAAC,kCAAkC,CAAC,CAAC;CACnF;;AAED,wBAEgC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts b/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts new file mode 100644 index 000000000..4e5e78dae --- /dev/null +++ b/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts @@ -0,0 +1,59 @@ +import type { HostComponent, ViewProps } from 'react-native'; +import { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +import type { UnsafeMixed } from './codegenUtils'; +declare type OptionalProp = UnsafeMixed; +export declare type FollowPuckOptionsNative = { + zoom?: number | 'keep'; + pitch?: number | 'keep'; + bearing?: 'course' | 'heading' | number | 'keep'; + padding?: { + top?: number; + left?: number; + bottom?: number; + right?: number; + } | 'keep'; +}; +export declare type ViewportStateNative = { + kind: 'followPuck'; + options?: FollowPuckOptionsNative; +} | { + kind: 'overview'; +}; +declare type ViewportStatus = { + kind: 'idle'; +} | { + kind: 'transition'; + toState: ViewportStateNative; + transition: ViewportTransition; +}; +declare type ViewportTransition = { + kind: 'immediate'; +} | { + kind: 'default'; + maxDurationMs?: number; +}; +declare type ViewportStatusChangeReason = 'TransitionStarted' | 'TransitionSucceeded' | 'IdleRequested' | 'UserInteraction'; +export declare type OnStatusChangedEventPayload = { + from: ViewportStatus; + to: ViewportStatus; + reason: ViewportStatusChangeReason; +}; +declare type OnStatusChangedEventType = { + type: string; + payload: string; +}; +export declare type OnStatusChangedEventTypeReal = { + type: 'statuschanged'; + payload: UnsafeMixed; +}; +export interface NativeProps extends ViewProps { + transitionsToIdleUponUserInteraction?: OptionalProp; + hasStatusChanged: boolean; + onStatusChanged?: DirectEventHandler; +} +declare const _default: HostComponent; +export default _default; +export declare type NativeViewportReal = HostComponent & { + onStatusChanged?: DirectEventHandler; +}>; +//# sourceMappingURL=RNMBXViewportNativeComponent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts.map b/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts.map new file mode 100644 index 000000000..0223bfd6b --- /dev/null +++ b/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RNMBXViewportNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXViewportNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C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;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAGjB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC,2BAA2B,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,oCAAoC,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC7D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;CAChE;;AAED,wBAEgC;AAEhC,oBAAY,kBAAkB,GAAG,aAAa,CAC5C,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,GAAG;IACrC,eAAe,CAAC,EAAE,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;CACpE,CACF,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/specs/codegenUtils.d.ts b/lib/typescript/src/specs/codegenUtils.d.ts new file mode 100644 index 000000000..86e7f8ada --- /dev/null +++ b/lib/typescript/src/specs/codegenUtils.d.ts @@ -0,0 +1,21 @@ +export declare type UnsafeMixed = T; +export declare type OptionalProp = UnsafeMixed; +import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +export declare type Point = { + x: Int32; + y: Int32; +}; +export declare type NativeCameraStop = { + centerCoordinate?: string; + bounds?: string; + heading?: Double; + pitch?: Double; + zoom?: Double; + paddingLeft?: Double; + paddingRight?: Double; + paddingTop?: Double; + paddingBottom?: Double; + duration?: Double; + mode?: string; +} | null; +//# sourceMappingURL=codegenUtils.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/specs/codegenUtils.d.ts.map b/lib/typescript/src/specs/codegenUtils.d.ts.map new file mode 100644 index 000000000..c2b92c30d --- /dev/null +++ b/lib/typescript/src/specs/codegenUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"codegenUtils.d.ts","sourceRoot":"","sources":["../../../../src/specs/codegenUtils.ts"],"names":[],"mappings":"AAGA,oBAAY,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAI/B,oBAAY,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAE1E,oBAAY,KAAK,GAAG;IAClB,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,KAAK,CAAC;CACV,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/types/BaseProps.d.ts b/lib/typescript/src/types/BaseProps.d.ts new file mode 100644 index 000000000..941de4367 --- /dev/null +++ b/lib/typescript/src/types/BaseProps.d.ts @@ -0,0 +1,5 @@ +export declare type BaseProps = { + key?: string; + testID?: string | undefined; +}; +//# sourceMappingURL=BaseProps.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/types/BaseProps.d.ts.map b/lib/typescript/src/types/BaseProps.d.ts.map new file mode 100644 index 000000000..237fccadb --- /dev/null +++ b/lib/typescript/src/types/BaseProps.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BaseProps.d.ts","sourceRoot":"","sources":["../../../../src/types/BaseProps.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/types/OnPressEvent.d.ts b/lib/typescript/src/types/OnPressEvent.d.ts new file mode 100644 index 000000000..8481b6169 --- /dev/null +++ b/lib/typescript/src/types/OnPressEvent.d.ts @@ -0,0 +1,12 @@ +export declare type OnPressEvent = { + features: Array; + coordinates: { + latitude: number; + longitude: number; + }; + point: { + x: number; + y: number; + }; +}; +//# sourceMappingURL=OnPressEvent.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/types/OnPressEvent.d.ts.map b/lib/typescript/src/types/OnPressEvent.d.ts.map new file mode 100644 index 000000000..1d13ffabf --- /dev/null +++ b/lib/typescript/src/types/OnPressEvent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OnPressEvent.d.ts","sourceRoot":"","sources":["../../../../src/types/OnPressEvent.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/types/Position.d.ts b/lib/typescript/src/types/Position.d.ts new file mode 100644 index 000000000..0f98d145f --- /dev/null +++ b/lib/typescript/src/types/Position.d.ts @@ -0,0 +1,5 @@ +/** + * Position is a tuple of latitude and longitude. + */ +export declare type Position = [number, number] | number[]; +//# sourceMappingURL=Position.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/types/Position.d.ts.map b/lib/typescript/src/types/Position.d.ts.map new file mode 100644 index 000000000..b41bcb372 --- /dev/null +++ b/lib/typescript/src/types/Position.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Position.d.ts","sourceRoot":"","sources":["../../../../src/types/Position.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/types/index.d.ts b/lib/typescript/src/types/index.d.ts new file mode 100644 index 000000000..69b926313 --- /dev/null +++ b/lib/typescript/src/types/index.d.ts @@ -0,0 +1,16 @@ +import { SyntheticEvent } from 'react'; +import { Animated } from 'react-native'; +import { GeoJsonObject } from 'geojson'; +export declare type MapboxGLEvent = SyntheticEvent; +export interface AnimatedPoint extends GeoJsonObject { + readonly type: 'Point'; + coordinates: (Animated.Value | number)[]; +} +export interface AnimatedShape extends GeoJsonObject { + readonly type: 'LineString'; + coordinates: (Animated.Value | number)[][]; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/types/index.d.ts.map b/lib/typescript/src/types/index.d.ts.map new file mode 100644 index 000000000..696b0aed3 --- /dev/null +++ b/lib/typescript/src/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,oBAAY,aAAa,CACvB,CAAC,SAAS,MAAM,EAChB,CAAC,GAAG,OAAO,CAAC,OAAO,EACnB,CAAC,GAAG,OAAO,IACT,cAAc,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAI/C,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC;CAC5C"} \ No newline at end of file diff --git a/lib/typescript/src/utils/BridgeValue.d.ts b/lib/typescript/src/utils/BridgeValue.d.ts new file mode 100644 index 000000000..0748a3005 --- /dev/null +++ b/lib/typescript/src/utils/BridgeValue.d.ts @@ -0,0 +1,46 @@ +export declare type RawValueType = string | number | boolean | RawValueType[] | { + [key: string]: RawValueType; +}; +export declare type StyleValueJSON = { + type: 'boolean'; + value: boolean; +} | { + type: 'number'; + value: number; +} | { + type: 'string'; + value: string; +} | { + type: 'hashmap'; + value: object; +} | { + type: 'array'; + value: unknown[]; +}; +declare type StyleValueTypes = 'boolean' | 'number' | 'string' | 'hashmap' | 'array'; +export default class BridgeValue { + rawValue: RawValueType; + constructor(rawValue: RawValueType); + get type(): StyleValueTypes; + get value(): string | number | boolean | RawValueType[] | { + [key: string]: RawValueType; + } | ({ + type: "boolean"; + value: boolean; + } | { + type: "number"; + value: number; + } | { + type: "string"; + value: string; + } | { + type: "hashmap"; + value: object; + } | { + type: "array"; + value: unknown[]; + })[] | StyleValueJSON[][]; + toJSON(formatter?: (arg0: T) => T): StyleValueJSON; +} +export {}; +//# sourceMappingURL=BridgeValue.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/BridgeValue.d.ts.map b/lib/typescript/src/utils/BridgeValue.d.ts.map new file mode 100644 index 000000000..3c18e0c4f --- /dev/null +++ b/lib/typescript/src/utils/BridgeValue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BridgeValue.d.ts","sourceRoot":"","sources":["../../../../src/utils/BridgeValue.ts"],"names":[],"mappings":"AAEA,oBAAY,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,YAAY,EAAE,GACd;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,CAAC;AAEpC,oBAAY,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAExC,aAAK,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,QAAQ,EAAE,YAAY,CAAC;gBAEX,QAAQ,EAAE,YAAY;IAIlC,IAAI,IAAI,IAAI,eAAe,CAmB1B;IAED,IAAI,KAAK;;;;;;;;;;;;;;;;;8BAiCR;IAED,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,cAAc;CAOtD"} \ No newline at end of file diff --git a/lib/typescript/src/utils/Logger.d.ts b/lib/typescript/src/utils/Logger.d.ts new file mode 100644 index 000000000..b83fa62cd --- /dev/null +++ b/lib/typescript/src/utils/Logger.d.ts @@ -0,0 +1,53 @@ +import { EmitterSubscription, NativeEventEmitter } from 'react-native'; +export declare type LogLevel = 'error' | 'warning' | 'info' | 'debug' | 'verbose'; +export interface LogObject { + level: LogLevel; + message: string; + tag: string; +} +declare type LogCallback = (object: LogObject) => boolean; +declare class Logger { + static instance: Logger | null; + loggerEmitter: NativeEventEmitter; + startedCount: number; + logCallback?: LogCallback; + subscription?: EmitterSubscription; + static sharedInstance(): Logger; + constructor(); + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + static setLogCallback(logCallback: LogCallback): void; + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + setLogCallback(logCallback: LogCallback): void; + /** + * This callback is displayed as part of the Requester class. + * @callback Logger~logCallback + * @param {object} log + * @param {string} log.message - the message of the log + * @param {string} log.level - log level + * @param {string} log.tag - optional tag used on android + */ + /** + * setLogLevel + * @param {LogLevel} level + */ + static setLogLevel(level: LogLevel): void; + /** + * @type {('error'|'warning'|'info'|'debug'|'verbose')} LogLevel - Supported log levels + */ + start(): void; + stop(): void; + subscribe(): void; + unsubscribe(): void; + effectiveLevel(log: LogObject): LogLevel; + onLog(log: LogObject): void; +} +export default Logger; +//# sourceMappingURL=Logger.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/Logger.d.ts.map b/lib/typescript/src/utils/Logger.d.ts.map new file mode 100644 index 000000000..2b6cd9166 --- /dev/null +++ b/lib/typescript/src/utils/Logger.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../src/utils/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAGtB,oBAAY,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE1E,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,aAAK,WAAW,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC;AAElD,cAAM,MAAM;IACV,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEtC,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC,MAAM,CAAC,cAAc;;IAarB;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW;IAI9C;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW;IAIvC;;;;;;;OAOG;IAEH;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ;IAIlC;;OAEG;IACH,KAAK;IAOL,IAAI;IAOJ,SAAS;IAMT,WAAW;IAKX,cAAc,CAAC,GAAG,EAAE,SAAS;IAe7B,KAAK,CAAC,GAAG,EAAE,SAAS;CAarB;AAID,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/utils/StyleValue.d.ts b/lib/typescript/src/utils/StyleValue.d.ts new file mode 100644 index 000000000..8d74bdace --- /dev/null +++ b/lib/typescript/src/utils/StyleValue.d.ts @@ -0,0 +1,10 @@ +import { type StyleValueJSON } from './BridgeValue'; +import { AllLayerStyleProps } from './MapboxStyles'; +export declare type StyleValue = { + styletype: string; + stylevalue: StyleValueJSON; +}; +export declare function transformStyle(style: AllLayerStyleProps | undefined): undefined | { + [key: string]: StyleValue; +}; +//# sourceMappingURL=StyleValue.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/StyleValue.d.ts.map b/lib/typescript/src/utils/StyleValue.d.ts.map new file mode 100644 index 000000000..eb09e5df3 --- /dev/null +++ b/lib/typescript/src/utils/StyleValue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StyleValue.d.ts","sourceRoot":"","sources":["../../../../src/utils/StyleValue.ts"],"names":[],"mappings":"AAEA,OAAoB,EAElB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,oBAAY,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,cAAc,CAAC;CAC5B,CAAC;AAEF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,kBAAkB,GAAG,SAAS,GACpC,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CA+C3C"} \ No newline at end of file diff --git a/lib/typescript/src/utils/animated/Animated.d.ts b/lib/typescript/src/utils/animated/Animated.d.ts new file mode 100644 index 000000000..c0d21dc30 --- /dev/null +++ b/lib/typescript/src/utils/animated/Animated.d.ts @@ -0,0 +1,23 @@ +import { Animated as RNAnimated } from 'react-native'; +import { ShapeSource } from '../../components/ShapeSource'; +import ImageSource from '../../components/ImageSource'; +import FillLayer from '../../components/FillLayer'; +import FillExtrusionLayer from '../../components/FillExtrusionLayer'; +import LineLayer from '../../components/LineLayer'; +import CircleLayer from '../../components/CircleLayer'; +import { SymbolLayer } from '../../components/SymbolLayer'; +import RasterLayer from '../../components/RasterLayer'; +import BackgroundLayer from '../../components/BackgroundLayer'; +declare const Animated: { + ShapeSource: RNAnimated.AnimatedComponent; + ImageSource: RNAnimated.AnimatedComponent; + FillLayer: RNAnimated.AnimatedComponent; + FillExtrusionLayer: RNAnimated.AnimatedComponent; + LineLayer: RNAnimated.AnimatedComponent; + CircleLayer: RNAnimated.AnimatedComponent; + SymbolLayer: RNAnimated.AnimatedComponent; + RasterLayer: RNAnimated.AnimatedComponent; + BackgroundLayer: RNAnimated.AnimatedComponent; +}; +export default Animated; +//# sourceMappingURL=Animated.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/animated/Animated.d.ts.map b/lib/typescript/src/utils/animated/Animated.d.ts.map new file mode 100644 index 000000000..5de5f4798 --- /dev/null +++ b/lib/typescript/src/utils/animated/Animated.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Animated.d.ts","sourceRoot":"","sources":["../../../../../src/utils/animated/Animated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAE/D,QAAA,MAAM,QAAQ;;;;;;;;;;CAab,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/utils/checkRequiredProps.d.ts b/lib/typescript/src/utils/checkRequiredProps.d.ts new file mode 100644 index 000000000..9b57c0cf2 --- /dev/null +++ b/lib/typescript/src/utils/checkRequiredProps.d.ts @@ -0,0 +1,8 @@ +declare type RequiredKeys = { + [k in keyof T]-?: undefined extends T[k] ? never : k; +}[keyof T]; +export default function checkRequiredProps(tag: string, props: Props, required: RequiredKeys[]): void; +export {}; +//# sourceMappingURL=checkRequiredProps.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/checkRequiredProps.d.ts.map b/lib/typescript/src/utils/checkRequiredProps.d.ts.map new file mode 100644 index 000000000..02d5e7fd1 --- /dev/null +++ b/lib/typescript/src/utils/checkRequiredProps.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"checkRequiredProps.d.ts","sourceRoot":"","sources":["../../../../src/utils/checkRequiredProps.ts"],"names":[],"mappings":"AAAA,aAAK,YAAY,CAAC,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;CACrD,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACxC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,QAU3D"} \ No newline at end of file diff --git a/lib/typescript/src/utils/deprecation.d.ts b/lib/typescript/src/utils/deprecation.d.ts new file mode 100644 index 000000000..d66dba554 --- /dev/null +++ b/lib/typescript/src/utils/deprecation.d.ts @@ -0,0 +1,13 @@ +/** + * deprecatedClass: creates a subclass of the class, which prints deprecated warning when called + */ +export declare function deprecatedClass object>(origClass: C, deprecationMessage: string): C; +/** + * Copy properties from origObject to newObject, but only those which not exists in newObject. + * Calls onDeprecatedCalled callback in case a copied property is invoked. + */ +export declare function copyPropertiesAsDeprecated, +WithDeprecatedType extends Record>(origObject: DeprecatedType, newObject: WithDeprecatedType, onDeprecatedCalled: (key: string) => void, accessors?: { + [key: string]: (value: unknown) => unknown; +}): WithDeprecatedType; +//# sourceMappingURL=deprecation.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/deprecation.d.ts.map b/lib/typescript/src/utils/deprecation.d.ts.map new file mode 100644 index 000000000..3f19cc353 --- /dev/null +++ b/lib/typescript/src/utils/deprecation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../src/utils/deprecation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,EACtE,SAAS,EAAE,CAAC,EACZ,kBAAkB,EAAE,MAAM,GACzB,CAAC,CAQH;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,SAAS,MAAM,EAAE,2BAA2B;AAC1D,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAElD,UAAU,EAAE,cAAc,EAC1B,SAAS,EAAE,kBAAkB,EAC7B,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EACzC,SAAS,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAA;CAAO,GAC7D,kBAAkB,CAapB"} \ No newline at end of file diff --git a/lib/typescript/src/utils/filterUtils.d.ts b/lib/typescript/src/utils/filterUtils.d.ts new file mode 100644 index 000000000..4db819486 --- /dev/null +++ b/lib/typescript/src/utils/filterUtils.d.ts @@ -0,0 +1,2 @@ +export declare function getFilter(filter: string[] | unknown): string[]; +//# sourceMappingURL=filterUtils.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/filterUtils.d.ts.map b/lib/typescript/src/utils/filterUtils.d.ts.map new file mode 100644 index 000000000..5a41869c7 --- /dev/null +++ b/lib/typescript/src/utils/filterUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"filterUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/filterUtils.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,GAAG,MAAM,EAAE,CAM9D"} \ No newline at end of file diff --git a/lib/typescript/src/utils/geoUtils.d.ts b/lib/typescript/src/utils/geoUtils.d.ts new file mode 100644 index 000000000..e1e44497a --- /dev/null +++ b/lib/typescript/src/utils/geoUtils.d.ts @@ -0,0 +1,15 @@ +import { point, feature, lineString, Position, Properties, Id, BBox, FeatureCollection, Geometry, Point, Feature } from '@turf/helpers'; +import distance from '@turf/distance'; +import along from '@turf/along'; +export declare const makePoint: typeof point; +export declare const makeLineString: typeof lineString; +export declare function makeLatLngBounds(northEastCoordinates: Position, southWestCoordinates: Position): FeatureCollection; +export declare const makeFeature: typeof feature; +export declare function makeFeatureCollection(features?: Array>, options?: { + bbox?: BBox; + id?: Id; +}): FeatureCollection; +export declare function addToFeatureCollection(newFeatureCollection: FeatureCollection, newFeature: Feature): FeatureCollection; +export declare const calculateDistance: typeof distance; +export declare const pointAlongLine: typeof along; +//# sourceMappingURL=geoUtils.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/geoUtils.d.ts.map b/lib/typescript/src/utils/geoUtils.d.ts.map new file mode 100644 index 000000000..9993acaca --- /dev/null +++ b/lib/typescript/src/utils/geoUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geoUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/geoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,UAAU,EACV,EAAE,EACF,IAAI,EACJ,iBAAiB,EACjB,QAAQ,EACR,KAAK,EACL,OAAO,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,eAAO,MAAM,SAAS,cAAQ,CAAC;AAE/B,eAAO,MAAM,cAAc,mBAAa,CAAC;AAEzC,wBAAgB,gBAAgB,CAC9B,oBAAoB,EAAE,QAAQ,EAC9B,oBAAoB,EAAE,QAAQ,GAC7B,iBAAiB,CAAC,KAAK,CAAC,CAK1B;AAED,eAAO,MAAM,WAAW,gBAAU,CAAC;AAEnC,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,GAAG,UAAU,EAChE,QAAQ,GAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAM,EACnC,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,EAAE,CAAC,EAAE,EAAE,CAAC;CACT,2BAGF;AAED,wBAAgB,sBAAsB,CACpC,oBAAoB,EAAE,iBAAiB,EACvC,UAAU,EAAE,OAAO,GAClB,iBAAiB,CAKnB;AAED,eAAO,MAAM,iBAAiB,iBAAW,CAAC;AAE1C,eAAO,MAAM,cAAc,cAAQ,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/utils/getAnnotationsLayerID.d.ts b/lib/typescript/src/utils/getAnnotationsLayerID.d.ts new file mode 100644 index 000000000..af9aba825 --- /dev/null +++ b/lib/typescript/src/utils/getAnnotationsLayerID.d.ts @@ -0,0 +1,2 @@ +export declare const getAnnotationsLayerID: (type: 'PointAnnotations' | 'Callouts') => string | undefined; +//# sourceMappingURL=getAnnotationsLayerID.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map b/lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map new file mode 100644 index 000000000..40f561139 --- /dev/null +++ b/lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getAnnotationsLayerID.d.ts","sourceRoot":"","sources":["../../../../src/utils/getAnnotationsLayerID.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,SAC1B,kBAAkB,GAAG,UAAU,uBAStC,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/utils/index.d.ts b/lib/typescript/src/utils/index.d.ts new file mode 100644 index 000000000..9b35ad6a9 --- /dev/null +++ b/lib/typescript/src/utils/index.d.ts @@ -0,0 +1,33 @@ +import React from 'react'; +import { ImageSourcePropType, TurboModule } from 'react-native'; +export declare function isAndroid(): boolean; +export declare function existenceChange(cur: boolean, next: boolean): boolean; +export declare function isFunction(fn: unknown): fn is boolean; +export declare function isNumber(num: unknown): num is number; +export declare function isUndefined(obj: unknown): obj is undefined; +export declare function isString(str: unknown): str is string; +export declare function isBoolean(bool: unknown): bool is boolean; +export declare function isPrimitive(value: unknown): value is string | number | boolean; +export declare type NativeArg = string | number | boolean | null | { + [k: string]: NativeArg; +} | NativeArg[]; +export declare function runNativeMethod(turboModule: TurboModule, name: string, nativeRef: any, args: NativeArg[]): Promise; +export declare function cloneReactChildrenWithProps(children: Parameters[0], propsToAdd?: { + [key: string]: string; +}): any; +export declare function resolveImagePath(imageRef: ImageSourcePropType): string; +export declare function toJSONString(json?: any): string; +export declare type OrnamentPositonProp = { + top: number; + left: number; +} | { + top: number; + right: number; +} | { + bottom: number; + left: number; +} | { + bottom: number; + right: number; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/index.d.ts.map b/lib/typescript/src/utils/index.d.ts.map new file mode 100644 index 000000000..7f1e9ab27 --- /dev/null +++ b/lib/typescript/src/utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,mBAAmB,EACnB,WAAW,EACZ,MAAM,cAAc,CAAC;AAEtB,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAKpE;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,OAAO,CAErD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAEpD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,SAAS,CAE1D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAEpD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,OAAO,CAExD;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,MAAM,GAAG,MAAM,GAAG,OAAO,CAEpC;AAED,oBAAY,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC1B,SAAS,EAAE,CAAC;AAEhB,wBAAgB,eAAe,CAAC,UAAU,GAAG,SAAS,EACpD,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,GAAG,EACd,IAAI,EAAE,SAAS,EAAE,GAChB,OAAO,CAAC,UAAU,CAAC,CASrB;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAClD,UAAU,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,OAkB3C;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAGtE;AAED,wBAAgB,YAAY,CAAC,IAAI,GAAE,GAAQ,UAE1C;AAED,oBAAY,mBAAmB,GAC3B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/utils/nativeRef.d.ts b/lib/typescript/src/utils/nativeRef.d.ts new file mode 100644 index 000000000..481839885 --- /dev/null +++ b/lib/typescript/src/utils/nativeRef.d.ts @@ -0,0 +1,21 @@ +import { RefObject, type Component, type MutableRefObject } from 'react'; +import { type NativeMethods, type HostComponent } from 'react-native'; +/** + * Helper for useRef and requireNativeComponent: + * @example + * RNMBXCamera = requireNativeComponent('RNMBXCamera'); + * const ref = useRef; + * ... + * + */ +export declare type NativeRefType

= MutableRefObject<(Component

& Readonly) | null>; +/** + * Helper for useRef and requireNativeComponent: + * @example + * RNMBXCamera = requireNativeComponent('RNMBXCamera'); + * const ref = nativeRef(useRef + */ +export default function nativeRef

(c: RefObject | null>): MutableRefObject<(Component

& Readonly) | null>; +//# sourceMappingURL=nativeRef.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/nativeRef.d.ts.map b/lib/typescript/src/utils/nativeRef.d.ts.map new file mode 100644 index 000000000..5d2084b9e --- /dev/null +++ b/lib/typescript/src/utils/nativeRef.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nativeRef.d.ts","sourceRoot":"","sources":["../../../../src/utils/nativeRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE;;;;;;;GAOG;AACH,oBAAY,aAAa,CAAC,CAAC,IAAI,gBAAgB,CAC7C,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAChD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EACjC,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GACpC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,CAEnE"} \ No newline at end of file diff --git a/lib/typescript/src/utils/styleMap.d.ts b/lib/typescript/src/utils/styleMap.d.ts new file mode 100644 index 000000000..864153e36 --- /dev/null +++ b/lib/typescript/src/utils/styleMap.d.ts @@ -0,0 +1,43 @@ +export declare const StyleTypes: { + Constant: string; + Color: string; + Transition: string; + Translation: string; + Function: string; + Image: string; + Enum: string; +}; +export declare function getStyleType(styleProp: keyof typeof styleExtras): string; +export declare const styleExtras: { + iconTextFitPadding: { + iosType: string; + }; + iconOffset: { + iosType: string; + }; + textOffset: { + iosType: string; + }; + lineOffset: { + iosType: string; + }; + fillTranslate: { + iosType: string; + }; + lineTranslate: { + iosType: string; + }; + iconTranslate: { + iosType: string; + }; + textTranslate: { + iosType: string; + }; + circleTranslate: { + iosType: string; + }; + fillExtrusionTranslate: { + iosType: string; + }; +}; +//# sourceMappingURL=styleMap.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/utils/styleMap.d.ts.map b/lib/typescript/src/utils/styleMap.d.ts.map new file mode 100644 index 000000000..999770e1b --- /dev/null +++ b/lib/typescript/src/utils/styleMap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"styleMap.d.ts","sourceRoot":"","sources":["../../../../src/utils/styleMap.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU;;;;;;;;CAQtB,CAAC;AAEF,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,OAAO,WAAW,UAU/D;AAiSD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCvB,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/web/MapContext.d.ts b/lib/typescript/src/web/MapContext.d.ts new file mode 100644 index 000000000..374f1421a --- /dev/null +++ b/lib/typescript/src/web/MapContext.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { Map } from 'mapbox-gl'; +declare const MapContext: React.Context<{ + map?: Map | undefined; +}>; +export default MapContext; +//# sourceMappingURL=MapContext.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/web/MapContext.d.ts.map b/lib/typescript/src/web/MapContext.d.ts.map new file mode 100644 index 000000000..25cf6ab60 --- /dev/null +++ b/lib/typescript/src/web/MapContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapContext.d.ts","sourceRoot":"","sources":["../../../../src/web/MapContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,QAAA,MAAM,UAAU;;EAAyC,CAAC;AAE1D,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/web/components/Camera.d.ts b/lib/typescript/src/web/components/Camera.d.ts new file mode 100644 index 000000000..5431c98b9 --- /dev/null +++ b/lib/typescript/src/web/components/Camera.d.ts @@ -0,0 +1,18 @@ +/// +import React from 'react'; +import MapContext from '../MapContext'; +declare class Camera extends React.Component<{ + centerCoordinate: [number, number] | null; +}> { + context: React.ContextType; + static contextType: React.Context<{ + map?: import("mapbox-gl").Map | undefined; + }>; + static UserTrackingModes: never[]; + componentDidMount(): void; + fitBounds(northEastCoordinates: [number, number], southWestCoordinates: [number, number], padding?: number, animationDuration?: number): void; + render(): JSX.Element; +} +export { Camera }; +export default Camera; +//# sourceMappingURL=Camera.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/web/components/Camera.d.ts.map b/lib/typescript/src/web/components/Camera.d.ts.map new file mode 100644 index 000000000..45db1d604 --- /dev/null +++ b/lib/typescript/src/web/components/Camera.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../../../../src/web/components/Camera.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,cAAM,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC;IACnC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC3C,CAAC;IACA,OAAO,EAAG,KAAK,CAAC,WAAW,CAAC,OAAO,UAAU,CAAC,CAAC;IAE/C,MAAM,CAAC,WAAW;;OAAc;IAChC,MAAM,CAAC,iBAAiB,UAAM;IAE9B,iBAAiB;IAQjB,SAAS,CACP,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,OAAO,SAAI,EACX,iBAAiB,SAAM;IAQzB,MAAM;CAGP;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/web/components/MapView.d.ts b/lib/typescript/src/web/components/MapView.d.ts new file mode 100644 index 000000000..9b37aba93 --- /dev/null +++ b/lib/typescript/src/web/components/MapView.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; +/** + * MapView backed by Mapbox GL KS + */ +declare class MapView extends React.Component<{ + styleURL: string; + children: JSX.Element; +}, { + map?: object | null; +}> { + state: { + map: null; + }; + mapContainer: HTMLElement | null; + map: object | null; + componentDidMount(): void; + render(): JSX.Element; +} +export default MapView; +//# sourceMappingURL=MapView.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/web/components/MapView.d.ts.map b/lib/typescript/src/web/components/MapView.d.ts.map new file mode 100644 index 000000000..05df8e17d --- /dev/null +++ b/lib/typescript/src/web/components/MapView.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../../src/web/components/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B;;GAEG;AACH,cAAM,OAAQ,SAAQ,KAAK,CAAC,SAAS,CACnC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,EAC3C;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CACxB;IACC,KAAK;;MAAiB;IACtB,YAAY,EAAE,WAAW,GAAG,IAAI,CAAQ;IACxC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1B,iBAAiB;IAcjB,MAAM;CAkBP;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/lib/typescript/src/web/utils/Logger.d.ts b/lib/typescript/src/web/utils/Logger.d.ts new file mode 100644 index 000000000..6cf2c7e76 --- /dev/null +++ b/lib/typescript/src/web/utils/Logger.d.ts @@ -0,0 +1,48 @@ +declare type LogMessage = { + level: LogLevel; + message: string; + tag: string; +}; +declare type LogCallback = (log: LogMessage) => boolean; +declare type LogLevel = 'error' | 'warning' | 'info' | 'debug' | 'verbose'; +declare class Logger { + static instance: Logger | null; + level: LogLevel; + logCallback: LogCallback | null; + startedCount: number; + static sharedInstance(): Logger; + constructor(); + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + static setLogCallback(logCallback: LogCallback): void; + /** + * Set custom logger function. + * @param {Logger~logCallback} logCallback - callback taking a log object as param. If callback return falsy value then + * default logging will take place. + */ + setLogCallback(logCallback: LogCallback): void; + /** + * This callback is displayed as part of the Requester class. + * @callback Logger~logCallback + * @param {object} log + * @param {string} log.message - the message of the log + * @param {string} log.level - log level + * @param {string} log.tag - optional tag used on android + */ + /** + * setLogLevel + * @param {LogLevel} level + */ + static setLogLevel(level: LogLevel): void; + start(): void; + stop(): void; + subscribe(): void; + unsubscribe(): void; + effectiveLevel(log: LogMessage): LogLevel; + onLog(log: LogMessage): void; +} +export default Logger; +//# sourceMappingURL=Logger.d.ts.map \ No newline at end of file diff --git a/lib/typescript/src/web/utils/Logger.d.ts.map b/lib/typescript/src/web/utils/Logger.d.ts.map new file mode 100644 index 000000000..39329a015 --- /dev/null +++ b/lib/typescript/src/web/utils/Logger.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/Logger.ts"],"names":[],"mappings":"AACA,aAAK,UAAU,GAAG;IAChB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AACF,aAAK,WAAW,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC;AAChD,aAAK,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnE,cAAM,MAAM;IACV,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEtC,KAAK,EAAE,QAAQ,CAAU;IACzB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,YAAY,SAAK;IAEjB,MAAM,CAAC,cAAc;;IAWrB;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW;IAI9C;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW;IAIvC;;;;;;;OAOG;IAEH;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ;IAIlC,KAAK;IAEL,IAAI;IAEJ,SAAS;IAIT,WAAW;IAIX,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,QAAQ;IAezC,KAAK,CAAC,GAAG,EAAE,UAAU;CAatB;AAID,eAAe,MAAM,CAAC"} \ No newline at end of file