@rnmapbox/maps 10.0.0-beta.49 → 10.0.0-beta.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/.gitignore +9 -0
- package/android/.npmignore +9 -0
- package/android/rctmgl/.gitignore +1 -0
- package/android/rctmgl/.npmignore +1 -0
- package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/modules/RCTMGLModule.java +2 -1
- package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/modules/RCTMGLModule.kt +3 -1
- package/index.d.ts +1 -1
- package/ios/RCTMGL/MGLModule.m +2 -1
- package/ios/RCTMGL-v10/MGLModule.m +3 -1
- package/ios/RCTMGL-v10/MGLModule.swift +15 -2
- package/javascript/components/AbstractLayer.tsx +2 -1
- package/javascript/components/Camera.tsx +1 -2
- package/javascript/index.js +2 -2
- package/javascript/requestAndroidLocationPermissions.ts +1 -2
- package/javascript/utils/{MapboxStyles.ts → MapboxStyles.d.ts} +0 -0
- package/javascript/utils/StyleValue.ts +3 -8
- package/lib/commonjs/classes/AnimatedCoordinatesArray.js +165 -0
- package/lib/commonjs/classes/AnimatedCoordinatesArray.js.map +1 -0
- package/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js +44 -0
- package/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js.map +1 -0
- package/lib/commonjs/classes/AnimatedPoint.js +117 -0
- package/lib/commonjs/classes/AnimatedPoint.js.map +1 -0
- package/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js +155 -0
- package/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js.map +1 -0
- package/lib/commonjs/classes/AnimatedShape.js +78 -0
- package/lib/commonjs/classes/AnimatedShape.js.map +1 -0
- package/lib/commonjs/classes/index.d.js +17 -0
- package/lib/commonjs/classes/index.d.js.map +1 -0
- package/lib/commonjs/classes/index.js +61 -0
- package/lib/commonjs/classes/index.js.map +1 -0
- package/lib/commonjs/components/AbstractLayer.js +61 -0
- package/lib/commonjs/components/AbstractLayer.js.map +1 -0
- package/lib/commonjs/components/AbstractSource.js +26 -0
- package/lib/commonjs/components/AbstractSource.js.map +1 -0
- package/lib/commonjs/components/Atmosphere.js +26 -0
- package/lib/commonjs/components/Atmosphere.js.map +1 -0
- package/lib/commonjs/components/BackgroundLayer.js +82 -0
- package/lib/commonjs/components/BackgroundLayer.js.map +1 -0
- package/lib/commonjs/components/Callout.js +119 -0
- package/lib/commonjs/components/Callout.js.map +1 -0
- package/lib/commonjs/components/Camera.js +336 -0
- package/lib/commonjs/components/Camera.js.map +1 -0
- package/lib/commonjs/components/CircleLayer.js +87 -0
- package/lib/commonjs/components/CircleLayer.js.map +1 -0
- package/lib/commonjs/components/FillExtrusionLayer.js +89 -0
- package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -0
- package/lib/commonjs/components/FillLayer.js +89 -0
- package/lib/commonjs/components/FillLayer.js.map +1 -0
- package/lib/commonjs/components/HeadingIndicator.js +33 -0
- package/lib/commonjs/components/HeadingIndicator.js.map +1 -0
- package/lib/commonjs/components/HeatmapLayer.js +90 -0
- package/lib/commonjs/components/HeatmapLayer.js.map +1 -0
- package/lib/commonjs/components/ImageSource.js +66 -0
- package/lib/commonjs/components/ImageSource.js.map +1 -0
- package/lib/commonjs/components/Images.js +98 -0
- package/lib/commonjs/components/Images.js.map +1 -0
- package/lib/commonjs/components/Light.js +51 -0
- package/lib/commonjs/components/Light.js.map +1 -0
- package/lib/commonjs/components/LineLayer.js +89 -0
- package/lib/commonjs/components/LineLayer.js.map +1 -0
- package/lib/commonjs/components/MapView.js +740 -0
- package/lib/commonjs/components/MapView.js.map +1 -0
- package/lib/commonjs/components/MarkerView.js +102 -0
- package/lib/commonjs/components/MarkerView.js.map +1 -0
- package/lib/commonjs/components/NativeBridgeComponent.js +85 -0
- package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -0
- package/lib/commonjs/components/NativeUserLocation.js +41 -0
- package/lib/commonjs/components/NativeUserLocation.js.map +1 -0
- package/lib/commonjs/components/PointAnnotation.js +121 -0
- package/lib/commonjs/components/PointAnnotation.js.map +1 -0
- package/lib/commonjs/components/RasterDemSource.js +95 -0
- package/lib/commonjs/components/RasterDemSource.js.map +1 -0
- package/lib/commonjs/components/RasterLayer.js +85 -0
- package/lib/commonjs/components/RasterLayer.js.map +1 -0
- package/lib/commonjs/components/RasterSource.js +112 -0
- package/lib/commonjs/components/RasterSource.js.map +1 -0
- package/lib/commonjs/components/ShapeSource.js +193 -0
- package/lib/commonjs/components/ShapeSource.js.map +1 -0
- package/lib/commonjs/components/SkyLayer.js +73 -0
- package/lib/commonjs/components/SkyLayer.js.map +1 -0
- package/lib/commonjs/components/Style.js +269 -0
- package/lib/commonjs/components/Style.js.map +1 -0
- package/lib/commonjs/components/SymbolLayer.js +49 -0
- package/lib/commonjs/components/SymbolLayer.js.map +1 -0
- package/lib/commonjs/components/Terrain.js +37 -0
- package/lib/commonjs/components/Terrain.js.map +1 -0
- package/lib/commonjs/components/UserLocation.js +255 -0
- package/lib/commonjs/components/UserLocation.js.map +1 -0
- package/lib/commonjs/components/VectorSource.js +175 -0
- package/lib/commonjs/components/VectorSource.js.map +1 -0
- package/lib/commonjs/components/annotations/Annotation.js +105 -0
- package/lib/commonjs/components/annotations/Annotation.js.map +1 -0
- package/lib/commonjs/global.d.js +2 -0
- package/lib/commonjs/global.d.js.map +1 -0
- package/lib/commonjs/index.js +331 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.web.js +27 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/modules/location/locationManager.js +85 -0
- package/lib/commonjs/modules/location/locationManager.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +45 -0
- package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -0
- package/lib/commonjs/modules/offline/OfflinePack.js +41 -0
- package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -0
- package/lib/commonjs/modules/offline/offlineManager.js +356 -0
- package/lib/commonjs/modules/offline/offlineManager.js.map +1 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js +60 -0
- package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -0
- package/lib/commonjs/modules/snapshot/snapshotManager.js +68 -0
- package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -0
- package/lib/commonjs/requestAndroidLocationPermissions.js +25 -0
- package/lib/commonjs/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/commonjs/types/index.js +6 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/utils/BridgeValue.js +66 -0
- package/lib/commonjs/utils/BridgeValue.js.map +1 -0
- package/lib/commonjs/utils/Logger.js +119 -0
- package/lib/commonjs/utils/Logger.js.map +1 -0
- package/lib/commonjs/utils/MapboxStyles.d.js +183 -0
- package/lib/commonjs/utils/MapboxStyles.d.js.map +1 -0
- package/lib/commonjs/utils/StyleValue.js +41 -0
- package/lib/commonjs/utils/StyleValue.js.map +1 -0
- package/lib/commonjs/utils/animated/Animated.js +33 -0
- package/lib/commonjs/utils/animated/Animated.js.map +1 -0
- package/lib/commonjs/utils/deprecation.js +40 -0
- package/lib/commonjs/utils/deprecation.js.map +1 -0
- package/lib/commonjs/utils/filterUtils.js +13 -0
- package/lib/commonjs/utils/filterUtils.js.map +1 -0
- package/lib/commonjs/utils/geoUtils.d.js +2 -0
- package/lib/commonjs/utils/geoUtils.d.js.map +1 -0
- package/lib/commonjs/utils/geoUtils.js +65 -0
- package/lib/commonjs/utils/geoUtils.js.map +1 -0
- package/lib/commonjs/utils/index.d.js +2 -0
- package/lib/commonjs/utils/index.d.js.map +1 -0
- package/lib/commonjs/utils/index.js +122 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/styleMap.js +1530 -0
- package/lib/commonjs/utils/styleMap.js.map +1 -0
- package/lib/commonjs/web/MapContext.js +12 -0
- package/lib/commonjs/web/MapContext.js.map +1 -0
- package/lib/commonjs/web/MapboxModule.js +21 -0
- package/lib/commonjs/web/MapboxModule.js.map +1 -0
- package/lib/commonjs/web/UnimplementedComponent.js +16 -0
- package/lib/commonjs/web/UnimplementedComponent.js.map +1 -0
- package/lib/commonjs/web/components/Camera.js +48 -0
- package/lib/commonjs/web/components/Camera.js.map +1 -0
- package/lib/commonjs/web/components/MapView.js +67 -0
- package/lib/commonjs/web/components/MapView.js.map +1 -0
- package/lib/commonjs/web/index.js +41 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/commonjs/web/utils/Logger.js +100 -0
- package/lib/commonjs/web/utils/Logger.js.map +1 -0
- package/lib/module/classes/AnimatedCoordinatesArray.js +158 -0
- package/lib/module/classes/AnimatedCoordinatesArray.js.map +1 -0
- package/lib/module/classes/AnimatedExtractCoordinateFromArray.js +37 -0
- package/lib/module/classes/AnimatedExtractCoordinateFromArray.js.map +1 -0
- package/lib/module/classes/AnimatedPoint.js +110 -0
- package/lib/module/classes/AnimatedPoint.js.map +1 -0
- package/lib/module/classes/AnimatedRouteCoordinatesArray.js +148 -0
- package/lib/module/classes/AnimatedRouteCoordinatesArray.js.map +1 -0
- package/lib/module/classes/AnimatedShape.js +71 -0
- package/lib/module/classes/AnimatedShape.js.map +1 -0
- package/lib/module/classes/index.d.js +6 -0
- package/lib/module/classes/index.d.js.map +1 -0
- package/lib/module/classes/index.js +6 -0
- package/lib/module/classes/index.js.map +1 -0
- package/lib/module/components/AbstractLayer.js +54 -0
- package/lib/module/components/AbstractLayer.js.map +1 -0
- package/lib/module/components/AbstractSource.js +18 -0
- package/lib/module/components/AbstractSource.js.map +1 -0
- package/lib/module/components/Atmosphere.js +16 -0
- package/lib/module/components/Atmosphere.js.map +1 -0
- package/lib/module/components/BackgroundLayer.js +73 -0
- package/lib/module/components/BackgroundLayer.js.map +1 -0
- package/lib/module/components/Callout.js +110 -0
- package/lib/module/components/Callout.js.map +1 -0
- package/lib/module/components/Camera.js +326 -0
- package/lib/module/components/Camera.js.map +1 -0
- package/lib/module/components/CircleLayer.js +78 -0
- package/lib/module/components/CircleLayer.js.map +1 -0
- package/lib/module/components/FillExtrusionLayer.js +80 -0
- package/lib/module/components/FillExtrusionLayer.js.map +1 -0
- package/lib/module/components/FillLayer.js +80 -0
- package/lib/module/components/FillLayer.js.map +1 -0
- package/lib/module/components/HeadingIndicator.js +25 -0
- package/lib/module/components/HeadingIndicator.js.map +1 -0
- package/lib/module/components/HeatmapLayer.js +81 -0
- package/lib/module/components/HeatmapLayer.js.map +1 -0
- package/lib/module/components/ImageSource.js +57 -0
- package/lib/module/components/ImageSource.js.map +1 -0
- package/lib/module/components/Images.js +89 -0
- package/lib/module/components/Images.js.map +1 -0
- package/lib/module/components/Light.js +42 -0
- package/lib/module/components/Light.js.map +1 -0
- package/lib/module/components/LineLayer.js +80 -0
- package/lib/module/components/LineLayer.js.map +1 -0
- package/lib/module/components/MapView.js +730 -0
- package/lib/module/components/MapView.js.map +1 -0
- package/lib/module/components/MarkerView.js +93 -0
- package/lib/module/components/MarkerView.js.map +1 -0
- package/lib/module/components/NativeBridgeComponent.js +78 -0
- package/lib/module/components/NativeBridgeComponent.js.map +1 -0
- package/lib/module/components/NativeUserLocation.js +33 -0
- package/lib/module/components/NativeUserLocation.js.map +1 -0
- package/lib/module/components/PointAnnotation.js +112 -0
- package/lib/module/components/PointAnnotation.js.map +1 -0
- package/lib/module/components/RasterDemSource.js +86 -0
- package/lib/module/components/RasterDemSource.js.map +1 -0
- package/lib/module/components/RasterLayer.js +76 -0
- package/lib/module/components/RasterLayer.js.map +1 -0
- package/lib/module/components/RasterSource.js +103 -0
- package/lib/module/components/RasterSource.js.map +1 -0
- package/lib/module/components/ShapeSource.js +184 -0
- package/lib/module/components/ShapeSource.js.map +1 -0
- package/lib/module/components/SkyLayer.js +64 -0
- package/lib/module/components/SkyLayer.js.map +1 -0
- package/lib/module/components/Style.js +259 -0
- package/lib/module/components/Style.js.map +1 -0
- package/lib/module/components/SymbolLayer.js +40 -0
- package/lib/module/components/SymbolLayer.js.map +1 -0
- package/lib/module/components/Terrain.js +27 -0
- package/lib/module/components/Terrain.js.map +1 -0
- package/lib/module/components/UserLocation.js +246 -0
- package/lib/module/components/UserLocation.js.map +1 -0
- package/lib/module/components/VectorSource.js +166 -0
- package/lib/module/components/VectorSource.js.map +1 -0
- package/lib/module/components/annotations/Annotation.js +97 -0
- package/lib/module/components/annotations/Annotation.js.map +1 -0
- package/lib/module/global.d.js +2 -0
- package/lib/module/global.d.js.map +1 -0
- package/lib/module/index.js +105 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.web.js +3 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/module/modules/location/locationManager.js +77 -0
- package/lib/module/modules/location/locationManager.js.map +1 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js +38 -0
- package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -0
- package/lib/module/modules/offline/OfflinePack.js +34 -0
- package/lib/module/modules/offline/OfflinePack.js.map +1 -0
- package/lib/module/modules/offline/offlineManager.js +347 -0
- package/lib/module/modules/offline/offlineManager.js.map +1 -0
- package/lib/module/modules/snapshot/SnapshotOptions.js +53 -0
- package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -0
- package/lib/module/modules/snapshot/snapshotManager.js +60 -0
- package/lib/module/modules/snapshot/snapshotManager.js.map +1 -0
- package/lib/module/requestAndroidLocationPermissions.js +19 -0
- package/lib/module/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/utils/BridgeValue.js +59 -0
- package/lib/module/utils/BridgeValue.js.map +1 -0
- package/lib/module/utils/Logger.js +112 -0
- package/lib/module/utils/Logger.js.map +1 -0
- package/lib/module/utils/MapboxStyles.d.js +179 -0
- package/lib/module/utils/MapboxStyles.d.js.map +1 -0
- package/lib/module/utils/StyleValue.js +34 -0
- package/lib/module/utils/StyleValue.js.map +1 -0
- package/lib/module/utils/animated/Animated.js +25 -0
- package/lib/module/utils/animated/Animated.js.map +1 -0
- package/lib/module/utils/deprecation.js +33 -0
- package/lib/module/utils/deprecation.js.map +1 -0
- package/lib/module/utils/filterUtils.js +7 -0
- package/lib/module/utils/filterUtils.js.map +1 -0
- package/lib/module/utils/geoUtils.d.js +2 -0
- package/lib/module/utils/geoUtils.d.js.map +1 -0
- package/lib/module/utils/geoUtils.js +50 -0
- package/lib/module/utils/geoUtils.js.map +1 -0
- package/lib/module/utils/index.d.js +2 -0
- package/lib/module/utils/index.d.js.map +1 -0
- package/lib/module/utils/index.js +99 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/styleMap.js +1505 -0
- package/lib/module/utils/styleMap.js.map +1 -0
- package/lib/module/web/MapContext.js +4 -0
- package/lib/module/web/MapContext.js.map +1 -0
- package/lib/module/web/MapboxModule.js +13 -0
- package/lib/module/web/MapboxModule.js.map +1 -0
- package/lib/module/web/UnimplementedComponent.js +8 -0
- package/lib/module/web/UnimplementedComponent.js.map +1 -0
- package/lib/module/web/components/Camera.js +40 -0
- package/lib/module/web/components/Camera.js.map +1 -0
- package/lib/module/web/components/MapView.js +60 -0
- package/lib/module/web/components/MapView.js.map +1 -0
- package/lib/module/web/index.js +16 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/module/web/utils/Logger.js +93 -0
- package/lib/module/web/utils/Logger.js.map +1 -0
- package/lib/typescript/components/AbstractLayer.d.ts +28 -0
- package/lib/typescript/components/AbstractLayer.d.ts.map +1 -0
- package/lib/typescript/components/AbstractSource.d.ts +9 -0
- package/lib/typescript/components/AbstractSource.d.ts.map +1 -0
- package/lib/typescript/components/Atmosphere.d.ts +9 -0
- package/lib/typescript/components/Atmosphere.d.ts.map +1 -0
- package/lib/typescript/components/Camera.d.ts +119 -0
- package/lib/typescript/components/Camera.d.ts.map +1 -0
- package/lib/typescript/components/HeadingIndicator.d.ts +7 -0
- package/lib/typescript/components/HeadingIndicator.d.ts.map +1 -0
- package/lib/typescript/components/MarkerView.d.ts +52 -0
- package/lib/typescript/components/MarkerView.d.ts.map +1 -0
- package/lib/typescript/components/NativeBridgeComponent.d.ts +50 -0
- package/lib/typescript/components/NativeBridgeComponent.d.ts.map +1 -0
- package/lib/typescript/components/PointAnnotation.d.ts +162 -0
- package/lib/typescript/components/PointAnnotation.d.ts.map +1 -0
- package/lib/typescript/components/ShapeSource.d.ts +222 -0
- package/lib/typescript/components/ShapeSource.d.ts.map +1 -0
- package/lib/typescript/components/SymbolLayer.d.ts +65 -0
- package/lib/typescript/components/SymbolLayer.d.ts.map +1 -0
- package/lib/typescript/components/Terrain.d.ts +20 -0
- package/lib/typescript/components/Terrain.d.ts.map +1 -0
- package/lib/typescript/requestAndroidLocationPermissions.d.ts +2 -0
- package/lib/typescript/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +16 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/utils/BridgeValue.d.ts +46 -0
- package/lib/typescript/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/utils/StyleValue.d.ts +10 -0
- package/lib/typescript/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/utils/deprecation.d.ts +12 -0
- package/lib/typescript/utils/deprecation.d.ts.map +1 -0
- package/lib/typescript/utils/filterUtils.d.ts +2 -0
- package/lib/typescript/utils/filterUtils.d.ts.map +1 -0
- package/lib/typescript/utils/styleMap.d.ts +1489 -0
- package/lib/typescript/utils/styleMap.d.ts.map +1 -0
- package/lib/typescript/web/MapContext.d.ts +7 -0
- package/lib/typescript/web/MapContext.d.ts.map +1 -0
- package/lib/typescript/web/components/Camera.d.ts +18 -0
- package/lib/typescript/web/components/Camera.d.ts.map +1 -0
- package/lib/typescript/web/components/MapView.d.ts +20 -0
- package/lib/typescript/web/components/MapView.d.ts.map +1 -0
- package/lib/typescript/web/utils/Logger.d.ts +48 -0
- package/lib/typescript/web/utils/Logger.d.ts.map +1 -0
- package/package.json +38 -6
- package/plugin/jest.config.js +1 -0
- package/plugin/src/withMapbox.ts +365 -0
- package/plugin/tsconfig.json +9 -0
- package/.eslintrc.js +0 -111
- package/.gitattributes +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -112
- package/.github/ISSUE_TEMPLATE/bug_setup.md +0 -23
- package/.github/ISSUE_TEMPLATE/feature.md +0 -15
- package/.github/dependabot.yml +0 -42
- package/.github/label-actions.yml +0 -26
- package/.github/pull_request_template.md +0 -27
- package/.github/stale.yml +0 -11
- package/.github/workflows/android-actions.yml +0 -56
- package/.github/workflows/bump-version.yml +0 -54
- package/.github/workflows/ios-actions.yml +0 -81
- package/.github/workflows/label-actions.yml +0 -17
- package/.github/workflows/on-push.yml +0 -131
- package/.github/workflows/publish.yml +0 -29
- package/.husky/pre-commit +0 -5
- package/.nvmrc +0 -2
- package/.prettierrc.js +0 -4
- package/.sonarcloud.properties +0 -15
- package/CONTRIBUTING.md +0 -30
- package/README-v10.md +0 -86
- package/RELEASE.md +0 -28
- package/app.plugin.js +0 -1
- package/babel.config.js +0 -9
- package/docs/Annotation.md +0 -39
- package/docs/Annotations.md +0 -20
- package/docs/Atmosphere.md +0 -265
- package/docs/BackgroundLayer.md +0 -166
- package/docs/Callout.md +0 -15
- package/docs/Camera.md +0 -152
- package/docs/CircleLayer.md +0 -470
- package/docs/CustomHttpHeaders.md +0 -89
- package/docs/FillExtrusionLayer.md +0 -346
- package/docs/FillLayer.md +0 -310
- package/docs/GettingStarted.md +0 -87
- package/docs/HeadingIndicator.md +0 -10
- package/docs/HeatmapLayer.md +0 -215
- package/docs/ImageSource.md +0 -13
- package/docs/Images.md +0 -12
- package/docs/Light.md +0 -159
- package/docs/LineLayer.md +0 -606
- package/docs/Logger.md +0 -22
- package/docs/MapView.md +0 -228
- package/docs/MapboxGL.md +0 -83
- package/docs/MarkerView.md +0 -26
- package/docs/NativeUserLocation.md +0 -11
- package/docs/OfflineManager.md +0 -264
- package/docs/PointAnnotation.md +0 -42
- package/docs/RasterDemSource.md +0 -15
- package/docs/RasterLayer.md +0 -357
- package/docs/RasterSource.md +0 -19
- package/docs/ShapeSource.md +0 -106
- package/docs/SkyLayer.md +0 -259
- package/docs/Style.md +0 -12
- package/docs/StyleSheet.md +0 -226
- package/docs/SymbolLayer.md +0 -1659
- package/docs/Terrain.md +0 -77
- package/docs/UserLocation.md +0 -39
- package/docs/VectorSource.md +0 -49
- package/docs/docs.json +0 -6571
- package/docs/snapshotManager.md +0 -55
- package/scripts/.eslintrc.js +0 -12
- package/scripts/autogenHelpers/DocJSONBuilder.js +0 -458
- package/scripts/autogenHelpers/JSDocNodeTree.js +0 -134
- package/scripts/autogenHelpers/MarkdownBuilder.js +0 -38
- package/scripts/autogenHelpers/globals.js +0 -518
- package/scripts/autogenerate.js +0 -545
- package/scripts/download-style-spec.sh +0 -15
- package/scripts/templates/MapboxStyles.ts.ejs +0 -97
- package/scripts/templates/RCTMGLStyle.h.ejs +0 -34
- package/scripts/templates/RCTMGLStyle.m.ejs +0 -106
- package/scripts/templates/RCTMGLStyle.swift.ejs +0 -116
- package/scripts/templates/RCTMGLStyleFactory.java.ejs +0 -108
- package/scripts/templates/RCTMGLStyleFactoryv10.java.ejs +0 -116
- package/scripts/templates/component.md.ejs +0 -122
- package/scripts/templates/index.d.ts.ejs +0 -56
- package/scripts/templates/styleMap.ts.ejs +0 -118
- package/setup-jest.js +0 -125
- package/style-spec/v8.json +0 -6727
- package/tsconfig.json +0 -24
package/scripts/autogenerate.js
DELETED
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
require('./autogenHelpers/globals');
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { execSync } = require('child_process');
|
|
6
|
-
|
|
7
|
-
const ejs = require('ejs');
|
|
8
|
-
const prettier = require('prettier');
|
|
9
|
-
|
|
10
|
-
const prettierrc = require('../.prettierrc.js');
|
|
11
|
-
const styleSpecJSON = require('../style-spec/v8.json');
|
|
12
|
-
|
|
13
|
-
const DocJSONBuilder = require('./autogenHelpers/DocJSONBuilder');
|
|
14
|
-
const MarkdownBuilder = require('./autogenHelpers/MarkdownBuilder');
|
|
15
|
-
|
|
16
|
-
function readIosVersion() {
|
|
17
|
-
const podspecPath = path.join(__dirname, '..', 'rnmapbox-maps.podspec');
|
|
18
|
-
const lines = fs.readFileSync(podspecPath, 'utf8').split('\n');
|
|
19
|
-
const mapboxLineRegex =
|
|
20
|
-
/^\s*rnMapboxMapsDefaultMapboxVersion\s*=\s*'~>\s+(\d+\.\d+)(\.\d+)?'$/;
|
|
21
|
-
const mapboxLine = lines.filter((i) => mapboxLineRegex.exec(i))[0];
|
|
22
|
-
|
|
23
|
-
const mapboxGLLineRegex =
|
|
24
|
-
/^\s*rnMapboxMapsDefaultMapboxGLVersion\s*=\s*'~>\s+(\d+\.\d+)(\.\d+)?'$/;
|
|
25
|
-
const mapboxGLLine = lines.filter((i) => mapboxGLLineRegex.exec(i))[0];
|
|
26
|
-
return {
|
|
27
|
-
v10: `${mapboxLineRegex.exec(mapboxLine)[1]}.0`,
|
|
28
|
-
gl: `${mapboxLineRegex.exec(mapboxLine)[1]}.0`,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function readAndroidVersion() {
|
|
33
|
-
const buildGradlePath = path.join(
|
|
34
|
-
__dirname,
|
|
35
|
-
'..',
|
|
36
|
-
'android',
|
|
37
|
-
'rctmgl',
|
|
38
|
-
'build.gradle',
|
|
39
|
-
);
|
|
40
|
-
const lines = fs.readFileSync(buildGradlePath, 'utf8').split('\n');
|
|
41
|
-
const mapboxGLLineRegex =
|
|
42
|
-
/^\s+implementation\s+'com.mapbox.mapboxsdk:mapbox-android-sdk:(\d+\.\d+\.\d+)'$/;
|
|
43
|
-
const mapboxGLLine = lines.filter((i) => mapboxGLLineRegex.exec(i))[0];
|
|
44
|
-
const mapboxV10LineRegex =
|
|
45
|
-
/^\s+implementation\s+'com.mapbox.maps:android:(\d+\.\d+\.\d+)'$/;
|
|
46
|
-
const mapboxV10Line = lines.filter((i) => mapboxV10LineRegex.exec(i))[0];
|
|
47
|
-
return {
|
|
48
|
-
gl: mapboxGLLineRegex.exec(mapboxGLLine)[1],
|
|
49
|
-
v10: mapboxV10LineRegex.exec(mapboxV10Line)[1],
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (!styleSpecJSON) {
|
|
54
|
-
console.log(
|
|
55
|
-
'Could not find style spec, try running "yarn run fetch:style:spec"',
|
|
56
|
-
);
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const layers = [];
|
|
61
|
-
const androidVersion = readAndroidVersion();
|
|
62
|
-
const iosVersion = readIosVersion();
|
|
63
|
-
|
|
64
|
-
const TMPL_PATH = path.join(__dirname, 'templates');
|
|
65
|
-
|
|
66
|
-
const outputToExample = false;
|
|
67
|
-
const OUTPUT_EXAMPLE_PREFIX = [
|
|
68
|
-
'..',
|
|
69
|
-
'example',
|
|
70
|
-
'node_modules',
|
|
71
|
-
'@react-native-mapbox-gl',
|
|
72
|
-
'maps',
|
|
73
|
-
];
|
|
74
|
-
const OUTPUT_PREFIX = outputToExample ? OUTPUT_EXAMPLE_PREFIX : ['..'];
|
|
75
|
-
|
|
76
|
-
const IOS_OUTPUT_PATH = path.join(__dirname, ...OUTPUT_PREFIX, 'ios', 'RCTMGL');
|
|
77
|
-
const IOS_V10_OUTPUT_PATH = path.join(
|
|
78
|
-
__dirname,
|
|
79
|
-
...OUTPUT_PREFIX,
|
|
80
|
-
'ios',
|
|
81
|
-
'RCTMGL-v10',
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const ANDROID_OUTPUT_PATH = path.join(
|
|
85
|
-
__dirname,
|
|
86
|
-
...OUTPUT_PREFIX,
|
|
87
|
-
'android',
|
|
88
|
-
'rctmgl',
|
|
89
|
-
'src',
|
|
90
|
-
'main',
|
|
91
|
-
'java-mapboxgl',
|
|
92
|
-
'common',
|
|
93
|
-
'com',
|
|
94
|
-
'mapbox',
|
|
95
|
-
'rctmgl',
|
|
96
|
-
'components',
|
|
97
|
-
'styles',
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const ANDROID_V10_OUTPUT_PATH = path.join(
|
|
101
|
-
__dirname,
|
|
102
|
-
...OUTPUT_PREFIX,
|
|
103
|
-
'android',
|
|
104
|
-
'rctmgl',
|
|
105
|
-
'src',
|
|
106
|
-
'main',
|
|
107
|
-
'java-v10',
|
|
108
|
-
'com',
|
|
109
|
-
'mapbox',
|
|
110
|
-
'rctmgl',
|
|
111
|
-
'components',
|
|
112
|
-
'styles',
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
const JS_OUTPUT_PATH = path.join(
|
|
116
|
-
__dirname,
|
|
117
|
-
...OUTPUT_PREFIX,
|
|
118
|
-
'javascript',
|
|
119
|
-
'utils',
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
getSupportedLayers(Object.keys(styleSpecJSON.layer.type.values)).forEach(
|
|
123
|
-
({ layerName, support }) => {
|
|
124
|
-
layers.push({
|
|
125
|
-
name: layerName,
|
|
126
|
-
properties: getPropertiesForLayer(layerName),
|
|
127
|
-
props: {
|
|
128
|
-
gl: getPropertiesForLayer(layerName, 'gl'),
|
|
129
|
-
v10: getPropertiesForLayer(layerName, 'v10'),
|
|
130
|
-
},
|
|
131
|
-
support,
|
|
132
|
-
});
|
|
133
|
-
},
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
// add light as a layer
|
|
137
|
-
layers.push({
|
|
138
|
-
name: 'light',
|
|
139
|
-
properties: getPropertiesFor('light'),
|
|
140
|
-
props: {
|
|
141
|
-
gl: getPropertiesFor('light', 'gl'),
|
|
142
|
-
v10: getPropertiesFor('light', 'v10'),
|
|
143
|
-
},
|
|
144
|
-
support: { gl: true, v10: true },
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// add atmosphere as a layer
|
|
148
|
-
layers.push({
|
|
149
|
-
name: 'atmosphere',
|
|
150
|
-
properties: getPropertiesFor('fog'),
|
|
151
|
-
props: {
|
|
152
|
-
gl: getPropertiesFor('fog', 'gl'),
|
|
153
|
-
v10: removeTransitionsOnV10Before1070(getPropertiesFor('fog', 'v10')),
|
|
154
|
-
},
|
|
155
|
-
support: { gl: false, v10: true },
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// add terrain as a layer
|
|
159
|
-
layers.push({
|
|
160
|
-
name: 'terrain',
|
|
161
|
-
properties: getPropertiesFor('terrain'),
|
|
162
|
-
props: {
|
|
163
|
-
gl: getPropertiesFor('terrain', 'gl'),
|
|
164
|
-
v10: getPropertiesFor('terrain', 'v10')
|
|
165
|
-
.filter(({ name }) => name !== 'source')
|
|
166
|
-
.map((i) => ({ ...i, transition: false })),
|
|
167
|
-
},
|
|
168
|
-
support: { gl: false, v10: true },
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
function getPropertiesFor(kind, only) {
|
|
172
|
-
const attributes = styleSpecJSON[kind];
|
|
173
|
-
|
|
174
|
-
const props = getSupportedProperties(attributes, only).map((attrName) => {
|
|
175
|
-
return Object.assign({}, buildProperties(attributes, attrName), {
|
|
176
|
-
allowedFunctionTypes: [],
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
return props;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function removeTransitionsOnV10Before1070(props) {
|
|
184
|
-
let isv17orolder = isVersionGTE(iosVersion.v10, '10.7.0');
|
|
185
|
-
|
|
186
|
-
return props.map((i) =>
|
|
187
|
-
!isv17orolder ? { ...i, transition: false } : { ...i },
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function getPropertiesForLayer(layerName, only) {
|
|
192
|
-
const paintAttributes = styleSpecJSON[`paint_${layerName}`];
|
|
193
|
-
const layoutAttributes = styleSpecJSON[`layout_${layerName}`];
|
|
194
|
-
|
|
195
|
-
const paintProps = getSupportedProperties(paintAttributes, only).map(
|
|
196
|
-
(attrName) => {
|
|
197
|
-
const prop = buildProperties(paintAttributes, attrName);
|
|
198
|
-
|
|
199
|
-
// overrides
|
|
200
|
-
if (['line-width'].includes(attrName)) {
|
|
201
|
-
prop.allowedFunctionTypes = ['camera'];
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return prop;
|
|
205
|
-
},
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
const layoutProps = getSupportedProperties(layoutAttributes, only).map(
|
|
209
|
-
(attrName) => {
|
|
210
|
-
const prop = buildProperties(layoutAttributes, attrName);
|
|
211
|
-
|
|
212
|
-
// overrides
|
|
213
|
-
if (
|
|
214
|
-
[
|
|
215
|
-
'line-join',
|
|
216
|
-
'text-max-width',
|
|
217
|
-
'text-letter-spacing',
|
|
218
|
-
'text-anchor',
|
|
219
|
-
'text-justify',
|
|
220
|
-
'text-font',
|
|
221
|
-
].includes(attrName)
|
|
222
|
-
) {
|
|
223
|
-
prop.allowedFunctionTypes = ['camera'];
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return prop;
|
|
227
|
-
},
|
|
228
|
-
);
|
|
229
|
-
|
|
230
|
-
return layoutProps.concat(paintProps);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function getSupportedLayers(layerNames) {
|
|
234
|
-
const layerMap = styleSpecJSON.layer.type.values;
|
|
235
|
-
|
|
236
|
-
const supportedLayers = [];
|
|
237
|
-
for (const layerName of layerNames) {
|
|
238
|
-
const layer = layerMap[layerName];
|
|
239
|
-
const support = getAttributeSupport(layer['sdk-support']);
|
|
240
|
-
|
|
241
|
-
if (
|
|
242
|
-
(support.basic.v10.android && support.basic.v10.ios) ||
|
|
243
|
-
(support.basic.gl.android && support.basic.gl.ios)
|
|
244
|
-
) {
|
|
245
|
-
supportedLayers.push({
|
|
246
|
-
layerName,
|
|
247
|
-
support: {
|
|
248
|
-
v10: support.basic.v10.android && support.basic.v10.ios,
|
|
249
|
-
gl: support.basic.gl.android && support.basic.gl.ios,
|
|
250
|
-
},
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return supportedLayers;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function getSupportedProperties(attributes, only) {
|
|
259
|
-
return Object.keys(attributes).filter((attrName) =>
|
|
260
|
-
isAttrSupported(attributes[attrName], only),
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function buildProperties(attributes, attrName) {
|
|
265
|
-
return {
|
|
266
|
-
name: camelCase(attrName),
|
|
267
|
-
doc: {
|
|
268
|
-
default: attributes[attrName].default,
|
|
269
|
-
minimum: attributes[attrName].minimum,
|
|
270
|
-
maximum: attributes[attrName].maximum,
|
|
271
|
-
units: attributes[attrName].units,
|
|
272
|
-
description: formatDescription(attributes[attrName].doc),
|
|
273
|
-
requires: getRequires(attributes[attrName].requires),
|
|
274
|
-
disabledBy: getDisables(attributes[attrName].requires),
|
|
275
|
-
values: attributes[attrName].values,
|
|
276
|
-
},
|
|
277
|
-
type: attributes[attrName].type,
|
|
278
|
-
value: attributes[attrName].value,
|
|
279
|
-
image: isImage(attrName, attributes[attrName].type),
|
|
280
|
-
translate: isTranslate(attrName),
|
|
281
|
-
transition: attributes[attrName].transition,
|
|
282
|
-
expression: attributes[attrName].expression,
|
|
283
|
-
expressionSupported:
|
|
284
|
-
Object.keys(attributes[attrName].expression || {}).length > 0,
|
|
285
|
-
support: getAttributeSupport(attributes[attrName]['sdk-support']),
|
|
286
|
-
allowedFunctionTypes: getAllowedFunctionTypes(attributes[attrName]),
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function formatDescription(description) {
|
|
291
|
-
const words = description.split(' ');
|
|
292
|
-
|
|
293
|
-
for (let i = 0; i < words.length; i++) {
|
|
294
|
-
const word = words[i];
|
|
295
|
-
|
|
296
|
-
if (word.includes('-')) {
|
|
297
|
-
words[i] = camelCase(word);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
const formattedDescription = words.join(' ');
|
|
302
|
-
return formattedDescription;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function getRequires(requiredItems) {
|
|
306
|
-
const items = [];
|
|
307
|
-
|
|
308
|
-
if (!requiredItems) {
|
|
309
|
-
return items;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
for (const item of requiredItems) {
|
|
313
|
-
if (typeof item === 'string') {
|
|
314
|
-
items.push(camelCase(item, '-'));
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return items;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
function getDisables(disabledItems) {
|
|
322
|
-
const items = [];
|
|
323
|
-
|
|
324
|
-
if (!disabledItems) {
|
|
325
|
-
return items;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
for (const item of disabledItems) {
|
|
329
|
-
if (item['!']) {
|
|
330
|
-
items.push(camelCase(item['!'], '-'));
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return items;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function isImage(attrName, type) {
|
|
338
|
-
return (
|
|
339
|
-
attrName.toLowerCase().indexOf('pattern') !== -1 ||
|
|
340
|
-
attrName.toLowerCase().indexOf('image') !== -1 ||
|
|
341
|
-
type === 'resolvedImage'
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
function isTranslate(attrName) {
|
|
346
|
-
return attrName.toLowerCase().indexOf('translate') !== -1;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
function isAttrSupported(attr, only) {
|
|
350
|
-
const support = getAttributeSupport(attr['sdk-support']);
|
|
351
|
-
if (attr.private === true) {
|
|
352
|
-
return false;
|
|
353
|
-
}
|
|
354
|
-
if (only != null) {
|
|
355
|
-
return support.basic[only].android && support.basic[only].ios;
|
|
356
|
-
}
|
|
357
|
-
return (
|
|
358
|
-
(support.basic.gl.android && support.basic.gl.ios) ||
|
|
359
|
-
(support.basic.v10.android && support.basic.v10.ios)
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function getAttributeSupport(sdkSupport) {
|
|
364
|
-
const support = {
|
|
365
|
-
basic: {
|
|
366
|
-
gl: { android: false, ios: false },
|
|
367
|
-
v10: { android: false, ios: false },
|
|
368
|
-
},
|
|
369
|
-
data: {
|
|
370
|
-
gl: { android: false, ios: false },
|
|
371
|
-
v10: { android: false, ios: false },
|
|
372
|
-
},
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
const basicSupport = sdkSupport && sdkSupport['basic functionality'];
|
|
376
|
-
if (basicSupport && basicSupport.android) {
|
|
377
|
-
support.basic.gl.android = isVersionGTE(
|
|
378
|
-
androidVersion.gl,
|
|
379
|
-
basicSupport.android,
|
|
380
|
-
);
|
|
381
|
-
support.basic.v10.android = isVersionGTE(
|
|
382
|
-
androidVersion.v10,
|
|
383
|
-
basicSupport.android,
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
if (basicSupport && basicSupport.ios) {
|
|
387
|
-
support.basic.gl.ios = isVersionGTE(iosVersion.gl, basicSupport.ios);
|
|
388
|
-
support.basic.v10.ios = isVersionGTE(iosVersion.v10, basicSupport.ios);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
const dataDrivenSupport = sdkSupport && sdkSupport['data-driven styling'];
|
|
392
|
-
if (dataDrivenSupport && dataDrivenSupport.android) {
|
|
393
|
-
support.data.gl.android = isVersionGTE(
|
|
394
|
-
androidVersion.gl,
|
|
395
|
-
dataDrivenSupport.android,
|
|
396
|
-
);
|
|
397
|
-
support.data.v10.android = isVersionGTE(
|
|
398
|
-
androidVersion.v10,
|
|
399
|
-
dataDrivenSupport.android,
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
if (dataDrivenSupport && dataDrivenSupport.ios) {
|
|
403
|
-
support.data.gl.ios = isVersionGTE(iosVersion.gl, dataDrivenSupport.ios);
|
|
404
|
-
support.data.v10.ios = isVersionGTE(iosVersion.v10, dataDrivenSupport.ios);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
if (support.data.v10.ios !== true || support.data.v10.android !== true) {
|
|
408
|
-
support.data.v10.ios = false;
|
|
409
|
-
support.data.v10.android = false;
|
|
410
|
-
}
|
|
411
|
-
if (support.data.gl.ios !== true || support.data.gl.android !== true) {
|
|
412
|
-
support.data.gl.ios = false;
|
|
413
|
-
support.data.gl.android = false;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return support;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function isVersionGTE(version, otherVersion) {
|
|
420
|
-
const v = +version
|
|
421
|
-
.split('.')
|
|
422
|
-
.map((i) => String(i).padStart(3, '0'))
|
|
423
|
-
.join('');
|
|
424
|
-
const ov = +otherVersion
|
|
425
|
-
.split('.')
|
|
426
|
-
.map((i) => String(i).padStart(3, '0'))
|
|
427
|
-
.join('');
|
|
428
|
-
return v >= ov;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
function getAllowedFunctionTypes(paintAttr) {
|
|
432
|
-
const allowedFunctionTypes = [];
|
|
433
|
-
|
|
434
|
-
if (paintAttr['zoom-function']) {
|
|
435
|
-
allowedFunctionTypes.push('camera');
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
if (paintAttr['property-function']) {
|
|
439
|
-
allowedFunctionTypes.push('source');
|
|
440
|
-
allowedFunctionTypes.push('composite');
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
return allowedFunctionTypes;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
async function generate() {
|
|
447
|
-
const templateMappings = [
|
|
448
|
-
{
|
|
449
|
-
input: path.join(TMPL_PATH, 'RCTMGLStyle.h.ejs'),
|
|
450
|
-
output: path.join(IOS_OUTPUT_PATH, 'RCTMGLStyle.h'),
|
|
451
|
-
only: 'gl',
|
|
452
|
-
},
|
|
453
|
-
/*{
|
|
454
|
-
input: path.join(TMPL_PATH, 'index.d.ts.ejs'),
|
|
455
|
-
output: path.join(IOS_OUTPUT_PATH, 'index.d.ts'),
|
|
456
|
-
},*/
|
|
457
|
-
{
|
|
458
|
-
input: path.join(TMPL_PATH, 'MapboxStyles.ts.ejs'),
|
|
459
|
-
output: path.join(JS_OUTPUT_PATH, 'MapboxStyles.ts'),
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
input: path.join(TMPL_PATH, 'RCTMGLStyle.m.ejs'),
|
|
463
|
-
output: path.join(IOS_OUTPUT_PATH, 'RCTMGLStyle.m'),
|
|
464
|
-
only: 'gl',
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
input: path.join(TMPL_PATH, 'RCTMGLStyle.swift.ejs'),
|
|
468
|
-
output: path.join(IOS_V10_OUTPUT_PATH, 'RCTMGLStyle.swift'),
|
|
469
|
-
only: 'v10',
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
input: path.join(TMPL_PATH, 'RCTMGLStyleFactory.java.ejs'),
|
|
473
|
-
output: path.join(ANDROID_OUTPUT_PATH, 'RCTMGLStyleFactory.java'),
|
|
474
|
-
only: 'gl',
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
input: path.join(TMPL_PATH, 'RCTMGLStyleFactoryv10.java.ejs'),
|
|
478
|
-
output: path.join(ANDROID_V10_OUTPUT_PATH, 'RCTMGLStyleFactory.java'),
|
|
479
|
-
only: 'v10',
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
input: path.join(TMPL_PATH, 'styleMap.ts.ejs'),
|
|
483
|
-
output: path.join(JS_OUTPUT_PATH, 'styleMap.ts'),
|
|
484
|
-
},
|
|
485
|
-
];
|
|
486
|
-
const outputPaths = templateMappings.map((m) => m.output);
|
|
487
|
-
|
|
488
|
-
// autogenerate code
|
|
489
|
-
templateMappings.forEach(({ input, output, only }) => {
|
|
490
|
-
const filename = output.split('/').pop();
|
|
491
|
-
console.log(`Generating ${filename}`);
|
|
492
|
-
const tmpl = ejs.compile(fs.readFileSync(input, 'utf8'), { strict: true });
|
|
493
|
-
|
|
494
|
-
function filterOnly(layers, only) {
|
|
495
|
-
if (only != null) {
|
|
496
|
-
let result = layers
|
|
497
|
-
.filter((e) => e.support[only])
|
|
498
|
-
.map((e) => ({ ...e, properties: e.props[only] }));
|
|
499
|
-
return result;
|
|
500
|
-
} else {
|
|
501
|
-
return layers;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
let results = tmpl({ layers: filterOnly(layers, only) });
|
|
506
|
-
if (filename.endsWith('ts')) {
|
|
507
|
-
results = prettier.format(results, {
|
|
508
|
-
...prettierrc,
|
|
509
|
-
filepath: filename,
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
fs.writeFileSync(output, results);
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
// autogenerate expo plugin
|
|
516
|
-
execSync('yarn build:plugin', { stdio: 'inherit' });
|
|
517
|
-
outputPaths.push('plugin/build');
|
|
518
|
-
|
|
519
|
-
// autogenerate docs
|
|
520
|
-
const docBuilder = new DocJSONBuilder(layers);
|
|
521
|
-
const markdownBuilder = new MarkdownBuilder();
|
|
522
|
-
await docBuilder.generate();
|
|
523
|
-
await markdownBuilder.generate();
|
|
524
|
-
|
|
525
|
-
// Check if any generated files changed
|
|
526
|
-
try {
|
|
527
|
-
execSync(`git diff --exit-code docs/ ${outputPaths.join(' ')}`);
|
|
528
|
-
} catch (error) {
|
|
529
|
-
console.error(
|
|
530
|
-
'\n\nThere are unstaged changes in the generated code. ' +
|
|
531
|
-
'Please add them to your commit.\n' +
|
|
532
|
-
'If you would really like to exlude them, run "git commit -n" to skip.\n\n',
|
|
533
|
-
);
|
|
534
|
-
const showDiff = true;
|
|
535
|
-
if (showDiff) {
|
|
536
|
-
console.log(`=> git diff docs/ ${outputPaths.join(' ')}`);
|
|
537
|
-
execSync(`git diff docs/ ${outputPaths.join(' ')} | head -n 20`, {
|
|
538
|
-
stdio: 'inherit',
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
process.exit(1);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
generate();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
echo "Downloading MapboxGL Style Spec"
|
|
4
|
-
cd style-spec/
|
|
5
|
-
|
|
6
|
-
FILENAME=v8.json
|
|
7
|
-
|
|
8
|
-
if [ -e "./${FILENAME}" ]; then
|
|
9
|
-
echo "Removing old style spec ${FILENAME}"
|
|
10
|
-
rm "./${FILENAME}"
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
echo "Fetching new style spec ${FILENAME}"
|
|
14
|
-
curl -sS https://raw.githubusercontent.com/mapbox/mapbox-gl-js/master/src/style-spec/reference/${FILENAME} -o ${FILENAME}
|
|
15
|
-
cd ..
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const layers = locals.layers;
|
|
3
|
-
-%>
|
|
4
|
-
/* This file was generated from MapboxStyle.ts.ejs do not modify */
|
|
5
|
-
import { type ImageSourcePropType } from 'react-native';
|
|
6
|
-
|
|
7
|
-
export type Translation = { x: number; y: number } | [number, number];
|
|
8
|
-
|
|
9
|
-
export interface Transition {
|
|
10
|
-
duration: number;
|
|
11
|
-
delay: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type FormattedString = string; /* TODO */
|
|
15
|
-
|
|
16
|
-
type ExpressionName =
|
|
17
|
-
// Types
|
|
18
|
-
| 'array' | 'boolean' | 'collator' | 'format' | 'image' | 'literal' | 'number' | 'number-format' | 'object' | 'string'
|
|
19
|
-
| 'to-boolean' | 'to-color' | 'to-number' | 'to-string' | 'typeof'
|
|
20
|
-
// Feature data
|
|
21
|
-
| 'accumulated' | 'feature-state' | 'geometry-type' | 'id' | 'line-progress' | 'properties'
|
|
22
|
-
// Lookup
|
|
23
|
-
| 'at' | 'get' | 'has' | 'in' | 'index-of' | 'length' | 'slice'
|
|
24
|
-
// Decision
|
|
25
|
-
| '!' | '!=' | '<' | '<=' | '==' | '>' | '>=' | 'all' | 'any' | 'case' | 'match' | 'coalesce' | 'within'
|
|
26
|
-
// Ramps, scales, curves
|
|
27
|
-
| 'interpolate' | 'interpolate-hcl' | 'interpolate-lab' | 'step'
|
|
28
|
-
// Variable binding
|
|
29
|
-
| 'let' | 'var'
|
|
30
|
-
// String
|
|
31
|
-
| 'concat' | 'downcase' | 'is-supported-script' | 'resolved-locale' | 'upcase'
|
|
32
|
-
// Color
|
|
33
|
-
| 'rgb' | 'rgba' | 'to-rgba'
|
|
34
|
-
// Math
|
|
35
|
-
| '-' | '*' | '/' | '%' | '^' | '+' | 'abs' | 'acos' | 'asin' | 'atan' | 'ceil' | 'cos' | 'distance' | 'e'
|
|
36
|
-
| 'floor' | 'ln' | 'ln2' | 'log10' | 'log2' | 'max' | 'min' | 'pi' | 'round' | 'sin' | 'sqrt' | 'tan'
|
|
37
|
-
// Zoom, Heatmap
|
|
38
|
-
| 'zoom' | 'heatmap-density';
|
|
39
|
-
|
|
40
|
-
type ExpressionField =
|
|
41
|
-
| string
|
|
42
|
-
| number
|
|
43
|
-
| boolean
|
|
44
|
-
| Expression
|
|
45
|
-
| ExpressionField[]
|
|
46
|
-
| { [key: string]: ExpressionField };
|
|
47
|
-
|
|
48
|
-
export type Expression = [ExpressionName, ...ExpressionField[]];
|
|
49
|
-
|
|
50
|
-
type ExpressionParameters = 'zoom' | 'feature' | 'feature-state' | 'sky-radial-progress' | 'line-progress' | 'heatmap-density';
|
|
51
|
-
|
|
52
|
-
type ResolvedImageType = ImageSourcePropType;
|
|
53
|
-
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
|
-
export type Value<T, AllowedParameters extends ExpressionParameters[] = []> =
|
|
56
|
-
| T
|
|
57
|
-
| Expression;
|
|
58
|
-
|
|
59
|
-
<%_ for (let enumInfo of getEnums(layers)) { _%>
|
|
60
|
-
enum <%- pascelCase(enumInfo.name) %>Enum {
|
|
61
|
-
<%_ for (let k of Object.keys(enumInfo.values)) { _%>
|
|
62
|
-
/** <%- enumInfo.values[k].doc %> */
|
|
63
|
-
<%- pascelCase(k) %> = '<%- k %>',
|
|
64
|
-
<%_ } _%>
|
|
65
|
-
}
|
|
66
|
-
type <%- pascelCase(enumInfo.name) %>EnumValues = <%- Object.keys(enumInfo.values).map(k => `'${k}'`).join(' | ') %>;
|
|
67
|
-
<%_ } _%>
|
|
68
|
-
|
|
69
|
-
type Enum<EnumType, EnumValues> = EnumType | EnumValues;
|
|
70
|
-
|
|
71
|
-
<%_ for (let layer of layers) { _%>
|
|
72
|
-
export interface <%- pascelCase(layer.name) %>LayerStyleProps {
|
|
73
|
-
<%_ for (let prop of layer.properties) { _%>
|
|
74
|
-
/**
|
|
75
|
-
* <%- prop.doc.description %>
|
|
76
|
-
<%_ if (prop.doc.requires.length) { _%>
|
|
77
|
-
*
|
|
78
|
-
* @requires <%- prop.doc.requires.join(', ') %>
|
|
79
|
-
<%_ } _%>
|
|
80
|
-
<%_ if (prop.doc.disabledBy.length) { _%>
|
|
81
|
-
*
|
|
82
|
-
* @disabledBy <%- prop.doc.disabledBy.join(', ') %>
|
|
83
|
-
<%_ } _%>
|
|
84
|
-
*/
|
|
85
|
-
<%= prop.name %>?: <%- dtsInterfaceType(prop) %>
|
|
86
|
-
<%_ if (true && prop.transition) { %>
|
|
87
|
-
/**
|
|
88
|
-
* The transition affecting any changes to this layer’s <%= prop.name %> property.
|
|
89
|
-
*/
|
|
90
|
-
<%= prop.name %>Transition?: Transition,
|
|
91
|
-
<%_ } _%>
|
|
92
|
-
<%_ } _%>
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
<%_ } _%>
|
|
96
|
-
|
|
97
|
-
export type AllLayerStyleProps = <%- layers.map(l => `${pascelCase(l.name)}LayerStyleProps`).join("|") -%>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const layers = locals.layers;
|
|
3
|
-
-%>
|
|
4
|
-
// DO NOT MODIFY
|
|
5
|
-
// THIS FILE IS AUTOGENERATED
|
|
6
|
-
|
|
7
|
-
#import "RCTMGLStyle.h"
|
|
8
|
-
#import "RCTMGLStyleValue.h"
|
|
9
|
-
#import <React/RCTBridge.h>
|
|
10
|
-
|
|
11
|
-
@import Mapbox;
|
|
12
|
-
|
|
13
|
-
@interface RCTMGLStyle : NSObject
|
|
14
|
-
|
|
15
|
-
@property (nonatomic, weak) RCTBridge *bridge;
|
|
16
|
-
@property (nonatomic, strong) MGLStyle *style;
|
|
17
|
-
|
|
18
|
-
- (id)initWithMGLStyle:(MGLStyle*)mglStyle;
|
|
19
|
-
|
|
20
|
-
<%_ for (const layer of layers) { _%>
|
|
21
|
-
<%_ if (layer.properties.length == 0) { continue } _%>
|
|
22
|
-
- (void)<%- setLayerMethodName(layer, 'ios') -%>:(<%- getLayerType(layer, 'ios') -%> *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid;
|
|
23
|
-
<%_ } _%>
|
|
24
|
-
|
|
25
|
-
<%_ for (const layer of layers) { _%>
|
|
26
|
-
<%_ for (const prop of layer.properties) { _%>
|
|
27
|
-
- (void)set<%- iosPropMethodName(layer, pascelCase(prop.name)) -%>:(<%- getLayerType(layer, 'ios') -%> *)layer withReactStyleValue:(RCTMGLStyleValue *)styleValue;
|
|
28
|
-
<%_ if (prop.transition) { _%>
|
|
29
|
-
- (void)set<%- iosPropMethodName(layer, pascelCase(prop.name)) -%>Transition:(<%- getLayerType(layer, 'ios') -%> *)layer withReactStyleValue:(RCTMGLStyleValue *)styleValue;
|
|
30
|
-
<%_ } _%>
|
|
31
|
-
<%_ } _%>
|
|
32
|
-
<% } %>
|
|
33
|
-
|
|
34
|
-
@end
|