@rnmapbox/maps 10.0.0-beta.75 → 10.0.0-beta.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/images/RCTMGLImagesManager.kt +5 -5
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyle.kt +7 -1
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +5 -5
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt +37 -10
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayer.kt +21 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayerManager.kt +65 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayer.kt +40 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayer.kt +43 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayer.kt +40 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayer.kt +40 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayer.kt +40 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayer.kt +18 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayerManager.kt +65 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSkyLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayer.kt +40 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayerManager.kt +76 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSource.kt +69 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSourceManager.kt +54 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSource.kt +82 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSourceManager.kt +30 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSource.kt +37 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSourceManager.kt +32 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLShapeSource.kt +5 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLShapeSourceManager.kt +10 -4
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSource.kt +44 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSourceManager.kt +69 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSource.kt +78 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSourceManager.kt +69 -0
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTSource.kt +101 -85
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/events/PointAnnotationDragEvent.java +4 -2
- package/ios/RCTMGL-v10/RCMTGLImage.swift +2 -1
- package/ios/RCTMGL-v10/RCTMGLCamera.swift +11 -31
- package/ios/RCTMGL-v10/RCTMGLImages.swift +57 -17
- package/ios/RCTMGL-v10/RCTMGLInteractiveElement.swift +13 -1
- package/ios/RCTMGL-v10/RCTMGLLayer.swift +35 -6
- package/ios/RCTMGL-v10/RCTMGLLocationModule.swift +27 -4
- package/ios/RCTMGL-v10/RCTMGLMapView.swift +15 -3
- package/ios/RCTMGL-v10/RCTMGLSource.swift +35 -17
- package/ios/RCTMGL-v10/RCTMGLUtils.swift +14 -5
- package/javascript/MGLModule.ts +54 -0
- package/javascript/Mapbox.ts +100 -0
- package/javascript/classes/index.d.ts +20 -1
- package/javascript/components/AbstractLayer.tsx +2 -1
- package/javascript/components/Annotation.tsx +141 -0
- package/javascript/components/BackgroundLayer.tsx +6 -1
- package/javascript/components/{Callout.js → Callout.tsx} +53 -45
- package/javascript/components/CircleLayer.tsx +5 -0
- package/javascript/components/FillExtrusionLayer.tsx +6 -1
- package/javascript/components/FillLayer.tsx +5 -0
- package/javascript/components/HeadingIndicator.tsx +24 -13
- package/javascript/components/HeatmapLayer.tsx +6 -1
- package/javascript/components/ImageSource.tsx +6 -1
- package/javascript/components/Images.tsx +58 -6
- package/javascript/components/LineLayer.tsx +5 -0
- package/javascript/components/MapView.tsx +1 -1
- package/javascript/components/MarkerView.tsx +3 -2
- package/javascript/components/PointAnnotation.tsx +11 -6
- package/javascript/components/RasterDemSource.tsx +5 -0
- package/javascript/components/RasterLayer.tsx +6 -1
- package/javascript/components/RasterSource.tsx +5 -0
- package/javascript/components/ShapeSource.tsx +6 -1
- package/javascript/components/SkyLayer.tsx +5 -0
- package/javascript/components/{Style.js → Style.tsx} +117 -35
- package/javascript/components/SymbolLayer.tsx +6 -1
- package/javascript/components/Terrain.tsx +8 -7
- package/javascript/components/{UserLocation.js → UserLocation.tsx} +106 -95
- package/javascript/components/VectorSource.tsx +6 -1
- package/javascript/index.ts +4 -0
- package/javascript/modules/offline/offlineManager.ts +5 -1
- package/javascript/modules/snapshot/snapshotManager.ts +1 -0
- package/javascript/types/BaseProps.ts +1 -0
- package/javascript/types/Position.ts +1 -0
- package/javascript/utils/Logger.ts +1 -1
- package/javascript/utils/geoUtils.ts +0 -35
- package/javascript/utils/index.ts +0 -8
- package/javascript/utils/styleMap.ts +0 -1598
- package/lib/commonjs/MGLModule.js +37 -0
- package/lib/commonjs/MGLModule.js.map +1 -0
- package/lib/commonjs/Mapbox.js +379 -0
- package/lib/commonjs/Mapbox.js.map +1 -0
- package/lib/commonjs/classes/index.d.js +2 -0
- package/lib/commonjs/classes/index.d.js.map +1 -1
- package/lib/commonjs/components/AbstractLayer.js +1 -2
- package/lib/commonjs/components/AbstractLayer.js.map +1 -1
- package/lib/commonjs/components/{annotations/Annotation.js → Annotation.js} +26 -27
- package/lib/commonjs/components/Annotation.js.map +1 -0
- package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
- package/lib/commonjs/components/Callout.js +7 -33
- package/lib/commonjs/components/Callout.js.map +1 -1
- package/lib/commonjs/components/CircleLayer.js.map +1 -1
- package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
- package/lib/commonjs/components/FillLayer.js.map +1 -1
- package/lib/commonjs/components/HeadingIndicator.js +12 -3
- package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
- package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
- package/lib/commonjs/components/ImageSource.js.map +1 -1
- package/lib/commonjs/components/Images.js +17 -1
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/LineLayer.js.map +1 -1
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/MarkerView.js.map +1 -1
- package/lib/commonjs/components/PointAnnotation.js.map +1 -1
- package/lib/commonjs/components/RasterDemSource.js.map +1 -1
- package/lib/commonjs/components/RasterLayer.js.map +1 -1
- package/lib/commonjs/components/RasterSource.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/SkyLayer.js.map +1 -1
- package/lib/commonjs/components/Style.js +11 -15
- package/lib/commonjs/components/Style.js.map +1 -1
- package/lib/commonjs/components/SymbolLayer.js.map +1 -1
- package/lib/commonjs/components/Terrain.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +28 -78
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/index.js +16 -339
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/offline/offlineManager.js +6 -0
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
- package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -1
- package/lib/commonjs/types/Position.js +2 -0
- package/lib/commonjs/types/Position.js.map +1 -0
- package/lib/commonjs/utils/animated/Animated.js.map +1 -1
- package/lib/commonjs/utils/geoUtils.js +1 -19
- package/lib/commonjs/utils/geoUtils.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -16
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/styleMap.js +1 -1217
- package/lib/commonjs/utils/styleMap.js.map +1 -1
- package/lib/module/MGLModule.js +19 -0
- package/lib/module/MGLModule.js.map +1 -0
- package/lib/module/Mapbox.js +59 -0
- package/lib/module/Mapbox.js.map +1 -0
- package/lib/module/classes/index.d.js +2 -0
- package/lib/module/classes/index.d.js.map +1 -1
- package/lib/module/components/AbstractLayer.js +1 -1
- package/lib/module/components/AbstractLayer.js.map +1 -1
- package/lib/module/components/{annotations/Annotation.js → Annotation.js} +26 -27
- package/lib/module/components/Annotation.js.map +1 -0
- package/lib/module/components/BackgroundLayer.js.map +1 -1
- package/lib/module/components/Callout.js +7 -33
- package/lib/module/components/Callout.js.map +1 -1
- package/lib/module/components/CircleLayer.js.map +1 -1
- package/lib/module/components/FillExtrusionLayer.js.map +1 -1
- package/lib/module/components/FillLayer.js.map +1 -1
- package/lib/module/components/HeadingIndicator.js +12 -3
- package/lib/module/components/HeadingIndicator.js.map +1 -1
- package/lib/module/components/HeatmapLayer.js.map +1 -1
- package/lib/module/components/ImageSource.js.map +1 -1
- package/lib/module/components/Images.js +17 -1
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/LineLayer.js.map +1 -1
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/MarkerView.js.map +1 -1
- package/lib/module/components/PointAnnotation.js.map +1 -1
- package/lib/module/components/RasterDemSource.js.map +1 -1
- package/lib/module/components/RasterLayer.js.map +1 -1
- package/lib/module/components/RasterSource.js.map +1 -1
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/SkyLayer.js.map +1 -1
- package/lib/module/components/Style.js +11 -15
- package/lib/module/components/Style.js.map +1 -1
- package/lib/module/components/SymbolLayer.js.map +1 -1
- package/lib/module/components/Terrain.js.map +1 -1
- package/lib/module/components/UserLocation.js +27 -77
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/index.js +3 -108
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/offline/offlineManager.js +1 -0
- package/lib/module/modules/offline/offlineManager.js.map +1 -1
- package/lib/module/modules/snapshot/snapshotManager.js.map +1 -1
- package/lib/module/types/Position.js +2 -0
- package/lib/module/types/Position.js.map +1 -0
- package/lib/module/utils/animated/Animated.js.map +1 -1
- package/lib/module/utils/geoUtils.js +0 -16
- package/lib/module/utils/geoUtils.js.map +1 -1
- package/lib/module/utils/index.js +0 -14
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/styleMap.js +0 -1201
- package/lib/module/utils/styleMap.js.map +1 -1
- package/lib/typescript/MGLModule.d.ts +22 -0
- package/lib/typescript/MGLModule.d.ts.map +1 -0
- package/lib/typescript/Mapbox.d.ts +54 -0
- package/lib/typescript/Mapbox.d.ts.map +1 -0
- package/lib/typescript/components/AbstractLayer.d.ts +1 -0
- package/lib/typescript/components/AbstractLayer.d.ts.map +1 -1
- package/lib/typescript/components/Annotation.d.ts +34 -0
- package/lib/typescript/components/Annotation.d.ts.map +1 -0
- package/lib/typescript/components/BackgroundLayer.d.ts +5 -1
- package/lib/typescript/components/BackgroundLayer.d.ts.map +1 -1
- package/lib/typescript/components/Callout.d.ts +41 -0
- package/lib/typescript/components/Callout.d.ts.map +1 -0
- package/lib/typescript/components/CircleLayer.d.ts +4 -0
- package/lib/typescript/components/CircleLayer.d.ts.map +1 -1
- package/lib/typescript/components/FillExtrusionLayer.d.ts +5 -1
- package/lib/typescript/components/FillExtrusionLayer.d.ts.map +1 -1
- package/lib/typescript/components/FillLayer.d.ts +4 -0
- package/lib/typescript/components/FillLayer.d.ts.map +1 -1
- package/lib/typescript/components/HeadingIndicator.d.ts +2 -1
- package/lib/typescript/components/HeadingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HeatmapLayer.d.ts +5 -1
- package/lib/typescript/components/HeatmapLayer.d.ts.map +1 -1
- package/lib/typescript/components/ImageSource.d.ts +5 -1
- package/lib/typescript/components/ImageSource.d.ts.map +1 -1
- package/lib/typescript/components/Images.d.ts +24 -2
- package/lib/typescript/components/Images.d.ts.map +1 -1
- package/lib/typescript/components/LineLayer.d.ts +4 -0
- package/lib/typescript/components/LineLayer.d.ts.map +1 -1
- package/lib/typescript/components/MapView.d.ts +2 -5
- package/lib/typescript/components/MapView.d.ts.map +1 -1
- package/lib/typescript/components/MarkerView.d.ts +3 -2
- package/lib/typescript/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/components/PointAnnotation.d.ts +8 -6
- package/lib/typescript/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/components/RasterDemSource.d.ts +4 -0
- package/lib/typescript/components/RasterDemSource.d.ts.map +1 -1
- package/lib/typescript/components/RasterLayer.d.ts +5 -1
- package/lib/typescript/components/RasterLayer.d.ts.map +1 -1
- package/lib/typescript/components/RasterSource.d.ts +4 -0
- package/lib/typescript/components/RasterSource.d.ts.map +1 -1
- package/lib/typescript/components/ShapeSource.d.ts +5 -1
- package/lib/typescript/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/components/SkyLayer.d.ts +4 -0
- package/lib/typescript/components/SkyLayer.d.ts.map +1 -1
- package/lib/typescript/components/Style.d.ts +74 -0
- package/lib/typescript/components/Style.d.ts.map +1 -0
- package/lib/typescript/components/SymbolLayer.d.ts +5 -1
- package/lib/typescript/components/SymbolLayer.d.ts.map +1 -1
- package/lib/typescript/components/Terrain.d.ts +2 -2
- package/lib/typescript/components/Terrain.d.ts.map +1 -1
- package/lib/typescript/components/UserLocation.d.ts +102 -0
- package/lib/typescript/components/UserLocation.d.ts.map +1 -0
- package/lib/typescript/components/VectorSource.d.ts +5 -1
- package/lib/typescript/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/modules/offline/offlineManager.d.ts +2 -1
- package/lib/typescript/modules/offline/offlineManager.d.ts.map +1 -1
- package/lib/typescript/modules/snapshot/snapshotManager.d.ts +1 -0
- package/lib/typescript/modules/snapshot/snapshotManager.d.ts.map +1 -1
- package/lib/typescript/types/BaseProps.d.ts +1 -0
- package/lib/typescript/types/BaseProps.d.ts.map +1 -1
- package/lib/typescript/types/Position.d.ts +2 -0
- package/lib/typescript/types/Position.d.ts.map +1 -0
- package/lib/typescript/utils/Logger.d.ts +1 -1
- package/lib/typescript/utils/Logger.d.ts.map +1 -1
- package/lib/typescript/utils/animated/Animated.d.ts +23 -0
- package/lib/typescript/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/utils/geoUtils.d.ts +0 -8
- package/lib/typescript/utils/geoUtils.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +0 -14
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/styleMap.d.ts +0 -1406
- package/lib/typescript/utils/styleMap.d.ts.map +1 -1
- package/package.json +35 -39
- package/plugin/build/withMapbox.d.ts +10 -6
- package/plugin/build/withMapbox.js +119 -137
- package/plugin/install.md +21 -0
- package/plugin/src/withMapbox.ts +166 -138
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayer.java +0 -23
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayerManager.java +0 -60
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayer.java +0 -53
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayerManager.java +0 -73
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayer.java +0 -51
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayerManager.java +0 -76
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayer.java +0 -51
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayerManager.java +0 -77
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayer.java +0 -51
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayerManager.java +0 -73
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayer.java +0 -51
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayerManager.java +0 -75
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayer.java +0 -24
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayerManager.java +0 -60
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSkyLayerManager.java +0 -73
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayer.java +0 -51
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayerManager.java +0 -71
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSource.java +0 -76
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSourceManager.java +0 -68
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSource.java +0 -122
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSourceManager.java +0 -64
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSource.java +0 -43
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSourceManager.java +0 -39
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSource.java +0 -103
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSourceManager.java +0 -80
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSource.java +0 -100
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSourceManager.java +0 -80
- package/index.d.ts +0 -516
- package/javascript/components/annotations/Annotation.js +0 -122
- package/javascript/index.js +0 -162
- package/lib/commonjs/components/annotations/Annotation.js.map +0 -1
- package/lib/module/components/annotations/Annotation.js.map +0 -1
- /package/javascript/utils/animated/{Animated.js → Animated.ts} +0 -0
package/README.md
CHANGED
|
@@ -147,15 +147,15 @@ npm run android
|
|
|
147
147
|
```js
|
|
148
148
|
import React from 'react';
|
|
149
149
|
import { StyleSheet, View } from 'react-native';
|
|
150
|
-
import
|
|
150
|
+
import Mapbox from '@rnmapbox/maps';
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Mapbox.setAccessToken('<YOUR_ACCESSTOKEN>');
|
|
153
153
|
|
|
154
154
|
const App = () => {
|
|
155
155
|
return (
|
|
156
156
|
<View style={styles.page}>
|
|
157
157
|
<View style={styles.container}>
|
|
158
|
-
<
|
|
158
|
+
<Mapbox.MapView style={styles.map} />
|
|
159
159
|
</View>
|
|
160
160
|
</View>
|
|
161
161
|
);
|
package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/images/RCTMGLImagesManager.kt
CHANGED
|
@@ -63,9 +63,9 @@ class RCTMGLImagesManager(private val mContext: ReactApplicationContext) :
|
|
|
63
63
|
val drawable =
|
|
64
64
|
ResourceUtils.getDrawableByName(mContext, resourceName) as BitmapDrawable
|
|
65
65
|
if (drawable != null) {
|
|
66
|
-
return NativeImage(
|
|
66
|
+
return NativeImage(resourceName, drawable)
|
|
67
67
|
} else {
|
|
68
|
-
Logger.e("RCTMGLImages", "cound not get native drawable with name: $
|
|
68
|
+
Logger.e("RCTMGLImages", "cound not get native drawable with name: $resourceName")
|
|
69
69
|
return null
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -98,10 +98,10 @@ class RCTMGLImagesManager(private val mContext: ReactApplicationContext) :
|
|
|
98
98
|
}
|
|
99
99
|
val drawable =
|
|
100
100
|
ResourceUtils.getDrawableByName(mContext, resourceName) as BitmapDrawable
|
|
101
|
-
if (drawable != null) {
|
|
102
|
-
return NativeImage(
|
|
101
|
+
if (drawable != null && resourceName != null) {
|
|
102
|
+
return NativeImage(resourceName, drawable, scale, sdf, stretchX, stretchY)
|
|
103
103
|
} else {
|
|
104
|
-
Logger.e("RCTMGLImages", "cound not get native drawable with name: $
|
|
104
|
+
Logger.e("RCTMGLImages", "cound not get native drawable with name: $resourceName")
|
|
105
105
|
return null
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -5,6 +5,7 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
5
5
|
import com.mapbox.maps.MapboxMap
|
|
6
6
|
import com.mapbox.rctmgl.utils.ImageEntry
|
|
7
7
|
import com.mapbox.rctmgl.utils.DownloadMapImageTask
|
|
8
|
+
import com.mapbox.rctmgl.utils.Logger
|
|
8
9
|
import java.util.AbstractMap
|
|
9
10
|
import java.util.ArrayList
|
|
10
11
|
|
|
@@ -39,11 +40,12 @@ class RCTMGLStyle(private val mContext: Context, reactStyle: ReadableMap?, map:
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
@JvmOverloads
|
|
42
|
-
fun addImage(styleValue: RCTMGLStyleValue, callback: DownloadMapImageTask.OnAllImagesLoaded? = null) {
|
|
43
|
+
fun addImage(styleValue: RCTMGLStyleValue, styleKey: String, callback: DownloadMapImageTask.OnAllImagesLoaded? = null) {
|
|
43
44
|
if (!styleValue.shouldAddImage()) {
|
|
44
45
|
callback?.onAllImagesLoaded()
|
|
45
46
|
return
|
|
46
47
|
}
|
|
48
|
+
Logger.w(LOG_TAG,"Deprecated: Image in style is deprecated, use images component instead. key: $styleKey [image-in-style-deprecated]")
|
|
47
49
|
val uriStr = styleValue.imageURI
|
|
48
50
|
val images = arrayOf<Map.Entry<String, ImageEntry>>(
|
|
49
51
|
AbstractMap.SimpleEntry<String, ImageEntry>(
|
|
@@ -59,4 +61,8 @@ class RCTMGLStyle(private val mContext: Context, reactStyle: ReadableMap?, map:
|
|
|
59
61
|
mReactStyle = reactStyle
|
|
60
62
|
mMap = map
|
|
61
63
|
}
|
|
64
|
+
|
|
65
|
+
companion object {
|
|
66
|
+
const val LOG_TAG = "RCTMGLStyle"
|
|
67
|
+
}
|
|
62
68
|
}
|
package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java
CHANGED
|
@@ -80,7 +80,7 @@ public class RCTMGLStyleFactory {
|
|
|
80
80
|
RCTMGLStyleFactory.setFillTranslateAnchor(layer, styleValue);
|
|
81
81
|
break;
|
|
82
82
|
case "fillPattern":
|
|
83
|
-
style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
83
|
+
style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
84
84
|
@Override
|
|
85
85
|
public void onAllImagesLoaded() {
|
|
86
86
|
try {
|
|
@@ -172,7 +172,7 @@ public class RCTMGLStyleFactory {
|
|
|
172
172
|
RCTMGLStyleFactory.setLineDasharray(layer, styleValue);
|
|
173
173
|
break;
|
|
174
174
|
case "linePattern":
|
|
175
|
-
style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
175
|
+
style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
176
176
|
@Override
|
|
177
177
|
public void onAllImagesLoaded() {
|
|
178
178
|
try {
|
|
@@ -240,7 +240,7 @@ public class RCTMGLStyleFactory {
|
|
|
240
240
|
RCTMGLStyleFactory.setIconTextFitPadding(layer, styleValue);
|
|
241
241
|
break;
|
|
242
242
|
case "iconImage":
|
|
243
|
-
style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
243
|
+
style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
244
244
|
@Override
|
|
245
245
|
public void onAllImagesLoaded() {
|
|
246
246
|
try {
|
|
@@ -573,7 +573,7 @@ public class RCTMGLStyleFactory {
|
|
|
573
573
|
RCTMGLStyleFactory.setFillExtrusionTranslateAnchor(layer, styleValue);
|
|
574
574
|
break;
|
|
575
575
|
case "fillExtrusionPattern":
|
|
576
|
-
style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
576
|
+
style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
577
577
|
@Override
|
|
578
578
|
public void onAllImagesLoaded() {
|
|
579
579
|
try {
|
|
@@ -729,7 +729,7 @@ public class RCTMGLStyleFactory {
|
|
|
729
729
|
RCTMGLStyleFactory.setBackgroundColorTransition(layer, styleValue);
|
|
730
730
|
break;
|
|
731
731
|
case "backgroundPattern":
|
|
732
|
-
style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
732
|
+
style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
|
|
733
733
|
@Override
|
|
734
734
|
public void onAllImagesLoaded() {
|
|
735
735
|
try {
|
package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt
CHANGED
|
@@ -17,6 +17,7 @@ import com.mapbox.maps.extension.style.expressions.generated.Expression
|
|
|
17
17
|
import com.mapbox.maps.extension.style.layers.*
|
|
18
18
|
import com.mapbox.maps.extension.style.layers.properties.generated.Visibility
|
|
19
19
|
import com.mapbox.rctmgl.components.styles.layers.RCTLayer
|
|
20
|
+
import com.mapbox.rctmgl.components.styles.sources.RCTSource
|
|
20
21
|
import com.mapbox.rctmgl.modules.RCTMGLLogging
|
|
21
22
|
import com.mapbox.rctmgl.utils.ExpressionParser
|
|
22
23
|
import java.lang.ClassCastException
|
|
@@ -43,10 +44,19 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
43
44
|
protected var mLayer: T? = null
|
|
44
45
|
protected var mHadFilter = false
|
|
45
46
|
|
|
47
|
+
protected var mExisting : Boolean? = null
|
|
48
|
+
|
|
46
49
|
fun setSourceID(sourceID: String?) {
|
|
47
50
|
mSourceID = sourceID
|
|
48
51
|
}
|
|
49
52
|
|
|
53
|
+
fun checkID(): String? {
|
|
54
|
+
if (iD == null) {
|
|
55
|
+
Logger.w(LOG_TAG, "iD is null in layer")
|
|
56
|
+
}
|
|
57
|
+
return iD;
|
|
58
|
+
}
|
|
59
|
+
|
|
50
60
|
fun setAboveLayerID(aboveLayerID: String?) {
|
|
51
61
|
if (mAboveLayerID != null && mAboveLayerID == aboveLayerID) {
|
|
52
62
|
return
|
|
@@ -76,7 +86,7 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
76
86
|
mLayerIndex = layerIndex
|
|
77
87
|
if (mLayer != null) {
|
|
78
88
|
removeFromMap(mMapView!!)
|
|
79
|
-
addAtIndex(
|
|
89
|
+
addAtIndex(layerIndex)
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
92
|
|
|
@@ -121,6 +131,10 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
121
131
|
}
|
|
122
132
|
}
|
|
123
133
|
|
|
134
|
+
fun setExisting(existing: Boolean) {
|
|
135
|
+
mExisting = existing
|
|
136
|
+
}
|
|
137
|
+
|
|
124
138
|
fun add() {
|
|
125
139
|
if (!hasInitialized()) {
|
|
126
140
|
return
|
|
@@ -175,7 +189,7 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
175
189
|
if (!hasInitialized()) {
|
|
176
190
|
return
|
|
177
191
|
}
|
|
178
|
-
|
|
192
|
+
val style = this.style ?: return
|
|
179
193
|
val layerSize = style!!.styleLayers.size
|
|
180
194
|
if (index >= layerSize) {
|
|
181
195
|
FLog.e(
|
|
@@ -184,13 +198,16 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
184
198
|
)
|
|
185
199
|
index = layerSize - 1
|
|
186
200
|
}
|
|
187
|
-
|
|
188
|
-
mMapView
|
|
201
|
+
val layer = mLayer ?: return
|
|
202
|
+
val mapView = mMapView ?: return
|
|
203
|
+
style.addLayerAt(layer, index)
|
|
204
|
+
mapView.layerAdded(layer)
|
|
189
205
|
}
|
|
190
206
|
|
|
191
207
|
protected fun insertLayer() {
|
|
192
|
-
|
|
193
|
-
|
|
208
|
+
val style = this.style ?: return
|
|
209
|
+
val id = checkID() ?: return
|
|
210
|
+
if (style.styleLayerExists(id)) {
|
|
194
211
|
return // prevent adding a layer twice
|
|
195
212
|
}
|
|
196
213
|
if (mAboveLayerID != null) {
|
|
@@ -218,8 +235,8 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
218
235
|
// override if you want to update the filter
|
|
219
236
|
}
|
|
220
237
|
|
|
221
|
-
private fun getLayerAs(style: Style
|
|
222
|
-
val result = style
|
|
238
|
+
private fun getLayerAs(style: Style, id: String?): T? {
|
|
239
|
+
val result = style.getLayer(iD!!)
|
|
223
240
|
return try {
|
|
224
241
|
result as T?
|
|
225
242
|
} catch (exception: ClassCastException) {
|
|
@@ -230,14 +247,24 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
230
247
|
override fun addToMap(mapView: RCTMGLMapView) {
|
|
231
248
|
super.addToMap(mapView)
|
|
232
249
|
mMap = mapView.getMapboxMap()
|
|
233
|
-
|
|
234
|
-
val
|
|
250
|
+
val style = style ?: return
|
|
251
|
+
val id = checkID() ?: return
|
|
252
|
+
|
|
253
|
+
val exists = style.styleLayerExists(id)
|
|
254
|
+
var existingLayer: T? = null;
|
|
255
|
+
if (exists) {
|
|
256
|
+
if (mExisting == null) {
|
|
257
|
+
Logger.e(LOG_TAG, "Layer $id seems to refer to an existing layer but existing flag is not specified, this is deprecated")
|
|
258
|
+
}
|
|
259
|
+
existingLayer = getLayerAs(style, id)
|
|
260
|
+
}
|
|
235
261
|
if (existingLayer != null) {
|
|
236
262
|
mLayer = existingLayer
|
|
237
263
|
} else {
|
|
238
264
|
mLayer = makeLayer()
|
|
239
265
|
insertLayer()
|
|
240
266
|
}
|
|
267
|
+
|
|
241
268
|
addStyles()
|
|
242
269
|
if (mFilter != null) {
|
|
243
270
|
mHadFilter = true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import com.mapbox.maps.extension.style.layers.generated.BackgroundLayer
|
|
5
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyle
|
|
6
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
|
|
7
|
+
|
|
8
|
+
class RCTMGLBackgroundLayer(context: Context?) : RCTLayer<BackgroundLayer?>(
|
|
9
|
+
context!!
|
|
10
|
+
) {
|
|
11
|
+
override fun makeLayer(): BackgroundLayer {
|
|
12
|
+
return BackgroundLayer(iD!!)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
override fun addStyles() {
|
|
16
|
+
RCTMGLStyleFactory.setBackgroundLayerStyle(
|
|
17
|
+
mLayer,
|
|
18
|
+
RCTMGLStyle(context, mReactStyle, mMap!!)
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableMap
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
5
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
6
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
7
|
+
|
|
8
|
+
class RCTMGLBackgroundLayerManager : ViewGroupManager<RCTMGLBackgroundLayer>() {
|
|
9
|
+
override fun getName(): String {
|
|
10
|
+
return REACT_CLASS
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLBackgroundLayer {
|
|
14
|
+
return RCTMGLBackgroundLayer(reactContext)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@ReactProp(name = "id")
|
|
18
|
+
fun setId(layer: RCTMGLBackgroundLayer, id: String?) {
|
|
19
|
+
layer.iD = id
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@ReactProp(name = "existing")
|
|
23
|
+
fun setExisting(layer: RCTMGLBackgroundLayer, existing: Boolean) {
|
|
24
|
+
layer.setExisting(existing)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@ReactProp(name = "sourceID")
|
|
28
|
+
fun setSourceID(layer: RCTMGLBackgroundLayer, sourceID: String?) {
|
|
29
|
+
layer.setSourceID(sourceID)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@ReactProp(name = "aboveLayerID")
|
|
33
|
+
fun setAboveLayerID(layer: RCTMGLBackgroundLayer, aboveLayerID: String?) {
|
|
34
|
+
layer.setAboveLayerID(aboveLayerID)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@ReactProp(name = "belowLayerID")
|
|
38
|
+
fun setBelowLayerID(layer: RCTMGLBackgroundLayer, belowLayerID: String?) {
|
|
39
|
+
layer.setBelowLayerID(belowLayerID)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ReactProp(name = "layerIndex")
|
|
43
|
+
fun setLayerIndex(layer: RCTMGLBackgroundLayer, layerIndex: Int) {
|
|
44
|
+
layer.setLayerIndex(layerIndex)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ReactProp(name = "minZoomLevel")
|
|
48
|
+
fun setMinZoomLevel(layer: RCTMGLBackgroundLayer, minZoomLevel: Double) {
|
|
49
|
+
layer.setMinZoomLevel(minZoomLevel)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@ReactProp(name = "maxZoomLevel")
|
|
53
|
+
fun setMaxZoomLevel(layer: RCTMGLBackgroundLayer, maxZoomLevel: Double) {
|
|
54
|
+
layer.setMaxZoomLevel(maxZoomLevel)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@ReactProp(name = "reactStyle")
|
|
58
|
+
fun setReactStyle(layer: RCTMGLBackgroundLayer, style: ReadableMap?) {
|
|
59
|
+
layer.setReactStyle(style)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
companion object {
|
|
63
|
+
const val REACT_CLASS = "RCTMGLBackgroundLayer"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import com.mapbox.maps.extension.style.expressions.generated.Expression
|
|
5
|
+
import com.mapbox.maps.extension.style.layers.generated.CircleLayer
|
|
6
|
+
import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
|
|
7
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyle
|
|
8
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
|
|
9
|
+
|
|
10
|
+
class RCTMGLCircleLayer(context: Context?) : RCTLayer<CircleLayer?>(
|
|
11
|
+
context!!
|
|
12
|
+
) {
|
|
13
|
+
private var mSourceLayerID: String? = null
|
|
14
|
+
override fun updateFilter(expression: Expression?) {
|
|
15
|
+
mLayer!!.filter(expression!!)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override fun addToMap(mapView: RCTMGLMapView) {
|
|
19
|
+
super.addToMap(mapView)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override fun makeLayer(): CircleLayer {
|
|
23
|
+
val layer = CircleLayer(iD!!, mSourceID!!)
|
|
24
|
+
if (mSourceLayerID != null) {
|
|
25
|
+
layer.sourceLayer(mSourceLayerID!!)
|
|
26
|
+
}
|
|
27
|
+
return layer
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun addStyles() {
|
|
31
|
+
RCTMGLStyleFactory.setCircleLayerStyle(mLayer, RCTMGLStyle(context, mReactStyle, mMap!!))
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun setSourceLayerID(sourceLayerID: String?) {
|
|
35
|
+
mSourceLayerID = sourceLayerID
|
|
36
|
+
if (mLayer != null) {
|
|
37
|
+
mLayer!!.sourceLayer(sourceLayerID!!)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
+
|
|
9
|
+
class RCTMGLCircleLayerManager : ViewGroupManager<RCTMGLCircleLayer>() {
|
|
10
|
+
override fun getName(): String {
|
|
11
|
+
return REACT_CLASS
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLCircleLayer {
|
|
15
|
+
return RCTMGLCircleLayer(reactContext)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactProp(name = "id")
|
|
19
|
+
fun setId(layer: RCTMGLCircleLayer, id: String?) {
|
|
20
|
+
layer.iD = id
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ReactProp(name = "existing")
|
|
24
|
+
fun setExisting(layer: RCTMGLCircleLayer, existing: Boolean) {
|
|
25
|
+
layer.setExisting(existing)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ReactProp(name = "sourceID")
|
|
29
|
+
fun setSourceID(layer: RCTMGLCircleLayer, sourceID: String?) {
|
|
30
|
+
layer.setSourceID(sourceID)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@ReactProp(name = "aboveLayerID")
|
|
34
|
+
fun setAboveLayerID(layer: RCTMGLCircleLayer, aboveLayerID: String?) {
|
|
35
|
+
layer.setAboveLayerID(aboveLayerID)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@ReactProp(name = "belowLayerID")
|
|
39
|
+
fun setBelowLayerID(layer: RCTMGLCircleLayer, belowLayerID: String?) {
|
|
40
|
+
layer.setBelowLayerID(belowLayerID)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactProp(name = "layerIndex")
|
|
44
|
+
fun setLayerIndex(layer: RCTMGLCircleLayer, layerIndex: Int) {
|
|
45
|
+
layer.setLayerIndex(layerIndex)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ReactProp(name = "minZoomLevel")
|
|
49
|
+
fun setMinZoomLevel(layer: RCTMGLCircleLayer, minZoomLevel: Double) {
|
|
50
|
+
layer.setMinZoomLevel(minZoomLevel)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ReactProp(name = "maxZoomLevel")
|
|
54
|
+
fun setMaxZoomLevel(layer: RCTMGLCircleLayer, maxZoomLevel: Double) {
|
|
55
|
+
layer.setMaxZoomLevel(maxZoomLevel)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactProp(name = "reactStyle")
|
|
59
|
+
fun setReactStyle(layer: RCTMGLCircleLayer, style: ReadableMap?) {
|
|
60
|
+
layer.setReactStyle(style)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@ReactProp(name = "sourceLayerID")
|
|
64
|
+
fun setSourceLayerId(layer: RCTMGLCircleLayer, sourceLayerID: String?) {
|
|
65
|
+
layer.setSourceLayerID(sourceLayerID)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@ReactProp(name = "filter")
|
|
69
|
+
fun setFilter(layer: RCTMGLCircleLayer, filterList: ReadableArray?) {
|
|
70
|
+
layer.setFilter(filterList)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
companion object {
|
|
74
|
+
const val REACT_CLASS = "RCTMGLCircleLayer"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import com.mapbox.maps.extension.style.expressions.generated.Expression
|
|
5
|
+
import com.mapbox.maps.extension.style.layers.generated.FillExtrusionLayer
|
|
6
|
+
import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
|
|
7
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyle
|
|
8
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
|
|
9
|
+
|
|
10
|
+
class RCTMGLFillExtrusionLayer(context: Context?) : RCTLayer<FillExtrusionLayer?>(
|
|
11
|
+
context!!
|
|
12
|
+
) {
|
|
13
|
+
private var mSourceLayerID: String? = null
|
|
14
|
+
override fun updateFilter(expression: Expression?) {
|
|
15
|
+
mLayer!!.filter(expression!!)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override fun addToMap(mapView: RCTMGLMapView) {
|
|
19
|
+
super.addToMap(mapView)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override fun makeLayer(): FillExtrusionLayer {
|
|
23
|
+
val layer = FillExtrusionLayer(iD!!, mSourceID!!)
|
|
24
|
+
if (mSourceLayerID != null) {
|
|
25
|
+
layer.sourceLayer(mSourceLayerID!!)
|
|
26
|
+
}
|
|
27
|
+
return layer
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun addStyles() {
|
|
31
|
+
RCTMGLStyleFactory.setFillExtrusionLayerStyle(
|
|
32
|
+
mLayer,
|
|
33
|
+
RCTMGLStyle(context, mReactStyle, mMap!!)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
fun setSourceLayerID(sourceLayerID: String?) {
|
|
38
|
+
mSourceLayerID = sourceLayerID
|
|
39
|
+
if (mLayer != null) {
|
|
40
|
+
mLayer!!.sourceLayer(mSourceLayerID!!)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
+
|
|
9
|
+
class RCTMGLFillExtrusionLayerManager : ViewGroupManager<RCTMGLFillExtrusionLayer>() {
|
|
10
|
+
override fun getName(): String {
|
|
11
|
+
return REACT_CLASS
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLFillExtrusionLayer {
|
|
15
|
+
return RCTMGLFillExtrusionLayer(reactContext)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactProp(name = "id")
|
|
19
|
+
fun setId(layer: RCTMGLFillExtrusionLayer, id: String?) {
|
|
20
|
+
layer.iD = id
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ReactProp(name = "existing")
|
|
24
|
+
fun setExisting(layer: RCTMGLFillExtrusionLayer, existing: Boolean) {
|
|
25
|
+
layer.setExisting(existing)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ReactProp(name = "sourceID")
|
|
29
|
+
fun setSourceID(layer: RCTMGLFillExtrusionLayer, sourceID: String?) {
|
|
30
|
+
layer.setSourceID(sourceID)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@ReactProp(name = "aboveLayerID")
|
|
34
|
+
fun setAboveLayerID(layer: RCTMGLFillExtrusionLayer, aboveLayerID: String?) {
|
|
35
|
+
layer.setAboveLayerID(aboveLayerID)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@ReactProp(name = "belowLayerID")
|
|
39
|
+
fun setBelowLayerID(layer: RCTMGLFillExtrusionLayer, belowLayerID: String?) {
|
|
40
|
+
layer.setBelowLayerID(belowLayerID)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactProp(name = "layerIndex")
|
|
44
|
+
fun setLayerIndex(layer: RCTMGLFillExtrusionLayer, layerIndex: Int) {
|
|
45
|
+
layer.setLayerIndex(layerIndex)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ReactProp(name = "minZoomLevel")
|
|
49
|
+
fun setMinZoomLevel(layer: RCTMGLFillExtrusionLayer, minZoomLevel: Double) {
|
|
50
|
+
layer.setMinZoomLevel(minZoomLevel)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ReactProp(name = "maxZoomLevel")
|
|
54
|
+
fun setMaxZoomLevel(layer: RCTMGLFillExtrusionLayer, maxZoomLevel: Double) {
|
|
55
|
+
layer.setMaxZoomLevel(maxZoomLevel)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactProp(name = "reactStyle")
|
|
59
|
+
fun setReactStyle(layer: RCTMGLFillExtrusionLayer, style: ReadableMap?) {
|
|
60
|
+
layer.setReactStyle(style)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@ReactProp(name = "sourceLayerID")
|
|
64
|
+
fun setSourceLayerId(layer: RCTMGLFillExtrusionLayer, sourceLayerID: String?) {
|
|
65
|
+
layer.setSourceLayerID(sourceLayerID)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@ReactProp(name = "filter")
|
|
69
|
+
fun setFilter(layer: RCTMGLFillExtrusionLayer, filterList: ReadableArray?) {
|
|
70
|
+
layer.setFilter(filterList)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
companion object {
|
|
74
|
+
const val REACT_CLASS = "RCTMGLFillExtrusionLayer"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import com.mapbox.maps.extension.style.expressions.generated.Expression
|
|
5
|
+
import com.mapbox.maps.extension.style.layers.generated.FillLayer
|
|
6
|
+
import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
|
|
7
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyle
|
|
8
|
+
import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
|
|
9
|
+
|
|
10
|
+
class RCTMGLFillLayer(context: Context?) : RCTLayer<FillLayer?>(
|
|
11
|
+
context!!
|
|
12
|
+
) {
|
|
13
|
+
private var mSourceLayerID: String? = null
|
|
14
|
+
override fun updateFilter(expression: Expression?) {
|
|
15
|
+
mLayer!!.filter(expression!!)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override fun addToMap(mapView: RCTMGLMapView) {
|
|
19
|
+
super.addToMap(mapView)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override fun makeLayer(): FillLayer {
|
|
23
|
+
val layer = FillLayer(iD!!, mSourceID!!)
|
|
24
|
+
if (mSourceLayerID != null) {
|
|
25
|
+
layer.sourceLayer(mSourceLayerID!!)
|
|
26
|
+
}
|
|
27
|
+
return layer
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun addStyles() {
|
|
31
|
+
RCTMGLStyleFactory.setFillLayerStyle(mLayer, RCTMGLStyle(context, mReactStyle, mMap!!))
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun setSourceLayerID(sourceLayerID: String?) {
|
|
35
|
+
mSourceLayerID = sourceLayerID
|
|
36
|
+
if (mLayer != null) {
|
|
37
|
+
mLayer!!.sourceLayer(mSourceLayerID!!)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
package com.mapbox.rctmgl.components.styles.layers
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
+
|
|
9
|
+
class RCTMGLFillLayerManager : ViewGroupManager<RCTMGLFillLayer>() {
|
|
10
|
+
override fun getName(): String {
|
|
11
|
+
return REACT_CLASS
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLFillLayer {
|
|
15
|
+
return RCTMGLFillLayer(reactContext)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactProp(name = "id")
|
|
19
|
+
fun setId(layer: RCTMGLFillLayer, id: String?) {
|
|
20
|
+
layer.iD = id
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ReactProp(name = "existing")
|
|
24
|
+
fun setExisting(layer: RCTMGLFillLayer, existing: Boolean) {
|
|
25
|
+
layer.setExisting(existing)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ReactProp(name = "sourceID")
|
|
29
|
+
fun setSourceID(layer: RCTMGLFillLayer, sourceID: String?) {
|
|
30
|
+
layer.setSourceID(sourceID)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@ReactProp(name = "sourceLayerID")
|
|
34
|
+
fun setSourceLayerId(layer: RCTMGLFillLayer, sourceLayerID: String?) {
|
|
35
|
+
layer.setSourceLayerID(sourceLayerID)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@ReactProp(name = "aboveLayerID")
|
|
39
|
+
fun setAboveLayerID(layer: RCTMGLFillLayer, aboveLayerID: String?) {
|
|
40
|
+
layer.setAboveLayerID(aboveLayerID)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactProp(name = "belowLayerID")
|
|
44
|
+
fun setBelowLayerID(layer: RCTMGLFillLayer, belowLayerID: String?) {
|
|
45
|
+
layer.setBelowLayerID(belowLayerID)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ReactProp(name = "layerIndex")
|
|
49
|
+
fun setLayerIndex(layer: RCTMGLFillLayer, layerIndex: Int) {
|
|
50
|
+
layer.setLayerIndex(layerIndex)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ReactProp(name = "minZoomLevel")
|
|
54
|
+
fun setMinZoomLevel(layer: RCTMGLFillLayer, minZoomLevel: Double) {
|
|
55
|
+
layer.setMinZoomLevel(minZoomLevel)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactProp(name = "maxZoomLevel")
|
|
59
|
+
fun setMaxZoomLevel(layer: RCTMGLFillLayer, maxZoomLevel: Double) {
|
|
60
|
+
layer.setMaxZoomLevel(maxZoomLevel)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@ReactProp(name = "reactStyle")
|
|
64
|
+
fun setReactStyle(layer: RCTMGLFillLayer, style: ReadableMap?) {
|
|
65
|
+
layer.setReactStyle(style)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@ReactProp(name = "filter")
|
|
69
|
+
fun setFilter(layer: RCTMGLFillLayer, filterList: ReadableArray?) {
|
|
70
|
+
layer.setFilter(filterList)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
companion object {
|
|
74
|
+
const val REACT_CLASS = "RCTMGLFillLayer"
|
|
75
|
+
}
|
|
76
|
+
}
|