diff --git a/src/legacy/core_plugins/tile_map/common/tms_service.js b/src/legacy/core_plugins/tile_map/common/tms_service.js index 31cd654203904..c42a2cd576ac2 100644 --- a/src/legacy/core_plugins/tile_map/common/tms_service.js +++ b/src/legacy/core_plugins/tile_map/common/tms_service.js @@ -23,32 +23,63 @@ import { ORIGIN } from './origin'; export class TMSService { _getRasterStyleJson = _.once(async () => { - const rasterUrl = this._getRasterStyleUrl(); + const rasterUrl = this._getStyleUrlForLocale('raster'); const url = this._proxyPath + rasterUrl; return this._emsClient.getManifest(this._emsClient.extendUrlWithParams(url)); }); + _getVectorStyleJsonRaw = _.once(async () => { + const vectorUrl = this._getStyleUrlForLocale('vector'); + const url = this._proxyPath + vectorUrl; + const vectorJson = await this._emsClient.getManifest(this._emsClient.extendUrlWithParams(url)); + return { ...vectorJson }; + }); + + _getVectorStyleJsonInlined = _.once(async () => { + const vectorJson = await this._getVectorStyleJsonRaw(); + const inlinedSources = {}; + for (const sourceName of Object.getOwnPropertyNames(vectorJson.sources)) { + const sourceUrl = this._proxyPath + vectorJson.sources[sourceName].url; + const extendedUrl = this._emsClient.extendUrlWithParams(sourceUrl); + const sourceJson = await this._emsClient.getManifest(extendedUrl); + + const extendedTileUrls = sourceJson.tiles.map(tileUrl => { + const url = this._proxyPath + tileUrl; + return this._emsClient.extendUrlWithParams(url); + }); + inlinedSources[sourceName] = { + type: 'vector', + ...sourceJson, + tiles: extendedTileUrls + }; + } + return { + ...vectorJson, + sources: inlinedSources, + sprite: await this._getSpriteSheetRootPath(), + }; + }); + constructor(config, emsClient, proxyPath) { this._config = config; this._emsClient = emsClient; this._proxyPath = proxyPath; } - _getRasterFormats(locale) { - return this._config.formats.filter(format => { - return format.locale === locale && format.format === 'raster'; - }); + _getFormats(formatType, locale) { + return this._config.formats.filter(format => format.locale === locale && format.format === formatType); } - _getRasterStyleUrl() { - let rasterFormats = this._getRasterFormats(this._emsClient.getLocale()); - if (!rasterFormats.length) {//fallback to default locale - rasterFormats = this._getRasterFormats(this._emsClient.getDefaultLocale()); + _getStyleUrlForLocale(formatType) { + let vectorFormats = this._getFormats(formatType, this._emsClient.getLocale()); + if (!vectorFormats.length) {//fallback to default locale + vectorFormats = this._getFormats(formatType, this._emsClient.getDefaultLocale()); } - if (!rasterFormats.length) { - throw new Error(`Cannot find raster tile layer for locale ${this._emsClient.getLocale()} or ${this._emsClient.getDefaultLocale()}`); + if (!vectorFormats.length) { + // eslint-disable-next-line max-len + throw new Error(`Cannot find ${formatType} tile layer for locale ${this._emsClient.getLocale()} or ${this._emsClient.getDefaultLocale()}`); } - const defaultStyle = rasterFormats[0]; + const defaultStyle = vectorFormats[0]; if (defaultStyle && defaultStyle.hasOwnProperty('url')) { return defaultStyle.url; } @@ -64,6 +95,52 @@ export class TMSService { return this._emsClient.extendUrlWithParams(directUrl); } + async getUrlTemplateForVector(sourceId) { + const tileJson = await this._getVectorStyleJsonInlined(); + if (!tileJson.sources[sourceId] || !tileJson.sources[sourceId].tiles) { + return null; + } + const directUrl = this._proxyPath + tileJson.sources[sourceId].tiles[0]; + return this._emsClient.extendUrlWithParams(directUrl); + } + + async getVectorStyleSheet() { + return await this._getVectorStyleJsonInlined(); + } + + async getVectorStyleSheetRaw() { + return await this._getVectorStyleJsonRaw(); + } + + async getSpriteSheetMeta(isRetina = false) { + const metaUrl = await this.getSpriteSheetJsonPath(isRetina); + const spritePngs = await this.getSpriteSheetPngPath(isRetina); + const metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl); + const jsonMeta = await this._emsClient.getManifest(metaUrlExtended); + return { + png: spritePngs, + json: jsonMeta + }; + } + + async _getSpriteSheetRootPath() { + const vectorStyleJson = await this._getVectorStyleJsonRaw(); + return this._proxyPath + vectorStyleJson.sprite; + } + + async getSpriteSheetJsonPath(isRetina = false) { + const spriteSheetRootPath = await this._getSpriteSheetRootPath(); + const suffix = isRetina ? '@2x' : ''; + return spriteSheetRootPath + suffix + '.json'; + } + + + async getSpriteSheetPngPath(isRetina = false) { + const spriteSheetRootPath = await this._getSpriteSheetRootPath(); + const suffix = isRetina ? '@2x' : ''; + return spriteSheetRootPath + suffix + '.png'; + } + getDisplayName() { return this._emsClient.getValueInLanguage(this._config.name); } diff --git a/src/legacy/server/config/schema.js b/src/legacy/server/config/schema.js index 34797cd90cc30..8fbb3ef0614bb 100644 --- a/src/legacy/server/config/schema.js +++ b/src/legacy/server/config/schema.js @@ -239,6 +239,7 @@ export default () => Joi.object({ }).default(), manifestServiceUrl: Joi.string().default('https://catalogue.maps.elastic.co/v7.2/manifest'), emsLandingPageUrl: Joi.string().default('https://maps.elastic.co/v7.2'), + emsFontLibraryUrl: Joi.string().default('https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf'), emsTileLayerId: Joi.object({ bright: Joi.string().default('road_map'), desaturated: Joi.string().default('road_map_desaturated'), @@ -247,7 +248,7 @@ export default () => Joi.object({ bright: 'road_map', desaturated: 'road_map_desaturated', dark: 'dark_map', - }), + }) }).default(), i18n: Joi.object({ diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_client.js b/src/legacy/ui/public/vis/__tests__/map/ems_client.js index a6d71e4408f9c..4568cf7319884 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_client.js +++ b/src/legacy/ui/public/vis/__tests__/map/ems_client.js @@ -20,6 +20,7 @@ import expect from '@kbn/expect'; import { getEMSClient } from './ems_client_util'; import EMS_STYLE_BRIGHT_PROXIED from './ems_mocks/sample_style_bright_proxied.json'; +import EMS_STYLE_BRIGHT_VECTOR_PROXIED from './ems_mocks/sample_style_bright_vector_proxied.json'; describe('ems_client', () => { @@ -188,7 +189,6 @@ describe('ems_client', () => { it('should prepend proxypath', async () => { - const emsClient = getEMSClient({ proxyPath: 'http://proxy.com/foobar', manifestServiceUrl: 'http://proxy.com/foobar/manifest' @@ -211,6 +211,47 @@ describe('ems_client', () => { }); + it('should retrieve vectorstylesheet with all sources inlined)', async () => { + + const emsClient = getEMSClient({}); + + const tmsServices = await emsClient.getTMSServices(); + expect(tmsServices.length).to.be(3); + const tmsService = tmsServices[0]; + + const styleSheet = await tmsService.getVectorStyleSheet(); + + expect(styleSheet.layers.length).to.be(111); + expect(styleSheet.sprite).to.be('https://tiles.maps.elastic.co/styles/osm-bright/sprite'); + expect(styleSheet.sources.openmaptiles.tiles.length).to.be(1); + expect(styleSheet.sources.openmaptiles.tiles[0]).to.be('https://tiles.maps.elastic.co/data/v3/{z}/{x}/{y}.pbf?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=7.x.x'); + + }); + + it('should retrieve vectorstylesheet with all sources inlined) (proxy)', async () => { + + const emsClient = getEMSClient({ + proxyPath: 'http://proxy.com/foobar', + manifestServiceUrl: 'http://proxy.com/foobar/manifest' + }); + + const tmsServices = await emsClient.getTMSServices(); + expect(tmsServices.length).to.be(1); + const tmsService = tmsServices[0]; + + tmsService._getVectorStyleJsonRaw = () => { + return EMS_STYLE_BRIGHT_VECTOR_PROXIED; + }; + + const styleSheet = await tmsService.getVectorStyleSheet(); + + expect(styleSheet.layers.length).to.be(111); + expect(styleSheet.sprite).to.be('http://proxy.com/foobar/styles/osm-bright/sprite'); + expect(styleSheet.sources.openmaptiles.tiles.length).to.be(1); + expect(styleSheet.sources.openmaptiles.tiles[0]).to.be('http://proxy.com/foobar/data/v3/{z}/{x}/{y}.pbf?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=7.x.x'); + + }); + }); diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_client_util.js b/src/legacy/ui/public/vis/__tests__/map/ems_client_util.js index 53cbdc9d13019..9080ed5b4316d 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_client_util.js +++ b/src/legacy/ui/public/vis/__tests__/map/ems_client_util.js @@ -27,6 +27,10 @@ import EMS_STYLE_ROAD_MAP_BRIGHT from './ems_mocks/sample_style_bright'; import EMS_STYLE_ROAD_MAP_DESATURATED from './ems_mocks/sample_style_desaturated'; import EMS_STYLE_DARK_MAP from './ems_mocks/sample_style_dark'; +import EMS_STYLE_ROAD_MAP_BRIGHT_VECTOR from './ems_mocks/sample_style_bright_vector'; +import EMS_STYLE_ROAD_MAP_BRIGHT_VECTOR_SOURCE from './ems_mocks/sample_style_bright_vector_source'; +import EMS_STYLE_ROAD_MAP_BRIGHT_VECTOR_SOURCE_PROXIED from './ems_mocks/sample_style_bright_vector_source_proxied'; + import EMS_CATALOGUE_PROXIED from './ems_mocks/sample_manifest_proxied.json'; import EMS_FILES_PROXIED from './ems_mocks/sample_files_proxied.json'; import EMS_TILES_PROXIED from './ems_mocks/sample_tiles_proxied.json'; @@ -64,6 +68,16 @@ export function getEMSClient(options = {}) { return EMS_FILES_PROXIED; } else if (url.startsWith('http://proxy.com/foobar/tiles')) { return EMS_TILES_PROXIED; + } else if (url.startsWith('https://vector-style.foobar/styles')) { + if (url.includes('osm-bright')) { + return EMS_STYLE_ROAD_MAP_BRIGHT_VECTOR; + } + } else if (url.startsWith('https://tiles.maps.elastic.co/data/v3.json')) { + return EMS_STYLE_ROAD_MAP_BRIGHT_VECTOR_SOURCE; + } else if (url.startsWith('http://proxy.com/foobar/data/v3.json')) { + return EMS_STYLE_ROAD_MAP_BRIGHT_VECTOR_SOURCE_PROXIED; + } else { + throw new Error(`url unexecpted: ${url}`); } }; return emsClient; diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json new file mode 100644 index 0000000000000..b14db52644459 --- /dev/null +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json @@ -0,0 +1,4960 @@ +{ + "version": 8, + "name": "OSM Bright", + "metadata": { + "mapbox:type": "template", + "mapbox:groups": { + "1444849364238.8171": { + "collapsed": false, + "name": "Buildings" + }, + "1444849354174.1904": { + "collapsed": true, + "name": "Tunnels" + }, + "1444849388993.3071": { + "collapsed": false, + "name": "Land" + }, + "1444849242106.713": { + "collapsed": false, + "name": "Places" + }, + "1444849382550.77": { + "collapsed": false, + "name": "Water" + }, + "1444849345966.4436": { + "collapsed": false, + "name": "Roads" + }, + "1444849334699.1902": { + "collapsed": true, + "name": "Bridges" + } + }, + "mapbox:autocomposite": false, + "openmaptiles:version": "3.x", + "openmaptiles:mapbox:owner": "openmaptiles", + "openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t" + }, + "sources": { + "openmaptiles": { + "type": "vector", + "url": "https://tiles.maps.elastic.co/data/v3.json" + } + }, + "sprite": "https://tiles.maps.elastic.co/styles/osm-bright/sprite", + "glyphs": "https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "#f8f4f0" + } + }, + { + "id": "landcover-glacier", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "subclass", + "glacier" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "#fff", + "fill-opacity": { + "base": 1, + "stops": [ + [ + 0, + 0.9 + ], + [ + 10, + 0.3 + ] + ] + } + } + }, + { + "id": "landuse-residential", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "residential" + ], + "paint": { + "fill-color": { + "base": 1, + "stops": [ + [ + 12, + "hsla(30, 19%, 90%, 0.4)" + ], + [ + 16, + "hsla(30, 19%, 90%, 0.2)" + ] + ] + } + } + }, + { + "id": "landuse-commercial", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ], + [ + "==", + "class", + "commercial" + ] + ], + "paint": { + "fill-color": "hsla(0, 60%, 87%, 0.23)" + } + }, + { + "id": "landuse-industrial", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ], + [ + "==", + "class", + "industrial" + ] + ], + "paint": { + "fill-color": "hsla(49, 100%, 88%, 0.34)" + } + }, + { + "id": "park", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "==", + "$type", + "Polygon" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": { + "base": 1.8, + "stops": [ + [ + 9, + 0.5 + ], + [ + 12, + 0.2 + ] + ] + } + } + }, + { + "id": "park-outline", + "type": "line", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "==", + "$type", + "Polygon" + ], + "layout": {}, + "paint": { + "line-color": { + "base": 1, + "stops": [ + [ + 6, + "hsla(96, 40%, 49%, 0.36)" + ], + [ + 8, + "hsla(96, 40%, 49%, 0.66)" + ] + ] + }, + "line-dasharray": [ + 3, + 3 + ] + } + }, + { + "id": "landuse-cemetery", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "cemetery" + ], + "paint": { + "fill-color": "#e0e4dd" + } + }, + { + "id": "landuse-hospital", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "hospital" + ], + "paint": { + "fill-color": "#fde" + } + }, + { + "id": "landuse-school", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "school" + ], + "paint": { + "fill-color": "#f0e8f8" + } + }, + { + "id": "landuse-railway", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "railway" + ], + "paint": { + "fill-color": "hsla(30, 19%, 90%, 0.4)" + } + }, + { + "id": "landcover-wood", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "class", + "wood" + ], + "paint": { + "fill-color": "#6a4", + "fill-opacity": 0.1, + "fill-outline-color": "hsla(0, 0%, 0%, 0.03)", + "fill-antialias": { + "base": 1, + "stops": [ + [ + 0, + false + ], + [ + 9, + true + ] + ] + } + } + }, + { + "id": "landcover-grass", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "class", + "grass" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": 1 + } + }, + { + "id": "landcover-grass-park", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "==", + "class", + "public_park" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": 0.8 + } + }, + { + "id": "waterway_tunnel", + "filter": [ + "all", + [ + "in", + "class", + "river", + "stream", + "canal" + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "type": "line", + "source": "openmaptiles", + "source-layer": "waterway", + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 6 + ] + ] + }, + "line-dasharray": [ + 2, + 4 + ] + }, + "minzoom": 14 + }, + { + "id": "waterway-other", + "type": "line", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "!in", + "class", + "canal", + "river", + "stream" + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "waterway-stream-canal", + "type": "line", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "all", + [ + "in", + "class", + "canal", + "stream" + ], + [ + "!=", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "waterway-river", + "type": "line", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "all", + [ + "==", + "class", + "river" + ], + [ + "!=", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.2, + "stops": [ + [ + 10, + 0.8 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "water-offset", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "maxzoom": 8, + "filter": [ + "==", + "$type", + "Polygon" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-opacity": 1, + "fill-color": "#a0c8f0", + "fill-translate": { + "base": 1, + "stops": [ + [ + 6, + [ + 2, + 0 + ] + ], + [ + 8, + [ + 0, + 0 + ] + ] + ] + } + } + }, + { + "id": "water", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "hsl(210, 67%, 85%)" + } + }, + { + "id": "water-pattern", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-translate": [ + 0, + 2.5 + ], + "fill-pattern": "wave" + } + }, + { + "id": "landcover-ice-shelf", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "subclass", + "ice_shelf" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "#fff", + "fill-opacity": { + "base": 1, + "stops": [ + [ + 0, + 0.9 + ], + [ + 10, + 0.3 + ] + ] + } + } + }, + { + "id": "building", + "type": "fill", + "metadata": { + "mapbox:group": "1444849364238.8171" + }, + "source": "openmaptiles", + "source-layer": "building", + "paint": { + "fill-color": { + "base": 1, + "stops": [ + [ + 15.5, + "#f2eae2" + ], + [ + 16, + "#dfdbd7" + ] + ] + }, + "fill-antialias": true + } + }, + { + "id": "building-top", + "type": "fill", + "metadata": { + "mapbox:group": "1444849364238.8171" + }, + "source": "openmaptiles", + "source-layer": "building", + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-translate": { + "base": 1, + "stops": [ + [ + 14, + [ + 0, + 0 + ] + ], + [ + 16, + [ + -2, + -2 + ] + ] + ] + }, + "fill-outline-color": "#dfdbd7", + "fill-color": "#f2eae2", + "fill-opacity": { + "base": 1, + "stops": [ + [ + 13, + 0 + ], + [ + 16, + 1 + ] + ] + } + } + }, + { + "id": "tunnel-service-track-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1 + ], + [ + 16, + 4 + ], + [ + 20, + 11 + ] + ] + } + } + }, + { + "id": "tunnel-minor-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "minor" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "tunnel-secondary-tertiary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "tunnel-trunk-primary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "tunnel-motorway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "tunnel-path", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#cba", + "line-dasharray": [ + 1.5, + 0.75 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 4 + ] + ] + } + } + }, + { + "id": "tunnel-service-track", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15.5, + 0 + ], + [ + 16, + 2 + ], + [ + 20, + 7.5 + ] + ] + } + } + }, + { + "id": "tunnel-minor", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "minor_road" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "tunnel-secondary-tertiary", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 10 + ] + ] + } + } + }, + { + "id": "tunnel-trunk-primary", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "tunnel-motorway", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#ffdaa6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "tunnel-railway", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + }, + "line-dasharray": [ + 2, + 2 + ] + } + }, + { + "id": "ferry", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "in", + "class", + "ferry" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(108, 159, 182, 1)", + "line-width": 1.1, + "line-dasharray": [ + 2, + 2 + ] + } + }, + { + "id": "aeroway-taxiway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 12, + "filter": [ + "all", + [ + "in", + "class", + "taxiway" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(153, 153, 153, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 2 + ], + [ + 17, + 12 + ] + ] + }, + "line-opacity": 1 + } + }, + { + "id": "aeroway-runway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 12, + "filter": [ + "all", + [ + "in", + "class", + "runway" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(153, 153, 153, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 5 + ], + [ + 17, + 55 + ] + ] + }, + "line-opacity": 1 + } + }, + { + "id": "aeroway-area", + "type": "fill", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 4, + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ], + [ + "in", + "class", + "runway", + "taxiway" + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-opacity": { + "base": 1, + "stops": [ + [ + 13, + 0 + ], + [ + 14, + 1 + ] + ] + }, + "fill-color": "rgba(255, 255, 255, 1)" + } + }, + { + "id": "aeroway-taxiway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 4, + "filter": [ + "all", + [ + "in", + "class", + "taxiway" + ], + [ + "==", + "$type", + "LineString" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 1 + ], + [ + 17, + 10 + ] + ] + }, + "line-opacity": { + "base": 1, + "stops": [ + [ + 11, + 0 + ], + [ + 12, + 1 + ] + ] + } + } + }, + { + "id": "aeroway-runway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 4, + "filter": [ + "all", + [ + "in", + "class", + "runway" + ], + [ + "==", + "$type", + "LineString" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 4 + ], + [ + 17, + 50 + ] + ] + }, + "line-opacity": { + "base": 1, + "stops": [ + [ + 11, + 0 + ], + [ + 12, + 1 + ] + ] + } + } + }, + { + "id": "highway-area", + "type": "fill", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "==", + "$type", + "Polygon" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "hsla(0, 0%, 89%, 0.56)", + "fill-outline-color": "#cfcdca", + "fill-opacity": 0.9, + "fill-antialias": false + } + }, + { + "id": "highway-motorway-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 12, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "highway-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "highway-minor-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!=", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "minor", + "service", + "track" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "highway-secondary-tertiary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "highway-primary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": { + "stops": [ + [ + 7, + 0 + ], + [ + 8, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 7, + 0 + ], + [ + 8, + 0.6 + ], + [ + 9, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "highway-trunk-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "trunk" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": { + "stops": [ + [ + 5, + 0 + ], + [ + 6, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "highway-motorway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 4, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 4, + 0 + ], + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + }, + "line-opacity": { + "stops": [ + [ + 4, + 0 + ], + [ + 5, + 1 + ] + ] + } + } + }, + { + "id": "highway-path", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#cba", + "line-dasharray": [ + 1.5, + 0.75 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 4 + ] + ] + } + } + }, + { + "id": "highway-motorway-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 12, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "highway-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "highway-minor", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!=", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "minor", + "service", + "track" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "highway-secondary-tertiary", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 8, + 0.5 + ], + [ + 20, + 13 + ] + ] + } + } + }, + { + "id": "highway-primary", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 8.5, + 0 + ], + [ + 9, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "highway-trunk", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "trunk" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "highway-motorway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "railway-transit", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "transit" + ], + [ + "!in", + "brunnel", + "tunnel" + ] + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.77)", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 20, + 1 + ] + ] + } + } + }, + { + "id": "railway-transit-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "transit" + ], + [ + "!in", + "brunnel", + "tunnel" + ] + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.68)", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 2 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "railway-service", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "rail" + ], + [ + "has", + "service" + ] + ] + ], + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.77)", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 20, + 1 + ] + ] + } + } + }, + { + "id": "railway-service-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "rail" + ], + [ + "has", + "service" + ] + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.68)", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 2 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "railway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!has", + "service" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "railway-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!has", + "service" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ] + ], + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + } + }, + { + "id": "bridge-motorway-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "bridge-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "bridge-secondary-tertiary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 28 + ] + ] + } + } + }, + { + "id": "bridge-trunk-primary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "hsl(28, 76%, 67%)", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 26 + ] + ] + } + } + }, + { + "id": "bridge-motorway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "bridge-path-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#f8f4f0", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge-path", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#cba", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 4 + ] + ] + }, + "line-dasharray": [ + 1.5, + 0.75 + ] + } + }, + { + "id": "bridge-motorway-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "bridge-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "bridge-secondary-tertiary", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 20 + ] + ] + } + } + }, + { + "id": "bridge-trunk-primary", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge-motorway", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge-railway", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "bridge-railway-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + } + }, + { + "id": "cablecar", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "==", + "class", + "cable_car" + ], + "layout": { + "visibility": "visible", + "line-cap": "round" + }, + "paint": { + "line-color": "hsl(0, 0%, 70%)", + "line-width": { + "base": 1, + "stops": [ + [ + 11, + 1 + ], + [ + 19, + 2.5 + ] + ] + } + } + }, + { + "id": "cablecar-dash", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "==", + "class", + "cable_car" + ], + "layout": { + "visibility": "visible", + "line-cap": "round" + }, + "paint": { + "line-color": "hsl(0, 0%, 70%)", + "line-width": { + "base": 1, + "stops": [ + [ + 11, + 3 + ], + [ + 19, + 5.5 + ] + ] + }, + "line-dasharray": [ + 2, + 3 + ] + } + }, + { + "id": "boundary-land-level-4", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + ">=", + "admin_level", + 4 + ], + [ + "<=", + "admin_level", + 8 + ], + [ + "!=", + "maritime", + 1 + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#9e9cab", + "line-dasharray": [ + 3, + 1, + 1, + 1 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 4, + 0.4 + ], + [ + 5, + 1 + ], + [ + 12, + 3 + ] + ] + } + } + }, + { + "id": "boundary-land-level-2", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "==", + "admin_level", + 2 + ], + [ + "!=", + "maritime", + 1 + ], + [ + "!=", + "disputed", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "hsl(248, 7%, 66%)", + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + } + } + }, + { + "id": "boundary-land-disputed", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "!=", + "maritime", + 1 + ], + [ + "==", + "disputed", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "hsl(248, 7%, 70%)", + "line-dasharray": [ + 1, + 3 + ], + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + } + } + }, + { + "id": "boundary-water", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "in", + "admin_level", + 2, + 4 + ], + [ + "==", + "maritime", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "rgba(154, 189, 214, 1)", + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + }, + "line-opacity": { + "stops": [ + [ + 6, + 0.6 + ], + [ + 10, + 1 + ] + ] + } + } + }, + { + "id": "waterway-name", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "waterway", + "minzoom": 13, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "has", + "name" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": 14, + "text-field": "{name:latin} {name:nonlatin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "line", + "text-letter-spacing": 0.2, + "symbol-spacing": 350 + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "water-name-lakeline", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "water_name", + "filter": [ + "==", + "$type", + "LineString" + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": 14, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "line", + "symbol-spacing": 350, + "text-letter-spacing": 0.2 + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "water-name-ocean", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "water_name", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "==", + "class", + "ocean" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": 14, + "text-field": "{name:latin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "point", + "symbol-spacing": 350, + "text-letter-spacing": 0.2 + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "water-name-other", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "water_name", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "!in", + "class", + "ocean" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": { + "stops": [ + [ + 0, + 10 + ], + [ + 6, + 14 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "point", + "symbol-spacing": 350, + "text-letter-spacing": 0.2, + "visibility": "visible" + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "poi-level-3", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 16, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + ">=", + "rank", + 25 + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9 + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "poi-level-2", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "<=", + "rank", + 24 + ], + [ + ">=", + "rank", + 15 + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9 + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "poi-level-1", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 14, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "<=", + "rank", + 14 + ], + [ + "has", + "name" + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9 + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "poi-railway", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 13, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "has", + "name" + ], + [ + "==", + "class", + "railway" + ], + [ + "==", + "subclass", + "station" + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9, + "icon-optional": false, + "icon-ignore-placement": false, + "icon-allow-overlap": false, + "text-ignore-placement": false, + "text-allow-overlap": false, + "text-optional": true + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "road_oneway", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "oneway", + 1 + ], + [ + "in", + "class", + "motorway", + "trunk", + "primary", + "secondary", + "tertiary", + "minor", + "service" + ] + ], + "layout": { + "symbol-placement": "line", + "icon-image": "oneway", + "symbol-spacing": 75, + "icon-padding": 2, + "icon-rotation-alignment": "map", + "icon-rotate": 90, + "icon-size": { + "stops": [ + [ + 15, + 0.5 + ], + [ + 19, + 1 + ] + ] + } + }, + "paint": { + "icon-opacity": 0.5 + } + }, + { + "id": "road_oneway_opposite", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "oneway", + -1 + ], + [ + "in", + "class", + "motorway", + "trunk", + "primary", + "secondary", + "tertiary", + "minor", + "service" + ] + ], + "layout": { + "symbol-placement": "line", + "icon-image": "oneway", + "symbol-spacing": 75, + "icon-padding": 2, + "icon-rotation-alignment": "map", + "icon-rotate": -90, + "icon-size": { + "stops": [ + [ + 15, + 0.5 + ], + [ + 19, + 1 + ] + ] + } + }, + "paint": { + "icon-opacity": 0.5 + } + }, + { + "id": "highway-name-path", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 15.5, + "filter": [ + "==", + "class", + "path" + ], + "layout": { + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + }, + "text-font": [ + "Noto Sans Regular" + ], + "text-field": "{name:latin} {name:nonlatin}", + "symbol-placement": "line", + "text-rotation-alignment": "map" + }, + "paint": { + "text-halo-color": "#f8f4f0", + "text-color": "hsl(30, 23%, 62%)", + "text-halo-width": 0.5 + } + }, + { + "id": "highway-name-minor", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor", + "service", + "track" + ] + ], + "layout": { + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + }, + "text-font": [ + "Noto Sans Regular" + ], + "text-field": "{name:latin} {name:nonlatin}", + "symbol-placement": "line", + "text-rotation-alignment": "map" + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#765", + "text-halo-width": 1 + } + }, + { + "id": "highway-name-major", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 12.2, + "filter": [ + "in", + "class", + "primary", + "secondary", + "tertiary", + "trunk" + ], + "layout": { + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + }, + "text-font": [ + "Noto Sans Regular" + ], + "text-field": "{name:latin} {name:nonlatin}", + "symbol-placement": "line", + "text-rotation-alignment": "map" + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#765", + "text-halo-width": 1 + } + }, + { + "id": "highway-shield", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 8, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ], + [ + "==", + "$type", + "LineString" + ], + [ + "!in", + "network", + "us-interstate", + "us-highway", + "us-state" + ] + ], + "layout": { + "text-size": 10, + "icon-image": "road_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-spacing": 200, + "text-font": [ + "Noto Sans Regular" + ], + "symbol-placement": { + "base": 1, + "stops": [ + [ + 10, + "point" + ], + [ + 11, + "line" + ] + ] + }, + "text-rotation-alignment": "viewport", + "icon-size": 1, + "text-field": "{ref}" + }, + "paint": {} + }, + { + "id": "highway-shield-us-interstate", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 7, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ], + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "network", + "us-interstate" + ] + ], + "layout": { + "text-size": 10, + "icon-image": "{network}_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-spacing": 200, + "text-font": [ + "Noto Sans Regular" + ], + "symbol-placement": { + "base": 1, + "stops": [ + [ + 7, + "point" + ], + [ + 7, + "line" + ], + [ + 8, + "line" + ] + ] + }, + "text-rotation-alignment": "viewport", + "icon-size": 1, + "text-field": "{ref}" + }, + "paint": { + "text-color": "rgba(0, 0, 0, 1)" + } + }, + { + "id": "highway-shield-us-other", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 9, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ], + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "network", + "us-highway", + "us-state" + ] + ], + "layout": { + "text-size": 10, + "icon-image": "{network}_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-spacing": 200, + "text-font": [ + "Noto Sans Regular" + ], + "symbol-placement": { + "base": 1, + "stops": [ + [ + 10, + "point" + ], + [ + 11, + "line" + ] + ] + }, + "text-rotation-alignment": "viewport", + "icon-size": 1, + "text-field": "{ref}" + }, + "paint": { + "text-color": "rgba(0, 0, 0, 1)" + } + }, + { + "id": "airport-label-major", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "aerodrome_label", + "minzoom": 10, + "filter": [ + "all", + [ + "has", + "iata" + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "airport_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9, + "visibility": "visible", + "icon-size": 1, + "text-optional": true + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "place-other", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "!in", + "class", + "city", + "town", + "village", + "country", + "continent" + ], + "layout": { + "text-letter-spacing": 0.1, + "text-size": { + "base": 1.2, + "stops": [ + [ + 12, + 10 + ], + [ + 15, + 14 + ] + ] + }, + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name:latin}\n{name:nonlatin}", + "text-transform": "uppercase", + "text-max-width": 9, + "visibility": "visible" + }, + "paint": { + "text-color": "#633", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-village", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "==", + "class", + "village" + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 10, + 12 + ], + [ + 15, + 22 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-town", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "==", + "class", + "town" + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 10, + 14 + ], + [ + 15, + 24 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-city", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "!=", + "capital", + 2 + ], + [ + "==", + "class", + "city" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 14 + ], + [ + 11, + 24 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-city-capital", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "capital", + 2 + ], + [ + "==", + "class", + "city" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 14 + ], + [ + 11, + 24 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "icon-image": "star_11", + "text-offset": [ + 0.4, + 0 + ], + "icon-size": 0.8, + "text-anchor": "left", + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-other", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + ">=", + "rank", + 3 + ], + [ + "!has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 3, + 11 + ], + [ + 7, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-3", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + ">=", + "rank", + 3 + ], + [ + "has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 3, + 11 + ], + [ + 7, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-2", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + "==", + "rank", + 2 + ], + [ + "has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 2, + 11 + ], + [ + 5, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-1", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + "==", + "rank", + 1 + ], + [ + "has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 1, + 11 + ], + [ + 4, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-continent", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "maxzoom": 1.1, + "filter": [ + "==", + "class", + "continent" + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": 14, + "text-max-width": 6.25, + "text-transform": "uppercase", + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + } + ], + "id": "osm-bright", + "maxzoom": 10 +} diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_proxied.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_proxied.json new file mode 100644 index 0000000000000..1efd2f348ff2c --- /dev/null +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_proxied.json @@ -0,0 +1,4960 @@ +{ + "version": 8, + "name": "OSM Bright", + "metadata": { + "mapbox:type": "template", + "mapbox:groups": { + "1444849364238.8171": { + "collapsed": false, + "name": "Buildings" + }, + "1444849354174.1904": { + "collapsed": true, + "name": "Tunnels" + }, + "1444849388993.3071": { + "collapsed": false, + "name": "Land" + }, + "1444849242106.713": { + "collapsed": false, + "name": "Places" + }, + "1444849382550.77": { + "collapsed": false, + "name": "Water" + }, + "1444849345966.4436": { + "collapsed": false, + "name": "Roads" + }, + "1444849334699.1902": { + "collapsed": true, + "name": "Bridges" + } + }, + "mapbox:autocomposite": false, + "openmaptiles:version": "3.x", + "openmaptiles:mapbox:owner": "openmaptiles", + "openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t" + }, + "sources": { + "openmaptiles": { + "type": "vector", + "url": "/data/v3.json" + } + }, + "sprite": "/styles/osm-bright/sprite", + "glyphs": "https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "#f8f4f0" + } + }, + { + "id": "landcover-glacier", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "subclass", + "glacier" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "#fff", + "fill-opacity": { + "base": 1, + "stops": [ + [ + 0, + 0.9 + ], + [ + 10, + 0.3 + ] + ] + } + } + }, + { + "id": "landuse-residential", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "residential" + ], + "paint": { + "fill-color": { + "base": 1, + "stops": [ + [ + 12, + "hsla(30, 19%, 90%, 0.4)" + ], + [ + 16, + "hsla(30, 19%, 90%, 0.2)" + ] + ] + } + } + }, + { + "id": "landuse-commercial", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ], + [ + "==", + "class", + "commercial" + ] + ], + "paint": { + "fill-color": "hsla(0, 60%, 87%, 0.23)" + } + }, + { + "id": "landuse-industrial", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ], + [ + "==", + "class", + "industrial" + ] + ], + "paint": { + "fill-color": "hsla(49, 100%, 88%, 0.34)" + } + }, + { + "id": "park", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "==", + "$type", + "Polygon" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": { + "base": 1.8, + "stops": [ + [ + 9, + 0.5 + ], + [ + 12, + 0.2 + ] + ] + } + } + }, + { + "id": "park-outline", + "type": "line", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "==", + "$type", + "Polygon" + ], + "layout": {}, + "paint": { + "line-color": { + "base": 1, + "stops": [ + [ + 6, + "hsla(96, 40%, 49%, 0.36)" + ], + [ + 8, + "hsla(96, 40%, 49%, 0.66)" + ] + ] + }, + "line-dasharray": [ + 3, + 3 + ] + } + }, + { + "id": "landuse-cemetery", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "cemetery" + ], + "paint": { + "fill-color": "#e0e4dd" + } + }, + { + "id": "landuse-hospital", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "hospital" + ], + "paint": { + "fill-color": "#fde" + } + }, + { + "id": "landuse-school", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "school" + ], + "paint": { + "fill-color": "#f0e8f8" + } + }, + { + "id": "landuse-railway", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "railway" + ], + "paint": { + "fill-color": "hsla(30, 19%, 90%, 0.4)" + } + }, + { + "id": "landcover-wood", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "class", + "wood" + ], + "paint": { + "fill-color": "#6a4", + "fill-opacity": 0.1, + "fill-outline-color": "hsla(0, 0%, 0%, 0.03)", + "fill-antialias": { + "base": 1, + "stops": [ + [ + 0, + false + ], + [ + 9, + true + ] + ] + } + } + }, + { + "id": "landcover-grass", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "class", + "grass" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": 1 + } + }, + { + "id": "landcover-grass-park", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "==", + "class", + "public_park" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": 0.8 + } + }, + { + "id": "waterway_tunnel", + "filter": [ + "all", + [ + "in", + "class", + "river", + "stream", + "canal" + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "type": "line", + "source": "openmaptiles", + "source-layer": "waterway", + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 6 + ] + ] + }, + "line-dasharray": [ + 2, + 4 + ] + }, + "minzoom": 14 + }, + { + "id": "waterway-other", + "type": "line", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "!in", + "class", + "canal", + "river", + "stream" + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "waterway-stream-canal", + "type": "line", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "all", + [ + "in", + "class", + "canal", + "stream" + ], + [ + "!=", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "waterway-river", + "type": "line", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "all", + [ + "==", + "class", + "river" + ], + [ + "!=", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.2, + "stops": [ + [ + 10, + 0.8 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "water-offset", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "maxzoom": 8, + "filter": [ + "==", + "$type", + "Polygon" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-opacity": 1, + "fill-color": "#a0c8f0", + "fill-translate": { + "base": 1, + "stops": [ + [ + 6, + [ + 2, + 0 + ] + ], + [ + 8, + [ + 0, + 0 + ] + ] + ] + } + } + }, + { + "id": "water", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "hsl(210, 67%, 85%)" + } + }, + { + "id": "water-pattern", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-translate": [ + 0, + 2.5 + ], + "fill-pattern": "wave" + } + }, + { + "id": "landcover-ice-shelf", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "==", + "subclass", + "ice_shelf" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "#fff", + "fill-opacity": { + "base": 1, + "stops": [ + [ + 0, + 0.9 + ], + [ + 10, + 0.3 + ] + ] + } + } + }, + { + "id": "building", + "type": "fill", + "metadata": { + "mapbox:group": "1444849364238.8171" + }, + "source": "openmaptiles", + "source-layer": "building", + "paint": { + "fill-color": { + "base": 1, + "stops": [ + [ + 15.5, + "#f2eae2" + ], + [ + 16, + "#dfdbd7" + ] + ] + }, + "fill-antialias": true + } + }, + { + "id": "building-top", + "type": "fill", + "metadata": { + "mapbox:group": "1444849364238.8171" + }, + "source": "openmaptiles", + "source-layer": "building", + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-translate": { + "base": 1, + "stops": [ + [ + 14, + [ + 0, + 0 + ] + ], + [ + 16, + [ + -2, + -2 + ] + ] + ] + }, + "fill-outline-color": "#dfdbd7", + "fill-color": "#f2eae2", + "fill-opacity": { + "base": 1, + "stops": [ + [ + 13, + 0 + ], + [ + 16, + 1 + ] + ] + } + } + }, + { + "id": "tunnel-service-track-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1 + ], + [ + 16, + 4 + ], + [ + 20, + 11 + ] + ] + } + } + }, + { + "id": "tunnel-minor-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "minor" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "tunnel-secondary-tertiary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "tunnel-trunk-primary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "tunnel-motorway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "tunnel-path", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#cba", + "line-dasharray": [ + 1.5, + 0.75 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 4 + ] + ] + } + } + }, + { + "id": "tunnel-service-track", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15.5, + 0 + ], + [ + 16, + 2 + ], + [ + 20, + 7.5 + ] + ] + } + } + }, + { + "id": "tunnel-minor", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "minor_road" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "tunnel-secondary-tertiary", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 10 + ] + ] + } + } + }, + { + "id": "tunnel-trunk-primary", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "tunnel-motorway", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#ffdaa6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "tunnel-railway", + "type": "line", + "metadata": { + "mapbox:group": "1444849354174.1904" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + }, + "line-dasharray": [ + 2, + 2 + ] + } + }, + { + "id": "ferry", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "in", + "class", + "ferry" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(108, 159, 182, 1)", + "line-width": 1.1, + "line-dasharray": [ + 2, + 2 + ] + } + }, + { + "id": "aeroway-taxiway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 12, + "filter": [ + "all", + [ + "in", + "class", + "taxiway" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(153, 153, 153, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 2 + ], + [ + 17, + 12 + ] + ] + }, + "line-opacity": 1 + } + }, + { + "id": "aeroway-runway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 12, + "filter": [ + "all", + [ + "in", + "class", + "runway" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(153, 153, 153, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 5 + ], + [ + 17, + 55 + ] + ] + }, + "line-opacity": 1 + } + }, + { + "id": "aeroway-area", + "type": "fill", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 4, + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ], + [ + "in", + "class", + "runway", + "taxiway" + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-opacity": { + "base": 1, + "stops": [ + [ + 13, + 0 + ], + [ + 14, + 1 + ] + ] + }, + "fill-color": "rgba(255, 255, 255, 1)" + } + }, + { + "id": "aeroway-taxiway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 4, + "filter": [ + "all", + [ + "in", + "class", + "taxiway" + ], + [ + "==", + "$type", + "LineString" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 1 + ], + [ + 17, + 10 + ] + ] + }, + "line-opacity": { + "base": 1, + "stops": [ + [ + 11, + 0 + ], + [ + 12, + 1 + ] + ] + } + } + }, + { + "id": "aeroway-runway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 4, + "filter": [ + "all", + [ + "in", + "class", + "runway" + ], + [ + "==", + "$type", + "LineString" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.5, + "stops": [ + [ + 11, + 4 + ], + [ + 17, + 50 + ] + ] + }, + "line-opacity": { + "base": 1, + "stops": [ + [ + 11, + 0 + ], + [ + 12, + 1 + ] + ] + } + } + }, + { + "id": "highway-area", + "type": "fill", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "==", + "$type", + "Polygon" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "hsla(0, 0%, 89%, 0.56)", + "fill-outline-color": "#cfcdca", + "fill-opacity": 0.9, + "fill-antialias": false + } + }, + { + "id": "highway-motorway-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 12, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "highway-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "highway-minor-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!=", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "minor", + "service", + "track" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "highway-secondary-tertiary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "highway-primary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": { + "stops": [ + [ + 7, + 0 + ], + [ + 8, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 7, + 0 + ], + [ + 8, + 0.6 + ], + [ + 9, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "highway-trunk-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "trunk" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": { + "stops": [ + [ + 5, + 0 + ], + [ + 6, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "highway-motorway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 4, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 4, + 0 + ], + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + }, + "line-opacity": { + "stops": [ + [ + 4, + 0 + ], + [ + 5, + 1 + ] + ] + } + } + }, + { + "id": "highway-path", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#cba", + "line-dasharray": [ + 1.5, + 0.75 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 4 + ] + ] + } + } + }, + { + "id": "highway-motorway-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 12, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "highway-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "highway-minor", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!=", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "minor", + "service", + "track" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "highway-secondary-tertiary", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 8, + 0.5 + ], + [ + 20, + 13 + ] + ] + } + } + }, + { + "id": "highway-primary", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 8.5, + 0 + ], + [ + 9, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "highway-trunk", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "trunk" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "highway-motorway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "railway-transit", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "transit" + ], + [ + "!in", + "brunnel", + "tunnel" + ] + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.77)", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 20, + 1 + ] + ] + } + } + }, + { + "id": "railway-transit-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "transit" + ], + [ + "!in", + "brunnel", + "tunnel" + ] + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.68)", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 2 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "railway-service", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "rail" + ], + [ + "has", + "service" + ] + ] + ], + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.77)", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 20, + 1 + ] + ] + } + } + }, + { + "id": "railway-service-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "class", + "rail" + ], + [ + "has", + "service" + ] + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "line-color": "hsla(0, 0%, 73%, 0.68)", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 2 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "railway", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!has", + "service" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "railway-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!has", + "service" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ] + ], + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + } + }, + { + "id": "bridge-motorway-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "bridge-link-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "bridge-secondary-tertiary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 28 + ] + ] + } + } + }, + { + "id": "bridge-trunk-primary-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "hsl(28, 76%, 67%)", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 26 + ] + ] + } + } + }, + { + "id": "bridge-motorway-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.6 + ], + [ + 7, + 1.5 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "bridge-path-casing", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#f8f4f0", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge-path", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "path" + ] + ] + ], + "paint": { + "line-color": "#cba", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1.2 + ], + [ + 20, + 4 + ] + ] + }, + "line-dasharray": [ + 1.5, + 0.75 + ] + } + }, + { + "id": "bridge-motorway-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "bridge-link", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary_link", + "secondary_link", + "tertiary_link", + "trunk_link" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + } + }, + { + "id": "bridge-secondary-tertiary", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 20 + ] + ] + } + } + }, + { + "id": "bridge-trunk-primary", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge-motorway", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "motorway" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge-railway", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "bridge-railway-hatching", + "type": "line", + "metadata": { + "mapbox:group": "1444849334699.1902" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + } + }, + { + "id": "cablecar", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "==", + "class", + "cable_car" + ], + "layout": { + "visibility": "visible", + "line-cap": "round" + }, + "paint": { + "line-color": "hsl(0, 0%, 70%)", + "line-width": { + "base": 1, + "stops": [ + [ + 11, + 1 + ], + [ + 19, + 2.5 + ] + ] + } + } + }, + { + "id": "cablecar-dash", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "==", + "class", + "cable_car" + ], + "layout": { + "visibility": "visible", + "line-cap": "round" + }, + "paint": { + "line-color": "hsl(0, 0%, 70%)", + "line-width": { + "base": 1, + "stops": [ + [ + 11, + 3 + ], + [ + 19, + 5.5 + ] + ] + }, + "line-dasharray": [ + 2, + 3 + ] + } + }, + { + "id": "boundary-land-level-4", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + ">=", + "admin_level", + 4 + ], + [ + "<=", + "admin_level", + 8 + ], + [ + "!=", + "maritime", + 1 + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#9e9cab", + "line-dasharray": [ + 3, + 1, + 1, + 1 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 4, + 0.4 + ], + [ + 5, + 1 + ], + [ + 12, + 3 + ] + ] + } + } + }, + { + "id": "boundary-land-level-2", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "==", + "admin_level", + 2 + ], + [ + "!=", + "maritime", + 1 + ], + [ + "!=", + "disputed", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "hsl(248, 7%, 66%)", + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + } + } + }, + { + "id": "boundary-land-disputed", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "!=", + "maritime", + 1 + ], + [ + "==", + "disputed", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "hsl(248, 7%, 70%)", + "line-dasharray": [ + 1, + 3 + ], + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + } + } + }, + { + "id": "boundary-water", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "in", + "admin_level", + 2, + 4 + ], + [ + "==", + "maritime", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "rgba(154, 189, 214, 1)", + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + }, + "line-opacity": { + "stops": [ + [ + 6, + 0.6 + ], + [ + 10, + 1 + ] + ] + } + } + }, + { + "id": "waterway-name", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "waterway", + "minzoom": 13, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "has", + "name" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": 14, + "text-field": "{name:latin} {name:nonlatin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "line", + "text-letter-spacing": 0.2, + "symbol-spacing": 350 + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "water-name-lakeline", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "water_name", + "filter": [ + "==", + "$type", + "LineString" + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": 14, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "line", + "symbol-spacing": 350, + "text-letter-spacing": 0.2 + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "water-name-ocean", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "water_name", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "==", + "class", + "ocean" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": 14, + "text-field": "{name:latin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "point", + "symbol-spacing": 350, + "text-letter-spacing": 0.2 + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "water-name-other", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "water_name", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "!in", + "class", + "ocean" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-size": { + "stops": [ + [ + 0, + 10 + ], + [ + 6, + 14 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 5, + "text-rotation-alignment": "map", + "symbol-placement": "point", + "symbol-spacing": 350, + "text-letter-spacing": 0.2, + "visibility": "visible" + }, + "paint": { + "text-color": "#74aee9", + "text-halo-width": 1.5, + "text-halo-color": "rgba(255,255,255,0.7)" + } + }, + { + "id": "poi-level-3", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 16, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + ">=", + "rank", + 25 + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9 + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "poi-level-2", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "<=", + "rank", + 24 + ], + [ + ">=", + "rank", + 15 + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9 + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "poi-level-1", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 14, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "<=", + "rank", + 14 + ], + [ + "has", + "name" + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9 + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "poi-railway", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 13, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + "has", + "name" + ], + [ + "==", + "class", + "railway" + ], + [ + "==", + "subclass", + "station" + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "{class}_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9, + "icon-optional": false, + "icon-ignore-placement": false, + "icon-allow-overlap": false, + "text-ignore-placement": false, + "text-allow-overlap": false, + "text-optional": true + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "road_oneway", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "oneway", + 1 + ], + [ + "in", + "class", + "motorway", + "trunk", + "primary", + "secondary", + "tertiary", + "minor", + "service" + ] + ], + "layout": { + "symbol-placement": "line", + "icon-image": "oneway", + "symbol-spacing": 75, + "icon-padding": 2, + "icon-rotation-alignment": "map", + "icon-rotate": 90, + "icon-size": { + "stops": [ + [ + 15, + 0.5 + ], + [ + 19, + 1 + ] + ] + } + }, + "paint": { + "icon-opacity": 0.5 + } + }, + { + "id": "road_oneway_opposite", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "oneway", + -1 + ], + [ + "in", + "class", + "motorway", + "trunk", + "primary", + "secondary", + "tertiary", + "minor", + "service" + ] + ], + "layout": { + "symbol-placement": "line", + "icon-image": "oneway", + "symbol-spacing": 75, + "icon-padding": 2, + "icon-rotation-alignment": "map", + "icon-rotate": -90, + "icon-size": { + "stops": [ + [ + 15, + 0.5 + ], + [ + 19, + 1 + ] + ] + } + }, + "paint": { + "icon-opacity": 0.5 + } + }, + { + "id": "highway-name-path", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 15.5, + "filter": [ + "==", + "class", + "path" + ], + "layout": { + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + }, + "text-font": [ + "Noto Sans Regular" + ], + "text-field": "{name:latin} {name:nonlatin}", + "symbol-placement": "line", + "text-rotation-alignment": "map" + }, + "paint": { + "text-halo-color": "#f8f4f0", + "text-color": "hsl(30, 23%, 62%)", + "text-halo-width": 0.5 + } + }, + { + "id": "highway-name-minor", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor", + "service", + "track" + ] + ], + "layout": { + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + }, + "text-font": [ + "Noto Sans Regular" + ], + "text-field": "{name:latin} {name:nonlatin}", + "symbol-placement": "line", + "text-rotation-alignment": "map" + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#765", + "text-halo-width": 1 + } + }, + { + "id": "highway-name-major", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 12.2, + "filter": [ + "in", + "class", + "primary", + "secondary", + "tertiary", + "trunk" + ], + "layout": { + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + }, + "text-font": [ + "Noto Sans Regular" + ], + "text-field": "{name:latin} {name:nonlatin}", + "symbol-placement": "line", + "text-rotation-alignment": "map" + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#765", + "text-halo-width": 1 + } + }, + { + "id": "highway-shield", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 8, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ], + [ + "==", + "$type", + "LineString" + ], + [ + "!in", + "network", + "us-interstate", + "us-highway", + "us-state" + ] + ], + "layout": { + "text-size": 10, + "icon-image": "road_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-spacing": 200, + "text-font": [ + "Noto Sans Regular" + ], + "symbol-placement": { + "base": 1, + "stops": [ + [ + 10, + "point" + ], + [ + 11, + "line" + ] + ] + }, + "text-rotation-alignment": "viewport", + "icon-size": 1, + "text-field": "{ref}" + }, + "paint": {} + }, + { + "id": "highway-shield-us-interstate", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 7, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ], + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "network", + "us-interstate" + ] + ], + "layout": { + "text-size": 10, + "icon-image": "{network}_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-spacing": 200, + "text-font": [ + "Noto Sans Regular" + ], + "symbol-placement": { + "base": 1, + "stops": [ + [ + 7, + "point" + ], + [ + 7, + "line" + ], + [ + 8, + "line" + ] + ] + }, + "text-rotation-alignment": "viewport", + "icon-size": 1, + "text-field": "{ref}" + }, + "paint": { + "text-color": "rgba(0, 0, 0, 1)" + } + }, + { + "id": "highway-shield-us-other", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 9, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ], + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "network", + "us-highway", + "us-state" + ] + ], + "layout": { + "text-size": 10, + "icon-image": "{network}_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-spacing": 200, + "text-font": [ + "Noto Sans Regular" + ], + "symbol-placement": { + "base": 1, + "stops": [ + [ + 10, + "point" + ], + [ + 11, + "line" + ] + ] + }, + "text-rotation-alignment": "viewport", + "icon-size": 1, + "text-field": "{ref}" + }, + "paint": { + "text-color": "rgba(0, 0, 0, 1)" + } + }, + { + "id": "airport-label-major", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "aerodrome_label", + "minzoom": 10, + "filter": [ + "all", + [ + "has", + "iata" + ] + ], + "layout": { + "text-padding": 2, + "text-font": [ + "Noto Sans Regular" + ], + "text-anchor": "top", + "icon-image": "airport_11", + "text-field": "{name:latin}\n{name:nonlatin}", + "text-offset": [ + 0, + 0.6 + ], + "text-size": 12, + "text-max-width": 9, + "visibility": "visible", + "icon-size": 1, + "text-optional": true + }, + "paint": { + "text-halo-blur": 0.5, + "text-color": "#666", + "text-halo-width": 1, + "text-halo-color": "#ffffff" + } + }, + { + "id": "place-other", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "!in", + "class", + "city", + "town", + "village", + "country", + "continent" + ], + "layout": { + "text-letter-spacing": 0.1, + "text-size": { + "base": 1.2, + "stops": [ + [ + 12, + 10 + ], + [ + 15, + 14 + ] + ] + }, + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name:latin}\n{name:nonlatin}", + "text-transform": "uppercase", + "text-max-width": 9, + "visibility": "visible" + }, + "paint": { + "text-color": "#633", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-village", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "==", + "class", + "village" + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 10, + 12 + ], + [ + 15, + 22 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-town", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "==", + "class", + "town" + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 10, + 14 + ], + [ + 15, + 24 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-city", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "!=", + "capital", + 2 + ], + [ + "==", + "class", + "city" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 14 + ], + [ + 11, + 24 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-city-capital", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "capital", + 2 + ], + [ + "==", + "class", + "city" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Regular" + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 14 + ], + [ + 11, + 24 + ] + ] + }, + "text-field": "{name:latin}\n{name:nonlatin}", + "text-max-width": 8, + "icon-image": "star_11", + "text-offset": [ + 0.4, + 0 + ], + "icon-size": 0.8, + "text-anchor": "left", + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-width": 1.2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-other", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + ">=", + "rank", + 3 + ], + [ + "!has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Italic" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 3, + 11 + ], + [ + 7, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-3", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + ">=", + "rank", + 3 + ], + [ + "has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 3, + 11 + ], + [ + 7, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-2", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + "==", + "rank", + 2 + ], + [ + "has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 2, + 11 + ], + [ + 5, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-country-1", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 1.1, + "filter": [ + "all", + [ + "==", + "class", + "country" + ], + [ + "==", + "rank", + 1 + ], + [ + "has", + "iso_a2" + ] + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": { + "stops": [ + [ + 1, + 11 + ], + [ + 4, + 17 + ] + ] + }, + "text-transform": "uppercase", + "text-max-width": 6.25, + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + }, + { + "id": "place-continent", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "maxzoom": 1.1, + "filter": [ + "==", + "class", + "continent" + ], + "layout": { + "text-font": [ + "Noto Sans Bold" + ], + "text-field": "{name_en}", + "text-size": 14, + "text-max-width": 6.25, + "text-transform": "uppercase", + "visibility": "visible" + }, + "paint": { + "text-halo-blur": 1, + "text-color": "#334", + "text-halo-width": 2, + "text-halo-color": "rgba(255,255,255,0.8)" + } + } + ], + "id": "osm-bright", + "maxzoom": 10 +} diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json new file mode 100644 index 0000000000000..a32b627dba2c2 --- /dev/null +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json @@ -0,0 +1,735 @@ +{ + "tiles": [ + "https://tiles.maps.elastic.co/data/v3/{z}/{x}/{y}.pbf" + ], + "name": "OpenMapTiles", + "format": "pbf", + "basename": "planet.mbtiles", + "id": "openmaptiles", + "attribution": "© MapTiler © OpenStreetMap contributors", + "bounds": [ + -180, + -85.0511, + 180, + 85.0511 + ], + "center": [ + -12.2168, + 28.6135, + 4 + ], + "description": "A tileset showcasing all layers in OpenMapTiles. https://openmaptiles.org", + "maxzoom": 10, + "minzoom": 0, + "pixel_scale": "256", + "vector_layers": [ + { + "maxzoom": 10, + "fields": { + "class": "String" + }, + "minzoom": 0, + "id": "water", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "brunnel": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "waterway", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "class": "String", + "subclass": "String" + }, + "minzoom": 0, + "id": "landcover", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "class": "String" + }, + "minzoom": 0, + "id": "landuse", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "osm_id": "Number", + "name:ml": "String", + "name:pl": "String", + "ele": "Number", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:ru": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "ele_ft": "Number", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "mountain_peak", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:sr": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "class": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "park", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "admin_level": "Number", + "disputed": "Number", + "maritime": "Number" + }, + "minzoom": 0, + "id": "boundary", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "ref": "String", + "class": "String" + }, + "minzoom": 0, + "id": "aeroway", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "layer": "Number", + "service": "String", + "level": "Number", + "brunnel": "String", + "indoor": "Number", + "ramp": "Number", + "subclass": "String", + "oneway": "Number", + "class": "String" + }, + "minzoom": 0, + "id": "transportation", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "render_min_height": "Number", + "hide_3d": "Boolean", + "render_height": "Number" + }, + "minzoom": 0, + "id": "building", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "water_name", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "layer": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "subclass": "String", + "name:de": "String", + "indoor": "Number", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "network": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "ref": "String", + "name:ja_kana": "String", + "level": "Number", + "ref_length": "Number", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "transportation_name", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "capital": "Number", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "iso_a2": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "place", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "housenumber": "String" + }, + "minzoom": 0, + "id": "housenumber", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "layer": "Number", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "subclass": "String", + "name:de": "String", + "indoor": "Number", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "level": "Number", + "name:is": "String", + "name:th": "String", + "agg_stop": "Number", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "poi", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "osm_id": "Number", + "name:ml": "String", + "name:pl": "String", + "ele": "Number", + "iata": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "ele_ft": "Number", + "name:uk": "String", + "name:hy": "String", + "name:ru": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "icao": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "aerodrome_label", + "description": "" + } + ], + "maskLevel": "8", + "planettime": "1555286400000", + "version": "3.9", + "tilejson": "2.0.0" +} diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source_proxied.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source_proxied.json new file mode 100644 index 0000000000000..9961d54028b13 --- /dev/null +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source_proxied.json @@ -0,0 +1,735 @@ +{ + "tiles": [ + "/data/v3/{z}/{x}/{y}.pbf" + ], + "name": "OpenMapTiles", + "format": "pbf", + "basename": "planet.mbtiles", + "id": "openmaptiles", + "attribution": "© MapTiler © OpenStreetMap contributors", + "bounds": [ + -180, + -85.0511, + 180, + 85.0511 + ], + "center": [ + -12.2168, + 28.6135, + 4 + ], + "description": "A tileset showcasing all layers in OpenMapTiles. https://openmaptiles.org", + "maxzoom": 10, + "minzoom": 0, + "pixel_scale": "256", + "vector_layers": [ + { + "maxzoom": 10, + "fields": { + "class": "String" + }, + "minzoom": 0, + "id": "water", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "brunnel": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "waterway", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "class": "String", + "subclass": "String" + }, + "minzoom": 0, + "id": "landcover", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "class": "String" + }, + "minzoom": 0, + "id": "landuse", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "osm_id": "Number", + "name:ml": "String", + "name:pl": "String", + "ele": "Number", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:ru": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "ele_ft": "Number", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "mountain_peak", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:sr": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "class": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "park", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "admin_level": "Number", + "disputed": "Number", + "maritime": "Number" + }, + "minzoom": 0, + "id": "boundary", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "ref": "String", + "class": "String" + }, + "minzoom": 0, + "id": "aeroway", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "layer": "Number", + "service": "String", + "level": "Number", + "brunnel": "String", + "indoor": "Number", + "ramp": "Number", + "subclass": "String", + "oneway": "Number", + "class": "String" + }, + "minzoom": 0, + "id": "transportation", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "render_min_height": "Number", + "hide_3d": "Boolean", + "render_height": "Number" + }, + "minzoom": 0, + "id": "building", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "water_name", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "layer": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "subclass": "String", + "name:de": "String", + "indoor": "Number", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "network": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "ref": "String", + "name:ja_kana": "String", + "level": "Number", + "ref_length": "Number", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "transportation_name", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "capital": "Number", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "iso_a2": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "place", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "housenumber": "String" + }, + "minzoom": 0, + "id": "housenumber", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "layer": "Number", + "rank": "Number", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "name:ru": "String", + "name:ml": "String", + "name:pl": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "subclass": "String", + "name:de": "String", + "indoor": "Number", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "name:uk": "String", + "name:hy": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "name:ja_kana": "String", + "level": "Number", + "name:is": "String", + "name:th": "String", + "agg_stop": "Number", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "poi", + "description": "" + }, + { + "maxzoom": 10, + "fields": { + "name:mt": "String", + "name:pt": "String", + "name:az": "String", + "name:cy": "String", + "name:rm": "String", + "name:ko": "String", + "name:kn": "String", + "name:ar": "String", + "name:cs": "String", + "name_de": "String", + "name:ro": "String", + "name:it": "String", + "osm_id": "Number", + "name:ml": "String", + "name:pl": "String", + "ele": "Number", + "iata": "String", + "name:ca": "String", + "name_int": "String", + "name:hu": "String", + "name:ka": "String", + "name:fi": "String", + "name:da": "String", + "name:de": "String", + "name:tr": "String", + "name:fr": "String", + "name:mk": "String", + "name:sl": "String", + "name:nonlatin": "String", + "name:fy": "String", + "name:zh": "String", + "name:ko_rm": "String", + "name:lv": "String", + "name:ja": "String", + "name:lt": "String", + "name:no": "String", + "name:kk": "String", + "name:sv": "String", + "name:he": "String", + "name:ja_rm": "String", + "name:ga": "String", + "name:br": "String", + "name:bs": "String", + "name:lb": "String", + "class": "String", + "name:la": "String", + "name:sk": "String", + "ele_ft": "Number", + "name:uk": "String", + "name:hy": "String", + "name:ru": "String", + "name:be": "String", + "name_en": "String", + "name:bg": "String", + "name:hr": "String", + "name:sr": "String", + "name:sq": "String", + "name:el": "String", + "name:eo": "String", + "name:en": "String", + "name": "String", + "name:gd": "String", + "icao": "String", + "name:ja_kana": "String", + "name:is": "String", + "name:th": "String", + "name:latin": "String", + "name:sr-Latn": "String", + "name:et": "String", + "name:nl": "String", + "name:es": "String" + }, + "minzoom": 0, + "id": "aerodrome_label", + "description": "" + } + ], + "maskLevel": "8", + "planettime": "1555286400000", + "version": "3.9", + "tilejson": "2.0.0" +} diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles_proxied.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles_proxied.json index 16166d83a2274..b57938e553c7f 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles_proxied.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles_proxied.json @@ -19,7 +19,7 @@ { "locale": "en", "format": "vector", - "url": "/vector/osm.bright.json" + "url": "/tiles/vector/osm.bright.json" }, { "locale": "en", diff --git a/x-pack/legacy/plugins/maps/common/constants.js b/x-pack/legacy/plugins/maps/common/constants.js index 6244255e55a79..a12cec442ea7a 100644 --- a/x-pack/legacy/plugins/maps/common/constants.js +++ b/x-pack/legacy/plugins/maps/common/constants.js @@ -5,12 +5,20 @@ */ export const EMS_CATALOGUE_PATH = 'ems/catalogue'; + export const EMS_FILES_CATALOGUE_PATH = 'ems/files'; export const EMS_FILES_DEFAULT_JSON_PATH = 'ems/files/file'; +export const EMS_GLYPHS_PATH = 'ems/fonts'; +export const EMS_SPRITES_PATH = 'ems/sprites'; export const EMS_TILES_CATALOGUE_PATH = 'ems/tiles'; -export const EMS_TILES_RASTER_TILE_PATH = 'ems/tiles/raster/tile'; export const EMS_TILES_RASTER_STYLE_PATH = 'ems/tiles/raster/style'; +export const EMS_TILES_RASTER_TILE_PATH = 'ems/tiles/raster/tile'; + +export const EMS_TILES_VECTOR_STYLE_PATH = 'ems/tiles/vector/style'; +export const EMS_TILES_VECTOR_SOURCE_PATH = 'ems/tiles/vector/source'; +export const EMS_TILES_VECTOR_TILE_PATH = 'ems/tiles/vector/tile'; + export const MAP_SAVED_OBJECT_TYPE = 'map'; export const APP_ID = 'maps'; diff --git a/x-pack/legacy/plugins/maps/index.js b/x-pack/legacy/plugins/maps/index.js index 2934a44504bcf..38fe0c2486a95 100644 --- a/x-pack/legacy/plugins/maps/index.js +++ b/x-pack/legacy/plugins/maps/index.js @@ -45,6 +45,7 @@ export function maps(kibana) { showMapsInspectorAdapter: serverConfig.get('xpack.maps.showMapsInspectorAdapter'), preserveDrawingBuffer: serverConfig.get('xpack.maps.preserveDrawingBuffer'), isEmsEnabled: mapConfig.includeElasticMapsService, + emsFontLibraryUrl: mapConfig.emsFontLibraryUrl, emsTileLayerId: mapConfig.emsTileLayerId, proxyElasticMapsServiceInMaps: mapConfig.proxyElasticMapsServiceInMaps, emsManifestServiceUrl: mapConfig.manifestServiceUrl, diff --git a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js index 317a94c8cdfe7..5dc08751347e4 100644 --- a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js +++ b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js @@ -52,10 +52,7 @@ describe('kibana.yml configured with map.tilemap.url', () => { sourceDescriptor: { type: 'KIBANA_TILEMAP' }, - style: { - properties: {}, - type: 'TILE', - }, + style: {}, type: 'TILE', visible: true, }]); @@ -99,11 +96,8 @@ describe('EMS is enabled', () => { isAutoSelect: true, type: 'EMS_TMS' }, - style: { - properties: {}, - type: 'TILE', - }, - type: 'TILE', + style: {}, + type: 'VECTOR_TILE', visible: true, }]); }); diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/view.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/view.js index 439c2e18f097c..dac695b9c3e26 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/view.js @@ -53,9 +53,11 @@ export class AddLayerPanel extends Component { this.props.removeTransientLayer(); return; } + + const style = (this.state.layer && this.state.layer.getCurrentStyle()) ? this.state.layer.getCurrentStyle().getDescriptor() : null; const layerInitProps = { ...options, - ...(this.state.layer && { style: this.state.layer.getCurrentStyle().getDescriptor() }) + style: style }; const newLayer = source.createDefaultLayer(layerInitProps, this.props.mapColors); this.setState( @@ -78,7 +80,7 @@ export class AddLayerPanel extends Component { _onSourceSelectionChange = ({ type, isIndexingSource }) => { this.setState({ sourceType: type, importView: isIndexingSource }); - } + }; _layerAddHandler = () => { const { isIndexingTriggered, setIndexingTriggered, selectLayerAndAdd, diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js index 6019b07fdddf7..dfe50a015eb24 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js @@ -10,29 +10,30 @@ import { RGBAImage } from './image_utils'; export function removeOrphanedSourcesAndLayers(mbMap, layerList) { const mbStyle = mbMap.getStyle(); + + const mbLayerIdsToRemove = []; + mbStyle.layers.forEach(mbLayer => { + const layer = layerList.find(layer => { + return layer.ownsMbLayerId(mbLayer.id); + }); + if (!layer) { + mbLayerIdsToRemove.push(mbLayer.id); + } + }); + mbLayerIdsToRemove.forEach((mbLayerId) => mbMap.removeLayer(mbLayerId)); + const mbSourcesToRemove = []; - for (const sourceId in mbStyle.sources) { - if (mbStyle.sources.hasOwnProperty(sourceId)) { + for (const mbSourceId in mbStyle.sources) { + if (mbStyle.sources.hasOwnProperty(mbSourceId)) { const layer = layerList.find(layer => { - return layer.ownsMbSourceId(sourceId); + return layer.ownsMbSourceId(mbSourceId); }); if (!layer) { - mbSourcesToRemove.push(sourceId); + mbSourcesToRemove.push(mbSourceId); } } } - const mbLayersToRemove = []; - mbStyle.layers.forEach(layer => { - if (mbSourcesToRemove.indexOf(layer.source) >= 0) { - mbLayersToRemove.push(layer.id); - } - }); - mbLayersToRemove.forEach((layerId) => { - mbMap.removeLayer(layerId); - }); - mbSourcesToRemove.forEach(sourceId => { - mbMap.removeSource(sourceId); - }); + mbSourcesToRemove.forEach(mbSourceId => mbMap.removeSource(mbSourceId)); } @@ -58,7 +59,7 @@ export function syncLayerOrderForSingleLayer(mbMap, layerList) { const currentLayerOrderLayerIds = _.uniq(layerIds); const newLayerOrderLayerIdsUnfiltered = layerList.map(l => l.getId()); - const newLayerOrderLayerIds = newLayerOrderLayerIdsUnfiltered.filter(layerId => currentLayerOrderLayerIds.includes(layerId)); + const newLayerOrderLayerIds = newLayerOrderLayerIdsUnfiltered.filter(layerId => currentLayerOrderLayerIds.includes(layerId)); let netPos = 0; let netNeg = 0; @@ -72,7 +73,7 @@ export function syncLayerOrderForSingleLayer(mbMap, layerList) { return; } const movedLayerId = (netPos >= netNeg) && movementArr.find(l => l.movement < 0).id || - (netPos < netNeg) && movementArr.find(l => l.movement > 0).id; + (netPos < netNeg) && movementArr.find(l => l.movement > 0).id; const nextLayerIdx = newLayerOrderLayerIds.findIndex(layerId => layerId === movedLayerId) + 1; let nextMbLayerId; @@ -108,19 +109,25 @@ function getImageData(img) { return context.getImageData(0, 0, img.width, img.height); } -export async function addSpritesheetToMap(json, img, mbMap) { +export async function addSpritesheetToMap(json, imgUrl, mbMap) { + const image = new Image(); + image.crossOrigin = 'Anonymous'; image.onload = (el) => { const imgData = getImageData(el.currentTarget); for (const imageId in json) { - if (json.hasOwnProperty(imageId)) { - const { width, height, x, y, sdf, pixelRatio } = json[imageId]; - const data = new RGBAImage({ width, height }); - RGBAImage.copy(imgData, data, { x, y }, { x: 0, y: 0 }, { width, height }); - // TODO not sure how to catch errors? - mbMap.addImage(imageId, data, { pixelRatio, sdf }); + if (!(json.hasOwnProperty(imageId) && !mbMap.hasImage(imageId))) { + continue; + } + const { width, height, x, y, sdf, pixelRatio } = json[imageId]; + if (typeof width !== 'number' || typeof height !== 'number') { + continue; } + + const data = new RGBAImage({ width, height }); + RGBAImage.copy(imgData, data, { x, y }, { x: 0, y: 0 }, { width, height }); + mbMap.addImage(imageId, data, { pixelRatio, sdf }); } }; - image.src = img; + image.src = imgUrl; } diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js index 49966d44d9118..649492c994671 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js @@ -14,6 +14,7 @@ import { removeOrphanedSourcesAndLayers, addSpritesheetToMap } from './utils'; +import { getGlyphUrl, isRetina } from '../../../meta'; import { DECIMAL_DEGREES_PRECISION, FEATURE_ID_PROPERTY_NAME, @@ -37,7 +38,6 @@ import sprites1 from '@elastic/maki/dist/sprite@1.png'; import sprites2 from '@elastic/maki/dist/sprite@2.png'; import { i18n } from '@kbn/i18n'; -const isRetina = window.devicePixelRatio === 2; const mbDrawModes = MapboxDraw.modes; mbDrawModes.draw_rectangle = DrawRectangle; @@ -46,6 +46,9 @@ const TOOLTIP_TYPE = { LOCKED: 'LOCKED' }; +// eslint-disable-next-line max-len,camelcase +const TRANSPARENT_1x1_BASE64_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII='; + export class MBMapContainer extends React.Component { state = { @@ -126,7 +129,7 @@ export class MBMapContainer extends React.Component { this.props.addFilters([filter]); } catch (error) { // TODO notify user why filter was not created - console.log(error); + console.error(error); } finally { this.props.disableDrawState(); } @@ -366,14 +369,21 @@ export class MBMapContainer extends React.Component { async _createMbMapInstance() { const initialView = this.props.goto ? this.props.goto.center : null; return new Promise((resolve) => { + + const mbStyle = { + version: 8, + sources: {}, + layers: [] + }; + const glyphUrl = getGlyphUrl(); + if (glyphUrl) { + mbStyle.glyphs = glyphUrl; + } + const options = { attributionControl: false, container: this.refs.mapContainer, - style: { - version: 8, - sources: {}, - layers: [] - }, + style: mbStyle, scrollZoom: this.props.scrollZoom, preserveDrawingBuffer: chrome.getInjected('preserveDrawingBuffer', false) }; @@ -390,8 +400,18 @@ export class MBMapContainer extends React.Component { mbMap.addControl( new mapboxgl.NavigationControl({ showCompass: false }), 'top-left' ); + + let emptyImage; + mbMap.on('styleimagemissing', (e) => { + if (emptyImage) { + mbMap.addImage(e.id, emptyImage); + } + }); mbMap.on('load', () => { - resolve(mbMap); + mbMap.loadImage(TRANSPARENT_1x1_BASE64_URI, (error, data) => { + emptyImage = data; + resolve(mbMap); + }); }); }); } @@ -451,8 +471,8 @@ export class MBMapContainer extends React.Component { } _loadMakiSprites() { - const sprites = isRetina ? sprites2 : sprites1; - const json = isRetina ? spritesheet[2] : spritesheet[1]; + const sprites = isRetina() ? sprites2 : sprites1; + const json = isRetina() ? spritesheet[2] : spritesheet[1]; addSpritesheetToMap(json, sprites, this._mbMap); } @@ -568,12 +588,6 @@ export class MBMapContainer extends React.Component { }; - _getLayerById(layerId) { - return this.props.layerList.find((layer) => { - return layer.getId() === layerId; - }); - } - _getLayerByMbLayerId(mbLayerId) { return this.props.layerList.find((layer) => { const mbLayerIds = layer.getMbLayerIds(); @@ -588,10 +602,7 @@ export class MBMapContainer extends React.Component { } removeOrphanedSourcesAndLayers(this._mbMap, this.props.layerList); - this.props.layerList.forEach(layer => { - layer.syncLayerWithMB(this._mbMap); - }); - + this.props.layerList.forEach(layer => layer.syncLayerWithMB(this._mbMap)); syncLayerOrderForSingleLayer(this._mbMap, this.props.layerList); }; diff --git a/x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js b/x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js index 7ccd98b88996c..df20cbff84d36 100644 --- a/x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js +++ b/x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js @@ -82,7 +82,7 @@ export class HeatmapLayer extends VectorLayer { mbSourceAfter.setData(featureCollection); } - mbMap.setLayoutProperty(heatmapLayerId, 'visibility', this.isVisible() ? 'visible' : 'none'); + this.syncVisibilityWithMb(mbMap, heatmapLayerId); this._style.setMBPaintProperties({ mbMap, layerId: heatmapLayerId, diff --git a/x-pack/legacy/plugins/maps/public/layers/layer.js b/x-pack/legacy/plugins/maps/public/layers/layer.js index f0186d91ab1a0..fe2f58c0264a3 100644 --- a/x-pack/legacy/plugins/maps/public/layers/layer.js +++ b/x-pack/legacy/plugins/maps/public/layers/layer.js @@ -340,6 +340,9 @@ export class AbstractLayer { } renderStyleEditor({ onStyleDescriptorChange }) { + if (!this._style) { + return null; + } return this._style.renderEditor({ layer: this, onStyleDescriptorChange }); } @@ -359,5 +362,9 @@ export class AbstractLayer { return []; } + syncVisibilityWithMb(mbMap, mbLayerId) { + mbMap.setLayoutProperty(mbLayerId, 'visibility', this.isVisible() ? 'visible' : 'none'); + } + } diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js b/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js index 2c45deac47c93..2f817aabeda53 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js +++ b/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js @@ -8,7 +8,7 @@ import _ from 'lodash'; import chrome from 'ui/chrome'; import React from 'react'; import { AbstractTMSSource } from '../tms_source'; -import { TileLayer } from '../../tile_layer'; +import { VectorTileLayer } from '../../vector_tile_layer'; import { getEMSClient } from '../../../meta'; import { EMSTMSCreateSourceEditor } from './create_source_editor'; @@ -89,14 +89,14 @@ export class EMSTMSSource extends AbstractTMSSource { } _createDefaultLayerDescriptor(options) { - return TileLayer.createDescriptor({ + return VectorTileLayer.createDescriptor({ sourceDescriptor: this._descriptor, ...options }); } createDefaultLayer(options) { - return new TileLayer({ + return new VectorTileLayer({ layerDescriptor: this._createDefaultLayerDescriptor(options), source: this }); @@ -135,6 +135,20 @@ export class EMSTMSSource extends AbstractTMSSource { return await emsTMSService.getUrlTemplate(); } + getSpriteNamespacePrefix() { + return 'ems/' + this._getEmsTileLayerId(); + } + + async getVectorStyleSheetAndSpriteMeta(isRetina) { + const emsTMSService = await this._getEMSTMSService(); + const styleSheet = await emsTMSService.getVectorStyleSheet(); + const spriteMeta = await emsTMSService.getSpriteSheetMeta(isRetina); + return { + vectorStyleSheet: styleSheet, + spriteMeta: spriteMeta + }; + } + _getEmsTileLayerId() { if (!this._descriptor.isAutoSelect) { return this._descriptor.id; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/tile_style.js b/x-pack/legacy/plugins/maps/public/layers/styles/tile_style.js deleted file mode 100644 index ede74aeb64cb3..0000000000000 --- a/x-pack/legacy/plugins/maps/public/layers/styles/tile_style.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { AbstractStyle } from './abstract_style'; -import { i18n } from '@kbn/i18n'; - -export class TileStyle extends AbstractStyle { - - static type = 'TILE'; - - constructor(styleDescriptor = {}) { - super(); - this._descriptor = TileStyle.createDescriptor(styleDescriptor.properties); - } - - static createDescriptor(properties = {}) { - return { - type: TileStyle.type, - properties: { - ...properties, - } - }; - } - - static getDisplayName() { - return i18n.translate('xpack.maps.style.tile.displayNameLabel', { - defaultMessage: 'Tile style' - }); - } -} diff --git a/x-pack/legacy/plugins/maps/public/layers/tile_layer.js b/x-pack/legacy/plugins/maps/public/layers/tile_layer.js index 928a005460198..b932b5303d40b 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tile_layer.js +++ b/x-pack/legacy/plugins/maps/public/layers/tile_layer.js @@ -6,7 +6,6 @@ import { AbstractLayer } from './layer'; import _ from 'lodash'; -import { TileStyle } from '../layers/styles/tile_style'; import { SOURCE_DATA_ID_ORIGIN } from '../../common/constants'; export class TileLayer extends AbstractLayer { @@ -15,17 +14,12 @@ export class TileLayer extends AbstractLayer { constructor({ layerDescriptor, source, style }) { super({ layerDescriptor, source, style }); - if (!style) { - this._style = new TileStyle(); - } } static createDescriptor(options) { const tileLayerDescriptor = super.createDescriptor(options); tileLayerDescriptor.type = TileLayer.type; tileLayerDescriptor.alpha = _.get(options, 'alpha', 1); - tileLayerDescriptor.style = - TileStyle.createDescriptor(tileLayerDescriptor.style.properties); return tileLayerDescriptor; } @@ -102,7 +96,7 @@ export class TileLayer extends AbstractLayer { } _setTileLayerProperties(mbMap, mbLayerId) { - mbMap.setLayoutProperty(mbLayerId, 'visibility', this.isVisible() ? 'visible' : 'none'); + this.syncVisibilityWithMb(mbMap, mbLayerId); mbMap.setLayerZoomRange(mbLayerId, this._descriptor.minZoom, this._descriptor.maxZoom); mbMap.setPaintProperty(mbLayerId, 'raster-opacity', this.getAlpha()); } diff --git a/x-pack/legacy/plugins/maps/public/layers/vector_layer.js b/x-pack/legacy/plugins/maps/public/layers/vector_layer.js index 17146956af8d1..b9f6599da59cd 100644 --- a/x-pack/legacy/plugins/maps/public/layers/vector_layer.js +++ b/x-pack/legacy/plugins/maps/public/layers/vector_layer.js @@ -566,23 +566,23 @@ export class VectorLayer extends AbstractLayer { const pointLayer = mbMap.getLayer(pointLayerId); const symbolLayer = mbMap.getLayer(symbolLayerId); - let layerId; + let mbLayerId; if (this._style.arePointsSymbolizedAsCircles()) { - layerId = pointLayerId; + mbLayerId = pointLayerId; if (symbolLayer) { mbMap.setLayoutProperty(symbolLayerId, 'visibility', 'none'); } this._setMbCircleProperties(mbMap); } else { - layerId = symbolLayerId; + mbLayerId = symbolLayerId; if (pointLayer) { mbMap.setLayoutProperty(pointLayerId, 'visibility', 'none'); } this._setMbSymbolProperties(mbMap); } - mbMap.setLayoutProperty(layerId, 'visibility', this.isVisible() ? 'visible' : 'none'); - mbMap.setLayerZoomRange(layerId, this._descriptor.minZoom, this._descriptor.maxZoom); + this.syncVisibilityWithMb(mbMap, mbLayerId); + mbMap.setLayerZoomRange(mbLayerId, this._descriptor.minZoom, this._descriptor.maxZoom); } _setMbCircleProperties(mbMap) { @@ -656,8 +656,9 @@ export class VectorLayer extends AbstractLayer { fillLayerId, lineLayerId, }); - mbMap.setLayoutProperty(fillLayerId, 'visibility', this.isVisible() ? 'visible' : 'none'); - mbMap.setLayoutProperty(lineLayerId, 'visibility', this.isVisible() ? 'visible' : 'none'); + + this.syncVisibilityWithMb(mbMap, fillLayerId); + this.syncVisibilityWithMb(mbMap, lineLayerId); mbMap.setLayerZoomRange(lineLayerId, this._descriptor.minZoom, this._descriptor.maxZoom); mbMap.setLayerZoomRange(fillLayerId, this._descriptor.minZoom, this._descriptor.maxZoom); } diff --git a/x-pack/legacy/plugins/maps/public/layers/vector_tile_layer.js b/x-pack/legacy/plugins/maps/public/layers/vector_tile_layer.js new file mode 100644 index 0000000000000..f15ffa417d2ba --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/layers/vector_tile_layer.js @@ -0,0 +1,228 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { TileLayer } from './tile_layer'; +import _ from 'lodash'; +import { SOURCE_DATA_ID_ORIGIN } from '../../common/constants'; +import { isRetina } from '../meta'; +import { addSpritesheetToMap } from '../connected_components/map/mb/utils';//todo move this implementation + +const MB_STYLE_TYPE_TO_OPACITY = { + 'fill': ['fill-opacity'], + 'line': ['line-opacity'], + 'circle': ['circle-opacity'], + 'background': ['background-opacity'], + 'symbol': ['icon-opacity', 'text-opacity'] +}; + +export class VectorTileLayer extends TileLayer { + + static type = 'VECTOR_TILE'; + + constructor({ layerDescriptor, source, style }) { + super({ layerDescriptor, source, style }); + } + + static createDescriptor(options) { + const tileLayerDescriptor = super.createDescriptor(options); + tileLayerDescriptor.type = VectorTileLayer.type; + tileLayerDescriptor.alpha = _.get(options, 'alpha', 1); + return tileLayerDescriptor; + } + + async syncData({ startLoading, stopLoading, onLoadError, dataFilters }) { + if (!this.isVisible() || !this.showAtZoomLevel(dataFilters.zoom)) { + return; + } + const sourceDataRequest = this.getSourceDataRequest(); + if (sourceDataRequest) {//data is immmutable + return; + } + const requestToken = Symbol(`layer-source-refresh:${ this.getId()} - source`); + startLoading(SOURCE_DATA_ID_ORIGIN, requestToken, dataFilters); + try { + const styleAndSprites = await this._source.getVectorStyleSheetAndSpriteMeta(isRetina()); + stopLoading(SOURCE_DATA_ID_ORIGIN, requestToken, styleAndSprites, {}); + } catch(error) { + onLoadError(SOURCE_DATA_ID_ORIGIN, requestToken, error.message); + } + } + + _generateMbId(name) { + return this.getId() + '_' + name; + } + + _getVectorStyle() { + const sourceDataRequest = this.getSourceDataRequest(); + if (!sourceDataRequest) { + return null; + } + const vectorStyleAndSprites = sourceDataRequest.getData(); + if (!vectorStyleAndSprites) { + return null; + } + return vectorStyleAndSprites.vectorStyleSheet; + } + + _getSpriteMeta() { + const sourceDataRequest = this.getSourceDataRequest(); + if (!sourceDataRequest) { + return null; + } + const vectorStyleAndSprites = sourceDataRequest.getData(); + return vectorStyleAndSprites.spriteMeta; + } + + getMbLayerIds() { + const vectorStyle = this._getVectorStyle(); + if (!vectorStyle) { + return []; + } + return vectorStyle.layers.map(layer => this._generateMbId(layer.id)); + } + + getMbSourceIds() { + const vectorStyle = this._getVectorStyle(); + if (!vectorStyle) { + return []; + } + const sourceIds = Object.keys(vectorStyle.sources); + return sourceIds.map(sourceId => this._generateMbId(sourceId)); + } + + ownsMbLayerId(mbLayerId) { + //todo optimize: do not create temp array + const mbLayerIds = this.getMbLayerIds(); + return mbLayerIds.indexOf(mbLayerId) >= 0; + } + + ownsMbSourceId(mbSourceId) { + //todo optimize: do not create temp array + const mbSourceIds = this.getMbSourceIds(); + return mbSourceIds.indexOf(mbSourceId) >= 0; + } + + _makeNamespacedImageId(imageId) { + const prefix = this._source.getSpriteNamespacePrefix() + '/'; + return prefix + imageId; + } + + syncLayerWithMB(mbMap) { + + const vectorStyle = this._getVectorStyle(); + if (!vectorStyle) { + return; + } + + let initialBootstrapCompleted = false; + + //sync sources + const sourceIds = Object.keys(vectorStyle.sources); + sourceIds.forEach(sourceId => { + if (initialBootstrapCompleted) { + return; + } + const mbSourceId = this._generateMbId(sourceId); + const mbSource = mbMap.getSource(mbSourceId); + if (mbSource) { + //if a single source is present, the layer already has bootstrapped with the mbMap + initialBootstrapCompleted = true; + return; + } + mbMap.addSource(mbSourceId, vectorStyle.sources[sourceId]); + }); + + if (!initialBootstrapCompleted) { + + //sync spritesheet + const spriteMeta = this._getSpriteMeta(); + if (!spriteMeta) { + return; + } + const newJson = {}; + for (const imageId in spriteMeta.json) { + if (spriteMeta.json.hasOwnProperty(imageId)) { + const namespacedImageId = this._makeNamespacedImageId(imageId); + newJson[namespacedImageId] = spriteMeta.json[imageId]; + } + } + addSpritesheetToMap(newJson, spriteMeta.png, mbMap); + + //sync layers + vectorStyle.layers.forEach(layer => { + const mbLayerId = this._generateMbId(layer.id); + const mbLayer = mbMap.getLayer(mbLayerId); + if (mbLayer) { + return; + } + const newLayerObject = { + ...layer, + source: this._generateMbId(layer.source), + id: mbLayerId + }; + + if (newLayerObject.type === 'symbol' && newLayerObject.layout && typeof newLayerObject.layout['icon-image'] === 'string') { + newLayerObject.layout['icon-image'] = this._makeNamespacedImageId(newLayerObject.layout['icon-image']); + } + + if (newLayerObject.type === 'fill' && newLayerObject.paint && typeof newLayerObject.paint['fill-pattern'] === 'string') { + newLayerObject.paint['fill-pattern'] = this._makeNamespacedImageId(newLayerObject.paint['fill-pattern']); + } + + mbMap.addLayer(newLayerObject); + }); + + } + + this._setTileLayerProperties(mbMap); + } + + _setOpacityForType(mbMap, mbLayer, mbLayerId) { + + const opacityProps = MB_STYLE_TYPE_TO_OPACITY[mbLayer.type]; + if (!opacityProps) { + return; + } + + opacityProps.forEach(opacityProp => { + if (mbLayer.paint && typeof mbLayer.paint[opacityProp] === 'number') { + const newOpacity = mbLayer.paint[opacityProp] * this.getAlpha(); + mbMap.setPaintProperty(mbLayerId, opacityProp, newOpacity); + } else { + mbMap.setPaintProperty(mbLayerId, opacityProp, this.getAlpha()); + } + }); + } + + _setLayerZoomRange(mbMap, mbLayer, mbLayerId) { + let minZoom = this._descriptor.minZoom; + if (typeof mbLayer.minzoom === 'number') { + minZoom = Math.max(minZoom, mbLayer.minzoom); + } + let maxZoom = this._descriptor.maxZoom; + if (typeof mbLayer.maxzoom === 'number') { + maxZoom = Math.min(maxZoom, mbLayer.maxzoom); + } + mbMap.setLayerZoomRange(mbLayerId, minZoom, maxZoom); + } + + _setTileLayerProperties(mbMap) { + + const vectorStyle = this._getVectorStyle(); + if (!vectorStyle) { + return; + } + + vectorStyle.layers.forEach(mbLayer => { + const mbLayerId = this._generateMbId(mbLayer.id); + this.syncVisibilityWithMb(mbMap, mbLayerId); + this._setLayerZoomRange(mbMap, mbLayer, mbLayerId); + this._setOpacityForType(mbMap, mbLayer, mbLayerId); + }); + + } + +} diff --git a/x-pack/legacy/plugins/maps/public/meta.js b/x-pack/legacy/plugins/maps/public/meta.js index 72e29b493a10f..fa96eb5f75acc 100644 --- a/x-pack/legacy/plugins/maps/public/meta.js +++ b/x-pack/legacy/plugins/maps/public/meta.js @@ -7,7 +7,7 @@ import { GIS_API_PATH, - EMS_CATALOGUE_PATH + EMS_CATALOGUE_PATH, EMS_GLYPHS_PATH } from '../common/constants'; import chrome from 'ui/chrome'; import { i18n } from '@kbn/i18n'; @@ -78,3 +78,16 @@ export function getEMSClient() { return emsClient; } + +export function getGlyphUrl() { + if (!chrome.getInjected('isEmsEnabled', true)) { + return ''; + } + return (chrome.getInjected('proxyElasticMapsServiceInMaps', false)) ? + (relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_GLYPHS_PATH}`) + `/{fontstack}/{range}`) : chrome.getInjected('emsFontLibraryUrl', true); + +} + +export function isRetina() { + return window.devicePixelRatio === 2; +} diff --git a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js index 0cffed7a51a41..fb344b15b2693 100644 --- a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js +++ b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js @@ -7,12 +7,12 @@ import { createSelector } from 'reselect'; import _ from 'lodash'; import { TileLayer } from '../layers/tile_layer'; +import { VectorTileLayer } from '../layers/vector_tile_layer'; import { VectorLayer } from '../layers/vector_layer'; import { HeatmapLayer } from '../layers/heatmap_layer'; import { ALL_SOURCES } from '../layers/sources/all_sources'; import { VectorStyle } from '../layers/styles/vector_style'; import { HeatmapStyle } from '../layers/styles/heatmap_style'; -import { TileStyle } from '../layers/styles/tile_style'; import { timefilter } from 'ui/timefilter'; import { getInspectorAdapters } from '../reducers/non_serializable_instances'; import { copyPersistentState, TRACKED_LAYER_DESCRIPTOR } from '../reducers/util'; @@ -25,6 +25,8 @@ function createLayerInstance(layerDescriptor, inspectorAdapters) { return new TileLayer({ layerDescriptor, source, style }); case VectorLayer.type: return new VectorLayer({ layerDescriptor, source, style }); + case VectorTileLayer.type: + return new VectorTileLayer({ layerDescriptor, source, style }); case HeatmapLayer.type: return new HeatmapLayer({ layerDescriptor, source, style }); default: @@ -50,10 +52,10 @@ function createStyleInstance(styleDescriptor, source) { } switch (styleDescriptor.type) { + case 'TILE'://backfill for old tilestyles. + return null; case VectorStyle.type: return new VectorStyle(styleDescriptor, source); - case TileStyle.type: - return new TileStyle(styleDescriptor); case HeatmapStyle.type: return new HeatmapStyle(styleDescriptor); default: diff --git a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js index e3466ce4d9f26..f898bcce6b68d 100644 --- a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js +++ b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js @@ -6,6 +6,7 @@ jest.mock('../layers/vector_layer', () => {}); jest.mock('../layers/heatmap_layer', () => {}); +jest.mock('../layers/vector_tile_layer', () => {}); jest.mock('../layers/sources/all_sources', () => {}); jest.mock('../reducers/non_serializable_instances', () => ({ getInspectorAdapters: () => { diff --git a/x-pack/legacy/plugins/maps/server/routes.js b/x-pack/legacy/plugins/maps/server/routes.js index c513a7bd17d35..70dcf08eb57aa 100644 --- a/x-pack/legacy/plugins/maps/server/routes.js +++ b/x-pack/legacy/plugins/maps/server/routes.js @@ -10,9 +10,13 @@ import { EMS_FILES_CATALOGUE_PATH, EMS_FILES_DEFAULT_JSON_PATH, EMS_TILES_CATALOGUE_PATH, + EMS_GLYPHS_PATH, EMS_TILES_RASTER_STYLE_PATH, EMS_TILES_RASTER_TILE_PATH, - GIS_API_PATH + EMS_TILES_VECTOR_STYLE_PATH, + EMS_TILES_VECTOR_SOURCE_PATH, + EMS_TILES_VECTOR_TILE_PATH, + GIS_API_PATH, EMS_SPRITES_PATH } from '../common/constants'; import fetch from 'node-fetch'; import { i18n } from '@kbn/i18n'; @@ -98,7 +102,7 @@ export function initRoutes(server, licenseUid) { typeof parseInt(request.query.y, 10) !== 'number' || typeof parseInt(request.query.z, 10) !== 'number' ) { - server.log('warning', 'Must supply id/x/y/z parameters to retrieve EMS tile'); + server.log('warning', 'Must supply id/x/y/z parameters to retrieve EMS raster tile'); return null; } @@ -113,20 +117,8 @@ export function initRoutes(server, licenseUid) { .replace('{y}', request.query.y) .replace('{z}', request.query.z); - try { - const tile = await fetch(url); - const arrayBuffer = await tile.arrayBuffer(); - const buffer = Buffer.from(arrayBuffer); - let response = h.response(buffer); - response = response.bytes(buffer.length); - response = response.header('Content-Disposition', 'inline'); - response = response.header('Content-type', 'image/png'); - response = response.encoding('binary'); - return response; - } catch(e) { - server.log('warning', `Cannot connect to EMS for tile, error: ${e.message}`); - throw Boom.badRequest(`Cannot connect to EMS`); - } + return await proxyResource(h, { url, contentType: 'image/png' }); + } }); @@ -196,8 +188,9 @@ export function initRoutes(server, licenseUid) { const newService = { ...service }; - const rasterFormats = service.formats.filter(format => format.format === 'raster'); + newService.formats = []; + const rasterFormats = service.formats.filter(format => format.format === 'raster'); if (rasterFormats.length) { const newUrl = `${GIS_API_PATH}/${EMS_TILES_RASTER_STYLE_PATH}?id=${service.id}`; newService.formats.push({ @@ -205,6 +198,15 @@ export function initRoutes(server, licenseUid) { url: newUrl }); } + + const vectorFormats = service.formats.filter(format => format.format === 'vector'); + if (vectorFormats.length) { + const newUrl = `${GIS_API_PATH}/${EMS_TILES_VECTOR_STYLE_PATH}?id=${service.id}`; + newService.formats.push({ + ...vectorFormats[0], + url: newUrl + }); + } return newService; }); @@ -242,12 +244,167 @@ export function initRoutes(server, licenseUid) { }); - function checkEMSProxyConfig() { - if (!mapConfig.proxyElasticMapsServiceInMaps) { - server.log('warning', `Cannot load content from EMS when map.proxyElasticMapsServiceInMaps is turned off`); - throw Boom.notFound(); + server.route({ + method: 'GET', + path: `${ROOT}/${EMS_TILES_VECTOR_STYLE_PATH}`, + handler: async (request) => { + + checkEMSProxyConfig(); + + if (!request.query.id) { + server.log('warning', 'Must supply id parameter to retrieve EMS vector style'); + return null; + } + + const tmsServices = await emsClient.getTMSServices(); + const tmsService = tmsServices.find(layer => layer.getId() === request.query.id); + if (!tmsService) { + return null; + } + + const vectorStyle = await tmsService.getVectorStyleSheetRaw(); + const newSources = {}; + for (const sourceId in vectorStyle.sources) { + if (vectorStyle.sources.hasOwnProperty(sourceId)) { + newSources[sourceId] = { + type: 'vector', + url: `${GIS_API_PATH}/${EMS_TILES_VECTOR_SOURCE_PATH}?id=${request.query.id}&sourceId=${sourceId}` + }; + } + } + + const spritePath = `${GIS_API_PATH}/${EMS_SPRITES_PATH}/${request.query.id}/sprite`; + + return { + ...vectorStyle, + glyphs: `${GIS_API_PATH}/${EMS_GLYPHS_PATH}/{fontstack}/{range}`, + sprite: spritePath, + sources: newSources + }; } - } + }); + + server.route({ + method: 'GET', + path: `${ROOT}/${EMS_TILES_VECTOR_SOURCE_PATH}`, + handler: async (request) => { + + checkEMSProxyConfig(); + + if (!request.query.id || !request.query.sourceId) { + server.log('warning', 'Must supply id and sourceId parameter to retrieve EMS vector source'); + return null; + } + + const tmsServices = await emsClient.getTMSServices(); + const tmsService = tmsServices.find(layer => layer.getId() === request.query.id); + if (!tmsService) { + return null; + } + + const vectorStyle = await tmsService.getVectorStyleSheet(); + const sourceManifest = vectorStyle.sources[request.query.sourceId]; + // eslint-disable-next-line max-len + const newUrl = `${GIS_API_PATH}/${EMS_TILES_VECTOR_TILE_PATH}?id=${request.query.id}&sourceId=${request.query.sourceId}&x={x}&y={y}&z={z}`; + return { + ...sourceManifest, + tiles: [newUrl] + }; + } + }); + + server.route({ + method: 'GET', + path: `${ROOT}/${EMS_TILES_VECTOR_TILE_PATH}`, + handler: async (request, h) => { + + checkEMSProxyConfig(); + + if (!request.query.id || + !request.query.sourceId || + typeof parseInt(request.query.x, 10) !== 'number' || + typeof parseInt(request.query.y, 10) !== 'number' || + typeof parseInt(request.query.z, 10) !== 'number' + ) { + server.log('warning', 'Must supply id/sourceId/x/y/z parameters to retrieve EMS vector tile'); + return null; + } + + const tmsServices = await emsClient.getTMSServices(); + const tmsService = tmsServices.find(layer => layer.getId() === request.query.id); + if (!tmsService) { + return null; + } + + const urlTemplate = await tmsService.getUrlTemplateForVector(request.query.sourceId); + const url = urlTemplate + .replace('{x}', request.query.x) + .replace('{y}', request.query.y) + .replace('{z}', request.query.z); + + return await proxyResource(h, { url }); + + } + }); + + server.route({ + + method: 'GET', + path: `${ROOT}/${EMS_GLYPHS_PATH}/{fontstack}/{range}`, + handler: async (request, h) => { + + checkEMSProxyConfig(); + + const url = mapConfig.emsFontLibraryUrl + .replace('{fontstack}', request.params.fontstack) + .replace('{range}', request.params.range); + + return await proxyResource(h, { url }); + } + + }); + + + server.route({ + + method: 'GET', + path: `${ROOT}/${EMS_SPRITES_PATH}/{id}/sprite{scaling}.{extension}`, + handler: async (request, h) => { + + checkEMSProxyConfig(); + + if (!request.params.id) { + server.log('warning', 'Must supply id parameter to retrieve EMS vector source sprite'); + return null; + } + + const tmsServices = await emsClient.getTMSServices(); + const tmsService = tmsServices.find(layer => layer.getId() === request.params.id); + if (!tmsService) { + return null; + } + + + let proxyPathUrl; + const isRetina = request.params.scaling === '@2x'; + if (request.params.extension === 'json') { + proxyPathUrl = await tmsService.getSpriteSheetJsonPath(isRetina); + } else if (request.params.extension === 'png') { + proxyPathUrl = await tmsService.getSpriteSheetPngPath(isRetina); + } else { + server.log('warning', `Must have png or json extension for spritesheet`); + return null; + } + + return await proxyResource(h, { + url: proxyPathUrl, + contentType: request.params.extension === 'png' ? 'image/png' : '' + }); + + } + + }); + server.route({ method: 'GET', @@ -268,4 +425,33 @@ export function initRoutes(server, licenseUid) { } } }); + + + function checkEMSProxyConfig() { + if (!mapConfig.proxyElasticMapsServiceInMaps) { + server.log('warning', `Cannot load content from EMS when map.proxyElasticMapsServiceInMaps is turned off`); + throw Boom.notFound(); + } + } + + async function proxyResource(h, { url, contentType }) { + try { + const resource = await fetch(url); + const arrayBuffer = await resource.arrayBuffer(); + const buffer = Buffer.from(arrayBuffer); + let response = h.response(buffer); + response = response.bytes(buffer.length); + response = response.header('Content-Disposition', 'inline'); + if (contentType) { + response = response.header('Content-type', contentType); + } + response = response.encoding('binary'); + return response; + } catch(e) { + server.log('warning', `Cannot connect to EMS for resource, error: ${e.message}`); + throw Boom.badRequest(`Cannot connect to EMS`); + } + } + + } diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 3b9d6e07cc15c..ec9f1387ebef6 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -5654,7 +5654,6 @@ "xpack.maps.source.wmsTitle": "ウェブマップサービス", "xpack.maps.style.heatmap.displayNameLabel": "ヒートマップスタイル", "xpack.maps.style.heatmap.resolutionStyleErrorMessage": "解像度パラメーターが認識されません: {resolution}", - "xpack.maps.style.tile.displayNameLabel": "タイルスタイル", "xpack.maps.style.vector.displayNameLabel": "ベクタースタイル", "xpack.maps.styles.staticDynamic.dynamicDescription": "プロパティ値で特徴をシンボル化します。", "xpack.maps.styles.staticDynamic.staticDescription": "静的スタイルプロパティで特徴をシンボル化します。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8291a86f6096d..5b1261daf726b 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -5797,7 +5797,6 @@ "xpack.maps.source.wmsTitle": "Web 地图服务", "xpack.maps.style.heatmap.displayNameLabel": "热图样式", "xpack.maps.style.heatmap.resolutionStyleErrorMessage": "无法识别分辨率参数:{resolution}", - "xpack.maps.style.tile.displayNameLabel": "磁帖样式", "xpack.maps.style.vector.displayNameLabel": "矢量样式", "xpack.maps.styles.staticDynamic.dynamicDescription": "使用属性值代表功能。", "xpack.maps.styles.staticDynamic.staticDescription": "使用静态样式属性代表功能。", @@ -10635,4 +10634,4 @@ "xpack.watcher.watchActions.logging.logTextIsRequiredValidationMessage": "“日志文本”必填。", "xpack.watcher.watcherDescription": "通过创建、管理和监测警报来检测数据中的更改。" } -} \ No newline at end of file +}