diff --git a/dist/MapboxVectorLayer.d.ts b/dist/MapboxVectorLayer.d.ts new file mode 100644 index 00000000..2bc00657 --- /dev/null +++ b/dist/MapboxVectorLayer.d.ts @@ -0,0 +1,274 @@ +/** + * @typedef {Object} Options + * @property {string} styleUrl The URL of the Mapbox style object to use for this layer. For a + * style created with Mapbox Studio and hosted on Mapbox, this will look like + * 'mapbox://styles/you/your-style'. + * @property {string} [accessToken] The access token for your Mapbox style. This has to be provided + * for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query + * parameter of the style url. + * @property {string} [source] If your style uses more than one source, you need to use either the + * `source` property or the `layers` property to limit rendering to a single vector source. The + * `source` property corresponds to the id of a vector source in your Mapbox style. + * @property {Array} [layers] Limit rendering to the list of included layers. All layers + * must share the same vector source. If your style uses more than one source, you need to use + * either the `source` property or the `layers` property to limit rendering to a single vector + * source. + * @property {boolean} [declutter=true] Declutter images and text. Decluttering is applied to all + * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority + * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features. + * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has + * higher priority. + * + * As an optimization decluttered features from layers with the same `className` are rendered above + * the fill and stroke styles of all of those layers regardless of z-index. To opt out of this + * behavior and place declutterd features with their own layer configure the layer with a `className` + * other than `ol-layer`. + * @property {import("ol/layer/Base.js").BackgroundColor|false} [background] Background color for the layer. + * If not specified, the background from the Mapbox style object will be used. Set to `false` to prevent + * the Mapbox style's background from being used. + * @property {string} [className='ol-layer'] A CSS class name to set to the layer element. + * @property {number} [opacity=1] Opacity (0, 1). + * @property {boolean} [visible=true] Visibility. + * @property {import("ol/extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be + * rendered outside of this extent. + * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers + * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed + * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()` + * method was used. + * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be + * visible. + * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will + * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will + * match the style source's `minzoom`. + * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will + * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match + * the style source's `minzoom`. + * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will + * be visible. + * @property {import("ol/render.js").OrderFunction} [renderOrder] Render order. Function to be used when sorting + * features before rendering. By default features are drawn in the order that they are created. Use + * `null` to avoid the sort, but get an undefined draw order. + * @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the + * renderer when getting features from the vector tile for the rendering or hit-detection. + * Recommended value: Vector tiles are usually generated with a buffer, so this value should match + * the largest possible buffer of the used tiles. It should be at least the size of the largest + * point symbol or line width. + * @property {import("ol/layer/VectorTile.js").VectorTileRenderType} [renderMode='hybrid'] Render mode for vector tiles: + * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom + * animations. Point symbols and texts are accurately rendered as vectors and can stay upright on + * rotated views. + * * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector + * tile layers with only a few rendered features (e.g. for highlighting a subset of features of + * another layer with the same source). + * @property {import("ol/Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage + * this layer in its layers collection, and the layer will be rendered on top. This is useful for + * temporary layers. The standard way to add a layer to a map and have it managed by the map is to + * use `map.addLayer()`. + * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be + * recreated during animations. This means that no vectors will be shown clipped, but the setting + * will have a performance impact for large amounts of vector data. When set to `false`, batches + * will be recreated when no animation is active. + * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will be + * recreated during interactions. See also `updateWhileAnimating`. + * @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0` + * means no preloading. + * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error. + * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`. + */ +/** + * @classdesc + * ```js + * import {MapboxVectorLayer} from 'ol-mapbox-style'; + * ``` + * A vector tile layer based on a Mapbox style that uses a single vector source. Configure + * the layer with the `styleUrl` and `accessToken` shown in Mapbox Studio's share panel. + * If the style uses more than one source, use the `source` property to choose a single + * vector source. If you want to render a subset of the layers in the style, use the `layers` + * property (all layers must share the same vector source). See the constructor options for + * more detail. + * + * const map = new Map({ + * view: new View({ + * center: [0, 0], + * zoom: 1, + * }), + * layers: [ + * new MapboxVectorLayer({ + * styleUrl: 'mapbox://styles/mapbox/bright-v9', + * accessToken: 'your-mapbox-access-token-here', + * }), + * ], + * target: 'map', + * }); + * + * On configuration or loading error, the layer will trigger an `'error'` event. Listeners + * will receive an object with an `error` property that can be used to diagnose the problem. + * + * **Note for users of the full build**: The `MapboxVectorLayer` requires the + * [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) library to be loaded as well. + * + * @param {Options} options Options. + * @extends {VectorTileLayer} + * @fires module:ol/events/Event~BaseEvent#event:error + * @api + */ +export default class MapboxVectorLayer extends VectorTileLayer { + /** + * @param {Options} options Layer options. At a minimum, `styleUrl` and `accessToken` + * must be provided. + */ + constructor(options: Options); + accessToken: string | undefined; +} +export type Map = import("ol/Map.js").default; +export type Options = { + /** + * The URL of the Mapbox style object to use for this layer. For a + * style created with Mapbox Studio and hosted on Mapbox, this will look like + * 'mapbox://styles/you/your-style'. + */ + styleUrl: string; + /** + * The access token for your Mapbox style. This has to be provided + * for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query + * parameter of the style url. + */ + accessToken?: string | undefined; + /** + * If your style uses more than one source, you need to use either the + * `source` property or the `layers` property to limit rendering to a single vector source. The + * `source` property corresponds to the id of a vector source in your Mapbox style. + */ + source?: string | undefined; + /** + * Limit rendering to the list of included layers. All layers + * must share the same vector source. If your style uses more than one source, you need to use + * either the `source` property or the `layers` property to limit rendering to a single vector + * source. + */ + layers?: string[] | undefined; + /** + * Declutter images and text. Decluttering is applied to all + * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority + * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features. + * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has + * higher priority. + * + * As an optimization decluttered features from layers with the same `className` are rendered above + * the fill and stroke styles of all of those layers regardless of z-index. To opt out of this + * behavior and place declutterd features with their own layer configure the layer with a `className` + * other than `ol-layer`. + */ + declutter?: boolean | undefined; + /** + * Background color for the layer. + * If not specified, the background from the Mapbox style object will be used. Set to `false` to prevent + * the Mapbox style's background from being used. + */ + background?: false | import("ol/layer/Base.js").BackgroundColor | undefined; + /** + * A CSS class name to set to the layer element. + */ + className?: string | undefined; + /** + * Opacity (0, 1). + */ + opacity?: number | undefined; + /** + * Visibility. + */ + visible?: boolean | undefined; + /** + * The bounding extent for layer rendering. The layer will not be + * rendered outside of this extent. + */ + extent?: import("ol/extent.js").Extent | undefined; + /** + * The z-index for layer rendering. At rendering time, the layers + * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed + * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()` + * method was used. + */ + zIndex?: number | undefined; + /** + * The minimum resolution (inclusive) at which this layer will be + * visible. + */ + minResolution?: number | undefined; + /** + * The maximum resolution (exclusive) below which this layer will + * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will + * match the style source's `minzoom`. + */ + maxResolution?: number | undefined; + /** + * The minimum view zoom level (exclusive) above which this layer will + * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match + * the style source's `minzoom`. + */ + minZoom?: number | undefined; + /** + * The maximum view zoom level (inclusive) at which this layer will + * be visible. + */ + maxZoom?: number | undefined; + /** + * Render order. Function to be used when sorting + * features before rendering. By default features are drawn in the order that they are created. Use + * `null` to avoid the sort, but get an undefined draw order. + */ + renderOrder?: import("ol/render.js").OrderFunction | undefined; + /** + * The buffer in pixels around the tile extent used by the + * renderer when getting features from the vector tile for the rendering or hit-detection. + * Recommended value: Vector tiles are usually generated with a buffer, so this value should match + * the largest possible buffer of the used tiles. It should be at least the size of the largest + * point symbol or line width. + */ + renderBuffer?: number | undefined; + /** + * Render mode for vector tiles: + * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom + * animations. Point symbols and texts are accurately rendered as vectors and can stay upright on + * rotated views. + * * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector + * tile layers with only a few rendered features (e.g. for highlighting a subset of features of + * another layer with the same source). + */ + renderMode?: import("ol/layer/VectorTile.js").VectorTileRenderType | undefined; + /** + * Sets the layer as overlay on a map. The map will not manage + * this layer in its layers collection, and the layer will be rendered on top. This is useful for + * temporary layers. The standard way to add a layer to a map and have it managed by the map is to + * use `map.addLayer()`. + */ + map?: import("ol/Map.js").default | undefined; + /** + * When set to `true`, feature batches will be + * recreated during animations. This means that no vectors will be shown clipped, but the setting + * will have a performance impact for large amounts of vector data. When set to `false`, batches + * will be recreated when no animation is active. + */ + updateWhileAnimating?: boolean | undefined; + /** + * When set to `true`, feature batches will be + * recreated during interactions. See also `updateWhileAnimating`. + */ + updateWhileInteracting?: boolean | undefined; + /** + * Preload. Load low-resolution tiles up to `preload` levels. `0` + * means no preloading. + */ + preload?: number | undefined; + /** + * Use interim tiles on error. + */ + useInterimTilesOnError?: boolean | undefined; + /** + * Arbitrary observable properties. Can be accessed with `#get()` and `#set()`. + */ + properties?: { + [x: string]: any; + } | undefined; +}; +import VectorTileLayer from 'ol/layer/VectorTile.js'; diff --git a/dist/apply.d.ts b/dist/apply.d.ts new file mode 100644 index 00000000..355dbe96 --- /dev/null +++ b/dist/apply.d.ts @@ -0,0 +1,309 @@ +/** + * Applies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector` + * with an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source + * yet, it will be created and populated from the information in the `glStyle` (unless `updateSource` is + * set to `false`). + * + * **Example:** + * ```js + * import {applyStyle} from 'ol-mapbox-style'; + * import {VectorTile} from 'ol/layer.js'; + * + * const layer = new VectorTile({declutter: true}); + * applyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN'); + * ``` + * + * The style function will render all layers from the `glStyle` object that use the source + * of the first layer, the specified `source`, or a subset of layers from the same source. The + * source needs to be a `"type": "vector"` or `"type": "geojson"` source. + * + * Two additional properties will be set on the provided layer: + * + * * `mapbox-source`: The `id` of the Mapbox Style document's source that the + * OpenLayers layer was created from. Usually `apply()` creates one + * OpenLayers layer per Mapbox Style source, unless the layer stack has + * layers from different sources in between. + * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are + * included in the OpenLayers layer. + * + * @param {VectorTileLayer|VectorLayer} layer OpenLayers layer. When the layer has a source configured, + * it will be modified to use the configuration from the glStyle's `source`. Options specified on the + * layer's source will override those from the glStyle's `source`, except for `url` and + * `tileUrlFunction`. When the source projection is the default (`EPSG:3857`), the `tileGrid` will + * also be overridden. If you'd rather not have ol-mapbox-style modify the source, configure `applyStyle()` + * with the `updateSource: false` option. + * @param {string|Object} glStyle Mapbox Style object. + * @param {string|Array|Options&ApplyStyleOptions} [sourceOrLayersOrOptions] Options or + * `source` key or an array of layer `id`s from the Mapbox Style object. When a `source` key is + * provided, all layers for the specified source will be included in the style function. When layer + * `id`s are provided, they must be from layers that use the same source. When not provided or a falsey + * value, all layers using the first source specified in the glStyle will be rendered. + * @param {Options&ApplyStyleOptions|string} [optionsOrPath] **Deprecated**. Options. Alternatively the path of the style file + * (only required when a relative path is used for the `"sprite"` property of the style). + * @param {Array} [resolutions] **Deprecated**. Resolutions for mapping resolution to zoom level. + * Only needed when working with non-standard tile grids or projections, can also be supplied with + * options. + * @return {Promise} Promise which will be resolved when the style can be used + * for rendering. + */ +export function applyStyle(layer: VectorTileLayer | VectorLayer, glStyle: string | any, sourceOrLayersOrOptions?: string | string[] | (Options & ApplyStyleOptions) | undefined, optionsOrPath?: string | (Options & ApplyStyleOptions) | undefined, resolutions?: number[] | undefined): Promise; +/** + * Applies properties of the Mapbox Style's first `background` layer to the + * provided map or layer (group). + * + * **Example:** + * ```js + * import {applyBackground} from 'ol-mapbox-style'; + * import {Map} from 'ol'; + * + * const map = new Map({target: 'map'}); + * applyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN'); + * ``` + * @param {Map|import("ol/layer/Base.js").default} mapOrLayer OpenLayers Map or layer (group). + * @param {Object|string} glStyle Mapbox Style object or url. + * @param {Options} options Options. + * @return {Promise} Promise that resolves when the background is applied. + */ +export function applyBackground(mapOrLayer: Map | import("ol/layer/Base.js").default, glStyle: any | string, options?: Options): Promise; +/** + * Creates an OpenLayers VectorTile source for a gl source entry. + * @param {Object} glSource "source" entry from a Mapbox Style object. + * @param {string|undefined} styleUrl URL to use for the source. This is expected to be the complete http(s) url, + * with access key applied. + * @param {Options} options Options. + * @return {Promise} Promise resolving to a VectorTile source. + * @private + */ +export function setupVectorSource(glSource: any, styleUrl: string | undefined, options: Options): Promise; +export function setupLayer(glStyle: any, styleUrl: any, glLayer: any, options: any): Layer> | undefined; +/** + * Loads and applies a Mapbox Style object into an OpenLayers Map or LayerGroup. + * This includes the map background, the layers, and for Map instances that did not + * have a View defined yet also the center and the zoom. + * + * **Example:** + * ```js + * import apply from 'ol-mapbox-style'; + * + * apply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'}); + * ``` + * + * The center and zoom will only be set if present in the Mapbox Style document, + * and if not already set on the OpenLayers map. + * + * Layers will be added to the OpenLayers map, without affecting any layers that + * might already be set on the map. + * + * Layers added by `apply()` will have two additional properties: + * + * * `mapbox-source`: The `id` of the Mapbox Style document's source that the + * OpenLayers layer was created from. Usually `apply()` creates one + * OpenLayers layer per Mapbox Style source, unless the layer stack has + * layers from different sources in between. + * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are + * included in the OpenLayers layer. + * + * This function sets an additional `mapbox-style` property on the OpenLayers + * Map or LayerGroup instance, which holds the Mapbox Style object. + * + * @param {Map|HTMLElement|string|LayerGroup} mapOrGroupOrElement Either an existing + * OpenLayers Map instance, or a HTML element, or the id of a HTML element that will be + * the target of a new OpenLayers Map, or a layer group. If layer group, styles + * releated to the map and view will be ignored. + * @param {string|Object} style JSON style object or style url pointing to a + * Mapbox Style object. When using Mapbox APIs, the url is the `styleUrl` + * shown in Mapbox Studio's "share" panel. In addition, the `accessToken` option + * (see below) must be set. + * When passed as JSON style object, all OpenLayers layers created by `apply()` + * will be immediately available, but they may not have a source yet (i.e. when + * they are defined by a TileJSON url in the Mapbox Style document). When passed + * as style url, layers will be added to the map when the Mapbox Style document + * is loaded and parsed. + * @param {Options} options Options. + * @return {Promise} A promise that resolves after all layers have been added to + * the OpenLayers Map instance or LayerGroup, their sources set, and their styles applied. The + * `resolve` callback will be called with the OpenLayers Map instance or LayerGroup as + * argument. + */ +export function apply(mapOrGroupOrElement: Map | HTMLElement | string | LayerGroup, style: string | any, options?: Options): Promise; +/** + * If layerIds is not empty, applies the style specified in glStyle to the layer, + * and adds the layer to the map. + * + * The layer may not yet have a source when the function is called. If so, the style + * is applied to the layer via a once listener on the 'change:source' event. + * + * @param {Layer} layer An OpenLayers layer instance. + * @param {Array} layerIds Array containing layer ids of already-processed layers. + * @param {Object} glStyle Style as a JSON object. + * @param {string|undefined} styleUrl The original style URL. Only required + * when a relative path is used with the `"sprite"` property of the style. + * @param {Map|LayerGroup} mapOrGroup OpenLayers Map. + * @param {Options} options Options. + * @return {Promise} Returns a promise that resolves after the source has + * been set on the specified layer, and the style has been applied. + */ +export function finalizeLayer(layer: Layer, layerIds: Array, glStyle: any, styleUrl: string | undefined, mapOrGroup: Map | LayerGroup, options?: Options): Promise; +/** + * Get the Mapbox Layer object for the provided `layerId`. + * @param {Map|LayerGroup} mapOrGroup Map or LayerGroup. + * @param {string} layerId Mapbox Layer id. + * @return {Object} Mapbox Layer object. + */ +export function getMapboxLayer(mapOrGroup: Map | LayerGroup, layerId: string): any; +/** + * Add a new Mapbox Layer object to the style. The map will be re-rendered. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {Object} mapboxLayer Mapbox Layer object. + * @param {string} [beforeLayerId] Optional id of the Mapbox Layer before the new layer that will be added. + * @return {Promise} Resolves when the added layer is available. + */ +export function addMapboxLayer(mapOrGroup: Map | LayerGroup, mapboxLayer: any, beforeLayerId?: string | undefined): Promise; +/** + * Update a Mapbox Layer object in the style. The map will be re-rendered with the new style. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {Object} mapboxLayer Updated Mapbox Layer object. + */ +export function updateMapboxLayer(mapOrGroup: Map | LayerGroup, mapboxLayer: any): void; +/** + * Updates a Mapbox source object in the style. The according OpenLayers source will be replaced + * and the map will be re-rendered. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {string} id Key of the source in the `sources` object literal. + * @param {Object} mapboxSource Mapbox source object. + * @return {Promise} Promise that resolves when the source has been updated. + */ +export function updateMapboxSource(mapOrGroup: Map | LayerGroup, id: string, mapboxSource: any): Promise; +/** + * Remove a Mapbox Layer object from the style. The map will be re-rendered. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {string|Object} mapboxLayerIdOrLayer Mapbox Layer id or Mapbox Layer object. + */ +export function removeMapboxLayer(mapOrGroup: Map | LayerGroup, mapboxLayerIdOrLayer: string | any): void; +/** + * Get the OpenLayers layer instance that contains the provided Mapbox Style + * `layer`. Note that multiple Mapbox Style layers are combined in a single + * OpenLayers layer instance when they use the same Mapbox Style `source`. + * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup. + * @param {string} layerId Mapbox Style layer id. + * @return {Layer} OpenLayers layer instance. + */ +export function getLayer(map: Map | LayerGroup, layerId: string): Layer; +/** + * Get the OpenLayers layer instances for the provided Mapbox Style `source`. + * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup. + * @param {string} sourceId Mapbox Style source id. + * @return {Array} OpenLayers layer instances. + */ +export function getLayers(map: Map | LayerGroup, sourceId: string): Array; +/** + * Get the OpenLayers source instance for the provided Mapbox Style `source`. + * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup. + * @param {string} sourceId Mapbox Style source id. + * @return {Source} OpenLayers source instance. + */ +export function getSource(map: Map | LayerGroup, sourceId: string): Source; +/** + * Sets or removes a feature state. The feature state is taken into account for styling, + * just like the feature's properties, and can be used e.g. to conditionally render selected + * features differently. + * + * The feature state will be stored on the OpenLayers layer matching the feature identifier, in the + * `mapbox-featurestate` property. + * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer OpenLayers Map or layer to set the feature + * state on. + * @param {FeatureIdentifier} feature Feature identifier. + * @param {Object|null} state Feature state. Set to `null` to remove the feature state. + */ +export function setFeatureState(mapOrLayer: Map | VectorLayer | VectorTileLayer, feature: FeatureIdentifier, state: any | null): void; +/** + * Sets or removes a feature state. The feature state is taken into account for styling, + * just like the feature's properties, and can be used e.g. to conditionally render selected + * features differently. + * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer Map or layer to set the feature state on. + * @param {FeatureIdentifier} feature Feature identifier. + * @return {Object|null} Feature state or `null` when no feature state is set for the given + * feature identifier. + */ +export function getFeatureState(mapOrLayer: Map | VectorLayer | VectorTileLayer, feature: FeatureIdentifier): any | null; +export type FeatureIdentifier = { + /** + * The feature id. + */ + id: string | number; + /** + * The source id. + */ + source: string; +}; +export type Options = { + /** + * Access token for 'mapbox://' urls. + */ + accessToken?: string | undefined; + /** + * Function for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying + * the url, adding headers or setting credentials options. Called with the url and the resource + * type as arguments, this function is supposed to return a `Request` or a url `string`, or a promise tehereof. + * Without a return value the original request will not be modified. + */ + transformRequest?: ((arg0: string, arg1: import("./util.js").ResourceType) => (Request | string | Promise | void)) | undefined; + /** + * Only useful when working with non-standard projections. + * Code of a projection registered with OpenLayers. All sources of the style must be provided in this + * projection. The projection must also have a valid extent defined, which will be used to determine the + * origin and resolutions of the tile grid for all tiled sources of the style. When provided, the bbox + * placeholder in tile and geojson urls changes: the default is `{bbox-epsg-3857}`, when projection is e.g. + * set to `EPSG:4326`, the bbox placeholder will be `{bbox-epsg-4326}`. + */ + projection?: string | undefined; + /** + * Only useful when working with non-standard projections. + * Resolutions for mapping resolution to the `zoom` used in the Mapbox style. + */ + resolutions?: number[] | undefined; + /** + * URL of the Mapbox GL style. Required for styles that were provided + * as object, when they contain a relative sprite url, or sources referencing data by relative url. + */ + styleUrl?: string | undefined; + /** + * Template for resolving webfonts. Can be used to specify where to fetch + * web fonts when no `ol:webfonts` metadata is set in the style object. See `getFonts()` and the + * "Font handling" section in `README.md` for details. + */ + webfonts?: string | undefined; + /** + * Function that returns an image for an icon name. If the result is an HTMLImageElement, it must already be + * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished. + * This function be used for icons not in the sprite or to override sprite icons. + */ + getImage?: ((arg0: VectorLayer | VectorTileLayer, arg1: string) => HTMLImageElement | HTMLCanvasElement | string | undefined) | undefined; + /** + * Access token param. For internal use. + */ + accessTokenParam?: string | undefined; +}; +export type ApplyStyleOptions = { + /** + * Source. Default is `''`, which causes the first source in the + * style to be used. + */ + source?: string | undefined; + /** + * Layers. If no source is provided, the layers with the + * provided ids will be used from the style's `layers` array. All layers need to use the same source. + */ + layers?: string[] | undefined; + /** + * Update or create vector (tile) layer source with parameters + * specified for the source in the mapbox style definition. + */ + updateSource?: boolean | undefined; +}; +import VectorTileLayer from 'ol/layer/VectorTile.js'; +import VectorLayer from 'ol/layer/Vector.js'; +import Map from 'ol/Map.js'; +import Source from 'ol/source/Source.js'; +import Layer from 'ol/layer/Layer.js'; +import LayerGroup from 'ol/layer/Group.js'; diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 00000000..bd8a72ab --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +export { default as MapboxVectorLayer } from "./MapboxVectorLayer.js"; +export { stylefunction, recordStyleLayer, renderTransparent, getStyleForLayer } from "./stylefunction.js"; +export { apply as default, apply, applyBackground, applyStyle, getLayer, getLayers, getSource, getMapboxLayer, updateMapboxSource, updateMapboxLayer, addMapboxLayer, removeMapboxLayer, getFeatureState, setFeatureState } from "./apply.js"; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 00000000..291289ab --- /dev/null +++ b/dist/index.js @@ -0,0 +1,8804 @@ +import Circle from 'ol/style/Circle.js'; +import Fill from 'ol/style/Fill.js'; +import Icon from 'ol/style/Icon.js'; +import RenderFeature from 'ol/render/Feature.js'; +import Stroke from 'ol/style/Stroke.js'; +import Style from 'ol/style/Style.js'; +import Text from 'ol/style/Text.js'; +import { toPromise } from 'ol/functions.js'; +import { registerFont, checkedFonts } from 'ol/render/canvas.js'; +import TileState from 'ol/TileState.js'; +import { VectorTile } from 'ol'; +import { expandUrl } from 'ol/tileurlfunction.js'; +import { getUid } from 'ol/util.js'; +import GeoJSON from 'ol/format/GeoJSON.js'; +import ImageLayer from 'ol/layer/Image.js'; +import Layer from 'ol/layer/Layer.js'; +import LayerGroup from 'ol/layer/Group.js'; +import MVT from 'ol/format/MVT.js'; +import Map from 'ol/Map.js'; +import Raster from 'ol/source/Raster.js'; +import Source from 'ol/source/Source.js'; +import TileGrid from 'ol/tilegrid/TileGrid.js'; +import TileJSON from 'ol/source/TileJSON.js'; +import TileLayer from 'ol/layer/Tile.js'; +import VectorLayer from 'ol/layer/Vector.js'; +import VectorSource from 'ol/source/Vector.js'; +import VectorTileLayer from 'ol/layer/VectorTile.js'; +import VectorTileSource, { defaultLoadFunction } from 'ol/source/VectorTile.js'; +import View from 'ol/View.js'; +import { METERS_PER_UNIT } from 'ol/proj/Units.js'; +import { bbox } from 'ol/loadingstrategy.js'; +import { createXYZ } from 'ol/tilegrid.js'; +import { get as get$1, getUserProjection, getPointResolution, fromLonLat, equivalent } from 'ol/proj.js'; +import { getCenter, getTopLeft } from 'ol/extent.js'; +import BaseEvent from 'ol/events/Event.js'; +import EventType from 'ol/events/EventType.js'; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var csscolorparser = {}; + +var parseCSSColor_1; +// (c) Dean McNamee , 2012. +// +// https://github.com/deanm/css-color-parser-js +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// http://www.w3.org/TR/css3-color/ +var kCSSColorTable = { + 'transparent': [ + 0, + 0, + 0, + 0 + ], + 'aliceblue': [ + 240, + 248, + 255, + 1 + ], + 'antiquewhite': [ + 250, + 235, + 215, + 1 + ], + 'aqua': [ + 0, + 255, + 255, + 1 + ], + 'aquamarine': [ + 127, + 255, + 212, + 1 + ], + 'azure': [ + 240, + 255, + 255, + 1 + ], + 'beige': [ + 245, + 245, + 220, + 1 + ], + 'bisque': [ + 255, + 228, + 196, + 1 + ], + 'black': [ + 0, + 0, + 0, + 1 + ], + 'blanchedalmond': [ + 255, + 235, + 205, + 1 + ], + 'blue': [ + 0, + 0, + 255, + 1 + ], + 'blueviolet': [ + 138, + 43, + 226, + 1 + ], + 'brown': [ + 165, + 42, + 42, + 1 + ], + 'burlywood': [ + 222, + 184, + 135, + 1 + ], + 'cadetblue': [ + 95, + 158, + 160, + 1 + ], + 'chartreuse': [ + 127, + 255, + 0, + 1 + ], + 'chocolate': [ + 210, + 105, + 30, + 1 + ], + 'coral': [ + 255, + 127, + 80, + 1 + ], + 'cornflowerblue': [ + 100, + 149, + 237, + 1 + ], + 'cornsilk': [ + 255, + 248, + 220, + 1 + ], + 'crimson': [ + 220, + 20, + 60, + 1 + ], + 'cyan': [ + 0, + 255, + 255, + 1 + ], + 'darkblue': [ + 0, + 0, + 139, + 1 + ], + 'darkcyan': [ + 0, + 139, + 139, + 1 + ], + 'darkgoldenrod': [ + 184, + 134, + 11, + 1 + ], + 'darkgray': [ + 169, + 169, + 169, + 1 + ], + 'darkgreen': [ + 0, + 100, + 0, + 1 + ], + 'darkgrey': [ + 169, + 169, + 169, + 1 + ], + 'darkkhaki': [ + 189, + 183, + 107, + 1 + ], + 'darkmagenta': [ + 139, + 0, + 139, + 1 + ], + 'darkolivegreen': [ + 85, + 107, + 47, + 1 + ], + 'darkorange': [ + 255, + 140, + 0, + 1 + ], + 'darkorchid': [ + 153, + 50, + 204, + 1 + ], + 'darkred': [ + 139, + 0, + 0, + 1 + ], + 'darksalmon': [ + 233, + 150, + 122, + 1 + ], + 'darkseagreen': [ + 143, + 188, + 143, + 1 + ], + 'darkslateblue': [ + 72, + 61, + 139, + 1 + ], + 'darkslategray': [ + 47, + 79, + 79, + 1 + ], + 'darkslategrey': [ + 47, + 79, + 79, + 1 + ], + 'darkturquoise': [ + 0, + 206, + 209, + 1 + ], + 'darkviolet': [ + 148, + 0, + 211, + 1 + ], + 'deeppink': [ + 255, + 20, + 147, + 1 + ], + 'deepskyblue': [ + 0, + 191, + 255, + 1 + ], + 'dimgray': [ + 105, + 105, + 105, + 1 + ], + 'dimgrey': [ + 105, + 105, + 105, + 1 + ], + 'dodgerblue': [ + 30, + 144, + 255, + 1 + ], + 'firebrick': [ + 178, + 34, + 34, + 1 + ], + 'floralwhite': [ + 255, + 250, + 240, + 1 + ], + 'forestgreen': [ + 34, + 139, + 34, + 1 + ], + 'fuchsia': [ + 255, + 0, + 255, + 1 + ], + 'gainsboro': [ + 220, + 220, + 220, + 1 + ], + 'ghostwhite': [ + 248, + 248, + 255, + 1 + ], + 'gold': [ + 255, + 215, + 0, + 1 + ], + 'goldenrod': [ + 218, + 165, + 32, + 1 + ], + 'gray': [ + 128, + 128, + 128, + 1 + ], + 'green': [ + 0, + 128, + 0, + 1 + ], + 'greenyellow': [ + 173, + 255, + 47, + 1 + ], + 'grey': [ + 128, + 128, + 128, + 1 + ], + 'honeydew': [ + 240, + 255, + 240, + 1 + ], + 'hotpink': [ + 255, + 105, + 180, + 1 + ], + 'indianred': [ + 205, + 92, + 92, + 1 + ], + 'indigo': [ + 75, + 0, + 130, + 1 + ], + 'ivory': [ + 255, + 255, + 240, + 1 + ], + 'khaki': [ + 240, + 230, + 140, + 1 + ], + 'lavender': [ + 230, + 230, + 250, + 1 + ], + 'lavenderblush': [ + 255, + 240, + 245, + 1 + ], + 'lawngreen': [ + 124, + 252, + 0, + 1 + ], + 'lemonchiffon': [ + 255, + 250, + 205, + 1 + ], + 'lightblue': [ + 173, + 216, + 230, + 1 + ], + 'lightcoral': [ + 240, + 128, + 128, + 1 + ], + 'lightcyan': [ + 224, + 255, + 255, + 1 + ], + 'lightgoldenrodyellow': [ + 250, + 250, + 210, + 1 + ], + 'lightgray': [ + 211, + 211, + 211, + 1 + ], + 'lightgreen': [ + 144, + 238, + 144, + 1 + ], + 'lightgrey': [ + 211, + 211, + 211, + 1 + ], + 'lightpink': [ + 255, + 182, + 193, + 1 + ], + 'lightsalmon': [ + 255, + 160, + 122, + 1 + ], + 'lightseagreen': [ + 32, + 178, + 170, + 1 + ], + 'lightskyblue': [ + 135, + 206, + 250, + 1 + ], + 'lightslategray': [ + 119, + 136, + 153, + 1 + ], + 'lightslategrey': [ + 119, + 136, + 153, + 1 + ], + 'lightsteelblue': [ + 176, + 196, + 222, + 1 + ], + 'lightyellow': [ + 255, + 255, + 224, + 1 + ], + 'lime': [ + 0, + 255, + 0, + 1 + ], + 'limegreen': [ + 50, + 205, + 50, + 1 + ], + 'linen': [ + 250, + 240, + 230, + 1 + ], + 'magenta': [ + 255, + 0, + 255, + 1 + ], + 'maroon': [ + 128, + 0, + 0, + 1 + ], + 'mediumaquamarine': [ + 102, + 205, + 170, + 1 + ], + 'mediumblue': [ + 0, + 0, + 205, + 1 + ], + 'mediumorchid': [ + 186, + 85, + 211, + 1 + ], + 'mediumpurple': [ + 147, + 112, + 219, + 1 + ], + 'mediumseagreen': [ + 60, + 179, + 113, + 1 + ], + 'mediumslateblue': [ + 123, + 104, + 238, + 1 + ], + 'mediumspringgreen': [ + 0, + 250, + 154, + 1 + ], + 'mediumturquoise': [ + 72, + 209, + 204, + 1 + ], + 'mediumvioletred': [ + 199, + 21, + 133, + 1 + ], + 'midnightblue': [ + 25, + 25, + 112, + 1 + ], + 'mintcream': [ + 245, + 255, + 250, + 1 + ], + 'mistyrose': [ + 255, + 228, + 225, + 1 + ], + 'moccasin': [ + 255, + 228, + 181, + 1 + ], + 'navajowhite': [ + 255, + 222, + 173, + 1 + ], + 'navy': [ + 0, + 0, + 128, + 1 + ], + 'oldlace': [ + 253, + 245, + 230, + 1 + ], + 'olive': [ + 128, + 128, + 0, + 1 + ], + 'olivedrab': [ + 107, + 142, + 35, + 1 + ], + 'orange': [ + 255, + 165, + 0, + 1 + ], + 'orangered': [ + 255, + 69, + 0, + 1 + ], + 'orchid': [ + 218, + 112, + 214, + 1 + ], + 'palegoldenrod': [ + 238, + 232, + 170, + 1 + ], + 'palegreen': [ + 152, + 251, + 152, + 1 + ], + 'paleturquoise': [ + 175, + 238, + 238, + 1 + ], + 'palevioletred': [ + 219, + 112, + 147, + 1 + ], + 'papayawhip': [ + 255, + 239, + 213, + 1 + ], + 'peachpuff': [ + 255, + 218, + 185, + 1 + ], + 'peru': [ + 205, + 133, + 63, + 1 + ], + 'pink': [ + 255, + 192, + 203, + 1 + ], + 'plum': [ + 221, + 160, + 221, + 1 + ], + 'powderblue': [ + 176, + 224, + 230, + 1 + ], + 'purple': [ + 128, + 0, + 128, + 1 + ], + 'rebeccapurple': [ + 102, + 51, + 153, + 1 + ], + 'red': [ + 255, + 0, + 0, + 1 + ], + 'rosybrown': [ + 188, + 143, + 143, + 1 + ], + 'royalblue': [ + 65, + 105, + 225, + 1 + ], + 'saddlebrown': [ + 139, + 69, + 19, + 1 + ], + 'salmon': [ + 250, + 128, + 114, + 1 + ], + 'sandybrown': [ + 244, + 164, + 96, + 1 + ], + 'seagreen': [ + 46, + 139, + 87, + 1 + ], + 'seashell': [ + 255, + 245, + 238, + 1 + ], + 'sienna': [ + 160, + 82, + 45, + 1 + ], + 'silver': [ + 192, + 192, + 192, + 1 + ], + 'skyblue': [ + 135, + 206, + 235, + 1 + ], + 'slateblue': [ + 106, + 90, + 205, + 1 + ], + 'slategray': [ + 112, + 128, + 144, + 1 + ], + 'slategrey': [ + 112, + 128, + 144, + 1 + ], + 'snow': [ + 255, + 250, + 250, + 1 + ], + 'springgreen': [ + 0, + 255, + 127, + 1 + ], + 'steelblue': [ + 70, + 130, + 180, + 1 + ], + 'tan': [ + 210, + 180, + 140, + 1 + ], + 'teal': [ + 0, + 128, + 128, + 1 + ], + 'thistle': [ + 216, + 191, + 216, + 1 + ], + 'tomato': [ + 255, + 99, + 71, + 1 + ], + 'turquoise': [ + 64, + 224, + 208, + 1 + ], + 'violet': [ + 238, + 130, + 238, + 1 + ], + 'wheat': [ + 245, + 222, + 179, + 1 + ], + 'white': [ + 255, + 255, + 255, + 1 + ], + 'whitesmoke': [ + 245, + 245, + 245, + 1 + ], + 'yellow': [ + 255, + 255, + 0, + 1 + ], + 'yellowgreen': [ + 154, + 205, + 50, + 1 + ] +}; +function clamp_css_byte(i) { + // Clamp to integer 0 .. 255. + i = Math.round(i); + // Seems to be what Chrome does (vs truncation). + return i < 0 ? 0 : i > 255 ? 255 : i; +} +function clamp_css_float(f) { + // Clamp to float 0.0 .. 1.0. + return f < 0 ? 0 : f > 1 ? 1 : f; +} +function parse_css_int(str) { + // int or percentage. + if (str[str.length - 1] === '%') + return clamp_css_byte(parseFloat(str) / 100 * 255); + return clamp_css_byte(parseInt(str)); +} +function parse_css_float(str) { + // float or percentage. + if (str[str.length - 1] === '%') + return clamp_css_float(parseFloat(str) / 100); + return clamp_css_float(parseFloat(str)); +} +function css_hue_to_rgb(m1, m2, h) { + if (h < 0) + h += 1; + else if (h > 1) + h -= 1; + if (h * 6 < 1) + return m1 + (m2 - m1) * h * 6; + if (h * 2 < 1) + return m2; + if (h * 3 < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + return m1; +} +function parseCSSColor(css_str) { + // Remove all whitespace, not compliant, but should just be more accepting. + var str = css_str.replace(/ /g, '').toLowerCase(); + // Color keywords (and transparent) lookup. + if (str in kCSSColorTable) + return kCSSColorTable[str].slice(); + // dup. + // #abc and #abc123 syntax. + if (str[0] === '#') { + if (str.length === 4) { + var iv = parseInt(str.substr(1), 16); + // TODO(deanm): Stricter parsing. + if (!(iv >= 0 && iv <= 4095)) + return null; + // Covers NaN. + return [ + (iv & 3840) >> 4 | (iv & 3840) >> 8, + iv & 240 | (iv & 240) >> 4, + iv & 15 | (iv & 15) << 4, + 1 + ]; + } else if (str.length === 7) { + var iv = parseInt(str.substr(1), 16); + // TODO(deanm): Stricter parsing. + if (!(iv >= 0 && iv <= 16777215)) + return null; + // Covers NaN. + return [ + (iv & 16711680) >> 16, + (iv & 65280) >> 8, + iv & 255, + 1 + ]; + } + return null; + } + var op = str.indexOf('('), ep = str.indexOf(')'); + if (op !== -1 && ep + 1 === str.length) { + var fname = str.substr(0, op); + var params = str.substr(op + 1, ep - (op + 1)).split(','); + var alpha = 1; + // To allow case fallthrough. + switch (fname) { + case 'rgba': + if (params.length !== 4) + return null; + alpha = parse_css_float(params.pop()); + // Fall through. + case 'rgb': + if (params.length !== 3) + return null; + return [ + parse_css_int(params[0]), + parse_css_int(params[1]), + parse_css_int(params[2]), + alpha + ]; + case 'hsla': + if (params.length !== 4) + return null; + alpha = parse_css_float(params.pop()); + // Fall through. + case 'hsl': + if (params.length !== 3) + return null; + var h = (parseFloat(params[0]) % 360 + 360) % 360 / 360; + // 0 .. 1 + // NOTE(deanm): According to the CSS spec s/l should only be + // percentages, but we don't bother and let float or percentage. + var s = parse_css_float(params[1]); + var l = parse_css_float(params[2]); + var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; + var m1 = l * 2 - m2; + return [ + clamp_css_byte(css_hue_to_rgb(m1, m2, h + 1 / 3) * 255), + clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255), + clamp_css_byte(css_hue_to_rgb(m1, m2, h - 1 / 3) * 255), + alpha + ]; + default: + return null; + } + } + return null; +} +try { + parseCSSColor_1 = csscolorparser.parseCSSColor = parseCSSColor; +} catch (e) { +} + +// +/** + * An RGBA color value. Create instances from color strings using the static + * method `Color.parse`. The constructor accepts RGB channel values in the range + * `[0, 1]`, premultiplied by A. + * + * @param {number} r The red channel. + * @param {number} g The green channel. + * @param {number} b The blue channel. + * @param {number} a The alpha channel. + * @private + */ +class Color { + constructor(r, g, b, a = 1) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + /** + * Parses valid CSS color strings and returns a `Color` instance. + * @returns A `Color` instance, or `undefined` if the input is not a valid color string. + */ + static parse(input) { + if (!input) { + return undefined; + } + if (input instanceof Color) { + return input; + } + if (typeof input !== 'string') { + return undefined; + } + const rgba = parseCSSColor_1(input); + if (!rgba) { + return undefined; + } + return new Color(rgba[0] / 255 * rgba[3], rgba[1] / 255 * rgba[3], rgba[2] / 255 * rgba[3], rgba[3]); + } + /** + * Returns an RGBA string representing the color value. + * + * @returns An RGBA string. + * @example + * var purple = new Color.parse('purple'); + * purple.toString; // = "rgba(128,0,128,1)" + * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)'); + * translucentGreen.toString(); // = "rgba(26,207,26,0.73)" + */ + toString() { + const [r, g, b, a] = this.toArray(); + return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`; + } + /** + * Returns an RGBA array of values representing the color, unpremultiplied by A. + * + * @returns An array of RGBA color values in the range [0, 255]. + */ + toArray() { + const {r, g, b, a} = this; + return a === 0 ? [ + 0, + 0, + 0, + 0 + ] : [ + r * 255 / a, + g * 255 / a, + b * 255 / a, + a + ]; + } + /** + * Returns a RGBA array of float values representing the color, unpremultiplied by A. + * + * @returns An array of RGBA color values in the range [0, 1]. + */ + toArray01() { + const {r, g, b, a} = this; + return a === 0 ? [ + 0, + 0, + 0, + 0 + ] : [ + r / a, + g / a, + b / a, + a + ]; + } + /** + * Returns an RGBA array of values representing the color, premultiplied by A. + * + * @returns An array of RGBA color values in the range [0, 1]. + */ + toArray01PremultipliedAlpha() { + const {r, g, b, a} = this; + return [ + r, + g, + b, + a + ]; + } +} +Color.black = new Color(0, 0, 0, 1); +Color.white = new Color(1, 1, 1, 1); +Color.transparent = new Color(0, 0, 0, 0); +Color.red = new Color(1, 0, 0, 1); +Color.blue = new Color(0, 0, 1, 1); +var Color$1 = Color; + +function convertLiteral(value) { + return typeof value === 'object' ? [ + 'literal', + value + ] : value; +} +function convertFunction(parameters, propertySpec) { + let stops = parameters.stops; + if (!stops) { + // identity function + return convertIdentityFunction(parameters, propertySpec); + } + const zoomAndFeatureDependent = stops && typeof stops[0][0] === 'object'; + const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined; + const zoomDependent = zoomAndFeatureDependent || !featureDependent; + stops = stops.map(stop => { + if (!featureDependent && propertySpec.tokens && typeof stop[1] === 'string') { + return [ + stop[0], + convertTokenString(stop[1]) + ]; + } + return [ + stop[0], + convertLiteral(stop[1]) + ]; + }); + if (zoomAndFeatureDependent) { + return convertZoomAndPropertyFunction(parameters, propertySpec, stops); + } else if (zoomDependent) { + return convertZoomFunction(parameters, propertySpec, stops); + } else { + return convertPropertyFunction(parameters, propertySpec, stops); + } +} +function convertIdentityFunction(parameters, propertySpec) { + const get = [ + 'get', + parameters.property + ]; + if (parameters.default === undefined) { + // By default, expressions for string-valued properties get coerced. To preserve + // legacy function semantics, insert an explicit assertion instead. + return propertySpec.type === 'string' ? [ + 'string', + get + ] : get; + } else if (propertySpec.type === 'enum') { + return [ + 'match', + get, + Object.keys(propertySpec.values), + get, + parameters.default + ]; + } else { + const expression = [ + propertySpec.type === 'color' ? 'to-color' : propertySpec.type, + get, + convertLiteral(parameters.default) + ]; + if (propertySpec.type === 'array') { + expression.splice(1, 0, propertySpec.value, propertySpec.length || null); + } + return expression; + } +} +function getInterpolateOperator(parameters) { + switch (parameters.colorSpace) { + case 'hcl': + return 'interpolate-hcl'; + case 'lab': + return 'interpolate-lab'; + default: + return 'interpolate'; + } +} +function convertZoomAndPropertyFunction(parameters, propertySpec, stops) { + const featureFunctionParameters = {}; + const featureFunctionStops = {}; + const zoomStops = []; + for (let s = 0; s < stops.length; s++) { + const stop = stops[s]; + const zoom = stop[0].zoom; + if (featureFunctionParameters[zoom] === undefined) { + featureFunctionParameters[zoom] = { + zoom, + type: parameters.type, + property: parameters.property, + default: parameters.default + }; + featureFunctionStops[zoom] = []; + zoomStops.push(zoom); + } + featureFunctionStops[zoom].push([ + stop[0].value, + stop[1] + ]); + } + // the interpolation type for the zoom dimension of a zoom-and-property + // function is determined directly from the style property specification + // for which it's being used: linear for interpolatable properties, step + // otherwise. + const functionType = getFunctionType({}, propertySpec); + if (functionType === 'exponential') { + const expression = [ + getInterpolateOperator(parameters), + ['linear'], + ['zoom'] + ]; + for (const z of zoomStops) { + const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]); + appendStopPair(expression, z, output, false); + } + return expression; + } else { + const expression = [ + 'step', + ['zoom'] + ]; + for (const z of zoomStops) { + const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]); + appendStopPair(expression, z, output, true); + } + fixupDegenerateStepCurve(expression); + return expression; + } +} +function coalesce(a, b) { + if (a !== undefined) + return a; + if (b !== undefined) + return b; +} +function getFallback(parameters, propertySpec) { + const defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default)); + /* + * Some fields with type: resolvedImage have an undefined default. + * Because undefined is an invalid value for resolvedImage, set fallback to + * an empty string instead of undefined to ensure output + * passes validation. + */ + if (defaultValue === undefined && propertySpec.type === 'resolvedImage') { + return ''; + } + return defaultValue; +} +function convertPropertyFunction(parameters, propertySpec, stops) { + const type = getFunctionType(parameters, propertySpec); + const get = [ + 'get', + parameters.property + ]; + if (type === 'categorical' && typeof stops[0][0] === 'boolean') { + const expression = ['case']; + for (const stop of stops) { + expression.push([ + '==', + get, + stop[0] + ], stop[1]); + } + expression.push(getFallback(parameters, propertySpec)); + return expression; + } else if (type === 'categorical') { + const expression = [ + 'match', + get + ]; + for (const stop of stops) { + appendStopPair(expression, stop[0], stop[1], false); + } + expression.push(getFallback(parameters, propertySpec)); + return expression; + } else if (type === 'interval') { + const expression = [ + 'step', + [ + 'number', + get + ] + ]; + for (const stop of stops) { + appendStopPair(expression, stop[0], stop[1], true); + } + fixupDegenerateStepCurve(expression); + return parameters.default === undefined ? expression : [ + 'case', + [ + '==', + [ + 'typeof', + get + ], + 'number' + ], + expression, + convertLiteral(parameters.default) + ]; + } else if (type === 'exponential') { + const base = parameters.base !== undefined ? parameters.base : 1; + const expression = [ + getInterpolateOperator(parameters), + base === 1 ? ['linear'] : [ + 'exponential', + base + ], + [ + 'number', + get + ] + ]; + for (const stop of stops) { + appendStopPair(expression, stop[0], stop[1], false); + } + return parameters.default === undefined ? expression : [ + 'case', + [ + '==', + [ + 'typeof', + get + ], + 'number' + ], + expression, + convertLiteral(parameters.default) + ]; + } else { + throw new Error(`Unknown property function type ${ type }`); + } +} +function convertZoomFunction(parameters, propertySpec, stops, input = ['zoom']) { + const type = getFunctionType(parameters, propertySpec); + let expression; + let isStep = false; + if (type === 'interval') { + expression = [ + 'step', + input + ]; + isStep = true; + } else if (type === 'exponential') { + const base = parameters.base !== undefined ? parameters.base : 1; + expression = [ + getInterpolateOperator(parameters), + base === 1 ? ['linear'] : [ + 'exponential', + base + ], + input + ]; + } else { + throw new Error(`Unknown zoom function type "${ type }"`); + } + for (const stop of stops) { + appendStopPair(expression, stop[0], stop[1], isStep); + } + fixupDegenerateStepCurve(expression); + return expression; +} +function fixupDegenerateStepCurve(expression) { + // degenerate step curve (i.e. a constant function): add a noop stop + if (expression[0] === 'step' && expression.length === 3) { + expression.push(0); + expression.push(expression[3]); + } +} +function appendStopPair(curve, input, output, isStep) { + // Skip duplicate stop values. They were not validated for functions, but they are for expressions. + // https://github.com/mapbox/mapbox-gl-js/issues/4107 + if (curve.length > 3 && input === curve[curve.length - 2]) { + return; + } + // step curves don't get the first input value, as it is redundant. + if (!(isStep && curve.length === 2)) { + curve.push(input); + } + curve.push(output); +} +function getFunctionType(parameters, propertySpec) { + if (parameters.type) { + return parameters.type; + } else { + return propertySpec.expression.interpolated ? 'exponential' : 'interval'; + } +} +// "String with {name} token" => ["concat", "String with ", ["get", "name"], " token"] +function convertTokenString(s) { + const result = ['concat']; + const re = /{([^{}]+)}/g; + let pos = 0; + for (let match = re.exec(s); match !== null; match = re.exec(s)) { + const literal = s.slice(pos, re.lastIndex - match[0].length); + pos = re.lastIndex; + if (literal.length > 0) + result.push(literal); + result.push([ + 'get', + match[1] + ]); + } + if (result.length === 1) { + return s; + } + if (pos < s.length) { + result.push(s.slice(pos)); + } else if (result.length === 2) { + return [ + 'to-string', + result[1] + ]; + } + return result; +} + +// +class ParsingError extends Error { + constructor(key, message) { + super(message); + this.message = message; + this.key = key; + } +} +var ParsingError$1 = ParsingError; + +// +/** + * Tracks `let` bindings during expression parsing. + * @private + */ +class Scope { + constructor(parent, bindings = []) { + this.parent = parent; + this.bindings = {}; + for (const [name, expression] of bindings) { + this.bindings[name] = expression; + } + } + concat(bindings) { + return new Scope(this, bindings); + } + get(name) { + if (this.bindings[name]) { + return this.bindings[name]; + } + if (this.parent) { + return this.parent.get(name); + } + throw new Error(`${ name } not found in scope.`); + } + has(name) { + if (this.bindings[name]) + return true; + return this.parent ? this.parent.has(name) : false; + } +} +var Scope$1 = Scope; + +// +const NullType = { kind: 'null' }; +const NumberType = { kind: 'number' }; +const StringType = { kind: 'string' }; +const BooleanType = { kind: 'boolean' }; +const ColorType = { kind: 'color' }; +const ObjectType = { kind: 'object' }; +const ValueType = { kind: 'value' }; +const ErrorType = { kind: 'error' }; +const CollatorType = { kind: 'collator' }; +const FormattedType = { kind: 'formatted' }; +const ResolvedImageType = { kind: 'resolvedImage' }; +function array$1(itemType, N) { + return { + kind: 'array', + itemType, + N + }; +} +function toString$1(type) { + if (type.kind === 'array') { + const itemType = toString$1(type.itemType); + return typeof type.N === 'number' ? `array<${ itemType }, ${ type.N }>` : type.itemType.kind === 'value' ? 'array' : `array<${ itemType }>`; + } else { + return type.kind; + } +} +const valueMemberTypes = [ + NullType, + NumberType, + StringType, + BooleanType, + ColorType, + FormattedType, + ObjectType, + array$1(ValueType), + ResolvedImageType +]; +/** + * Returns null if `t` is a subtype of `expected`; otherwise returns an + * error message. + * @private + */ +function checkSubtype(expected, t) { + if (t.kind === 'error') { + // Error is a subtype of every type + return null; + } else if (expected.kind === 'array') { + if (t.kind === 'array' && (t.N === 0 && t.itemType.kind === 'value' || !checkSubtype(expected.itemType, t.itemType)) && (typeof expected.N !== 'number' || expected.N === t.N)) { + return null; + } + } else if (expected.kind === t.kind) { + return null; + } else if (expected.kind === 'value') { + for (const memberType of valueMemberTypes) { + if (!checkSubtype(memberType, t)) { + return null; + } + } + } + return `Expected ${ toString$1(expected) } but found ${ toString$1(t) } instead.`; +} +function isValidType(provided, allowedTypes) { + return allowedTypes.some(t => t.kind === provided.kind); +} +function isValidNativeType(provided, allowedTypes) { + return allowedTypes.some(t => { + if (t === 'null') { + return provided === null; + } else if (t === 'array') { + return Array.isArray(provided); + } else if (t === 'object') { + return provided && !Array.isArray(provided) && typeof provided === 'object'; + } else { + return t === typeof provided; + } + }); +} + +// +// Flow type declarations for Intl cribbed from +// https://github.com/facebook/flow/issues/1270 +class Collator { + constructor(caseSensitive, diacriticSensitive, locale) { + if (caseSensitive) + this.sensitivity = diacriticSensitive ? 'variant' : 'case'; + else + this.sensitivity = diacriticSensitive ? 'accent' : 'base'; + this.locale = locale; + this.collator = new Intl.Collator(this.locale ? this.locale : [], { + sensitivity: this.sensitivity, + usage: 'search' + }); + } + compare(lhs, rhs) { + return this.collator.compare(lhs, rhs); + } + resolvedLocale() { + // We create a Collator without "usage: search" because we don't want + // the search options encoded in our result (e.g. "en-u-co-search") + return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale; + } +} + +// +class FormattedSection { + constructor(text, image, scale, fontStack, textColor) { + // combine characters so that diacritic marks are not separate code points + this.text = text.normalize ? text.normalize() : text; + this.image = image; + this.scale = scale; + this.fontStack = fontStack; + this.textColor = textColor; + } +} +class Formatted { + constructor(sections) { + this.sections = sections; + } + static fromString(unformatted) { + return new Formatted([new FormattedSection(unformatted, null, null, null, null)]); + } + isEmpty() { + if (this.sections.length === 0) + return true; + return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.name.length !== 0); + } + static factory(text) { + if (text instanceof Formatted) { + return text; + } else { + return Formatted.fromString(text); + } + } + toString() { + if (this.sections.length === 0) + return ''; + return this.sections.map(section => section.text).join(''); + } + serialize() { + const serialized = ['format']; + for (const section of this.sections) { + if (section.image) { + serialized.push([ + 'image', + section.image.name + ]); + continue; + } + serialized.push(section.text); + const options = {}; + if (section.fontStack) { + options['text-font'] = [ + 'literal', + section.fontStack.split(',') + ]; + } + if (section.scale) { + options['font-scale'] = section.scale; + } + if (section.textColor) { + options['text-color'] = ['rgba'].concat(section.textColor.toArray()); + } + serialized.push(options); + } + return serialized; + } +} + +// +class ResolvedImage { + constructor(options) { + this.name = options.name; + this.available = options.available; + } + toString() { + return this.name; + } + static fromString(name) { + if (!name) + return null; + // treat empty values as no image + return new ResolvedImage({ + name, + available: false + }); + } + serialize() { + return [ + 'image', + this.name + ]; + } +} + +function validateRGBA(r, g, b, a) { + if (!(typeof r === 'number' && r >= 0 && r <= 255 && typeof g === 'number' && g >= 0 && g <= 255 && typeof b === 'number' && b >= 0 && b <= 255)) { + const value = typeof a === 'number' ? [ + r, + g, + b, + a + ] : [ + r, + g, + b + ]; + return `Invalid rgba value [${ value.join(', ') }]: 'r', 'g', and 'b' must be between 0 and 255.`; + } + if (!(typeof a === 'undefined' || typeof a === 'number' && a >= 0 && a <= 1)) { + return `Invalid rgba value [${ [ + r, + g, + b, + a + ].join(', ') }]: 'a' must be between 0 and 1.`; + } + return null; +} +function isValue(mixed) { + if (mixed === null) { + return true; + } else if (typeof mixed === 'string') { + return true; + } else if (typeof mixed === 'boolean') { + return true; + } else if (typeof mixed === 'number') { + return true; + } else if (mixed instanceof Color$1) { + return true; + } else if (mixed instanceof Collator) { + return true; + } else if (mixed instanceof Formatted) { + return true; + } else if (mixed instanceof ResolvedImage) { + return true; + } else if (Array.isArray(mixed)) { + for (const item of mixed) { + if (!isValue(item)) { + return false; + } + } + return true; + } else if (typeof mixed === 'object') { + for (const key in mixed) { + if (!isValue(mixed[key])) { + return false; + } + } + return true; + } else { + return false; + } +} +function typeOf(value) { + if (value === null) { + return NullType; + } else if (typeof value === 'string') { + return StringType; + } else if (typeof value === 'boolean') { + return BooleanType; + } else if (typeof value === 'number') { + return NumberType; + } else if (value instanceof Color$1) { + return ColorType; + } else if (value instanceof Collator) { + return CollatorType; + } else if (value instanceof Formatted) { + return FormattedType; + } else if (value instanceof ResolvedImage) { + return ResolvedImageType; + } else if (Array.isArray(value)) { + const length = value.length; + let itemType; + for (const item of value) { + const t = typeOf(item); + if (!itemType) { + itemType = t; + } else if (itemType === t) { + continue; + } else { + itemType = ValueType; + break; + } + } + return array$1(itemType || ValueType, length); + } else { + return ObjectType; + } +} +function toString(value) { + const type = typeof value; + if (value === null) { + return ''; + } else if (type === 'string' || type === 'number' || type === 'boolean') { + return String(value); + } else if (value instanceof Color$1 || value instanceof Formatted || value instanceof ResolvedImage) { + return value.toString(); + } else { + return JSON.stringify(value); + } +} + +class Literal { + constructor(type, value) { + this.type = type; + this.value = value; + } + static parse(args, context) { + if (args.length !== 2) + return context.error(`'literal' expression requires exactly one argument, but found ${ args.length - 1 } instead.`); + if (!isValue(args[1])) + return context.error(`invalid value`); + const value = args[1]; + let type = typeOf(value); + // special case: infer the item type if possible for zero-length arrays + const expected = context.expectedType; + if (type.kind === 'array' && type.N === 0 && expected && expected.kind === 'array' && (typeof expected.N !== 'number' || expected.N === 0)) { + type = expected; + } + return new Literal(type, value); + } + evaluate() { + return this.value; + } + eachChild() { + } + outputDefined() { + return true; + } + serialize() { + if (this.type.kind === 'array' || this.type.kind === 'object') { + return [ + 'literal', + this.value + ]; + } else if (this.value instanceof Color$1) { + // Constant-folding can generate Literal expressions that you + // couldn't actually generate with a "literal" expression, + // so we have to implement an equivalent serialization here + return ['rgba'].concat(this.value.toArray()); + } else if (this.value instanceof Formatted) { + // Same as Color + return this.value.serialize(); + } else { + return this.value; + } + } +} +var Literal$1 = Literal; + +// +class RuntimeError { + constructor(message) { + this.name = 'ExpressionEvaluationError'; + this.message = message; + } + toJSON() { + return this.message; + } +} +var RuntimeError$1 = RuntimeError; + +const types$2 = { + string: StringType, + number: NumberType, + boolean: BooleanType, + object: ObjectType +}; +class Assertion { + constructor(type, args) { + this.type = type; + this.args = args; + } + static parse(args, context) { + if (args.length < 2) + return context.error(`Expected at least one argument.`); + let i = 1; + let type; + const name = args[0]; + if (name === 'array') { + let itemType; + if (args.length > 2) { + const type = args[1]; + if (typeof type !== 'string' || !(type in types$2) || type === 'object') + return context.error('The item type argument of "array" must be one of string, number, boolean', 1); + itemType = types$2[type]; + i++; + } else { + itemType = ValueType; + } + let N; + if (args.length > 3) { + if (args[2] !== null && (typeof args[2] !== 'number' || args[2] < 0 || args[2] !== Math.floor(args[2]))) { + return context.error('The length argument to "array" must be a positive integer literal', 2); + } + N = args[2]; + i++; + } + type = array$1(itemType, N); + } else { + type = types$2[name]; + } + const parsed = []; + for (; i < args.length; i++) { + const input = context.parse(args[i], i, ValueType); + if (!input) + return null; + parsed.push(input); + } + return new Assertion(type, parsed); + } + evaluate(ctx) { + for (let i = 0; i < this.args.length; i++) { + const value = this.args[i].evaluate(ctx); + const error = checkSubtype(this.type, typeOf(value)); + if (!error) { + return value; + } else if (i === this.args.length - 1) { + throw new RuntimeError$1(`Expected value to be of type ${ toString$1(this.type) }, but found ${ toString$1(typeOf(value)) } instead.`); + } + } + return null; + } + eachChild(fn) { + this.args.forEach(fn); + } + outputDefined() { + return this.args.every(arg => arg.outputDefined()); + } + serialize() { + const type = this.type; + const serialized = [type.kind]; + if (type.kind === 'array') { + const itemType = type.itemType; + if (itemType.kind === 'string' || itemType.kind === 'number' || itemType.kind === 'boolean') { + serialized.push(itemType.kind); + const N = type.N; + if (typeof N === 'number' || this.args.length > 1) { + serialized.push(N); + } + } + } + return serialized.concat(this.args.map(arg => arg.serialize())); + } +} +var Assertion$1 = Assertion; + +// +class FormatExpression { + constructor(sections) { + this.type = FormattedType; + this.sections = sections; + } + static parse(args, context) { + if (args.length < 2) { + return context.error(`Expected at least one argument.`); + } + const firstArg = args[1]; + if (!Array.isArray(firstArg) && typeof firstArg === 'object') { + return context.error(`First argument must be an image or text section.`); + } + const sections = []; + let nextTokenMayBeObject = false; + for (let i = 1; i <= args.length - 1; ++i) { + const arg = args[i]; + if (nextTokenMayBeObject && typeof arg === 'object' && !Array.isArray(arg)) { + nextTokenMayBeObject = false; + let scale = null; + if (arg['font-scale']) { + scale = context.parse(arg['font-scale'], 1, NumberType); + if (!scale) + return null; + } + let font = null; + if (arg['text-font']) { + font = context.parse(arg['text-font'], 1, array$1(StringType)); + if (!font) + return null; + } + let textColor = null; + if (arg['text-color']) { + textColor = context.parse(arg['text-color'], 1, ColorType); + if (!textColor) + return null; + } + const lastExpression = sections[sections.length - 1]; + lastExpression.scale = scale; + lastExpression.font = font; + lastExpression.textColor = textColor; + } else { + const content = context.parse(args[i], 1, ValueType); + if (!content) + return null; + const kind = content.type.kind; + if (kind !== 'string' && kind !== 'value' && kind !== 'null' && kind !== 'resolvedImage') + return context.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`); + nextTokenMayBeObject = true; + sections.push({ + content, + scale: null, + font: null, + textColor: null + }); + } + } + return new FormatExpression(sections); + } + evaluate(ctx) { + const evaluateSection = section => { + const evaluatedContent = section.content.evaluate(ctx); + if (typeOf(evaluatedContent) === ResolvedImageType) { + return new FormattedSection('', evaluatedContent, null, null, null); + } + return new FormattedSection(toString(evaluatedContent), null, section.scale ? section.scale.evaluate(ctx) : null, section.font ? section.font.evaluate(ctx).join(',') : null, section.textColor ? section.textColor.evaluate(ctx) : null); + }; + return new Formatted(this.sections.map(evaluateSection)); + } + eachChild(fn) { + for (const section of this.sections) { + fn(section.content); + if (section.scale) { + fn(section.scale); + } + if (section.font) { + fn(section.font); + } + if (section.textColor) { + fn(section.textColor); + } + } + } + outputDefined() { + // Technically the combinatoric set of all children + // Usually, this.text will be undefined anyway + return false; + } + serialize() { + const serialized = ['format']; + for (const section of this.sections) { + serialized.push(section.content.serialize()); + const options = {}; + if (section.scale) { + options['font-scale'] = section.scale.serialize(); + } + if (section.font) { + options['text-font'] = section.font.serialize(); + } + if (section.textColor) { + options['text-color'] = section.textColor.serialize(); + } + serialized.push(options); + } + return serialized; + } +} + +// +class ImageExpression { + constructor(input) { + this.type = ResolvedImageType; + this.input = input; + } + static parse(args, context) { + if (args.length !== 2) { + return context.error(`Expected two arguments.`); + } + const name = context.parse(args[1], 1, StringType); + if (!name) + return context.error(`No image name provided.`); + return new ImageExpression(name); + } + evaluate(ctx) { + const evaluatedImageName = this.input.evaluate(ctx); + const value = ResolvedImage.fromString(evaluatedImageName); + if (value && ctx.availableImages) + value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1; + return value; + } + eachChild(fn) { + fn(this.input); + } + outputDefined() { + // The output of image is determined by the list of available images in the evaluation context + return false; + } + serialize() { + return [ + 'image', + this.input.serialize() + ]; + } +} + +const types$1 = { + 'to-boolean': BooleanType, + 'to-color': ColorType, + 'to-number': NumberType, + 'to-string': StringType +}; +/** + * Special form for error-coalescing coercion expressions "to-number", + * "to-color". Since these coercions can fail at runtime, they accept multiple + * arguments, only evaluating one at a time until one succeeds. + * + * @private + */ +class Coercion { + constructor(type, args) { + this.type = type; + this.args = args; + } + static parse(args, context) { + if (args.length < 2) + return context.error(`Expected at least one argument.`); + const name = args[0]; + if ((name === 'to-boolean' || name === 'to-string') && args.length !== 2) + return context.error(`Expected one argument.`); + const type = types$1[name]; + const parsed = []; + for (let i = 1; i < args.length; i++) { + const input = context.parse(args[i], i, ValueType); + if (!input) + return null; + parsed.push(input); + } + return new Coercion(type, parsed); + } + evaluate(ctx) { + if (this.type.kind === 'boolean') { + return Boolean(this.args[0].evaluate(ctx)); + } else if (this.type.kind === 'color') { + let input; + let error; + for (const arg of this.args) { + input = arg.evaluate(ctx); + error = null; + if (input instanceof Color$1) { + return input; + } else if (typeof input === 'string') { + const c = ctx.parseColor(input); + if (c) + return c; + } else if (Array.isArray(input)) { + if (input.length < 3 || input.length > 4) { + error = `Invalid rbga value ${ JSON.stringify(input) }: expected an array containing either three or four numeric values.`; + } else { + error = validateRGBA(input[0], input[1], input[2], input[3]); + } + if (!error) { + return new Color$1(input[0] / 255, input[1] / 255, input[2] / 255, input[3]); + } + } + } + throw new RuntimeError$1(error || `Could not parse color from value '${ typeof input === 'string' ? input : String(JSON.stringify(input)) }'`); + } else if (this.type.kind === 'number') { + let value = null; + for (const arg of this.args) { + value = arg.evaluate(ctx); + if (value === null) + return 0; + const num = Number(value); + if (isNaN(num)) + continue; + return num; + } + throw new RuntimeError$1(`Could not convert ${ JSON.stringify(value) } to number.`); + } else if (this.type.kind === 'formatted') { + // There is no explicit 'to-formatted' but this coercion can be implicitly + // created by properties that expect the 'formatted' type. + return Formatted.fromString(toString(this.args[0].evaluate(ctx))); + } else if (this.type.kind === 'resolvedImage') { + return ResolvedImage.fromString(toString(this.args[0].evaluate(ctx))); + } else { + return toString(this.args[0].evaluate(ctx)); + } + } + eachChild(fn) { + this.args.forEach(fn); + } + outputDefined() { + return this.args.every(arg => arg.outputDefined()); + } + serialize() { + if (this.type.kind === 'formatted') { + return new FormatExpression([{ + content: this.args[0], + scale: null, + font: null, + textColor: null + }]).serialize(); + } + if (this.type.kind === 'resolvedImage') { + return new ImageExpression(this.args[0]).serialize(); + } + const serialized = [`to-${ this.type.kind }`]; + this.eachChild(child => { + serialized.push(child.serialize()); + }); + return serialized; + } +} +var Coercion$1 = Coercion; + +// +const geometryTypes = [ + 'Unknown', + 'Point', + 'LineString', + 'Polygon' +]; +class EvaluationContext { + constructor() { + this.globals = null; + this.feature = null; + this.featureState = null; + this.formattedSection = null; + this._parseColorCache = {}; + this.availableImages = null; + this.canonical = null; + this.featureTileCoord = null; + this.featureDistanceData = null; + } + id() { + return this.feature && this.feature.id !== undefined ? this.feature.id : null; + } + geometryType() { + return this.feature ? typeof this.feature.type === 'number' ? geometryTypes[this.feature.type] : this.feature.type : null; + } + geometry() { + return this.feature && 'geometry' in this.feature ? this.feature.geometry : null; + } + canonicalID() { + return this.canonical; + } + properties() { + return this.feature && this.feature.properties || {}; + } + distanceFromCenter() { + if (this.featureTileCoord && this.featureDistanceData) { + const c = this.featureDistanceData.center; + const scale = this.featureDistanceData.scale; + const {x, y} = this.featureTileCoord; + // Calculate the distance vector `d` (left handed) + const dX = x * scale - c[0]; + const dY = y * scale - c[1]; + // The bearing vector `b` (left handed) + const bX = this.featureDistanceData.bearing[0]; + const bY = this.featureDistanceData.bearing[1]; + // Distance is calculated as `dot(d, v)` + const dist = bX * dX + bY * dY; + return dist; + } + return 0; + } + parseColor(input) { + let cached = this._parseColorCache[input]; + if (!cached) { + cached = this._parseColorCache[input] = Color$1.parse(input); + } + return cached; + } +} +var EvaluationContext$1 = EvaluationContext; + +// +class CompoundExpression { + constructor(name, type, evaluate, args) { + this.name = name; + this.type = type; + this._evaluate = evaluate; + this.args = args; + } + evaluate(ctx) { + return this._evaluate(ctx, this.args); + } + eachChild(fn) { + this.args.forEach(fn); + } + outputDefined() { + return false; + } + serialize() { + return [this.name].concat(this.args.map(arg => arg.serialize())); + } + static parse(args, context) { + const op = args[0]; + const definition = CompoundExpression.definitions[op]; + if (!definition) { + return context.error(`Unknown expression "${ op }". If you wanted a literal array, use ["literal", [...]].`, 0); + } + // Now check argument types against each signature + const type = Array.isArray(definition) ? definition[0] : definition.type; + const availableOverloads = Array.isArray(definition) ? [[ + definition[1], + definition[2] + ]] : definition.overloads; + const overloads = availableOverloads.filter(([signature]) => !Array.isArray(signature) || // varags + signature.length === args.length - 1 // correct param count +); + let signatureContext = null; + for (const [params, evaluate] of overloads) { + // Use a fresh context for each attempted signature so that, if + // we eventually succeed, we haven't polluted `context.errors`. + signatureContext = new ParsingContext$1(context.registry, context.path, null, context.scope); + // First parse all the args, potentially coercing to the + // types expected by this overload. + const parsedArgs = []; + let argParseFailed = false; + for (let i = 1; i < args.length; i++) { + const arg = args[i]; + const expectedType = Array.isArray(params) ? params[i - 1] : params.type; + const parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType); + if (!parsed) { + argParseFailed = true; + break; + } + parsedArgs.push(parsed); + } + if (argParseFailed) { + // Couldn't coerce args of this overload to expected type, move + // on to next one. + continue; + } + if (Array.isArray(params)) { + if (params.length !== parsedArgs.length) { + signatureContext.error(`Expected ${ params.length } arguments, but found ${ parsedArgs.length } instead.`); + continue; + } + } + for (let i = 0; i < parsedArgs.length; i++) { + const expected = Array.isArray(params) ? params[i] : params.type; + const arg = parsedArgs[i]; + signatureContext.concat(i + 1).checkSubtype(expected, arg.type); + } + if (signatureContext.errors.length === 0) { + return new CompoundExpression(op, type, evaluate, parsedArgs); + } + } + if (overloads.length === 1) { + context.errors.push(...signatureContext.errors); + } else { + const expected = overloads.length ? overloads : availableOverloads; + const signatures = expected.map(([params]) => stringifySignature(params)).join(' | '); + const actualTypes = []; + // For error message, re-parse arguments without trying to + // apply any coercions + for (let i = 1; i < args.length; i++) { + const parsed = context.parse(args[i], 1 + actualTypes.length); + if (!parsed) + return null; + actualTypes.push(toString$1(parsed.type)); + } + context.error(`Expected arguments of type ${ signatures }, but found (${ actualTypes.join(', ') }) instead.`); + } + return null; + } + static register(registry, definitions) { + CompoundExpression.definitions = definitions; + for (const name in definitions) { + registry[name] = CompoundExpression; + } + } +} +function stringifySignature(signature) { + if (Array.isArray(signature)) { + return `(${ signature.map(toString$1).join(', ') })`; + } else { + return `(${ toString$1(signature.type) }...)`; + } +} +var CompoundExpression$1 = CompoundExpression; + +// +class CollatorExpression { + constructor(caseSensitive, diacriticSensitive, locale) { + this.type = CollatorType; + this.locale = locale; + this.caseSensitive = caseSensitive; + this.diacriticSensitive = diacriticSensitive; + } + static parse(args, context) { + if (args.length !== 2) + return context.error(`Expected one argument.`); + const options = args[1]; + if (typeof options !== 'object' || Array.isArray(options)) + return context.error(`Collator options argument must be an object.`); + const caseSensitive = context.parse(options['case-sensitive'] === undefined ? false : options['case-sensitive'], 1, BooleanType); + if (!caseSensitive) + return null; + const diacriticSensitive = context.parse(options['diacritic-sensitive'] === undefined ? false : options['diacritic-sensitive'], 1, BooleanType); + if (!diacriticSensitive) + return null; + let locale = null; + if (options['locale']) { + locale = context.parse(options['locale'], 1, StringType); + if (!locale) + return null; + } + return new CollatorExpression(caseSensitive, diacriticSensitive, locale); + } + evaluate(ctx) { + return new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null); + } + eachChild(fn) { + fn(this.caseSensitive); + fn(this.diacriticSensitive); + if (this.locale) { + fn(this.locale); + } + } + outputDefined() { + // Technically the set of possible outputs is the combinatoric set of Collators produced + // by all possible outputs of locale/caseSensitive/diacriticSensitive + // But for the primary use of Collators in comparison operators, we ignore the Collator's + // possible outputs anyway, so we can get away with leaving this false for now. + return false; + } + serialize() { + const options = {}; + options['case-sensitive'] = this.caseSensitive.serialize(); + options['diacritic-sensitive'] = this.diacriticSensitive.serialize(); + if (this.locale) { + options['locale'] = this.locale.serialize(); + } + return [ + 'collator', + options + ]; + } +} + +// +// minX, minY, maxX, maxY +const EXTENT = 8192; +function updateBBox(bbox, coord) { + bbox[0] = Math.min(bbox[0], coord[0]); + bbox[1] = Math.min(bbox[1], coord[1]); + bbox[2] = Math.max(bbox[2], coord[0]); + bbox[3] = Math.max(bbox[3], coord[1]); +} +function mercatorXfromLng(lng) { + return (180 + lng) / 360; +} +function mercatorYfromLat(lat) { + return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))) / 360; +} +function boxWithinBox(bbox1, bbox2) { + if (bbox1[0] <= bbox2[0]) + return false; + if (bbox1[2] >= bbox2[2]) + return false; + if (bbox1[1] <= bbox2[1]) + return false; + if (bbox1[3] >= bbox2[3]) + return false; + return true; +} +function getTileCoordinates(p, canonical) { + const x = mercatorXfromLng(p[0]); + const y = mercatorYfromLat(p[1]); + const tilesAtZoom = Math.pow(2, canonical.z); + return [ + Math.round(x * tilesAtZoom * EXTENT), + Math.round(y * tilesAtZoom * EXTENT) + ]; +} +function onBoundary(p, p1, p2) { + const x1 = p[0] - p1[0]; + const y1 = p[1] - p1[1]; + const x2 = p[0] - p2[0]; + const y2 = p[1] - p2[1]; + return x1 * y2 - x2 * y1 === 0 && x1 * x2 <= 0 && y1 * y2 <= 0; +} +function rayIntersect(p, p1, p2) { + return p1[1] > p[1] !== p2[1] > p[1] && p[0] < (p2[0] - p1[0]) * (p[1] - p1[1]) / (p2[1] - p1[1]) + p1[0]; +} +// ray casting algorithm for detecting if point is in polygon +function pointWithinPolygon(point, rings) { + let inside = false; + for (let i = 0, len = rings.length; i < len; i++) { + const ring = rings[i]; + for (let j = 0, len2 = ring.length; j < len2 - 1; j++) { + if (onBoundary(point, ring[j], ring[j + 1])) + return false; + if (rayIntersect(point, ring[j], ring[j + 1])) + inside = !inside; + } + } + return inside; +} +function pointWithinPolygons(point, polygons) { + for (let i = 0; i < polygons.length; i++) { + if (pointWithinPolygon(point, polygons[i])) + return true; + } + return false; +} +function perp(v1, v2) { + return v1[0] * v2[1] - v1[1] * v2[0]; +} +// check if p1 and p2 are in different sides of line segment q1->q2 +function twoSided(p1, p2, q1, q2) { + // q1->p1 (x1, y1), q1->p2 (x2, y2), q1->q2 (x3, y3) + const x1 = p1[0] - q1[0]; + const y1 = p1[1] - q1[1]; + const x2 = p2[0] - q1[0]; + const y2 = p2[1] - q1[1]; + const x3 = q2[0] - q1[0]; + const y3 = q2[1] - q1[1]; + const det1 = x1 * y3 - x3 * y1; + const det2 = x2 * y3 - x3 * y2; + if (det1 > 0 && det2 < 0 || det1 < 0 && det2 > 0) + return true; + return false; +} +// a, b are end points for line segment1, c and d are end points for line segment2 +function lineIntersectLine(a, b, c, d) { + // check if two segments are parallel or not + // precondition is end point a, b is inside polygon, if line a->b is + // parallel to polygon edge c->d, then a->b won't intersect with c->d + const vectorP = [ + b[0] - a[0], + b[1] - a[1] + ]; + const vectorQ = [ + d[0] - c[0], + d[1] - c[1] + ]; + if (perp(vectorQ, vectorP) === 0) + return false; + // If lines are intersecting with each other, the relative location should be: + // a and b lie in different sides of segment c->d + // c and d lie in different sides of segment a->b + if (twoSided(a, b, c, d) && twoSided(c, d, a, b)) + return true; + return false; +} +function lineIntersectPolygon(p1, p2, polygon) { + for (const ring of polygon) { + // loop through every edge of the ring + for (let j = 0; j < ring.length - 1; ++j) { + if (lineIntersectLine(p1, p2, ring[j], ring[j + 1])) { + return true; + } + } + } + return false; +} +function lineStringWithinPolygon(line, polygon) { + // First, check if geometry points of line segments are all inside polygon + for (let i = 0; i < line.length; ++i) { + if (!pointWithinPolygon(line[i], polygon)) { + return false; + } + } + // Second, check if there is line segment intersecting polygon edge + for (let i = 0; i < line.length - 1; ++i) { + if (lineIntersectPolygon(line[i], line[i + 1], polygon)) { + return false; + } + } + return true; +} +function lineStringWithinPolygons(line, polygons) { + for (let i = 0; i < polygons.length; i++) { + if (lineStringWithinPolygon(line, polygons[i])) + return true; + } + return false; +} +function getTilePolygon(coordinates, bbox, canonical) { + const polygon = []; + for (let i = 0; i < coordinates.length; i++) { + const ring = []; + for (let j = 0; j < coordinates[i].length; j++) { + const coord = getTileCoordinates(coordinates[i][j], canonical); + updateBBox(bbox, coord); + ring.push(coord); + } + polygon.push(ring); + } + return polygon; +} +function getTilePolygons(coordinates, bbox, canonical) { + const polygons = []; + for (let i = 0; i < coordinates.length; i++) { + const polygon = getTilePolygon(coordinates[i], bbox, canonical); + polygons.push(polygon); + } + return polygons; +} +function updatePoint(p, bbox, polyBBox, worldSize) { + if (p[0] < polyBBox[0] || p[0] > polyBBox[2]) { + const halfWorldSize = worldSize * 0.5; + let shift = p[0] - polyBBox[0] > halfWorldSize ? -worldSize : polyBBox[0] - p[0] > halfWorldSize ? worldSize : 0; + if (shift === 0) { + shift = p[0] - polyBBox[2] > halfWorldSize ? -worldSize : polyBBox[2] - p[0] > halfWorldSize ? worldSize : 0; + } + p[0] += shift; + } + updateBBox(bbox, p); +} +function resetBBox(bbox) { + bbox[0] = bbox[1] = Infinity; + bbox[2] = bbox[3] = -Infinity; +} +function getTilePoints(geometry, pointBBox, polyBBox, canonical) { + const worldSize = Math.pow(2, canonical.z) * EXTENT; + const shifts = [ + canonical.x * EXTENT, + canonical.y * EXTENT + ]; + const tilePoints = []; + if (!geometry) + return tilePoints; + for (const points of geometry) { + for (const point of points) { + const p = [ + point.x + shifts[0], + point.y + shifts[1] + ]; + updatePoint(p, pointBBox, polyBBox, worldSize); + tilePoints.push(p); + } + } + return tilePoints; +} +function getTileLines(geometry, lineBBox, polyBBox, canonical) { + const worldSize = Math.pow(2, canonical.z) * EXTENT; + const shifts = [ + canonical.x * EXTENT, + canonical.y * EXTENT + ]; + const tileLines = []; + if (!geometry) + return tileLines; + for (const line of geometry) { + const tileLine = []; + for (const point of line) { + const p = [ + point.x + shifts[0], + point.y + shifts[1] + ]; + updateBBox(lineBBox, p); + tileLine.push(p); + } + tileLines.push(tileLine); + } + if (lineBBox[2] - lineBBox[0] <= worldSize / 2) { + resetBBox(lineBBox); + for (const line of tileLines) { + for (const p of line) { + updatePoint(p, lineBBox, polyBBox, worldSize); + } + } + } + return tileLines; +} +function pointsWithinPolygons(ctx, polygonGeometry) { + const pointBBox = [ + Infinity, + Infinity, + -Infinity, + -Infinity + ]; + const polyBBox = [ + Infinity, + Infinity, + -Infinity, + -Infinity + ]; + const canonical = ctx.canonicalID(); + if (!canonical) { + return false; + } + if (polygonGeometry.type === 'Polygon') { + const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical); + const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical); + if (!boxWithinBox(pointBBox, polyBBox)) + return false; + for (const point of tilePoints) { + if (!pointWithinPolygon(point, tilePolygon)) + return false; + } + } + if (polygonGeometry.type === 'MultiPolygon') { + const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical); + const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical); + if (!boxWithinBox(pointBBox, polyBBox)) + return false; + for (const point of tilePoints) { + if (!pointWithinPolygons(point, tilePolygons)) + return false; + } + } + return true; +} +function linesWithinPolygons(ctx, polygonGeometry) { + const lineBBox = [ + Infinity, + Infinity, + -Infinity, + -Infinity + ]; + const polyBBox = [ + Infinity, + Infinity, + -Infinity, + -Infinity + ]; + const canonical = ctx.canonicalID(); + if (!canonical) { + return false; + } + if (polygonGeometry.type === 'Polygon') { + const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical); + const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical); + if (!boxWithinBox(lineBBox, polyBBox)) + return false; + for (const line of tileLines) { + if (!lineStringWithinPolygon(line, tilePolygon)) + return false; + } + } + if (polygonGeometry.type === 'MultiPolygon') { + const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical); + const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical); + if (!boxWithinBox(lineBBox, polyBBox)) + return false; + for (const line of tileLines) { + if (!lineStringWithinPolygons(line, tilePolygons)) + return false; + } + } + return true; +} +class Within { + constructor(geojson, geometries) { + this.type = BooleanType; + this.geojson = geojson; + this.geometries = geometries; + } + static parse(args, context) { + if (args.length !== 2) + return context.error(`'within' expression requires exactly one argument, but found ${ args.length - 1 } instead.`); + if (isValue(args[1])) { + const geojson = args[1]; + if (geojson.type === 'FeatureCollection') { + for (let i = 0; i < geojson.features.length; ++i) { + const type = geojson.features[i].geometry.type; + if (type === 'Polygon' || type === 'MultiPolygon') { + return new Within(geojson, geojson.features[i].geometry); + } + } + } else if (geojson.type === 'Feature') { + const type = geojson.geometry.type; + if (type === 'Polygon' || type === 'MultiPolygon') { + return new Within(geojson, geojson.geometry); + } + } else if (geojson.type === 'Polygon' || geojson.type === 'MultiPolygon') { + return new Within(geojson, geojson); + } + } + return context.error(`'within' expression requires valid geojson object that contains polygon geometry type.`); + } + evaluate(ctx) { + if (ctx.geometry() != null && ctx.canonicalID() != null) { + if (ctx.geometryType() === 'Point') { + return pointsWithinPolygons(ctx, this.geometries); + } else if (ctx.geometryType() === 'LineString') { + return linesWithinPolygons(ctx, this.geometries); + } + } + return false; + } + eachChild() { + } + outputDefined() { + return true; + } + serialize() { + return [ + 'within', + this.geojson + ]; + } +} +var Within$1 = Within; + +// +function isFeatureConstant(e) { + if (e instanceof CompoundExpression$1) { + if (e.name === 'get' && e.args.length === 1) { + return false; + } else if (e.name === 'feature-state') { + return false; + } else if (e.name === 'has' && e.args.length === 1) { + return false; + } else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') { + return false; + } else if (/^filter-/.test(e.name)) { + return false; + } + } + if (e instanceof Within$1) { + return false; + } + let result = true; + e.eachChild(arg => { + if (result && !isFeatureConstant(arg)) { + result = false; + } + }); + return result; +} +function isStateConstant(e) { + if (e instanceof CompoundExpression$1) { + if (e.name === 'feature-state') { + return false; + } + } + let result = true; + e.eachChild(arg => { + if (result && !isStateConstant(arg)) { + result = false; + } + }); + return result; +} +function isGlobalPropertyConstant(e, properties) { + if (e instanceof CompoundExpression$1 && properties.indexOf(e.name) >= 0) { + return false; + } + let result = true; + e.eachChild(arg => { + if (result && !isGlobalPropertyConstant(arg, properties)) { + result = false; + } + }); + return result; +} + +// +class Var { + constructor(name, boundExpression) { + this.type = boundExpression.type; + this.name = name; + this.boundExpression = boundExpression; + } + static parse(args, context) { + if (args.length !== 2 || typeof args[1] !== 'string') + return context.error(`'var' expression requires exactly one string literal argument.`); + const name = args[1]; + if (!context.scope.has(name)) { + return context.error(`Unknown variable "${ name }". Make sure "${ name }" has been bound in an enclosing "let" expression before using it.`, 1); + } + return new Var(name, context.scope.get(name)); + } + evaluate(ctx) { + return this.boundExpression.evaluate(ctx); + } + eachChild() { + } + outputDefined() { + return false; + } + serialize() { + return [ + 'var', + this.name + ]; + } +} +var Var$1 = Var; + +// +/** + * State associated parsing at a given point in an expression tree. + * @private + */ +class ParsingContext { + // The expected type of this expression. Provided only to allow Expression + // implementations to infer argument types: Expression#parse() need not + // check that the output type of the parsed expression matches + // `expectedType`. + constructor(registry, path = [], expectedType, scope = new Scope$1(), errors = []) { + this.registry = registry; + this.path = path; + this.key = path.map(part => `[${ part }]`).join(''); + this.scope = scope; + this.errors = errors; + this.expectedType = expectedType; + } + /** + * @param expr the JSON expression to parse + * @param index the optional argument index if this expression is an argument of a parent expression that's being parsed + * @param options + * @param options.omitTypeAnnotations set true to omit inferred type annotations. Caller beware: with this option set, the parsed expression's type will NOT satisfy `expectedType` if it would normally be wrapped in an inferred annotation. + * @private + */ + parse(expr, index, expectedType, bindings, options = {}) { + if (index) { + return this.concat(index, expectedType, bindings)._parse(expr, options); + } + return this._parse(expr, options); + } + _parse(expr, options) { + if (expr === null || typeof expr === 'string' || typeof expr === 'boolean' || typeof expr === 'number') { + expr = [ + 'literal', + expr + ]; + } + function annotate(parsed, type, typeAnnotation) { + if (typeAnnotation === 'assert') { + return new Assertion$1(type, [parsed]); + } else if (typeAnnotation === 'coerce') { + return new Coercion$1(type, [parsed]); + } else { + return parsed; + } + } + if (Array.isArray(expr)) { + if (expr.length === 0) { + return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`); + } + const op = expr[0]; + if (typeof op !== 'string') { + this.error(`Expression name must be a string, but found ${ typeof op } instead. If you wanted a literal array, use ["literal", [...]].`, 0); + return null; + } + const Expr = this.registry[op]; + if (Expr) { + let parsed = Expr.parse(expr, this); + if (!parsed) + return null; + if (this.expectedType) { + const expected = this.expectedType; + const actual = parsed.type; + // When we expect a number, string, boolean, or array but have a value, wrap it in an assertion. + // When we expect a color or formatted string, but have a string or value, wrap it in a coercion. + // Otherwise, we do static type-checking. + // + // These behaviors are overridable for: + // * The "coalesce" operator, which needs to omit type annotations. + // * String-valued properties (e.g. `text-field`), where coercion is more convenient than assertion. + // + if ((expected.kind === 'string' || expected.kind === 'number' || expected.kind === 'boolean' || expected.kind === 'object' || expected.kind === 'array') && actual.kind === 'value') { + parsed = annotate(parsed, expected, options.typeAnnotation || 'assert'); + } else if ((expected.kind === 'color' || expected.kind === 'formatted' || expected.kind === 'resolvedImage') && (actual.kind === 'value' || actual.kind === 'string')) { + parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce'); + } else if (this.checkSubtype(expected, actual)) { + return null; + } + } + // If an expression's arguments are all literals, we can evaluate + // it immediately and replace it with a literal value in the + // parsed/compiled result. Expressions that expect an image should + // not be resolved here so we can later get the available images. + if (!(parsed instanceof Literal$1) && parsed.type.kind !== 'resolvedImage' && isConstant(parsed)) { + const ec = new EvaluationContext$1(); + try { + parsed = new Literal$1(parsed.type, parsed.evaluate(ec)); + } catch (e) { + this.error(e.message); + return null; + } + } + return parsed; + } + return this.error(`Unknown expression "${ op }". If you wanted a literal array, use ["literal", [...]].`, 0); + } else if (typeof expr === 'undefined') { + return this.error(`'undefined' value invalid. Use null instead.`); + } else if (typeof expr === 'object') { + return this.error(`Bare objects invalid. Use ["literal", {...}] instead.`); + } else { + return this.error(`Expected an array, but found ${ typeof expr } instead.`); + } + } + /** + * Returns a copy of this context suitable for parsing the subexpression at + * index `index`, optionally appending to 'let' binding map. + * + * Note that `errors` property, intended for collecting errors while + * parsing, is copied by reference rather than cloned. + * @private + */ + concat(index, expectedType, bindings) { + const path = typeof index === 'number' ? this.path.concat(index) : this.path; + const scope = bindings ? this.scope.concat(bindings) : this.scope; + return new ParsingContext(this.registry, path, expectedType || null, scope, this.errors); + } + /** + * Push a parsing (or type checking) error into the `this.errors` + * @param error The message + * @param keys Optionally specify the source of the error at a child + * of the current expression at `this.key`. + * @private + */ + error(error, ...keys) { + const key = `${ this.key }${ keys.map(k => `[${ k }]`).join('') }`; + this.errors.push(new ParsingError$1(key, error)); + } + /** + * Returns null if `t` is a subtype of `expected`; otherwise returns an + * error message and also pushes it to `this.errors`. + */ + checkSubtype(expected, t) { + const error = checkSubtype(expected, t); + if (error) + this.error(error); + return error; + } +} +var ParsingContext$1 = ParsingContext; +function isConstant(expression) { + if (expression instanceof Var$1) { + return isConstant(expression.boundExpression); + } else if (expression instanceof CompoundExpression$1 && expression.name === 'error') { + return false; + } else if (expression instanceof CollatorExpression) { + // Although the results of a Collator expression with fixed arguments + // generally shouldn't change between executions, we can't serialize them + // as constant expressions because results change based on environment. + return false; + } else if (expression instanceof Within$1) { + return false; + } + const isTypeAnnotation = expression instanceof Coercion$1 || expression instanceof Assertion$1; + let childrenConstant = true; + expression.eachChild(child => { + // We can _almost_ assume that if `expressions` children are constant, + // they would already have been evaluated to Literal values when they + // were parsed. Type annotations are the exception, because they might + // have been inferred and added after a child was parsed. + // So we recurse into isConstant() for the children of type annotations, + // but otherwise simply check whether they are Literals. + if (isTypeAnnotation) { + childrenConstant = childrenConstant && isConstant(child); + } else { + childrenConstant = childrenConstant && child instanceof Literal$1; + } + }); + if (!childrenConstant) { + return false; + } + return isFeatureConstant(expression) && isGlobalPropertyConstant(expression, [ + 'zoom', + 'heatmap-density', + 'line-progress', + 'sky-radial-progress', + 'accumulated', + 'is-supported-script', + 'pitch', + 'distance-from-center' + ]); +} + +// +/** + * Returns the index of the last stop <= input, or 0 if it doesn't exist. + * @private + */ +function findStopLessThanOrEqualTo(stops, input) { + const lastIndex = stops.length - 1; + let lowerIndex = 0; + let upperIndex = lastIndex; + let currentIndex = 0; + let currentValue, nextValue; + while (lowerIndex <= upperIndex) { + currentIndex = Math.floor((lowerIndex + upperIndex) / 2); + currentValue = stops[currentIndex]; + nextValue = stops[currentIndex + 1]; + if (currentValue <= input) { + if (currentIndex === lastIndex || input < nextValue) { + // Search complete + return currentIndex; + } + lowerIndex = currentIndex + 1; + } else if (currentValue > input) { + upperIndex = currentIndex - 1; + } else { + throw new RuntimeError$1('Input is not a number.'); + } + } + return 0; +} + +// +class Step { + constructor(type, input, stops) { + this.type = type; + this.input = input; + this.labels = []; + this.outputs = []; + for (const [label, expression] of stops) { + this.labels.push(label); + this.outputs.push(expression); + } + } + static parse(args, context) { + if (args.length - 1 < 4) { + return context.error(`Expected at least 4 arguments, but found only ${ args.length - 1 }.`); + } + if ((args.length - 1) % 2 !== 0) { + return context.error(`Expected an even number of arguments.`); + } + const input = context.parse(args[1], 1, NumberType); + if (!input) + return null; + const stops = []; + let outputType = null; + if (context.expectedType && context.expectedType.kind !== 'value') { + outputType = context.expectedType; + } + for (let i = 1; i < args.length; i += 2) { + const label = i === 1 ? -Infinity : args[i]; + const value = args[i + 1]; + const labelKey = i; + const valueKey = i + 1; + if (typeof label !== 'number') { + return context.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey); + } + if (stops.length && stops[stops.length - 1][0] >= label) { + return context.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', labelKey); + } + const parsed = context.parse(value, valueKey, outputType); + if (!parsed) + return null; + outputType = outputType || parsed.type; + stops.push([ + label, + parsed + ]); + } + return new Step(outputType, input, stops); + } + evaluate(ctx) { + const labels = this.labels; + const outputs = this.outputs; + if (labels.length === 1) { + return outputs[0].evaluate(ctx); + } + const value = this.input.evaluate(ctx); + if (value <= labels[0]) { + return outputs[0].evaluate(ctx); + } + const stopCount = labels.length; + if (value >= labels[stopCount - 1]) { + return outputs[stopCount - 1].evaluate(ctx); + } + const index = findStopLessThanOrEqualTo(labels, value); + return outputs[index].evaluate(ctx); + } + eachChild(fn) { + fn(this.input); + for (const expression of this.outputs) { + fn(expression); + } + } + outputDefined() { + return this.outputs.every(out => out.outputDefined()); + } + serialize() { + const serialized = [ + 'step', + this.input.serialize() + ]; + for (let i = 0; i < this.labels.length; i++) { + if (i > 0) { + serialized.push(this.labels[i]); + } + serialized.push(this.outputs[i].serialize()); + } + return serialized; + } +} +var Step$1 = Step; + +/* + * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Ported from Webkit + * http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/platform/graphics/UnitBezier.h + */ + +var unitbezier = UnitBezier; +function UnitBezier(p1x, p1y, p2x, p2y) { + // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1). + this.cx = 3 * p1x; + this.bx = 3 * (p2x - p1x) - this.cx; + this.ax = 1 - this.cx - this.bx; + this.cy = 3 * p1y; + this.by = 3 * (p2y - p1y) - this.cy; + this.ay = 1 - this.cy - this.by; + this.p1x = p1x; + this.p1y = p2y; + this.p2x = p2x; + this.p2y = p2y; +} +UnitBezier.prototype.sampleCurveX = function (t) { + // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule. + return ((this.ax * t + this.bx) * t + this.cx) * t; +}; +UnitBezier.prototype.sampleCurveY = function (t) { + return ((this.ay * t + this.by) * t + this.cy) * t; +}; +UnitBezier.prototype.sampleCurveDerivativeX = function (t) { + return (3 * this.ax * t + 2 * this.bx) * t + this.cx; +}; +UnitBezier.prototype.solveCurveX = function (x, epsilon) { + if (typeof epsilon === 'undefined') + epsilon = 0.000001; + var t0, t1, t2, x2, i; + // First try a few iterations of Newton's method -- normally very fast. + for (t2 = x, i = 0; i < 8; i++) { + x2 = this.sampleCurveX(t2) - x; + if (Math.abs(x2) < epsilon) + return t2; + var d2 = this.sampleCurveDerivativeX(t2); + if (Math.abs(d2) < 0.000001) + break; + t2 = t2 - x2 / d2; + } + // Fall back to the bisection method for reliability. + t0 = 0; + t1 = 1; + t2 = x; + if (t2 < t0) + return t0; + if (t2 > t1) + return t1; + while (t0 < t1) { + x2 = this.sampleCurveX(t2); + if (Math.abs(x2 - x) < epsilon) + return t2; + if (x > x2) { + t0 = t2; + } else { + t1 = t2; + } + t2 = (t1 - t0) * 0.5 + t0; + } + // Failure. + return t2; +}; +UnitBezier.prototype.solve = function (x, epsilon) { + return this.sampleCurveY(this.solveCurveX(x, epsilon)); +}; + +var UnitBezier$1 = /*@__PURE__*/getDefaultExportFromCjs(unitbezier); + +// +function number(a, b, t) { + return a * (1 - t) + b * t; +} +function color(from, to, t) { + return new Color$1(number(from.r, to.r, t), number(from.g, to.g, t), number(from.b, to.b, t), number(from.a, to.a, t)); +} +function array(from, to, t) { + return from.map((d, i) => { + return number(d, to[i], t); + }); +} + +var interpolate = /*#__PURE__*/Object.freeze({ + __proto__: null, + number: number, + color: color, + array: array +}); + +// +// Constants +const Xn = 0.95047, + // D65 standard referent + Yn = 1, Zn = 1.08883, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad$1 = Math.PI / 180, rad2deg = 180 / Math.PI; +// Utilities +function xyz2lab(t) { + return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; +} +function lab2xyz(t) { + return t > t1 ? t * t * t : t2 * (t - t0); +} +function xyz2rgb(x) { + return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); +} +function rgb2xyz(x) { + x /= 255; + return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); +} +// LAB +function rgbToLab(rgbColor) { + const b = rgb2xyz(rgbColor.r), a = rgb2xyz(rgbColor.g), l = rgb2xyz(rgbColor.b), x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn), y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.072175 * l) / Yn), z = xyz2lab((0.0193339 * b + 0.119192 * a + 0.9503041 * l) / Zn); + return { + l: 116 * y - 16, + a: 500 * (x - y), + b: 200 * (y - z), + alpha: rgbColor.a + }; +} +function labToRgb(labColor) { + let y = (labColor.l + 16) / 116, x = isNaN(labColor.a) ? y : y + labColor.a / 500, z = isNaN(labColor.b) ? y : y - labColor.b / 200; + y = Yn * lab2xyz(y); + x = Xn * lab2xyz(x); + z = Zn * lab2xyz(z); + return new Color$1(xyz2rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB + xyz2rgb(-0.969266 * x + 1.8760108 * y + 0.041556 * z), xyz2rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z), labColor.alpha); +} +function interpolateLab(from, to, t) { + return { + l: number(from.l, to.l, t), + a: number(from.a, to.a, t), + b: number(from.b, to.b, t), + alpha: number(from.alpha, to.alpha, t) + }; +} +// HCL +function rgbToHcl(rgbColor) { + const {l, a, b} = rgbToLab(rgbColor); + const h = Math.atan2(b, a) * rad2deg; + return { + h: h < 0 ? h + 360 : h, + c: Math.sqrt(a * a + b * b), + l, + alpha: rgbColor.a + }; +} +function hclToRgb(hclColor) { + const h = hclColor.h * deg2rad$1, c = hclColor.c, l = hclColor.l; + return labToRgb({ + l, + a: Math.cos(h) * c, + b: Math.sin(h) * c, + alpha: hclColor.alpha + }); +} +function interpolateHue(a, b, t) { + const d = b - a; + return a + t * (d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d); +} +function interpolateHcl(from, to, t) { + return { + h: interpolateHue(from.h, to.h, t), + c: number(from.c, to.c, t), + l: number(from.l, to.l, t), + alpha: number(from.alpha, to.alpha, t) + }; +} +const lab = { + forward: rgbToLab, + reverse: labToRgb, + interpolate: interpolateLab +}; +const hcl = { + forward: rgbToHcl, + reverse: hclToRgb, + interpolate: interpolateHcl +}; + +// +class Interpolate { + constructor(type, operator, interpolation, input, stops) { + this.type = type; + this.operator = operator; + this.interpolation = interpolation; + this.input = input; + this.labels = []; + this.outputs = []; + for (const [label, expression] of stops) { + this.labels.push(label); + this.outputs.push(expression); + } + } + static interpolationFactor(interpolation, input, lower, upper) { + let t = 0; + if (interpolation.name === 'exponential') { + t = exponentialInterpolation(input, interpolation.base, lower, upper); + } else if (interpolation.name === 'linear') { + t = exponentialInterpolation(input, 1, lower, upper); + } else if (interpolation.name === 'cubic-bezier') { + const c = interpolation.controlPoints; + const ub = new UnitBezier$1(c[0], c[1], c[2], c[3]); + t = ub.solve(exponentialInterpolation(input, 1, lower, upper)); + } + return t; + } + static parse(args, context) { + let [operator, interpolation, input, ...rest] = args; + if (!Array.isArray(interpolation) || interpolation.length === 0) { + return context.error(`Expected an interpolation type expression.`, 1); + } + if (interpolation[0] === 'linear') { + interpolation = { name: 'linear' }; + } else if (interpolation[0] === 'exponential') { + const base = interpolation[1]; + if (typeof base !== 'number') + return context.error(`Exponential interpolation requires a numeric base.`, 1, 1); + interpolation = { + name: 'exponential', + base + }; + } else if (interpolation[0] === 'cubic-bezier') { + const controlPoints = interpolation.slice(1); + if (controlPoints.length !== 4 || controlPoints.some(t => typeof t !== 'number' || t < 0 || t > 1)) { + return context.error('Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.', 1); + } + interpolation = { + name: 'cubic-bezier', + controlPoints: controlPoints + }; + } else { + return context.error(`Unknown interpolation type ${ String(interpolation[0]) }`, 1, 0); + } + if (args.length - 1 < 4) { + return context.error(`Expected at least 4 arguments, but found only ${ args.length - 1 }.`); + } + if ((args.length - 1) % 2 !== 0) { + return context.error(`Expected an even number of arguments.`); + } + input = context.parse(input, 2, NumberType); + if (!input) + return null; + const stops = []; + let outputType = null; + if (operator === 'interpolate-hcl' || operator === 'interpolate-lab') { + outputType = ColorType; + } else if (context.expectedType && context.expectedType.kind !== 'value') { + outputType = context.expectedType; + } + for (let i = 0; i < rest.length; i += 2) { + const label = rest[i]; + const value = rest[i + 1]; + const labelKey = i + 3; + const valueKey = i + 4; + if (typeof label !== 'number') { + return context.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey); + } + if (stops.length && stops[stops.length - 1][0] >= label) { + return context.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', labelKey); + } + const parsed = context.parse(value, valueKey, outputType); + if (!parsed) + return null; + outputType = outputType || parsed.type; + stops.push([ + label, + parsed + ]); + } + if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) { + return context.error(`Type ${ toString$1(outputType) } is not interpolatable.`); + } + return new Interpolate(outputType, operator, interpolation, input, stops); + } + evaluate(ctx) { + const labels = this.labels; + const outputs = this.outputs; + if (labels.length === 1) { + return outputs[0].evaluate(ctx); + } + const value = this.input.evaluate(ctx); + if (value <= labels[0]) { + return outputs[0].evaluate(ctx); + } + const stopCount = labels.length; + if (value >= labels[stopCount - 1]) { + return outputs[stopCount - 1].evaluate(ctx); + } + const index = findStopLessThanOrEqualTo(labels, value); + const lower = labels[index]; + const upper = labels[index + 1]; + const t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper); + const outputLower = outputs[index].evaluate(ctx); + const outputUpper = outputs[index + 1].evaluate(ctx); + if (this.operator === 'interpolate') { + return interpolate[this.type.kind.toLowerCase()](outputLower, outputUpper, t); // eslint-disable-line import/namespace + } else if (this.operator === 'interpolate-hcl') { + return hcl.reverse(hcl.interpolate(hcl.forward(outputLower), hcl.forward(outputUpper), t)); + } else { + return lab.reverse(lab.interpolate(lab.forward(outputLower), lab.forward(outputUpper), t)); + } + } + eachChild(fn) { + fn(this.input); + for (const expression of this.outputs) { + fn(expression); + } + } + outputDefined() { + return this.outputs.every(out => out.outputDefined()); + } + serialize() { + let interpolation; + if (this.interpolation.name === 'linear') { + interpolation = ['linear']; + } else if (this.interpolation.name === 'exponential') { + if (this.interpolation.base === 1) { + interpolation = ['linear']; + } else { + interpolation = [ + 'exponential', + this.interpolation.base + ]; + } + } else { + interpolation = ['cubic-bezier'].concat(this.interpolation.controlPoints); + } + const serialized = [ + this.operator, + interpolation, + this.input.serialize() + ]; + for (let i = 0; i < this.labels.length; i++) { + serialized.push(this.labels[i], this.outputs[i].serialize()); + } + return serialized; + } +} +/** + * Returns a ratio that can be used to interpolate between exponential function + * stops. + * How it works: Two consecutive stop values define a (scaled and shifted) exponential function `f(x) = a * base^x + b`, where `base` is the user-specified base, + * and `a` and `b` are constants affording sufficient degrees of freedom to fit + * the function to the given stops. + * + * Here's a bit of algebra that lets us compute `f(x)` directly from the stop + * values without explicitly solving for `a` and `b`: + * + * First stop value: `f(x0) = y0 = a * base^x0 + b` + * Second stop value: `f(x1) = y1 = a * base^x1 + b` + * => `y1 - y0 = a(base^x1 - base^x0)` + * => `a = (y1 - y0)/(base^x1 - base^x0)` + * + * Desired value: `f(x) = y = a * base^x + b` + * => `f(x) = y0 + a * (base^x - base^x0)` + * + * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a + * little algebra: + * ``` + * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0) + * = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0) + * ``` + * + * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have + * `f(x) = y0 + (y1 - y0) * ratio`. In other words, `ratio` may be treated as + * an interpolation factor between the two stops' output values. + * + * (Note: a slightly different form for `ratio`, + * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer + * expensive `Math.pow()` operations.) + * + * @private +*/ +function exponentialInterpolation(input, base, lowerValue, upperValue) { + const difference = upperValue - lowerValue; + const progress = input - lowerValue; + if (difference === 0) { + return 0; + } else if (base === 1) { + return progress / difference; + } else { + return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1); + } +} +var Interpolate$1 = Interpolate; + +class Coalesce { + constructor(type, args) { + this.type = type; + this.args = args; + } + static parse(args, context) { + if (args.length < 2) { + return context.error('Expectected at least one argument.'); + } + let outputType = null; + const expectedType = context.expectedType; + if (expectedType && expectedType.kind !== 'value') { + outputType = expectedType; + } + const parsedArgs = []; + for (const arg of args.slice(1)) { + const parsed = context.parse(arg, 1 + parsedArgs.length, outputType, undefined, { typeAnnotation: 'omit' }); + if (!parsed) + return null; + outputType = outputType || parsed.type; + parsedArgs.push(parsed); + } + // Above, we parse arguments without inferred type annotation so that + // they don't produce a runtime error for `null` input, which would + // preempt the desired null-coalescing behavior. + // Thus, if any of our arguments would have needed an annotation, we + // need to wrap the enclosing coalesce expression with it instead. + const needsAnnotation = expectedType && parsedArgs.some(arg => checkSubtype(expectedType, arg.type)); + return needsAnnotation ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs); + } + evaluate(ctx) { + let result = null; + let argCount = 0; + let firstImage; + for (const arg of this.args) { + argCount++; + result = arg.evaluate(ctx); + // we need to keep track of the first requested image in a coalesce statement + // if coalesce can't find a valid image, we return the first image so styleimagemissing can fire + if (result && result instanceof ResolvedImage && !result.available) { + // set to first image + if (!firstImage) { + firstImage = result; + } + result = null; + // if we reach the end, return the first image + if (argCount === this.args.length) { + return firstImage; + } + } + if (result !== null) + break; + } + return result; + } + eachChild(fn) { + this.args.forEach(fn); + } + outputDefined() { + return this.args.every(arg => arg.outputDefined()); + } + serialize() { + const serialized = ['coalesce']; + this.eachChild(child => { + serialized.push(child.serialize()); + }); + return serialized; + } +} +var Coalesce$1 = Coalesce; + +// +class Let { + constructor(bindings, result) { + this.type = result.type; + this.bindings = [].concat(bindings); + this.result = result; + } + evaluate(ctx) { + return this.result.evaluate(ctx); + } + eachChild(fn) { + for (const binding of this.bindings) { + fn(binding[1]); + } + fn(this.result); + } + static parse(args, context) { + if (args.length < 4) + return context.error(`Expected at least 3 arguments, but found ${ args.length - 1 } instead.`); + const bindings = []; + for (let i = 1; i < args.length - 1; i += 2) { + const name = args[i]; + if (typeof name !== 'string') { + return context.error(`Expected string, but found ${ typeof name } instead.`, i); + } + if (/[^a-zA-Z0-9_]/.test(name)) { + return context.error(`Variable names must contain only alphanumeric characters or '_'.`, i); + } + const value = context.parse(args[i + 1], i + 1); + if (!value) + return null; + bindings.push([ + name, + value + ]); + } + const result = context.parse(args[args.length - 1], args.length - 1, context.expectedType, bindings); + if (!result) + return null; + return new Let(bindings, result); + } + outputDefined() { + return this.result.outputDefined(); + } + serialize() { + const serialized = ['let']; + for (const [name, expr] of this.bindings) { + serialized.push(name, expr.serialize()); + } + serialized.push(this.result.serialize()); + return serialized; + } +} +var Let$1 = Let; + +// +class At { + constructor(type, index, input) { + this.type = type; + this.index = index; + this.input = input; + } + static parse(args, context) { + if (args.length !== 3) + return context.error(`Expected 2 arguments, but found ${ args.length - 1 } instead.`); + const index = context.parse(args[1], 1, NumberType); + const input = context.parse(args[2], 2, array$1(context.expectedType || ValueType)); + if (!index || !input) + return null; + const t = input.type; + return new At(t.itemType, index, input); + } + evaluate(ctx) { + const index = this.index.evaluate(ctx); + const array = this.input.evaluate(ctx); + if (index < 0) { + throw new RuntimeError$1(`Array index out of bounds: ${ index } < 0.`); + } + if (index >= array.length) { + throw new RuntimeError$1(`Array index out of bounds: ${ index } > ${ array.length - 1 }.`); + } + if (index !== Math.floor(index)) { + throw new RuntimeError$1(`Array index must be an integer, but found ${ index } instead.`); + } + return array[index]; + } + eachChild(fn) { + fn(this.index); + fn(this.input); + } + outputDefined() { + return false; + } + serialize() { + return [ + 'at', + this.index.serialize(), + this.input.serialize() + ]; + } +} +var At$1 = At; + +// +class In { + constructor(needle, haystack) { + this.type = BooleanType; + this.needle = needle; + this.haystack = haystack; + } + static parse(args, context) { + if (args.length !== 3) { + return context.error(`Expected 2 arguments, but found ${ args.length - 1 } instead.`); + } + const needle = context.parse(args[1], 1, ValueType); + const haystack = context.parse(args[2], 2, ValueType); + if (!needle || !haystack) + return null; + if (!isValidType(needle.type, [ + BooleanType, + StringType, + NumberType, + NullType, + ValueType + ])) { + return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${ toString$1(needle.type) } instead`); + } + return new In(needle, haystack); + } + evaluate(ctx) { + const needle = this.needle.evaluate(ctx); + const haystack = this.haystack.evaluate(ctx); + if (haystack == null) + return false; + if (!isValidNativeType(needle, [ + 'boolean', + 'string', + 'number', + 'null' + ])) { + throw new RuntimeError$1(`Expected first argument to be of type boolean, string, number or null, but found ${ toString$1(typeOf(needle)) } instead.`); + } + if (!isValidNativeType(haystack, [ + 'string', + 'array' + ])) { + throw new RuntimeError$1(`Expected second argument to be of type array or string, but found ${ toString$1(typeOf(haystack)) } instead.`); + } + return haystack.indexOf(needle) >= 0; + } + eachChild(fn) { + fn(this.needle); + fn(this.haystack); + } + outputDefined() { + return true; + } + serialize() { + return [ + 'in', + this.needle.serialize(), + this.haystack.serialize() + ]; + } +} +var In$1 = In; + +// +class IndexOf { + constructor(needle, haystack, fromIndex) { + this.type = NumberType; + this.needle = needle; + this.haystack = haystack; + this.fromIndex = fromIndex; + } + static parse(args, context) { + if (args.length <= 2 || args.length >= 5) { + return context.error(`Expected 3 or 4 arguments, but found ${ args.length - 1 } instead.`); + } + const needle = context.parse(args[1], 1, ValueType); + const haystack = context.parse(args[2], 2, ValueType); + if (!needle || !haystack) + return null; + if (!isValidType(needle.type, [ + BooleanType, + StringType, + NumberType, + NullType, + ValueType + ])) { + return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${ toString$1(needle.type) } instead`); + } + if (args.length === 4) { + const fromIndex = context.parse(args[3], 3, NumberType); + if (!fromIndex) + return null; + return new IndexOf(needle, haystack, fromIndex); + } else { + return new IndexOf(needle, haystack); + } + } + evaluate(ctx) { + const needle = this.needle.evaluate(ctx); + const haystack = this.haystack.evaluate(ctx); + if (!isValidNativeType(needle, [ + 'boolean', + 'string', + 'number', + 'null' + ])) { + throw new RuntimeError$1(`Expected first argument to be of type boolean, string, number or null, but found ${ toString$1(typeOf(needle)) } instead.`); + } + if (!isValidNativeType(haystack, [ + 'string', + 'array' + ])) { + throw new RuntimeError$1(`Expected second argument to be of type array or string, but found ${ toString$1(typeOf(haystack)) } instead.`); + } + if (this.fromIndex) { + const fromIndex = this.fromIndex.evaluate(ctx); + return haystack.indexOf(needle, fromIndex); + } + return haystack.indexOf(needle); + } + eachChild(fn) { + fn(this.needle); + fn(this.haystack); + if (this.fromIndex) { + fn(this.fromIndex); + } + } + outputDefined() { + return false; + } + serialize() { + if (this.fromIndex != null && this.fromIndex !== undefined) { + const fromIndex = this.fromIndex.serialize(); + return [ + 'index-of', + this.needle.serialize(), + this.haystack.serialize(), + fromIndex + ]; + } + return [ + 'index-of', + this.needle.serialize(), + this.haystack.serialize() + ]; + } +} +var IndexOf$1 = IndexOf; + +// Map input label values to output expression index +class Match { + constructor(inputType, outputType, input, cases, outputs, otherwise) { + this.inputType = inputType; + this.type = outputType; + this.input = input; + this.cases = cases; + this.outputs = outputs; + this.otherwise = otherwise; + } + static parse(args, context) { + if (args.length < 5) + return context.error(`Expected at least 4 arguments, but found only ${ args.length - 1 }.`); + if (args.length % 2 !== 1) + return context.error(`Expected an even number of arguments.`); + let inputType; + let outputType; + if (context.expectedType && context.expectedType.kind !== 'value') { + outputType = context.expectedType; + } + const cases = {}; + const outputs = []; + for (let i = 2; i < args.length - 1; i += 2) { + let labels = args[i]; + const value = args[i + 1]; + if (!Array.isArray(labels)) { + labels = [labels]; + } + const labelContext = context.concat(i); + if (labels.length === 0) { + return labelContext.error('Expected at least one branch label.'); + } + for (const label of labels) { + if (typeof label !== 'number' && typeof label !== 'string') { + return labelContext.error(`Branch labels must be numbers or strings.`); + } else if (typeof label === 'number' && Math.abs(label) > Number.MAX_SAFE_INTEGER) { + return labelContext.error(`Branch labels must be integers no larger than ${ Number.MAX_SAFE_INTEGER }.`); + } else if (typeof label === 'number' && Math.floor(label) !== label) { + return labelContext.error(`Numeric branch labels must be integer values.`); + } else if (!inputType) { + inputType = typeOf(label); + } else if (labelContext.checkSubtype(inputType, typeOf(label))) { + return null; + } + if (typeof cases[String(label)] !== 'undefined') { + return labelContext.error('Branch labels must be unique.'); + } + cases[String(label)] = outputs.length; + } + const result = context.parse(value, i, outputType); + if (!result) + return null; + outputType = outputType || result.type; + outputs.push(result); + } + const input = context.parse(args[1], 1, ValueType); + if (!input) + return null; + const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType); + if (!otherwise) + return null; + if (input.type.kind !== 'value' && context.concat(1).checkSubtype(inputType, input.type)) { + return null; + } + return new Match(inputType, outputType, input, cases, outputs, otherwise); + } + evaluate(ctx) { + const input = this.input.evaluate(ctx); + const output = typeOf(input) === this.inputType && this.outputs[this.cases[input]] || this.otherwise; + return output.evaluate(ctx); + } + eachChild(fn) { + fn(this.input); + this.outputs.forEach(fn); + fn(this.otherwise); + } + outputDefined() { + return this.outputs.every(out => out.outputDefined()) && this.otherwise.outputDefined(); + } + serialize() { + const serialized = [ + 'match', + this.input.serialize() + ]; + // Sort so serialization has an arbitrary defined order, even though + // branch order doesn't affect evaluation + const sortedLabels = Object.keys(this.cases).sort(); + // Group branches by unique match expression to support condensed + // serializations of the form [case1, case2, ...] -> matchExpression + const groupedByOutput = []; + const outputLookup = {}; + // lookup index into groupedByOutput for a given output expression + for (const label of sortedLabels) { + const outputIndex = outputLookup[this.cases[label]]; + if (outputIndex === undefined) { + // First time seeing this output, add it to the end of the grouped list + outputLookup[this.cases[label]] = groupedByOutput.length; + groupedByOutput.push([ + this.cases[label], + [label] + ]); + } else { + // We've seen this expression before, add the label to that output's group + groupedByOutput[outputIndex][1].push(label); + } + } + const coerceLabel = label => this.inputType.kind === 'number' ? Number(label) : label; + for (const [outputIndex, labels] of groupedByOutput) { + if (labels.length === 1) { + // Only a single label matches this output expression + serialized.push(coerceLabel(labels[0])); + } else { + // Array of literal labels pointing to this output expression + serialized.push(labels.map(coerceLabel)); + } + serialized.push(this.outputs[outputIndex].serialize()); + } + serialized.push(this.otherwise.serialize()); + return serialized; + } +} +var Match$1 = Match; + +class Case { + constructor(type, branches, otherwise) { + this.type = type; + this.branches = branches; + this.otherwise = otherwise; + } + static parse(args, context) { + if (args.length < 4) + return context.error(`Expected at least 3 arguments, but found only ${ args.length - 1 }.`); + if (args.length % 2 !== 0) + return context.error(`Expected an odd number of arguments.`); + let outputType; + if (context.expectedType && context.expectedType.kind !== 'value') { + outputType = context.expectedType; + } + const branches = []; + for (let i = 1; i < args.length - 1; i += 2) { + const test = context.parse(args[i], i, BooleanType); + if (!test) + return null; + const result = context.parse(args[i + 1], i + 1, outputType); + if (!result) + return null; + branches.push([ + test, + result + ]); + outputType = outputType || result.type; + } + const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType); + if (!otherwise) + return null; + return new Case(outputType, branches, otherwise); + } + evaluate(ctx) { + for (const [test, expression] of this.branches) { + if (test.evaluate(ctx)) { + return expression.evaluate(ctx); + } + } + return this.otherwise.evaluate(ctx); + } + eachChild(fn) { + for (const [test, expression] of this.branches) { + fn(test); + fn(expression); + } + fn(this.otherwise); + } + outputDefined() { + return this.branches.every(([_, out]) => out.outputDefined()) && this.otherwise.outputDefined(); + } + serialize() { + const serialized = ['case']; + this.eachChild(child => { + serialized.push(child.serialize()); + }); + return serialized; + } +} +var Case$1 = Case; + +// +class Slice { + constructor(type, input, beginIndex, endIndex) { + this.type = type; + this.input = input; + this.beginIndex = beginIndex; + this.endIndex = endIndex; + } + static parse(args, context) { + if (args.length <= 2 || args.length >= 5) { + return context.error(`Expected 3 or 4 arguments, but found ${ args.length - 1 } instead.`); + } + const input = context.parse(args[1], 1, ValueType); + const beginIndex = context.parse(args[2], 2, NumberType); + if (!input || !beginIndex) + return null; + if (!isValidType(input.type, [ + array$1(ValueType), + StringType, + ValueType + ])) { + return context.error(`Expected first argument to be of type array or string, but found ${ toString$1(input.type) } instead`); + } + if (args.length === 4) { + const endIndex = context.parse(args[3], 3, NumberType); + if (!endIndex) + return null; + return new Slice(input.type, input, beginIndex, endIndex); + } else { + return new Slice(input.type, input, beginIndex); + } + } + evaluate(ctx) { + const input = this.input.evaluate(ctx); + const beginIndex = this.beginIndex.evaluate(ctx); + if (!isValidNativeType(input, [ + 'string', + 'array' + ])) { + throw new RuntimeError$1(`Expected first argument to be of type array or string, but found ${ toString$1(typeOf(input)) } instead.`); + } + if (this.endIndex) { + const endIndex = this.endIndex.evaluate(ctx); + return input.slice(beginIndex, endIndex); + } + return input.slice(beginIndex); + } + eachChild(fn) { + fn(this.input); + fn(this.beginIndex); + if (this.endIndex) { + fn(this.endIndex); + } + } + outputDefined() { + return false; + } + serialize() { + if (this.endIndex != null && this.endIndex !== undefined) { + const endIndex = this.endIndex.serialize(); + return [ + 'slice', + this.input.serialize(), + this.beginIndex.serialize(), + endIndex + ]; + } + return [ + 'slice', + this.input.serialize(), + this.beginIndex.serialize() + ]; + } +} +var Slice$1 = Slice; + +// +function isComparableType(op, type) { + if (op === '==' || op === '!=') { + // equality operator + return type.kind === 'boolean' || type.kind === 'string' || type.kind === 'number' || type.kind === 'null' || type.kind === 'value'; + } else { + // ordering operator + return type.kind === 'string' || type.kind === 'number' || type.kind === 'value'; + } +} +function eq(ctx, a, b) { + return a === b; +} +function neq(ctx, a, b) { + return a !== b; +} +function lt(ctx, a, b) { + return a < b; +} +function gt(ctx, a, b) { + return a > b; +} +function lteq(ctx, a, b) { + return a <= b; +} +function gteq(ctx, a, b) { + return a >= b; +} +function eqCollate(ctx, a, b, c) { + return c.compare(a, b) === 0; +} +function neqCollate(ctx, a, b, c) { + return !eqCollate(ctx, a, b, c); +} +function ltCollate(ctx, a, b, c) { + return c.compare(a, b) < 0; +} +function gtCollate(ctx, a, b, c) { + return c.compare(a, b) > 0; +} +function lteqCollate(ctx, a, b, c) { + return c.compare(a, b) <= 0; +} +function gteqCollate(ctx, a, b, c) { + return c.compare(a, b) >= 0; +} +/** + * Special form for comparison operators, implementing the signatures: + * - (T, T, ?Collator) => boolean + * - (T, value, ?Collator) => boolean + * - (value, T, ?Collator) => boolean + * + * For inequalities, T must be either value, string, or number. For ==/!=, it + * can also be boolean or null. + * + * Equality semantics are equivalent to Javascript's strict equality (===/!==) + * -- i.e., when the arguments' types don't match, == evaluates to false, != to + * true. + * + * When types don't match in an ordering comparison, a runtime error is thrown. + * + * @private + */ +function makeComparison(op, compareBasic, compareWithCollator) { + const isOrderComparison = op !== '==' && op !== '!='; + return class Comparison { + constructor(lhs, rhs, collator) { + this.type = BooleanType; + this.lhs = lhs; + this.rhs = rhs; + this.collator = collator; + this.hasUntypedArgument = lhs.type.kind === 'value' || rhs.type.kind === 'value'; + } + static parse(args, context) { + if (args.length !== 3 && args.length !== 4) + return context.error(`Expected two or three arguments.`); + const op = args[0]; + let lhs = context.parse(args[1], 1, ValueType); + if (!lhs) + return null; + if (!isComparableType(op, lhs.type)) { + return context.concat(1).error(`"${ op }" comparisons are not supported for type '${ toString$1(lhs.type) }'.`); + } + let rhs = context.parse(args[2], 2, ValueType); + if (!rhs) + return null; + if (!isComparableType(op, rhs.type)) { + return context.concat(2).error(`"${ op }" comparisons are not supported for type '${ toString$1(rhs.type) }'.`); + } + if (lhs.type.kind !== rhs.type.kind && lhs.type.kind !== 'value' && rhs.type.kind !== 'value') { + return context.error(`Cannot compare types '${ toString$1(lhs.type) }' and '${ toString$1(rhs.type) }'.`); + } + if (isOrderComparison) { + // typing rules specific to less/greater than operators + if (lhs.type.kind === 'value' && rhs.type.kind !== 'value') { + // (value, T) + lhs = new Assertion$1(rhs.type, [lhs]); + } else if (lhs.type.kind !== 'value' && rhs.type.kind === 'value') { + // (T, value) + rhs = new Assertion$1(lhs.type, [rhs]); + } + } + let collator = null; + if (args.length === 4) { + if (lhs.type.kind !== 'string' && rhs.type.kind !== 'string' && lhs.type.kind !== 'value' && rhs.type.kind !== 'value') { + return context.error(`Cannot use collator to compare non-string types.`); + } + collator = context.parse(args[3], 3, CollatorType); + if (!collator) + return null; + } + return new Comparison(lhs, rhs, collator); + } + evaluate(ctx) { + const lhs = this.lhs.evaluate(ctx); + const rhs = this.rhs.evaluate(ctx); + if (isOrderComparison && this.hasUntypedArgument) { + const lt = typeOf(lhs); + const rt = typeOf(rhs); + // check that type is string or number, and equal + if (lt.kind !== rt.kind || !(lt.kind === 'string' || lt.kind === 'number')) { + throw new RuntimeError$1(`Expected arguments for "${ op }" to be (string, string) or (number, number), but found (${ lt.kind }, ${ rt.kind }) instead.`); + } + } + if (this.collator && !isOrderComparison && this.hasUntypedArgument) { + const lt = typeOf(lhs); + const rt = typeOf(rhs); + if (lt.kind !== 'string' || rt.kind !== 'string') { + return compareBasic(ctx, lhs, rhs); + } + } + return this.collator ? compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx)) : compareBasic(ctx, lhs, rhs); + } + eachChild(fn) { + fn(this.lhs); + fn(this.rhs); + if (this.collator) { + fn(this.collator); + } + } + outputDefined() { + return true; + } + serialize() { + const serialized = [op]; + this.eachChild(child => { + serialized.push(child.serialize()); + }); + return serialized; + } + }; +} +const Equals = makeComparison('==', eq, eqCollate); +const NotEquals = makeComparison('!=', neq, neqCollate); +const LessThan = makeComparison('<', lt, ltCollate); +const GreaterThan = makeComparison('>', gt, gtCollate); +const LessThanOrEqual = makeComparison('<=', lteq, lteqCollate); +const GreaterThanOrEqual = makeComparison('>=', gteq, gteqCollate); + +// +class NumberFormat { + // BCP 47 language tag + // ISO 4217 currency code, required if style=currency + // Simple units sanctioned for use in ECMAScript, required if style=unit. https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier + // Default 0 + // Default 3 + constructor(number, locale, currency, unit, minFractionDigits, maxFractionDigits) { + this.type = StringType; + this.number = number; + this.locale = locale; + this.currency = currency; + this.unit = unit; + this.minFractionDigits = minFractionDigits; + this.maxFractionDigits = maxFractionDigits; + } + static parse(args, context) { + if (args.length !== 3) + return context.error(`Expected two arguments.`); + const number = context.parse(args[1], 1, NumberType); + if (!number) + return null; + const options = args[2]; + if (typeof options !== 'object' || Array.isArray(options)) + return context.error(`NumberFormat options argument must be an object.`); + let locale = null; + if (options['locale']) { + locale = context.parse(options['locale'], 1, StringType); + if (!locale) + return null; + } + let currency = null; + if (options['currency']) { + currency = context.parse(options['currency'], 1, StringType); + if (!currency) + return null; + } + let unit = null; + if (options['unit']) { + unit = context.parse(options['unit'], 1, StringType); + if (!unit) + return null; + } + let minFractionDigits = null; + if (options['min-fraction-digits']) { + minFractionDigits = context.parse(options['min-fraction-digits'], 1, NumberType); + if (!minFractionDigits) + return null; + } + let maxFractionDigits = null; + if (options['max-fraction-digits']) { + maxFractionDigits = context.parse(options['max-fraction-digits'], 1, NumberType); + if (!maxFractionDigits) + return null; + } + return new NumberFormat(number, locale, currency, unit, minFractionDigits, maxFractionDigits); + } + evaluate(ctx) { + return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], { + style: this.currency && 'currency' || this.unit && 'unit' || 'decimal', + currency: this.currency ? this.currency.evaluate(ctx) : undefined, + unit: this.unit ? this.unit.evaluate(ctx) : undefined, + minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : undefined, + maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : undefined + }).format(this.number.evaluate(ctx)); + } + eachChild(fn) { + fn(this.number); + if (this.locale) { + fn(this.locale); + } + if (this.currency) { + fn(this.currency); + } + if (this.unit) { + fn(this.unit); + } + if (this.minFractionDigits) { + fn(this.minFractionDigits); + } + if (this.maxFractionDigits) { + fn(this.maxFractionDigits); + } + } + outputDefined() { + return false; + } + serialize() { + const options = {}; + if (this.locale) { + options['locale'] = this.locale.serialize(); + } + if (this.currency) { + options['currency'] = this.currency.serialize(); + } + if (this.unit) { + options['unit'] = this.unit.serialize(); + } + if (this.minFractionDigits) { + options['min-fraction-digits'] = this.minFractionDigits.serialize(); + } + if (this.maxFractionDigits) { + options['max-fraction-digits'] = this.maxFractionDigits.serialize(); + } + return [ + 'number-format', + this.number.serialize(), + options + ]; + } +} + +// +class Length { + constructor(input) { + this.type = NumberType; + this.input = input; + } + static parse(args, context) { + if (args.length !== 2) + return context.error(`Expected 1 argument, but found ${ args.length - 1 } instead.`); + const input = context.parse(args[1], 1); + if (!input) + return null; + if (input.type.kind !== 'array' && input.type.kind !== 'string' && input.type.kind !== 'value') + return context.error(`Expected argument of type string or array, but found ${ toString$1(input.type) } instead.`); + return new Length(input); + } + evaluate(ctx) { + const input = this.input.evaluate(ctx); + if (typeof input === 'string') { + return input.length; + } else if (Array.isArray(input)) { + return input.length; + } else { + throw new RuntimeError$1(`Expected value to be of type string or array, but found ${ toString$1(typeOf(input)) } instead.`); + } + } + eachChild(fn) { + fn(this.input); + } + outputDefined() { + return false; + } + serialize() { + const serialized = ['length']; + this.eachChild(child => { + serialized.push(child.serialize()); + }); + return serialized; + } +} +var Length$1 = Length; + +// +const expressions = { + // special forms + '==': Equals, + '!=': NotEquals, + '>': GreaterThan, + '<': LessThan, + '>=': GreaterThanOrEqual, + '<=': LessThanOrEqual, + 'array': Assertion$1, + 'at': At$1, + 'boolean': Assertion$1, + 'case': Case$1, + 'coalesce': Coalesce$1, + 'collator': CollatorExpression, + 'format': FormatExpression, + 'image': ImageExpression, + 'in': In$1, + 'index-of': IndexOf$1, + 'interpolate': Interpolate$1, + 'interpolate-hcl': Interpolate$1, + 'interpolate-lab': Interpolate$1, + 'length': Length$1, + 'let': Let$1, + 'literal': Literal$1, + 'match': Match$1, + 'number': Assertion$1, + 'number-format': NumberFormat, + 'object': Assertion$1, + 'slice': Slice$1, + 'step': Step$1, + 'string': Assertion$1, + 'to-boolean': Coercion$1, + 'to-color': Coercion$1, + 'to-number': Coercion$1, + 'to-string': Coercion$1, + 'var': Var$1, + 'within': Within$1 +}; +function rgba(ctx, [r, g, b, a]) { + r = r.evaluate(ctx); + g = g.evaluate(ctx); + b = b.evaluate(ctx); + const alpha = a ? a.evaluate(ctx) : 1; + const error = validateRGBA(r, g, b, alpha); + if (error) + throw new RuntimeError$1(error); + return new Color$1(r / 255 * alpha, g / 255 * alpha, b / 255 * alpha, alpha); +} +function has(key, obj) { + return key in obj; +} +function get(key, obj) { + const v = obj[key]; + return typeof v === 'undefined' ? null : v; +} +function binarySearch(v, a, i, j) { + while (i <= j) { + const m = i + j >> 1; + if (a[m] === v) + return true; + if (a[m] > v) + j = m - 1; + else + i = m + 1; + } + return false; +} +function varargs(type) { + return { type }; +} +CompoundExpression$1.register(expressions, { + 'error': [ + ErrorType, + [StringType], + (ctx, [v]) => { + throw new RuntimeError$1(v.evaluate(ctx)); + } + ], + 'typeof': [ + StringType, + [ValueType], + (ctx, [v]) => toString$1(typeOf(v.evaluate(ctx))) + ], + 'to-rgba': [ + array$1(NumberType, 4), + [ColorType], + (ctx, [v]) => { + return v.evaluate(ctx).toArray(); + } + ], + 'rgb': [ + ColorType, + [ + NumberType, + NumberType, + NumberType + ], + rgba + ], + 'rgba': [ + ColorType, + [ + NumberType, + NumberType, + NumberType, + NumberType + ], + rgba + ], + 'has': { + type: BooleanType, + overloads: [ + [ + [StringType], + (ctx, [key]) => has(key.evaluate(ctx), ctx.properties()) + ], + [ + [ + StringType, + ObjectType + ], + (ctx, [key, obj]) => has(key.evaluate(ctx), obj.evaluate(ctx)) + ] + ] + }, + 'get': { + type: ValueType, + overloads: [ + [ + [StringType], + (ctx, [key]) => get(key.evaluate(ctx), ctx.properties()) + ], + [ + [ + StringType, + ObjectType + ], + (ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx)) + ] + ] + }, + 'feature-state': [ + ValueType, + [StringType], + (ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {}) + ], + 'properties': [ + ObjectType, + [], + ctx => ctx.properties() + ], + 'geometry-type': [ + StringType, + [], + ctx => ctx.geometryType() + ], + 'id': [ + ValueType, + [], + ctx => ctx.id() + ], + 'zoom': [ + NumberType, + [], + ctx => ctx.globals.zoom + ], + 'pitch': [ + NumberType, + [], + ctx => ctx.globals.pitch || 0 + ], + 'distance-from-center': [ + NumberType, + [], + ctx => ctx.distanceFromCenter() + ], + 'heatmap-density': [ + NumberType, + [], + ctx => ctx.globals.heatmapDensity || 0 + ], + 'line-progress': [ + NumberType, + [], + ctx => ctx.globals.lineProgress || 0 + ], + 'sky-radial-progress': [ + NumberType, + [], + ctx => ctx.globals.skyRadialProgress || 0 + ], + 'accumulated': [ + ValueType, + [], + ctx => ctx.globals.accumulated === undefined ? null : ctx.globals.accumulated + ], + '+': [ + NumberType, + varargs(NumberType), + (ctx, args) => { + let result = 0; + for (const arg of args) { + result += arg.evaluate(ctx); + } + return result; + } + ], + '*': [ + NumberType, + varargs(NumberType), + (ctx, args) => { + let result = 1; + for (const arg of args) { + result *= arg.evaluate(ctx); + } + return result; + } + ], + '-': { + type: NumberType, + overloads: [ + [ + [ + NumberType, + NumberType + ], + (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx) + ], + [ + [NumberType], + (ctx, [a]) => -a.evaluate(ctx) + ] + ] + }, + '/': [ + NumberType, + [ + NumberType, + NumberType + ], + (ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx) + ], + '%': [ + NumberType, + [ + NumberType, + NumberType + ], + (ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx) + ], + 'ln2': [ + NumberType, + [], + () => Math.LN2 + ], + 'pi': [ + NumberType, + [], + () => Math.PI + ], + 'e': [ + NumberType, + [], + () => Math.E + ], + '^': [ + NumberType, + [ + NumberType, + NumberType + ], + (ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx)) + ], + 'sqrt': [ + NumberType, + [NumberType], + (ctx, [x]) => Math.sqrt(x.evaluate(ctx)) + ], + 'log10': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10 + ], + 'ln': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.log(n.evaluate(ctx)) + ], + 'log2': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2 + ], + 'sin': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.sin(n.evaluate(ctx)) + ], + 'cos': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.cos(n.evaluate(ctx)) + ], + 'tan': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.tan(n.evaluate(ctx)) + ], + 'asin': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.asin(n.evaluate(ctx)) + ], + 'acos': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.acos(n.evaluate(ctx)) + ], + 'atan': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.atan(n.evaluate(ctx)) + ], + 'min': [ + NumberType, + varargs(NumberType), + (ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx))) + ], + 'max': [ + NumberType, + varargs(NumberType), + (ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx))) + ], + 'abs': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.abs(n.evaluate(ctx)) + ], + 'round': [ + NumberType, + [NumberType], + (ctx, [n]) => { + const v = n.evaluate(ctx); + // Javascript's Math.round() rounds towards +Infinity for halfway + // values, even when they're negative. It's more common to round + // away from 0 (e.g., this is what python and C++ do) + return v < 0 ? -Math.round(-v) : Math.round(v); + } + ], + 'floor': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.floor(n.evaluate(ctx)) + ], + 'ceil': [ + NumberType, + [NumberType], + (ctx, [n]) => Math.ceil(n.evaluate(ctx)) + ], + 'filter-==': [ + BooleanType, + [ + StringType, + ValueType + ], + (ctx, [k, v]) => ctx.properties()[k.value] === v.value + ], + 'filter-id-==': [ + BooleanType, + [ValueType], + (ctx, [v]) => ctx.id() === v.value + ], + 'filter-type-==': [ + BooleanType, + [StringType], + (ctx, [v]) => ctx.geometryType() === v.value + ], + 'filter-<': [ + BooleanType, + [ + StringType, + ValueType + ], + (ctx, [k, v]) => { + const a = ctx.properties()[k.value]; + const b = v.value; + return typeof a === typeof b && a < b; + } + ], + 'filter-id-<': [ + BooleanType, + [ValueType], + (ctx, [v]) => { + const a = ctx.id(); + const b = v.value; + return typeof a === typeof b && a < b; + } + ], + 'filter->': [ + BooleanType, + [ + StringType, + ValueType + ], + (ctx, [k, v]) => { + const a = ctx.properties()[k.value]; + const b = v.value; + return typeof a === typeof b && a > b; + } + ], + 'filter-id->': [ + BooleanType, + [ValueType], + (ctx, [v]) => { + const a = ctx.id(); + const b = v.value; + return typeof a === typeof b && a > b; + } + ], + 'filter-<=': [ + BooleanType, + [ + StringType, + ValueType + ], + (ctx, [k, v]) => { + const a = ctx.properties()[k.value]; + const b = v.value; + return typeof a === typeof b && a <= b; + } + ], + 'filter-id-<=': [ + BooleanType, + [ValueType], + (ctx, [v]) => { + const a = ctx.id(); + const b = v.value; + return typeof a === typeof b && a <= b; + } + ], + 'filter->=': [ + BooleanType, + [ + StringType, + ValueType + ], + (ctx, [k, v]) => { + const a = ctx.properties()[k.value]; + const b = v.value; + return typeof a === typeof b && a >= b; + } + ], + 'filter-id->=': [ + BooleanType, + [ValueType], + (ctx, [v]) => { + const a = ctx.id(); + const b = v.value; + return typeof a === typeof b && a >= b; + } + ], + 'filter-has': [ + BooleanType, + [ValueType], + (ctx, [k]) => k.value in ctx.properties() + ], + 'filter-has-id': [ + BooleanType, + [], + ctx => ctx.id() !== null && ctx.id() !== undefined + ], + 'filter-type-in': [ + BooleanType, + [array$1(StringType)], + (ctx, [v]) => v.value.indexOf(ctx.geometryType()) >= 0 + ], + 'filter-id-in': [ + BooleanType, + [array$1(ValueType)], + (ctx, [v]) => v.value.indexOf(ctx.id()) >= 0 + ], + 'filter-in-small': [ + BooleanType, + [ + StringType, + array$1(ValueType) + ], + // assumes v is an array literal + (ctx, [k, v]) => v.value.indexOf(ctx.properties()[k.value]) >= 0 + ], + 'filter-in-large': [ + BooleanType, + [ + StringType, + array$1(ValueType) + ], + // assumes v is a array literal with values sorted in ascending order and of a single type + (ctx, [k, v]) => binarySearch(ctx.properties()[k.value], v.value, 0, v.value.length - 1) + ], + 'all': { + type: BooleanType, + overloads: [ + [ + [ + BooleanType, + BooleanType + ], + (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx) + ], + [ + varargs(BooleanType), + (ctx, args) => { + for (const arg of args) { + if (!arg.evaluate(ctx)) + return false; + } + return true; + } + ] + ] + }, + 'any': { + type: BooleanType, + overloads: [ + [ + [ + BooleanType, + BooleanType + ], + (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx) + ], + [ + varargs(BooleanType), + (ctx, args) => { + for (const arg of args) { + if (arg.evaluate(ctx)) + return true; + } + return false; + } + ] + ] + }, + '!': [ + BooleanType, + [BooleanType], + (ctx, [b]) => !b.evaluate(ctx) + ], + 'is-supported-script': [ + BooleanType, + [StringType], + // At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant + (ctx, [s]) => { + const isSupportedScript = ctx.globals && ctx.globals.isSupportedScript; + if (isSupportedScript) { + return isSupportedScript(s.evaluate(ctx)); + } + return true; + } + ], + 'upcase': [ + StringType, + [StringType], + (ctx, [s]) => s.evaluate(ctx).toUpperCase() + ], + 'downcase': [ + StringType, + [StringType], + (ctx, [s]) => s.evaluate(ctx).toLowerCase() + ], + 'concat': [ + StringType, + varargs(ValueType), + (ctx, args) => args.map(arg => toString(arg.evaluate(ctx))).join('') + ], + 'resolved-locale': [ + StringType, + [CollatorType], + (ctx, [collator]) => collator.evaluate(ctx).resolvedLocale() + ] +}); +var definitions = expressions; + +// +/** + * A type used for returning and propagating errors. The first element of the union + * represents success and contains a value, and the second represents an error and + * contains an error value. + * @private + */ +function success(value) { + return { + result: 'success', + value + }; +} +function error(value) { + return { + result: 'error', + value + }; +} + +// +function supportsPropertyExpression(spec) { + return spec['property-type'] === 'data-driven'; +} +function supportsZoomExpression(spec) { + return !!spec.expression && spec.expression.parameters.indexOf('zoom') > -1; +} +function supportsInterpolation(spec) { + return !!spec.expression && spec.expression.interpolated; +} + +function isFunction(value) { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} + +class StyleExpression { + constructor(expression, propertySpec) { + this.expression = expression; + this._warningHistory = {}; + this._evaluator = new EvaluationContext$1(); + this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null; + this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null; + } + evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) { + this._evaluator.globals = globals; + this._evaluator.feature = feature; + this._evaluator.featureState = featureState; + this._evaluator.canonical = canonical || null; + this._evaluator.availableImages = availableImages || null; + this._evaluator.formattedSection = formattedSection; + this._evaluator.featureTileCoord = featureTileCoord || null; + this._evaluator.featureDistanceData = featureDistanceData || null; + return this.expression.evaluate(this._evaluator); + } + evaluate(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) { + this._evaluator.globals = globals; + this._evaluator.feature = feature || null; + this._evaluator.featureState = featureState || null; + this._evaluator.canonical = canonical || null; + this._evaluator.availableImages = availableImages || null; + this._evaluator.formattedSection = formattedSection || null; + this._evaluator.featureTileCoord = featureTileCoord || null; + this._evaluator.featureDistanceData = featureDistanceData || null; + try { + const val = this.expression.evaluate(this._evaluator); + // eslint-disable-next-line no-self-compare + if (val === null || val === undefined || typeof val === 'number' && val !== val) { + return this._defaultValue; + } + if (this._enumValues && !(val in this._enumValues)) { + throw new RuntimeError$1(`Expected value to be one of ${ Object.keys(this._enumValues).map(v => JSON.stringify(v)).join(', ') }, but found ${ JSON.stringify(val) } instead.`); + } + return val; + } catch (e) { + if (!this._warningHistory[e.message]) { + this._warningHistory[e.message] = true; + if (typeof console !== 'undefined') { + console.warn(e.message); + } + } + return this._defaultValue; + } + } +} +function isExpression(expression) { + return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === 'string' && expression[0] in definitions; +} +/** + * Parse and typecheck the given style spec JSON expression. If + * options.defaultValue is provided, then the resulting StyleExpression's + * `evaluate()` method will handle errors by logging a warning (once per + * message) and returning the default value. Otherwise, it will throw + * evaluation errors. + * + * @private + */ +function createExpression(expression, propertySpec) { + const parser = new ParsingContext$1(definitions, [], propertySpec ? getExpectedType(propertySpec) : undefined); + // For string-valued properties, coerce to string at the top level rather than asserting. + const parsed = parser.parse(expression, undefined, undefined, undefined, propertySpec && propertySpec.type === 'string' ? { typeAnnotation: 'coerce' } : undefined); + if (!parsed) { + return error(parser.errors); + } + return success(new StyleExpression(parsed, propertySpec)); +} +class ZoomConstantExpression { + constructor(kind, expression) { + this.kind = kind; + this._styleExpression = expression; + this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression); + } + evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) { + return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection); + } + evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) { + return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection); + } +} +class ZoomDependentExpression { + constructor(kind, expression, zoomStops, interpolationType) { + this.kind = kind; + this.zoomStops = zoomStops; + this._styleExpression = expression; + this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression); + this.interpolationType = interpolationType; + } + evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) { + return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection); + } + evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) { + return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection); + } + interpolationFactor(input, lower, upper) { + if (this.interpolationType) { + return Interpolate$1.interpolationFactor(this.interpolationType, input, lower, upper); + } else { + return 0; + } + } +} +function createPropertyExpression(expression, propertySpec) { + expression = createExpression(expression, propertySpec); + if (expression.result === 'error') { + return expression; + } + const parsed = expression.value.expression; + const isFeatureConstant$1 = isFeatureConstant(parsed); + if (!isFeatureConstant$1 && !supportsPropertyExpression(propertySpec)) { + return error([new ParsingError$1('', 'data expressions not supported')]); + } + const isZoomConstant = isGlobalPropertyConstant(parsed, [ + 'zoom', + 'pitch', + 'distance-from-center' + ]); + if (!isZoomConstant && !supportsZoomExpression(propertySpec)) { + return error([new ParsingError$1('', 'zoom expressions not supported')]); + } + const zoomCurve = findZoomCurve(parsed); + if (!zoomCurve && !isZoomConstant) { + return error([new ParsingError$1('', '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]); + } else if (zoomCurve instanceof ParsingError$1) { + return error([zoomCurve]); + } else if (zoomCurve instanceof Interpolate$1 && !supportsInterpolation(propertySpec)) { + return error([new ParsingError$1('', '"interpolate" expressions cannot be used with this property')]); + } + if (!zoomCurve) { + return success(isFeatureConstant$1 ? new ZoomConstantExpression('constant', expression.value) : new ZoomConstantExpression('source', expression.value)); + } + const interpolationType = zoomCurve instanceof Interpolate$1 ? zoomCurve.interpolation : undefined; + return success(isFeatureConstant$1 ? new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType) : new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType)); +} +// Zoom-dependent expressions may only use ["zoom"] as the input to a top-level "step" or "interpolate" +// expression (collectively referred to as a "curve"). The curve may be wrapped in one or more "let" or +// "coalesce" expressions. +function findZoomCurve(expression) { + let result = null; + if (expression instanceof Let$1) { + result = findZoomCurve(expression.result); + } else if (expression instanceof Coalesce$1) { + for (const arg of expression.args) { + result = findZoomCurve(arg); + if (result) { + break; + } + } + } else if ((expression instanceof Step$1 || expression instanceof Interpolate$1) && expression.input instanceof CompoundExpression$1 && expression.input.name === 'zoom') { + result = expression; + } + if (result instanceof ParsingError$1) { + return result; + } + expression.eachChild(child => { + const childResult = findZoomCurve(child); + if (childResult instanceof ParsingError$1) { + result = childResult; + } else if (!result && childResult) { + result = new ParsingError$1('', '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'); + } else if (result && childResult && result !== childResult) { + result = new ParsingError$1('', 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'); + } + }); + return result; +} +function getExpectedType(spec) { + const types = { + color: ColorType, + string: StringType, + number: NumberType, + enum: StringType, + boolean: BooleanType, + formatted: FormattedType, + resolvedImage: ResolvedImageType + }; + if (spec.type === 'array') { + return array$1(types[spec.value] || ValueType, spec.length); + } + return types[spec.type]; +} +function getDefaultValue(spec) { + if (spec.type === 'color' && (isFunction(spec.default) || Array.isArray(spec.default))) { + // Special case for heatmap-color: it uses the 'default:' to define a + // default color ramp, but createExpression expects a simple value to fall + // back to in case of runtime errors + return new Color$1(0, 0, 0, 0); + } else if (spec.type === 'color') { + return Color$1.parse(spec.default) || null; + } else if (spec.default === undefined) { + return null; + } else { + return spec.default; + } +} + +// +// Turn jsonlint-lines-primitives objects into primitive objects +function unbundle(value) { + if (value instanceof Number || value instanceof String || value instanceof Boolean) { + return value.valueOf(); + } else { + return value; + } +} +function deepUnbundle(value) { + if (Array.isArray(value)) { + return value.map(deepUnbundle); + } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) { + const unbundledValue = {}; + for (const key in value) { + unbundledValue[key] = deepUnbundle(value[key]); + } + return unbundledValue; + } + return unbundle(value); +} + +var spec = {"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"expression_name":{"type":"enum","values":{"let":{"group":"Variable binding"},"var":{"group":"Variable binding"},"literal":{"group":"Types"},"array":{"group":"Types"},"at":{"group":"Lookup"},"in":{"group":"Lookup"},"index-of":{"group":"Lookup"},"slice":{"group":"Lookup"},"case":{"group":"Decision"},"match":{"group":"Decision"},"coalesce":{"group":"Decision"},"step":{"group":"Ramps, scales, curves"},"interpolate":{"group":"Ramps, scales, curves"},"interpolate-hcl":{"group":"Ramps, scales, curves"},"interpolate-lab":{"group":"Ramps, scales, curves"},"ln2":{"group":"Math"},"pi":{"group":"Math"},"e":{"group":"Math"},"typeof":{"group":"Types"},"string":{"group":"Types"},"number":{"group":"Types"},"boolean":{"group":"Types"},"object":{"group":"Types"},"collator":{"group":"Types"},"format":{"group":"Types"},"image":{"group":"Types"},"number-format":{"group":"Types"},"to-string":{"group":"Types"},"to-number":{"group":"Types"},"to-boolean":{"group":"Types"},"to-rgba":{"group":"Color"},"to-color":{"group":"Types"},"rgb":{"group":"Color"},"rgba":{"group":"Color"},"get":{"group":"Lookup"},"has":{"group":"Lookup"},"length":{"group":"Lookup"},"properties":{"group":"Feature data"},"feature-state":{"group":"Feature data"},"geometry-type":{"group":"Feature data"},"id":{"group":"Feature data"},"zoom":{"group":"Camera"},"pitch":{"group":"Camera"},"distance-from-center":{"group":"Camera"},"heatmap-density":{"group":"Heatmap"},"line-progress":{"group":"Feature data"},"sky-radial-progress":{"group":"sky"},"accumulated":{"group":"Feature data"},"+":{"group":"Math"},"*":{"group":"Math"},"-":{"group":"Math"},"/":{"group":"Math"},"%":{"group":"Math"},"^":{"group":"Math"},"sqrt":{"group":"Math"},"log10":{"group":"Math"},"ln":{"group":"Math"},"log2":{"group":"Math"},"sin":{"group":"Math"},"cos":{"group":"Math"},"tan":{"group":"Math"},"asin":{"group":"Math"},"acos":{"group":"Math"},"atan":{"group":"Math"},"min":{"group":"Math"},"max":{"group":"Math"},"round":{"group":"Math"},"abs":{"group":"Math"},"ceil":{"group":"Math"},"floor":{"group":"Math"},"distance":{"group":"Math"},"==":{"group":"Decision"},"!=":{"group":"Decision"},">":{"group":"Decision"},"<":{"group":"Decision"},">=":{"group":"Decision"},"<=":{"group":"Decision"},"all":{"group":"Decision"},"any":{"group":"Decision"},"!":{"group":"Decision"},"within":{"group":"Decision"},"is-supported-script":{"group":"String"},"upcase":{"group":"String"},"downcase":{"group":"String"},"concat":{"group":"String"},"resolved-locale":{"group":"String"}}},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}; + +// +function isExpressionFilter(filter) { + if (filter === true || filter === false) { + return true; + } + if (!Array.isArray(filter) || filter.length === 0) { + return false; + } + switch (filter[0]) { + case 'has': + return filter.length >= 2 && filter[1] !== '$id' && filter[1] !== '$type'; + case 'in': + return filter.length >= 3 && (typeof filter[1] !== 'string' || Array.isArray(filter[2])); + case '!in': + case '!has': + case 'none': + return false; + case '==': + case '!=': + case '>': + case '>=': + case '<': + case '<=': + return filter.length !== 3 || (Array.isArray(filter[1]) || Array.isArray(filter[2])); + case 'any': + case 'all': + for (const f of filter.slice(1)) { + if (!isExpressionFilter(f) && typeof f !== 'boolean') { + return false; + } + } + return true; + default: + return true; + } +} +/** + * Given a filter expressed as nested arrays, return a new function + * that evaluates whether a given feature (with a .properties or .tags property) + * passes its test. + * + * @private + * @param {Array} filter mapbox gl filter + * @param {string} layerType the type of the layer this filter will be applied to. + * @returns {Function} filter-evaluating function + */ +function createFilter(filter, layerType = 'fill') { + if (filter === null || filter === undefined) { + return { + filter: () => true, + needGeometry: false, + needFeature: false + }; + } + if (!isExpressionFilter(filter)) { + filter = convertFilter(filter); + } + const filterExp = filter; + let staticFilter = true; + try { + staticFilter = extractStaticFilter(filterExp); + } catch (e) { + console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md +and paste the contents of this message in the report. +Thank you! +Filter Expression: +${ JSON.stringify(filterExp, null, 2) } + `); + } + // Compile the static component of the filter + const filterSpec = spec[`filter_${ layerType }`]; + const compiledStaticFilter = createExpression(staticFilter, filterSpec); + let filterFunc = null; + if (compiledStaticFilter.result === 'error') { + throw new Error(compiledStaticFilter.value.map(err => `${ err.key }: ${ err.message }`).join(', ')); + } else { + filterFunc = (globalProperties, feature, canonical) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical); + } + // If the static component is not equal to the entire filter then we have a dynamic component + // Compile the dynamic component separately + let dynamicFilterFunc = null; + let needFeature = null; + if (staticFilter !== filterExp) { + const compiledDynamicFilter = createExpression(filterExp, filterSpec); + if (compiledDynamicFilter.result === 'error') { + throw new Error(compiledDynamicFilter.value.map(err => `${ err.key }: ${ err.message }`).join(', ')); + } else { + dynamicFilterFunc = (globalProperties, feature, canonical, featureTileCoord, featureDistanceData) => compiledDynamicFilter.value.evaluate(globalProperties, feature, {}, canonical, undefined, undefined, featureTileCoord, featureDistanceData); + needFeature = !isFeatureConstant(compiledDynamicFilter.value.expression); + } + } + filterFunc = filterFunc; + const needGeometry = geometryNeeded(staticFilter); + return { + filter: filterFunc, + dynamicFilter: dynamicFilterFunc ? dynamicFilterFunc : undefined, + needGeometry, + needFeature: !!needFeature + }; +} +function extractStaticFilter(filter) { + if (!isDynamicFilter(filter)) { + return filter; + } + // Shallow copy so we can replace expressions in-place + let result = deepUnbundle(filter); + // 1. Union branches + unionDynamicBranches(result); + // 2. Collapse dynamic conditions to `true` + result = collapseDynamicBooleanExpressions(result); + return result; +} +function collapseDynamicBooleanExpressions(expression) { + if (!Array.isArray(expression)) { + return expression; + } + const collapsed = collapsedExpression(expression); + if (collapsed === true) { + return collapsed; + } else { + return collapsed.map(subExpression => collapseDynamicBooleanExpressions(subExpression)); + } +} +/** + * Traverses the expression and replaces all instances of branching on a + * `dynamic` conditional (such as `['pitch']` or `['distance-from-center']`) + * into an `any` expression. + * This ensures that all possible outcomes of a `dynamic` branch are considered + * when evaluating the expression upfront during filtering. + * + * @param {Array} filter the filter expression mutated in-place. + */ +function unionDynamicBranches(filter) { + let isBranchingDynamically = false; + const branches = []; + if (filter[0] === 'case') { + for (let i = 1; i < filter.length - 1; i += 2) { + isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[i]); + branches.push(filter[i + 1]); + } + branches.push(filter[filter.length - 1]); + } else if (filter[0] === 'match') { + isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[1]); + for (let i = 2; i < filter.length - 1; i += 2) { + branches.push(filter[i + 1]); + } + branches.push(filter[filter.length - 1]); + } else if (filter[0] === 'step') { + isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[1]); + for (let i = 1; i < filter.length - 1; i += 2) { + branches.push(filter[i + 1]); + } + } + if (isBranchingDynamically) { + filter.length = 0; + filter.push('any', ...branches); + } + // traverse and recurse into children + for (let i = 1; i < filter.length; i++) { + unionDynamicBranches(filter[i]); + } +} +function isDynamicFilter(filter) { + // Base Cases + if (!Array.isArray(filter)) { + return false; + } + if (isRootExpressionDynamic(filter[0])) { + return true; + } + for (let i = 1; i < filter.length; i++) { + const child = filter[i]; + if (isDynamicFilter(child)) { + return true; + } + } + return false; +} +function isRootExpressionDynamic(expression) { + return expression === 'pitch' || expression === 'distance-from-center'; +} +const dynamicConditionExpressions = new Set([ + 'in', + '==', + '!=', + '>', + '>=', + '<', + '<=', + 'to-boolean' +]); +function collapsedExpression(expression) { + if (dynamicConditionExpressions.has(expression[0])) { + for (let i = 1; i < expression.length; i++) { + const param = expression[i]; + if (isDynamicFilter(param)) { + return true; + } + } + } + return expression; +} +// Comparison function to sort numbers and strings +function compare(a, b) { + return a < b ? -1 : a > b ? 1 : 0; +} +function geometryNeeded(filter) { + if (!Array.isArray(filter)) + return false; + if (filter[0] === 'within') + return true; + for (let index = 1; index < filter.length; index++) { + if (geometryNeeded(filter[index])) + return true; + } + return false; +} +function convertFilter(filter) { + if (!filter) + return true; + const op = filter[0]; + if (filter.length <= 1) + return op !== 'any'; + const converted = op === '==' ? convertComparisonOp(filter[1], filter[2], '==') : op === '!=' ? convertNegation(convertComparisonOp(filter[1], filter[2], '==')) : op === '<' || op === '>' || op === '<=' || op === '>=' ? convertComparisonOp(filter[1], filter[2], op) : op === 'any' ? convertDisjunctionOp(filter.slice(1)) : op === 'all' ? ['all'].concat(filter.slice(1).map(convertFilter)) : op === 'none' ? ['all'].concat(filter.slice(1).map(convertFilter).map(convertNegation)) : op === 'in' ? convertInOp(filter[1], filter.slice(2)) : op === '!in' ? convertNegation(convertInOp(filter[1], filter.slice(2))) : op === 'has' ? convertHasOp(filter[1]) : op === '!has' ? convertNegation(convertHasOp(filter[1])) : op === 'within' ? filter : true; + return converted; +} +function convertComparisonOp(property, value, op) { + switch (property) { + case '$type': + return [ + `filter-type-${ op }`, + value + ]; + case '$id': + return [ + `filter-id-${ op }`, + value + ]; + default: + return [ + `filter-${ op }`, + property, + value + ]; + } +} +function convertDisjunctionOp(filters) { + return ['any'].concat(filters.map(convertFilter)); +} +function convertInOp(property, values) { + if (values.length === 0) { + return false; + } + switch (property) { + case '$type': + return [ + `filter-type-in`, + [ + 'literal', + values + ] + ]; + case '$id': + return [ + `filter-id-in`, + [ + 'literal', + values + ] + ]; + default: + if (values.length > 200 && !values.some(v => typeof v !== typeof values[0])) { + return [ + 'filter-in-large', + property, + [ + 'literal', + values.sort(compare) + ] + ]; + } else { + return [ + 'filter-in-small', + property, + [ + 'literal', + values + ] + ]; + } + } +} +function convertHasOp(property) { + switch (property) { + case '$type': + return true; + case '$id': + return [`filter-has-id`]; + default: + return [ + `filter-has`, + property + ]; + } +} +function convertNegation(filter) { + return [ + '!', + filter + ]; +} + +// +var refProperties = [ + 'type', + 'source', + 'source-layer', + 'minzoom', + 'maxzoom', + 'filter', + 'layout' +]; + +// +function deref(layer, parent) { + const result = {}; + for (const k in layer) { + if (k !== 'ref') { + result[k] = layer[k]; + } + } + refProperties.forEach(k => { + if (k in parent) { + result[k] = parent[k]; + } + }); + return result; +} +/** + * Given an array of layers, some of which may contain `ref` properties + * whose value is the `id` of another property, return a new array where + * such layers have been augmented with the 'type', 'source', etc. properties + * from the parent layer, and the `ref` property has been removed. + * + * The input is not modified. The output may contain references to portions + * of the input. + * + * @private + * @param {Array} layers + * @returns {Array} + */ +function derefLayers(layers) { + layers = layers.slice(); + const map = Object.create(null); + for (let i = 0; i < layers.length; i++) { + map[layers[i].id] = layers[i]; + } + for (let i = 0; i < layers.length; i++) { + if ('ref' in layers[i]) { + layers[i] = deref(layers[i], map[layers[i].ref]); + } + } + return layers; +} + +var fontWeights = { + thin: 100, + hairline: 100, + 'ultra-light': 200, + 'extra-light': 200, + light: 300, + book: 300, + regular: 400, + normal: 400, + plain: 400, + roman: 400, + standard: 400, + medium: 500, + 'semi-bold': 600, + 'demi-bold': 600, + bold: 700, + 'extra-bold': 800, + 'ultra-bold': 800, + heavy: 900, + black: 900, + 'heavy-black': 900, + fat: 900, + poster: 900, + 'ultra-black': 950, + 'extra-black': 950 +}; +var sp = ' '; +var italicRE = /(italic|oblique)$/i; +var fontCache = {}; +var mapboxToCssFont = function (fonts, size, lineHeight) { + var cssData = fontCache[fonts]; + if (!cssData) { + if (!Array.isArray(fonts)) { + fonts = [fonts]; + } + var weight = 400; + var style = 'normal'; + var fontFamilies = []; + var haveWeight, haveStyle; + for (var i = 0, ii = fonts.length; i < ii; ++i) { + var font = fonts[i]; + var parts = font.split(' '); + var maybeWeight = parts[parts.length - 1].toLowerCase(); + if (maybeWeight == 'normal' || maybeWeight == 'italic' || maybeWeight == 'oblique') { + style = haveStyle ? style : maybeWeight; + haveStyle = true; + parts.pop(); + maybeWeight = parts[parts.length - 1].toLowerCase(); + } else if (italicRE.test(maybeWeight)) { + maybeWeight = maybeWeight.replace(italicRE, ''); + style = haveStyle ? style : parts[parts.length - 1].replace(maybeWeight, ''); + haveStyle = true; + } + for (var w in fontWeights) { + var previousPart = parts.length > 1 ? parts[parts.length - 2].toLowerCase() : ''; + if (maybeWeight == w || maybeWeight == w.replace('-', '') || previousPart + '-' + maybeWeight == w) { + weight = haveWeight ? weight : fontWeights[w]; + parts.pop(); + if (previousPart && w.startsWith(previousPart)) { + parts.pop(); + } + break; + } + } + if (!haveWeight && typeof maybeWeight == 'number') { + weight = maybeWeight; + haveWeight = true; + } + var fontFamily = parts.join(sp).replace('Klokantech Noto Sans', 'Noto Sans'); + if (fontFamily.indexOf(sp) !== -1) { + fontFamily = '"' + fontFamily + '"'; + } + fontFamilies.push(fontFamily); + } + // CSS font property: font-style font-weight font-size/line-height font-family + cssData = fontCache[fonts] = [ + style, + weight, + fontFamilies + ]; + } + return cssData[0] + sp + cssData[1] + sp + size + 'px' + (lineHeight ? '/' + lineHeight : '') + sp + cssData[2]; +}; + +var mb2css = /*@__PURE__*/getDefaultExportFromCjs(mapboxToCssFont); + +const mapboxBaseUrl = 'https://api.mapbox.com'; +/** + * Gets the path from a mapbox:// URL. + * @param {string} url The Mapbox URL. + * @return {string} The path. + * @private + */ +function getMapboxPath(url) { + const startsWith = 'mapbox://'; + if (url.indexOf(startsWith) !== 0) { + return ''; + } + return url.slice(startsWith.length); +} +/** + * Turns mapbox:// sprite URLs into resolvable URLs. + * @param {string} url The sprite URL. + * @param {string} token The access token. + * @param {string} styleUrl The style URL. + * @return {string} A resolvable URL. + * @private + */ +function normalizeSpriteUrl(url, token, styleUrl) { + const mapboxPath = getMapboxPath(url); + if (!mapboxPath) { + return decodeURI(new URL(url, styleUrl).href); + } + const startsWith = 'sprites/'; + if (mapboxPath.indexOf(startsWith) !== 0) { + throw new Error(`unexpected sprites url: ${ url }`); + } + const sprite = mapboxPath.slice(startsWith.length); + return `${ mapboxBaseUrl }/styles/v1/${ sprite }/sprite?access_token=${ token }`; +} +/** + * Turns mapbox:// style URLs into resolvable URLs. + * @param {string} url The style URL. + * @param {string} token The access token. + * @return {string} A resolvable URL. + * @private + */ +function normalizeStyleUrl(url, token) { + const mapboxPath = getMapboxPath(url); + if (!mapboxPath) { + return decodeURI(new URL(url, location.href).href); + } + const startsWith = 'styles/'; + if (mapboxPath.indexOf(startsWith) !== 0) { + throw new Error(`unexpected style url: ${ url }`); + } + const style = mapboxPath.slice(startsWith.length); + return `${ mapboxBaseUrl }/styles/v1/${ style }?&access_token=${ token }`; +} +/** + * Turns mapbox:// source URLs into vector tile URL templates. + * @param {string} url The source URL. + * @param {string} token The access token. + * @param {string} tokenParam The access token key. + * @param {string} styleUrl The style URL. + * @return {string} A vector tile template. + * @private + */ +function normalizeSourceUrl(url, token, tokenParam, styleUrl) { + const urlObject = new URL(url, styleUrl); + const mapboxPath = getMapboxPath(url); + if (!mapboxPath) { + if (!token) { + return decodeURI(urlObject.href); + } + if (!urlObject.searchParams.has(tokenParam)) { + urlObject.searchParams.set(tokenParam, token); + } + return decodeURI(urlObject.href); + } + if (mapboxPath === 'mapbox.satellite') { + const sizeFactor = window.devicePixelRatio >= 1.5 ? '@2x' : ''; + return `https://api.mapbox.com/v4/${ mapboxPath }/{z}/{x}/{y}${ sizeFactor }.webp?access_token=${ token }`; + } + return `https://{a-d}.tiles.mapbox.com/v4/${ mapboxPath }/{z}/{x}/{y}.vector.pbf?access_token=${ token }`; +} + +/** @typedef {'Style'|'Source'|'Sprite'|'SpriteImage'|'Tiles'|'GeoJSON'} ResourceType */ +/** @typedef {import("ol").Map} Map */ +/** @typedef {import("ol/layer").Layer} Layer */ +/** @typedef {import("ol/layer").Group} LayerGroup */ +/** @typedef {import("ol/layer").Vector} VectorLayer */ +/** @typedef {import("ol/layer").VectorTile} VectorTileLayer */ +/** @typedef {import("ol/source").Source} Source */ +const functionCacheByStyleId = {}; +const filterCacheByStyleId = {}; +let styleId = 0; +function getStyleId(glStyle) { + if (!glStyle.id) { + glStyle.id = styleId++; + } + return glStyle.id; +} +function getStyleFunctionKey(glStyle, olLayer) { + return getStyleId(glStyle) + '.' + getUid(olLayer); +} +/** + * @param {Object} glStyle Mapboox style object. + * @return {Object} Function cache. + */ +function getFunctionCache(glStyle) { + let functionCache = functionCacheByStyleId[glStyle.id]; + if (!functionCache) { + functionCache = {}; + functionCacheByStyleId[getStyleId(glStyle)] = functionCache; + } + return functionCache; +} +function clearFunctionCache() { + for (const key in functionCacheByStyleId) { + delete functionCacheByStyleId[key]; + } +} +/** + * @param {Object} glStyle Mapboox style object. + * @return {Object} Filter cache. + */ +function getFilterCache(glStyle) { + let filterCache = filterCacheByStyleId[glStyle.id]; + if (!filterCache) { + filterCache = {}; + filterCacheByStyleId[getStyleId(glStyle)] = filterCache; + } + return filterCache; +} +function deg2rad(degrees) { + return degrees * Math.PI / 180; +} +const defaultResolutions = (function () { + const resolutions = []; + for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) { + resolutions.push(res); + } + return resolutions; +}()); +/** + * @param {number} width Width of the canvas. + * @param {number} height Height of the canvas. + * @return {HTMLCanvasElement} Canvas. + */ +function createCanvas(width, height) { + if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && typeof OffscreenCanvas !== 'undefined') { + // eslint-disable-line + return new OffscreenCanvas(width, height); + } + const canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + return canvas; +} +function getZoomForResolution(resolution, resolutions) { + let i = 0; + const ii = resolutions.length; + for (; i < ii; ++i) { + const candidate = resolutions[i]; + if (candidate < resolution && i + 1 < ii) { + const zoomFactor = resolutions[i] / resolutions[i + 1]; + return i + Math.log(resolutions[i] / resolution) / Math.log(zoomFactor); + } + } + return ii - 1; +} +function getResolutionForZoom(zoom, resolutions) { + const base = Math.floor(zoom); + const factor = Math.pow(2, zoom - base); + return resolutions[base] / factor; +} +const pendingRequests = {}; +/** + * @param {ResourceType} resourceType Type of resource to load. + * @param {string} url Url of the resource. + * @param {Options} [options={}] Options. + * @param {{request?: Request}} [metadata] Object to be filled with the request. + * @return {Promise} Promise that resolves with the loaded resource + * or rejects with the Response object. + * @private + */ +function fetchResource(resourceType, url, options = {}, metadata) { + if (url in pendingRequests) { + if (metadata) { + metadata.request = pendingRequests[url][0]; + } + return pendingRequests[url][1]; + } + const transformedRequest = options.transformRequest ? options.transformRequest(url, resourceType) || url : url; + const pendingRequest = toPromise(() => transformedRequest).then(transformedRequest => { + if (!(transformedRequest instanceof Request)) { + transformedRequest = new Request(transformedRequest); + } + if (!transformedRequest.headers.get('Accept')) { + transformedRequest.headers.set('Accept', 'application/json'); + } + if (metadata) { + metadata.request = transformedRequest; + } + return fetch(transformedRequest).then(function (response) { + delete pendingRequests[url]; + return response.ok ? response.json() : Promise.reject(new Error('Error fetching source ' + url)); + }).catch(function (error) { + delete pendingRequests[url]; + return Promise.reject(new Error('Error fetching source ' + url)); + }); + }); + pendingRequests[url] = [ + transformedRequest, + pendingRequest + ]; + return pendingRequest; +} +function getGlStyle(glStyleOrUrl, options) { + if (typeof glStyleOrUrl === 'string') { + if (glStyleOrUrl.trim().startsWith('{')) { + try { + const glStyle = JSON.parse(glStyleOrUrl); + return Promise.resolve(glStyle); + } catch (error) { + return Promise.reject(error); + } + } else { + glStyleOrUrl = normalizeStyleUrl(glStyleOrUrl, options.accessToken); + return fetchResource('Style', glStyleOrUrl, options); + } + } else { + return Promise.resolve(glStyleOrUrl); + } +} +const tilejsonCache = {}; +/** + * @param {Object} glSource glStyle source object. + * @param {string} styleUrl Style URL. + * @param {Options} options Options. + * @return {Promise<{tileJson: Object, tileLoadFunction: import('ol/Tile.js').LoadFunction}?>} TileJson and load function + */ +function getTileJson(glSource, styleUrl, options = {}) { + const cacheKey = [ + styleUrl, + JSON.stringify(glSource) + ].toString(); + let promise = tilejsonCache[cacheKey]; + if (!promise || options.transformRequest) { + let tileLoadFunction; + if (options.transformRequest) { + tileLoadFunction = (tile, src) => { + const transformedRequest = options.transformRequest ? options.transformRequest(src, 'Tiles') || src : src; + if (tile instanceof VectorTile) { + tile.setLoader((extent, resolution, projection) => { + toPromise(() => transformedRequest).then(transformedRequest => { + fetch(transformedRequest).then(response => response.arrayBuffer()).then(data => { + const format = tile.getFormat(); + const features = format.readFeatures(data, { + extent: extent, + featureProjection: projection + }); + // @ts-ignore + tile.setFeatures(features); + }).catch(e => tile.setState(TileState.ERROR)); + }); + }); + } else { + const img = tile.getImage(); + toPromise(() => transformedRequest).then(transformedRequest => { + if (transformedRequest instanceof Request) { + fetch(transformedRequest).then(response => response.blob()).then(blob => { + const url = URL.createObjectURL(blob); + img.addEventListener('load', () => URL.revokeObjectURL(url)); + img.addEventListener('error', () => URL.revokeObjectURL(url)); + img.src = url; + }).catch(e => tile.setState(TileState.ERROR)); + } else { + img.src = transformedRequest; + } + }); + } + }; + } + const url = glSource.url; + if (url && !glSource.tiles) { + const normalizedSourceUrl = normalizeSourceUrl(url, options.accessToken, options.accessTokenParam || 'access_token', styleUrl || location.href); + if (url.startsWith('mapbox://')) { + promise = Promise.resolve({ + tileJson: Object.assign({}, glSource, { + url: undefined, + tiles: expandUrl(normalizedSourceUrl) + }), + tileLoadFunction + }); + } else { + const metadata = {}; + promise = fetchResource('Source', normalizedSourceUrl, options, metadata).then(function (tileJson) { + tileJson.tiles = tileJson.tiles.map(function (tileUrl) { + if (tileJson.scheme === 'tms') { + tileUrl = tileUrl.replace('{y}', '{-y}'); + } + return normalizeSourceUrl(tileUrl, options.accessToken, options.accessTokenParam || 'access_token', metadata.request.url); + }); + return Promise.resolve({ + tileJson, + tileLoadFunction + }); + }); + } + } else { + glSource = Object.assign({}, glSource, { + tiles: glSource.tiles.map(function (tileUrl) { + if (glSource.scheme === 'tms') { + tileUrl = tileUrl.replace('{y}', '{-y}'); + } + return normalizeSourceUrl(tileUrl, options.accessToken, options.accessTokenParam || 'access_token', styleUrl || location.href); + }) + }); + promise = Promise.resolve({ + tileJson: Object.assign({}, glSource), + tileLoadFunction + }); + } + tilejsonCache[cacheKey] = promise; + } + return promise; +} +/** + * @param {HTMLImageElement|HTMLCanvasElement} spriteImage Sprite image id. + * @param {{x: number, y: number, width: number, height: number, pixelRatio: number}} spriteImageData Sprite image data. + * @param {number} haloWidth Halo width. + * @param {{r: number, g: number, b: number, a: number}} haloColor Halo color. + * @return {HTMLCanvasElement} Canvas element with the halo. + */ +function drawIconHalo(spriteImage, spriteImageData, haloWidth, haloColor) { + const imgSize = [ + 2 * haloWidth * spriteImageData.pixelRatio + spriteImageData.width, + 2 * haloWidth * spriteImageData.pixelRatio + spriteImageData.height + ]; + const imageCanvas = createCanvas(imgSize[0], imgSize[1]); + const imageContext = imageCanvas.getContext('2d'); + imageContext.drawImage(spriteImage, spriteImageData.x, spriteImageData.y, spriteImageData.width, spriteImageData.height, haloWidth * spriteImageData.pixelRatio, haloWidth * spriteImageData.pixelRatio, spriteImageData.width, spriteImageData.height); + const imageData = imageContext.getImageData(0, 0, imgSize[0], imgSize[1]); + imageContext.globalCompositeOperation = 'destination-over'; + imageContext.fillStyle = `rgba(${ haloColor.r * 255 },${ haloColor.g * 255 },${ haloColor.b * 255 },${ haloColor.a })`; + const data = imageData.data; + for (let i = 0, ii = imageData.width; i < ii; ++i) { + for (let j = 0, jj = imageData.height; j < jj; ++j) { + const index = (j * ii + i) * 4; + const alpha = data[index + 3]; + if (alpha > 0) { + imageContext.arc(i, j, haloWidth * spriteImageData.pixelRatio, 0, 2 * Math.PI); + } + } + } + imageContext.fill(); + return imageCanvas; +} +function smoothstep(min, max, value) { + const x = Math.max(0, Math.min(1, (value - min) / (max - min))); + return x * x * (3 - 2 * x); +} +/** + * @param {HTMLImageElement} image SDF image + * @param {{x: number, y: number, width: number, height: number}} area Area to unSDF + * @param {{r: number, g: number, b: number, a: number}} color Color to use + * @return {HTMLCanvasElement} Regular image + */ +function drawSDF(image, area, color) { + const imageCanvas = createCanvas(area.width, area.height); + const imageContext = imageCanvas.getContext('2d'); + imageContext.drawImage(image, area.x, area.y, area.width, area.height, 0, 0, area.width, area.height); + const imageData = imageContext.getImageData(0, 0, area.width, area.height); + const data = imageData.data; + for (let i = 0, ii = imageData.width; i < ii; ++i) { + for (let j = 0, jj = imageData.height; j < jj; ++j) { + const index = (j * ii + i) * 4; + const dist = data[index + 3] / 255; + const buffer = 0.75; + const gamma = 0.1; + const alpha = smoothstep(buffer - gamma, buffer + gamma, dist); + if (alpha > 0) { + data[index + 0] = Math.round(255 * color.r * alpha); + data[index + 1] = Math.round(255 * color.g * alpha); + data[index + 2] = Math.round(255 * color.b * alpha); + data[index + 3] = Math.round(255 * alpha); + } else { + data[index + 3] = 0; + } + } + } + imageContext.putImageData(imageData, 0, 0); + return imageCanvas; +} /** + * @typedef {import("./apply.js").Options} Options + * @private + */ + +const hairSpacePool = Array(256).join('\u200A'); +function applyLetterSpacing(text, letterSpacing) { + if (letterSpacing >= 0.05) { + let textWithLetterSpacing = ''; + const lines = text.split('\n'); + const joinSpaceString = hairSpacePool.slice(0, Math.round(letterSpacing / 0.1)); + for (let l = 0, ll = lines.length; l < ll; ++l) { + if (l > 0) { + textWithLetterSpacing += '\n'; + } + textWithLetterSpacing += lines[l].split('').join(joinSpaceString); + } + return textWithLetterSpacing; + } + return text; +} +let measureContext; +function getMeasureContext() { + if (!measureContext) { + measureContext = createCanvas(1, 1).getContext('2d'); + } + return measureContext; +} +function measureText(text, letterSpacing) { + return getMeasureContext().measureText(text).width + (text.length - 1) * letterSpacing; +} +const measureCache = {}; +function wrapText(text, font, em, letterSpacing) { + if (text.indexOf('\n') !== -1) { + const hardLines = text.split('\n'); + const lines = []; + for (let i = 0, ii = hardLines.length; i < ii; ++i) { + lines.push(wrapText(hardLines[i], font, em, letterSpacing)); + } + return lines.join('\n'); + } + const key = em + ',' + font + ',' + text + ',' + letterSpacing; + let wrappedText = measureCache[key]; + if (!wrappedText) { + const words = text.split(' '); + if (words.length > 1) { + const ctx = getMeasureContext(); + ctx.font = font; + const oneEm = ctx.measureText('M').width; + const maxWidth = oneEm * em; + let line = ''; + const lines = []; + // Pass 1 - wrap lines to not exceed maxWidth + for (let i = 0, ii = words.length; i < ii; ++i) { + const word = words[i]; + const testLine = line + (line ? ' ' : '') + word; + if (measureText(testLine, letterSpacing) <= maxWidth) { + line = testLine; + } else { + if (line) { + lines.push(line); + } + line = word; + } + } + if (line) { + lines.push(line); + } + // Pass 2 - add lines with a width of less than 30% of maxWidth to the previous or next line + for (let i = 0, ii = lines.length; i < ii && ii > 1; ++i) { + const line = lines[i]; + if (measureText(line, letterSpacing) < maxWidth * 0.35) { + const prevWidth = i > 0 ? measureText(lines[i - 1], letterSpacing) : Infinity; + const nextWidth = i < ii - 1 ? measureText(lines[i + 1], letterSpacing) : Infinity; + lines.splice(i, 1); + ii -= 1; + if (prevWidth < nextWidth) { + lines[i - 1] += ' ' + line; + i -= 1; + } else { + lines[i] = line + ' ' + lines[i]; + } + } + } + // Pass 3 - try to fill 80% of maxWidth for each line + for (let i = 0, ii = lines.length - 1; i < ii; ++i) { + const line = lines[i]; + const next = lines[i + 1]; + if (measureText(line, letterSpacing) > maxWidth * 0.7 && measureText(next, letterSpacing) < maxWidth * 0.6) { + const lineWords = line.split(' '); + const lastWord = lineWords.pop(); + if (measureText(lastWord, letterSpacing) < maxWidth * 0.2) { + lines[i] = lineWords.join(' '); + lines[i + 1] = lastWord + ' ' + next; + } + ii -= 1; + } + } + wrappedText = lines.join('\n'); + } else { + wrappedText = text; + } + wrappedText = applyLetterSpacing(wrappedText, letterSpacing); + measureCache[key] = wrappedText; + } + return wrappedText; +} +const fontFamilyRegEx = /font-family: ?([^;]*);/; +const stripQuotesRegEx = /("|')/g; +let loadedFontFamilies; +function hasFontFamily(family) { + if (!loadedFontFamilies) { + loadedFontFamilies = {}; + const styleSheets = document.styleSheets; + for (let i = 0, ii = styleSheets.length; i < ii; ++i) { + const styleSheet = styleSheets[i]; + try { + const cssRules = styleSheet.rules || styleSheet.cssRules; + if (cssRules) { + for (let j = 0, jj = cssRules.length; j < jj; ++j) { + const cssRule = cssRules[j]; + if (cssRule.type == 5) { + const match = cssRule.cssText.match(fontFamilyRegEx); + loadedFontFamilies[match[1].replace(stripQuotesRegEx, '')] = true; + } + } + } + } catch (e) { + } + } + } + return family in loadedFontFamilies; +} +const processedFontFamilies = {}; +/** + * @param {Array} fonts Fonts. + * @param {string} [templateUrl] Template URL. + * @return {Array} Processed fonts. + * @private + */ +function getFonts(fonts, templateUrl = 'https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css') { + const fontsKey = fonts.toString(); + if (fontsKey in processedFontFamilies) { + return processedFontFamilies[fontsKey]; + } + const fontDescriptions = []; + for (let i = 0, ii = fonts.length; i < ii; ++i) { + fonts[i] = fonts[i].replace('Arial Unicode MS', 'Arial'); + const font = fonts[i]; + const cssFont = mb2css(font, 1); + registerFont(cssFont); + const parts = cssFont.split(' '); + fontDescriptions.push([ + parts.slice(3).join(' ').replace(/"/g, ''), + parts[1], + parts[0] + ]); + } + for (let i = 0, ii = fontDescriptions.length; i < ii; ++i) { + const fontDescription = fontDescriptions[i]; + const family = fontDescription[0]; + if (!hasFontFamily(family)) { + if (checkedFonts.get(`${ fontDescription[2] }\n${ fontDescription[1] } \n${ family }`) !== 100) { + const fontUrl = templateUrl.replace('{font-family}', family.replace(/ /g, '-').toLowerCase()).replace('{Font+Family}', family.replace(/ /g, '+')).replace('{fontweight}', fontDescription[1]).replace('{-fontstyle}', fontDescription[2].replace('normal', '').replace(/(.+)/, '-$1')).replace('{fontstyle}', fontDescription[2]); + if (!document.querySelector('link[href="' + fontUrl + '"]')) { + const markup = document.createElement('link'); + markup.href = fontUrl; + markup.rel = 'stylesheet'; + document.head.appendChild(markup); + } + } + } + } + processedFontFamilies[fontsKey] = fonts; + return fonts; +} + +/* +ol-mapbox-style - Use Mapbox Style objects with OpenLayers +Copyright 2016-present ol-mapbox-style contributors +License: https://raw.githubusercontent.com/openlayers/ol-mapbox-style/master/LICENSE +*/ +/** + * @typedef {import("ol/layer/Vector").default} VectorLayer + * @typedef {import("ol/layer/VectorTile").default} VectorTileLayer + * @typedef {import("ol/style/Style").StyleFunction} StyleFunction + * @typedef {import('./util.js').ResourceType} ResourceType + */ +const types = { + 'Point': 1, + 'MultiPoint': 1, + 'LineString': 2, + 'MultiLineString': 2, + 'Polygon': 3, + 'MultiPolygon': 3 +}; +const anchor = { + 'center': [ + 0.5, + 0.5 + ], + 'left': [ + 0, + 0.5 + ], + 'right': [ + 1, + 0.5 + ], + 'top': [ + 0.5, + 0 + ], + 'bottom': [ + 0.5, + 1 + ], + 'top-left': [ + 0, + 0 + ], + 'top-right': [ + 1, + 0 + ], + 'bottom-left': [ + 0, + 1 + ], + 'bottom-right': [ + 1, + 1 + ] +}; +const expressionData = function (rawExpression, propertySpec) { + const compiledExpression = createPropertyExpression(rawExpression, propertySpec); + if (compiledExpression.result === 'error') { + throw new Error(compiledExpression.value.map(err => `${ err.key }: ${ err.message }`).join(', ')); + } + return compiledExpression.value; +}; +const emptyObj$1 = {}; +const zoomObj = { zoom: 0 }; +let renderFeatureCoordinates, renderFeature; +/** + * @private + * @param {Object} layer Gl object layer. + * @param {string} layoutOrPaint 'layout' or 'paint'. + * @param {string} property Feature property. + * @param {number} zoom Zoom. + * @param {Object} feature Gl feature. + * @param {Object} [functionCache] Function cache. + * @param {Object} [featureState] Feature state. + * @return {?} Value. + */ +function getValue(layer, layoutOrPaint, property, zoom, feature, functionCache, featureState) { + const layerId = layer.id; + if (!functionCache) { + functionCache = {}; + console.warn('No functionCache provided to getValue()'); //eslint-disable-line no-console + } + if (!functionCache[layerId]) { + functionCache[layerId] = {}; + } + const functions = functionCache[layerId]; + if (!functions[property]) { + let value = (layer[layoutOrPaint] || emptyObj$1)[property]; + const propertySpec = spec[`${ layoutOrPaint }_${ layer.type }`][property]; + if (value === undefined) { + value = propertySpec.default; + } + let isExpr = isExpression(value); + if (!isExpr && isFunction(value)) { + value = convertFunction(value, propertySpec); + isExpr = true; + } + if (isExpr) { + const compiledExpression = expressionData(value, propertySpec); + functions[property] = compiledExpression.evaluate.bind(compiledExpression); + } else { + if (propertySpec.type == 'color') { + value = Color$1.parse(value); + } + functions[property] = function () { + return value; + }; + } + } + zoomObj.zoom = zoom; + return functions[property](zoomObj, feature, featureState); +} +/** + * @private + * @param {Object} layer Gl object layer. + * @param {number} zoom Zoom. + * @param {Object} feature Gl feature. + * @param {"icon"|"text"} prefix Style property prefix. + * @param {Object} [functionCache] Function cache. + * @return {"declutter"|"obstacle"|"none"} Value. + */ +function getDeclutterMode(layer, zoom, feature, prefix, functionCache) { + const allowOverlap = getValue(layer, 'layout', `${ prefix }-allow-overlap`, zoom, feature, functionCache); + if (!allowOverlap) { + return 'declutter'; + } + const ignorePlacement = getValue(layer, 'layout', `${ prefix }-ignore-placement`, zoom, feature, functionCache); + if (!ignorePlacement) { + return 'obstacle'; + } + return 'none'; +} +/** + * @private + * @param {string} layerId Layer id. + * @param {?} filter Filter. + * @param {Object} feature Feature. + * @param {number} zoom Zoom. + * @param {Object} [filterCache] Filter cache. + * @return {boolean} Filter result. + */ +function evaluateFilter(layerId, filter, feature, zoom, filterCache) { + if (!filterCache) { + console.warn('No filterCache provided to evaluateFilter()'); //eslint-disable-line no-console + } + if (!(layerId in filterCache)) { + filterCache[layerId] = createFilter(filter).filter; + } + zoomObj.zoom = zoom; + return filterCache[layerId](zoomObj, feature); +} +let renderTransparentEnabled = false; +/** + * Configure whether features with a transparent style should be rendered. When + * set to `true`, it will be possible to hit detect content that is not visible, + * like transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or + * `ol/Map#getFeaturesAtPixel()` + * @param {boolean} enabled Rendering of transparent elements is enabled. + * Default is `false`. + */ +function renderTransparent(enabled) { + if (enabled !== renderTransparentEnabled) { + clearFunctionCache(); + renderTransparentEnabled = enabled; + } +} +/** + * @private + * @param {?} color Color. + * @param {number} [opacity] Opacity. + * @return {string} Color. + */ +function colorWithOpacity(color, opacity) { + if (color) { + if (!renderTransparentEnabled && (color.a === 0 || opacity === 0)) { + return undefined; + } + const a = color.a; + opacity = opacity === undefined ? 1 : opacity; + return a === 0 ? 'transparent' : 'rgba(' + Math.round(color.r * 255 / a) + ',' + Math.round(color.g * 255 / a) + ',' + Math.round(color.b * 255 / a) + ',' + a * opacity + ')'; + } + return color; +} +const templateRegEx = /\{[^{}}]*\}/g; +/** + * @private + * @param {string} text Text. + * @param {Object} properties Properties. + * @return {string} Text. + */ +function fromTemplate(text, properties) { + return text.replace(templateRegEx, function (match) { + return properties[match.slice(1, -1)] || ''; + }); +} +let recordLayer = false; +/** + * Turns recording of the Mapbox Style's `layer` on and off. When turned on, + * the layer that a rendered feature belongs to will be set as the feature's + * `mapbox-layer` property. + * @param {boolean} record Recording of the style layer is on. + */ +function recordStyleLayer(record = false) { + recordLayer = record; +} +const styleFunctionArgs = {}; +/** + * Creates a style function from the `glStyle` object for all layers that use + * the specified `source`, which needs to be a `"type": "vector"` or + * `"type": "geojson"` source and applies it to the specified OpenLayers layer. + * + * Two additional properties will be set on the provided layer: + * + * * `mapbox-source`: The `id` of the Mapbox Style document's source that the + * OpenLayers layer was created from. Usually `apply()` creates one + * OpenLayers layer per Mapbox Style source, unless the layer stack has + * layers from different sources in between. + * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are + * included in the OpenLayers layer. + * + * This function also works in a web worker. In worker mode, the main thread needs + * to listen to messages from the worker and respond with another message to make + * sure that sprite image loading works: + * + * ```js + * worker.addEventListener('message', event => { + * if (event.data.action === 'loadImage') { + * const image = new Image(); + * image.crossOrigin = 'anonymous'; + * image.addEventListener('load', function() { + * createImageBitmap(image, 0, 0, image.width, image.height).then(imageBitmap => { + * worker.postMessage({ + * action: 'imageLoaded', + * image: imageBitmap, + * src: event.data.src + * }, [imageBitmap]); + * }); + * }); + * image.src = event.data.src; + * } + * }); + * ``` + * + * @param {VectorLayer|VectorTileLayer} olLayer OpenLayers layer to + * apply the style to. In addition to the style, the layer will get two + * properties: `mapbox-source` will be the `id` of the `glStyle`'s source used + * for the layer, and `mapbox-layers` will be an array of the `id`s of the + * `glStyle`'s layers. + * @param {string|Object} glStyle Mapbox Style object. + * @param {string|Array} sourceOrLayers `source` key or an array of layer `id`s + * from the Mapbox Style object. When a `source` key is provided, all layers for + * the specified source will be included in the style function. When layer `id`s + * are provided, they must be from layers that use the same source. + * @param {Array} resolutions + * Resolutions for mapping resolution to zoom level. + * @param {Object} spriteData Sprite data from the url specified in + * the Mapbox Style object's `sprite` property. Only required if a `sprite` + * property is specified in the Mapbox Style object. + * @param {string|Request|Promise} spriteImageUrl Sprite image url for the sprite + * specified in the Mapbox Style object's `sprite` property. Only required if a + * `sprite` property is specified in the Mapbox Style object. + * @param {function(Array, string=):Array} getFonts Function that + * receives a font stack and the url template from the GL style's `metadata['ol:webfonts']` + * property (if set) as arguments, and returns a (modified) font stack that + * is available. Font names are the names used in the Mapbox Style object. If + * not provided, the font stack will be used as-is. This function can also be + * used for loading web fonts. + * @param {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined] + * Function that returns an image or a URL for an image name. If the result is an HTMLImageElement, it must already be + * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished. + * This function can be used for icons not in the sprite or to override sprite icons. + * @return {StyleFunction} Style function for use in + * `ol.layer.Vector` or `ol.layer.VectorTile`. + */ +function stylefunction(olLayer, glStyle, sourceOrLayers, resolutions = defaultResolutions, spriteData = undefined, spriteImageUrl = undefined, getFonts = undefined, getImage = undefined) { + if (typeof glStyle == 'string') { + glStyle = JSON.parse(glStyle); + } + if (glStyle.version != 8) { + throw new Error('glStyle version 8 required.'); + } + styleFunctionArgs[getStyleFunctionKey(glStyle, olLayer)] = Array.from(arguments); + let spriteImage, spriteImageSize; + let spriteImageUnSDFed; + if (spriteImageUrl) { + if (typeof Image !== 'undefined') { + const img = new Image(); + let blobUrl; + toPromise(() => spriteImageUrl).then(spriteImageUrl => { + if (spriteImageUrl instanceof Request) { + fetch(spriteImageUrl).then(response => response.blob()).then(blob => { + blobUrl = URL.createObjectURL(blob); + img.src = blobUrl; + }).catch(() => { + }); + } else { + img.crossOrigin = 'anonymous'; + img.src = spriteImageUrl; + if (blobUrl) { + URL.revokeObjectURL(blobUrl); + } + } + }); + img.onload = function () { + spriteImage = img; + spriteImageSize = [ + img.width, + img.height + ]; + olLayer.changed(); + img.onload = null; + }; + } else if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { + //eslint-disable-line + const worker = self; + // Main thread needs to handle 'loadImage' and dispatch 'imageLoaded' + worker.postMessage({ + action: 'loadImage', + src: spriteImageUrl + }); + worker.addEventListener('message', function handler(event) { + if (event.data.action === 'imageLoaded' && event.data.src === spriteImageUrl) { + spriteImage = event.data.image; + spriteImageSize = [ + spriteImage.width, + spriteImage.height + ]; + } + }); + } + } + const allLayers = derefLayers(glStyle.layers); + const layersBySourceLayer = {}; + const mapboxLayers = []; + const iconImageCache = {}; + const patternCache = {}; + const functionCache = getFunctionCache(glStyle); + const filterCache = getFilterCache(glStyle); + let mapboxSource; + for (let i = 0, ii = allLayers.length; i < ii; ++i) { + const layer = allLayers[i]; + const layerId = layer.id; + if (typeof sourceOrLayers == 'string' && layer.source == sourceOrLayers || Array.isArray(sourceOrLayers) && sourceOrLayers.indexOf(layerId) !== -1) { + const sourceLayer = layer['source-layer']; + if (!mapboxSource) { + mapboxSource = layer.source; + const source = glStyle.sources[mapboxSource]; + if (!source) { + throw new Error(`Source "${ mapboxSource }" is not defined`); + } + const type = source.type; + if (type !== 'vector' && type !== 'geojson') { + throw new Error(`Source "${ mapboxSource }" is not of type "vector" or "geojson", but "${ type }"`); + } + } else if (layer.source !== mapboxSource) { + throw new Error(`Layer "${ layerId }" does not use source "${ mapboxSource }`); + } + let layers = layersBySourceLayer[sourceLayer]; + if (!layers) { + layers = []; + layersBySourceLayer[sourceLayer] = layers; + } + layers.push({ + layer: layer, + index: i + }); + mapboxLayers.push(layerId); + } + } + const textHalo = new Stroke(); + const textColor = new Fill(); + const styles = []; + /** + * @param {import("ol/Feature").default|import("ol/render/Feature").default} feature Feature. + * @param {number} resolution Resolution. + * @param {string} [onlyLayer] Calculate style for this layer only. + * @return {Array} Style. + */ + const styleFunction = function (feature, resolution, onlyLayer) { + const properties = feature.getProperties(); + const layers = layersBySourceLayer[properties.layer]; + if (!layers) { + return undefined; + } + let zoom = resolutions.indexOf(resolution); + if (zoom == -1) { + zoom = getZoomForResolution(resolution, resolutions); + } + const type = types[feature.getGeometry().getType()]; + const f = { + id: feature.getId(), + properties: properties, + type: type + }; + const featureState = olLayer.get('mapbox-featurestate')[feature.getId()]; + let stylesLength = -1; + let featureBelongsToLayer; + for (let i = 0, ii = layers.length; i < ii; ++i) { + const layerData = layers[i]; + const layer = layerData.layer; + const layerId = layer.id; + if (onlyLayer !== undefined && onlyLayer !== layerId) { + continue; + } + const layout = layer.layout || emptyObj$1; + const paint = layer.paint || emptyObj$1; + if (layout.visibility === 'none' || 'minzoom' in layer && zoom < layer.minzoom || 'maxzoom' in layer && zoom >= layer.maxzoom) { + continue; + } + const filter = layer.filter; + if (!filter || evaluateFilter(layerId, filter, f, zoom, filterCache)) { + featureBelongsToLayer = layer; + let color, opacity, fill, stroke, strokeColor, style; + const index = layerData.index; + if (type == 3 && (layer.type == 'fill' || layer.type == 'fill-extrusion')) { + opacity = getValue(layer, 'paint', layer.type + '-opacity', zoom, f, functionCache, featureState); + if (layer.type + '-pattern' in paint) { + const fillIcon = getValue(layer, 'paint', layer.type + '-pattern', zoom, f, functionCache, featureState); + if (fillIcon) { + const icon = typeof fillIcon === 'string' ? fromTemplate(fillIcon, properties) : fillIcon.toString(); + if (spriteImage && spriteData && spriteData[icon]) { + ++stylesLength; + style = styles[stylesLength]; + if (!style || !style.getFill() || style.getStroke() || style.getText()) { + style = new Style({ fill: new Fill() }); + styles[stylesLength] = style; + } + fill = style.getFill(); + style.setZIndex(index); + const icon_cache_key = icon + '.' + opacity; + let pattern = patternCache[icon_cache_key]; + if (!pattern) { + const spriteImageData = spriteData[icon]; + const canvas = createCanvas(spriteImageData.width, spriteImageData.height); + const ctx = canvas.getContext('2d'); + ctx.globalAlpha = opacity; + ctx.drawImage(spriteImage, spriteImageData.x, spriteImageData.y, spriteImageData.width, spriteImageData.height, 0, 0, spriteImageData.width, spriteImageData.height); + pattern = ctx.createPattern(canvas, 'repeat'); + patternCache[icon_cache_key] = pattern; + } + fill.setColor(pattern); + } + } + } else { + color = colorWithOpacity(getValue(layer, 'paint', layer.type + '-color', zoom, f, functionCache, featureState), opacity); + if (layer.type + '-outline-color' in paint) { + strokeColor = colorWithOpacity(getValue(layer, 'paint', layer.type + '-outline-color', zoom, f, functionCache, featureState), opacity); + } + if (!strokeColor) { + strokeColor = color; + } + if (color || strokeColor) { + ++stylesLength; + style = styles[stylesLength]; + if (!style || color && !style.getFill() || !color && style.getFill() || strokeColor && !style.getStroke() || !strokeColor && style.getStroke() || style.getText()) { + style = new Style({ + fill: color ? new Fill() : undefined, + stroke: strokeColor ? new Stroke() : undefined + }); + styles[stylesLength] = style; + } + if (color) { + fill = style.getFill(); + fill.setColor(color); + } + if (strokeColor) { + stroke = style.getStroke(); + stroke.setColor(strokeColor); + stroke.setWidth(0.5); + } + style.setZIndex(index); + } + } + } + if (type != 1 && layer.type == 'line') { + if (!('line-pattern' in paint)) { + color = colorWithOpacity(getValue(layer, 'paint', 'line-color', zoom, f, functionCache, featureState), getValue(layer, 'paint', 'line-opacity', zoom, f, functionCache, featureState)); + } else { + color = undefined; + } + const width = getValue(layer, 'paint', 'line-width', zoom, f, functionCache, featureState); + if (color && width > 0) { + ++stylesLength; + style = styles[stylesLength]; + if (!style || !style.getStroke() || style.getFill() || style.getText()) { + style = new Style({ stroke: new Stroke() }); + styles[stylesLength] = style; + } + stroke = style.getStroke(); + stroke.setLineCap(getValue(layer, 'layout', 'line-cap', zoom, f, functionCache, featureState)); + stroke.setLineJoin(getValue(layer, 'layout', 'line-join', zoom, f, functionCache, featureState)); + stroke.setMiterLimit(getValue(layer, 'layout', 'line-miter-limit', zoom, f, functionCache, featureState)); + stroke.setColor(color); + stroke.setWidth(width); + stroke.setLineDash(paint['line-dasharray'] ? getValue(layer, 'paint', 'line-dasharray', zoom, f, functionCache, featureState).map(function (x) { + return x * width; + }) : null); + style.setZIndex(index); + } + } + let hasImage = false; + let text = null; + let placementAngle = 0; + let icon, iconImg, skipLabel; + if ((type == 1 || type == 2) && 'icon-image' in layout) { + const iconImage = getValue(layer, 'layout', 'icon-image', zoom, f, functionCache, featureState); + if (iconImage) { + icon = typeof iconImage === 'string' ? fromTemplate(iconImage, properties) : iconImage.toString(); + let styleGeom = undefined; + const imageElement = getImage ? getImage(olLayer, icon) : undefined; + if (spriteImage && spriteData && spriteData[icon] || imageElement) { + const iconRotationAlignment = getValue(layer, 'layout', 'icon-rotation-alignment', zoom, f, functionCache, featureState); + if (type == 2) { + const geom = feature.getGeometry(); + // ol package and ol-debug.js only + if (geom.getFlatMidpoint || geom.getFlatMidpoints) { + const extent = geom.getExtent(); + const size = Math.sqrt(Math.max(Math.pow((extent[2] - extent[0]) / resolution, 2), Math.pow((extent[3] - extent[1]) / resolution, 2))); + if (size > 150) { + //FIXME Do not hard-code a size of 150 + const midpoint = geom.getType() === 'MultiLineString' ? geom.getFlatMidpoints() : geom.getFlatMidpoint(); + if (!renderFeature) { + renderFeatureCoordinates = [ + NaN, + NaN + ]; + renderFeature = new RenderFeature('Point', renderFeatureCoordinates, [], 2, {}, undefined); + } + styleGeom = renderFeature; + renderFeatureCoordinates[0] = midpoint[0]; + renderFeatureCoordinates[1] = midpoint[1]; + const placement = getValue(layer, 'layout', 'symbol-placement', zoom, f, functionCache, featureState); + if (placement === 'line' && iconRotationAlignment === 'map') { + const stride = geom.getStride(); + const coordinates = geom.getFlatCoordinates(); + for (let i = 0, ii = coordinates.length - stride; i < ii; i += stride) { + const x1 = coordinates[i]; + const y1 = coordinates[i + 1]; + const x2 = coordinates[i + stride]; + const y2 = coordinates[i + stride + 1]; + const minX = Math.min(x1, x2); + const minY = Math.min(y1, y2); + const maxX = Math.max(x1, x2); + const maxY = Math.max(y1, y2); + if (midpoint[0] >= minX && midpoint[0] <= maxX && midpoint[1] >= minY && midpoint[1] <= maxY) { + placementAngle = Math.atan2(y1 - y2, x2 - x1); + break; + } + } + } + } + } + } + if (type !== 2 || styleGeom) { + const iconSize = getValue(layer, 'layout', 'icon-size', zoom, f, functionCache, featureState); + const iconColor = paint['icon-color'] !== undefined ? getValue(layer, 'paint', 'icon-color', zoom, f, functionCache, featureState) : null; + if (!iconColor || iconColor.a !== 0) { + const haloColor = getValue(layer, 'paint', 'icon-halo-color', zoom, f, functionCache, featureState); + const haloWidth = getValue(layer, 'paint', 'icon-halo-width', zoom, f, functionCache, featureState); + let iconCacheKey = `${ icon }.${ iconSize }.${ haloWidth }.${ haloColor }`; + if (iconColor !== null) { + iconCacheKey += `.${ iconColor }`; + } + iconImg = iconImageCache[iconCacheKey]; + if (!iconImg) { + const declutterMode = getDeclutterMode(layer, zoom, f, 'icon', functionCache); + let displacement; + if ('icon-offset' in layout) { + displacement = getValue(layer, 'layout', 'icon-offset', zoom, f, functionCache, featureState).slice(0); + displacement[0] *= iconSize; + displacement[1] *= -iconSize; + } + let color = iconColor ? [ + iconColor.r * 255, + iconColor.g * 255, + iconColor.b * 255, + iconColor.a + ] : undefined; + if (imageElement) { + const iconOptions = { + color: color, + rotateWithView: iconRotationAlignment === 'map', + displacement: displacement, + declutterMode: declutterMode, + scale: iconSize + }; + if (typeof imageElement === 'string') { + // it is a src URL + iconOptions.src = imageElement; + } else { + iconOptions.img = imageElement; + iconOptions.imgSize = [ + imageElement.width, + imageElement.height + ]; + } + iconImg = new Icon(iconOptions); + } else { + const spriteImageData = spriteData[icon]; + let img, size, offset; + if (haloWidth) { + if (spriteImageData.sdf) { + img = drawIconHalo(drawSDF(spriteImage, spriteImageData, iconColor || [ + 0, + 0, + 0, + 1 + ]), { + x: 0, + y: 0, + width: spriteImageData.width, + height: spriteImageData.height, + pixelRatio: spriteImageData.pixelRatio + }, haloWidth, haloColor); + color = undefined; // do not tint haloed icons + } else { + img = drawIconHalo(spriteImage, spriteImageData, haloWidth, haloColor); + } + } else { + if (spriteImageData.sdf) { + if (!spriteImageUnSDFed) { + spriteImageUnSDFed = drawSDF(spriteImage, { + x: 0, + y: 0, + width: spriteImageSize[0], + height: spriteImageSize[1] + }, { + r: 1, + g: 1, + b: 1, + a: 1 + }); + } + img = spriteImageUnSDFed; + } else { + img = spriteImage; + } + size = [ + spriteImageData.width, + spriteImageData.height + ]; + offset = [ + spriteImageData.x, + spriteImageData.y + ]; + } + iconImg = new Icon({ + color: color, + img: img, + // @ts-ignore + imgSize: spriteImageSize, + size: size, + offset: offset, + rotateWithView: iconRotationAlignment === 'map', + scale: iconSize / spriteImageData.pixelRatio, + displacement: displacement, + declutterMode: declutterMode + }); + } + iconImageCache[iconCacheKey] = iconImg; + } + } + if (iconImg) { + ++stylesLength; + style = styles[stylesLength]; + if (!style || !style.getImage() || style.getFill() || style.getStroke()) { + style = new Style(); + styles[stylesLength] = style; + } + style.setGeometry(styleGeom); + iconImg.setRotation(placementAngle + deg2rad(getValue(layer, 'layout', 'icon-rotate', zoom, f, functionCache, featureState))); + iconImg.setOpacity(getValue(layer, 'paint', 'icon-opacity', zoom, f, functionCache, featureState)); + iconImg.setAnchor(anchor[getValue(layer, 'layout', 'icon-anchor', zoom, f, functionCache, featureState)]); + style.setImage(iconImg); + text = style.getText(); + style.setText(undefined); + style.setZIndex(index); + hasImage = true; + skipLabel = false; + } + } else { + skipLabel = true; + } + } + } + } + if (type == 1 && layer.type === 'circle') { + ++stylesLength; + style = styles[stylesLength]; + if (!style || !style.getImage() || style.getFill() || style.getStroke()) { + style = new Style(); + styles[stylesLength] = style; + } + const circleRadius = 'circle-radius' in paint ? getValue(layer, 'paint', 'circle-radius', zoom, f, functionCache, featureState) : 5; + const circleStrokeColor = colorWithOpacity(getValue(layer, 'paint', 'circle-stroke-color', zoom, f, functionCache, featureState), getValue(layer, 'paint', 'circle-stroke-opacity', zoom, f, functionCache, featureState)); + const circleTranslate = getValue(layer, 'paint', 'circle-translate', zoom, f, functionCache, featureState); + const circleColor = colorWithOpacity(getValue(layer, 'paint', 'circle-color', zoom, f, functionCache, featureState), getValue(layer, 'paint', 'circle-opacity', zoom, f, functionCache, featureState)); + const circleStrokeWidth = getValue(layer, 'paint', 'circle-stroke-width', zoom, f, functionCache, featureState); + const cache_key = circleRadius + '.' + circleStrokeColor + '.' + circleColor + '.' + circleStrokeWidth + '.' + circleTranslate[0] + '.' + circleTranslate[1]; + iconImg = iconImageCache[cache_key]; + if (!iconImg) { + iconImg = new Circle({ + radius: circleRadius, + displacement: [ + circleTranslate[0], + -circleTranslate[1] + ], + stroke: circleStrokeColor && circleStrokeWidth > 0 ? new Stroke({ + width: circleStrokeWidth, + color: circleStrokeColor + }) : undefined, + fill: circleColor ? new Fill({ color: circleColor }) : undefined, + declutterMode: 'none' + }); + iconImageCache[cache_key] = iconImg; + } + style.setImage(iconImg); + text = style.getText(); + style.setText(undefined); + style.setGeometry(undefined); + style.setZIndex(index); + hasImage = true; + } + let label, font, textLineHeight, textSize, letterSpacing, maxTextWidth; + if ('text-field' in layout) { + textSize = Math.round(getValue(layer, 'layout', 'text-size', zoom, f, functionCache, featureState)); + const fontArray = getValue(layer, 'layout', 'text-font', zoom, f, functionCache, featureState); + textLineHeight = getValue(layer, 'layout', 'text-line-height', zoom, f, functionCache, featureState); + font = mb2css(getFonts ? getFonts(fontArray, glStyle.metadata ? glStyle.metadata['ol:webfonts'] : undefined) : fontArray, textSize, textLineHeight); + if (!font.includes('sans-serif')) { + font += ',sans-serif'; + } + letterSpacing = getValue(layer, 'layout', 'text-letter-spacing', zoom, f, functionCache, featureState); + maxTextWidth = getValue(layer, 'layout', 'text-max-width', zoom, f, functionCache, featureState); + const textField = getValue(layer, 'layout', 'text-field', zoom, f, functionCache, featureState); + if (typeof textField === 'object' && textField.sections) { + if (textField.sections.length === 1) { + label = textField.toString(); + } else { + label = textField.sections.reduce((acc, chunk, i) => { + const fonts = chunk.fontStack ? chunk.fontStack.split(',') : fontArray; + const chunkFont = mb2css(getFonts ? getFonts(fonts) : fonts, textSize * (chunk.scale || 1), textLineHeight); + let text = chunk.text; + if (text === '\n') { + acc.push('\n', ''); + return acc; + } + if (type == 2) { + acc.push(applyLetterSpacing(text, letterSpacing), chunkFont); + return; + } + text = wrapText(text, chunkFont, maxTextWidth, letterSpacing).split('\n'); + for (let i = 0, ii = text.length; i < ii; ++i) { + if (i > 0) { + acc.push('\n', ''); + } + acc.push(text[i], chunkFont); + } + return acc; + }, []); + } + } else { + label = fromTemplate(textField, properties).trim(); + } + opacity = getValue(layer, 'paint', 'text-opacity', zoom, f, functionCache, featureState); + } + if (label && opacity && !skipLabel) { + if (!hasImage) { + ++stylesLength; + style = styles[stylesLength]; + if (!style || !style.getText() || style.getFill() || style.getStroke()) { + style = new Style(); + styles[stylesLength] = style; + } + style.setImage(undefined); + style.setGeometry(undefined); + } + const declutterMode = getDeclutterMode(layer, zoom, f, 'text', functionCache); + if (!style.getText()) { + style.setText(text); + } + text = style.getText(); + if (!text || 'getDeclutterMode' in text && text.getDeclutterMode() !== declutterMode) { + text = new Text({ + padding: [ + 2, + 2, + 2, + 2 + ], + // @ts-ignore + declutterMode: declutterMode + }); + style.setText(text); + } + const textTransform = getValue(layer, 'layout', 'text-transform', zoom, f, functionCache, featureState); + if (textTransform == 'uppercase') { + label = Array.isArray(label) ? label.map((t, i) => i % 2 ? t : t.toUpperCase()) : label.toUpperCase(); + } else if (textTransform == 'lowercase') { + label = Array.isArray(label) ? label.map((t, i) => i % 2 ? t : t.toLowerCase()) : label.toLowerCase(); + } + const wrappedLabel = Array.isArray(label) ? label : type == 2 ? applyLetterSpacing(label, letterSpacing) : wrapText(label, font, maxTextWidth, letterSpacing); + text.setText(wrappedLabel); + text.setFont(font); + text.setRotation(deg2rad(getValue(layer, 'layout', 'text-rotate', zoom, f, functionCache, featureState))); + const textAnchor = getValue(layer, 'layout', 'text-anchor', zoom, f, functionCache, featureState); + const placement = hasImage || type == 1 ? 'point' : getValue(layer, 'layout', 'symbol-placement', zoom, f, functionCache, featureState); + let textAlign; + if (placement === 'line-center') { + text.setPlacement('line'); + textAlign = 'center'; + } else { + text.setPlacement(placement); + } + if (placement === 'line' && typeof text.setRepeat === 'function') { + const symbolSpacing = getValue(layer, 'layout', 'symbol-spacing', zoom, f, functionCache, featureState); + text.setRepeat(symbolSpacing * 2); + } + text.setOverflow(placement === 'point'); + let textHaloWidth = getValue(layer, 'paint', 'text-halo-width', zoom, f, functionCache, featureState); + const textOffset = getValue(layer, 'layout', 'text-offset', zoom, f, functionCache, featureState); + const textTranslate = getValue(layer, 'paint', 'text-translate', zoom, f, functionCache, featureState); + // Text offset has to take halo width and line height into account + let vOffset = 0; + let hOffset = 0; + if (placement == 'point') { + textAlign = 'center'; + if (textAnchor.indexOf('left') !== -1) { + textAlign = 'left'; + hOffset = textHaloWidth; + } else if (textAnchor.indexOf('right') !== -1) { + textAlign = 'right'; + hOffset = -textHaloWidth; + } + const textRotationAlignment = getValue(layer, 'layout', 'text-rotation-alignment', zoom, f, functionCache, featureState); + text.setRotateWithView(textRotationAlignment == 'map'); + } else { + text.setMaxAngle(deg2rad(getValue(layer, 'layout', 'text-max-angle', zoom, f, functionCache, featureState)) * label.length / wrappedLabel.length); + text.setRotateWithView(false); + } + text.setTextAlign(textAlign); + let textBaseline = 'middle'; + if (textAnchor.indexOf('bottom') == 0) { + textBaseline = 'bottom'; + vOffset = -textHaloWidth - 0.5 * (textLineHeight - 1) * textSize; + } else if (textAnchor.indexOf('top') == 0) { + textBaseline = 'top'; + vOffset = textHaloWidth + 0.5 * (textLineHeight - 1) * textSize; + } + text.setTextBaseline(textBaseline); + const textJustify = getValue(layer, 'layout', 'text-justify', zoom, f, functionCache, featureState); + text.setJustify(textJustify === 'auto' ? undefined : textJustify); + text.setOffsetX(textOffset[0] * textSize + hOffset + textTranslate[0]); + text.setOffsetY(textOffset[1] * textSize + vOffset + textTranslate[1]); + textColor.setColor(colorWithOpacity(getValue(layer, 'paint', 'text-color', zoom, f, functionCache, featureState), opacity)); + text.setFill(textColor); + const haloColor = colorWithOpacity(getValue(layer, 'paint', 'text-halo-color', zoom, f, functionCache, featureState), opacity); + if (haloColor && textHaloWidth > 0) { + textHalo.setColor(haloColor); + // spec here : https://docs.mapbox.com/mapbox-gl-js/style-spec/#paint-symbol-text-halo-width + // Halo width must be doubled because it is applied around the center of the text outline + textHaloWidth *= 2; + // 1/4 of text size (spec) x 2 + const halfTextSize = 0.5 * textSize; + textHalo.setWidth(textHaloWidth <= halfTextSize ? textHaloWidth : halfTextSize); + text.setStroke(textHalo); + } else { + text.setStroke(undefined); + } + const textPadding = getValue(layer, 'layout', 'text-padding', zoom, f, functionCache, featureState); + const padding = text.getPadding(); + if (textPadding !== padding[0]) { + padding[0] = textPadding; + padding[1] = textPadding; + padding[2] = textPadding; + padding[3] = textPadding; + } + style.setZIndex(index); + } + } + } + if (stylesLength > -1) { + styles.length = stylesLength + 1; + if (recordLayer) { + if ('set' in feature) { + // ol/Feature + feature.set('mapbox-layer', featureBelongsToLayer); + } else { + // ol/render/Feature + feature.getProperties()['mapbox-layer'] = featureBelongsToLayer; + } + } + return styles; + } + return undefined; + }; + olLayer.setStyle(styleFunction); + olLayer.set('mapbox-source', mapboxSource); + olLayer.set('mapbox-layers', mapboxLayers); + olLayer.set('mapbox-featurestate', olLayer.get('mapbox-featurestate') || {}); + return styleFunction; +} +/** + * Get the the style for a specific Mapbox layer only. This can be useful for creating a legend. + * @param {import("ol/Feature").default|import("ol/render/Feature").default} feature OpenLayers feature. + * @param {number} resolution View resolution. + * @param {import("ol/layer").Vector|import("ol/layer").VectorTile} olLayer OpenLayers layer. + * @param {string} layerId Id of the Mapbox layer to get the style for + * @return {Array} Styles for the provided Mapbox layer. + */ +function getStyleForLayer(feature, resolution, olLayer, layerId) { + const evaluateStyle = olLayer.getStyleFunction(); + if (evaluateStyle.length === 3) { + // @ts-ignore + return evaluateStyle(feature, resolution, layerId); + } + return undefined; +} + +/** + * Generates a shaded relief image given elevation data. Uses a 3x3 + * neighborhood for determining slope and aspect. + * @param {Array} inputs Array of input images. + * @param {Object} data Data added in the "beforeoperations" event. + * @return {ImageData} Output image. + */ +function hillshade(inputs, data) { + const elevationImage = inputs[0]; + const width = elevationImage.width; + const height = elevationImage.height; + const elevationData = elevationImage.data; + const shadeData = new Uint8ClampedArray(elevationData.length); + const dp = data.resolution * 2; + const maxX = width - 1; + const maxY = height - 1; + const pixel = [ + 0, + 0, + 0, + 0 + ]; + const twoPi = 2 * Math.PI; + const halfPi = Math.PI / 2; + const sunEl = Math.PI * data.sunEl / 180; + const sunAz = Math.PI * data.sunAz / 180; + const cosSunEl = Math.cos(sunEl); + const sinSunEl = Math.sin(sunEl); + const highlightColor = data.highlightColor; + const shadowColor = data.shadowColor; + const accentColor = data.accentColor; + const encoding = data.encoding; + let pixelX, pixelY, x0, x1, y0, y1, offset, z0, z1, dzdx, dzdy, slope, aspect, accent, scaled, shade, scaledAccentColor, compositeShadeColor, clamp, slopeScaleBase, scaledSlope, cosIncidence; + function calculateElevation(pixel, encoding = 'mapbox') { + // The method used to extract elevations from the DEM. + // + // The supported methods are the Mapbox format + // (red * 256 * 256 + green * 256 + blue) * 0.1 - 10000 + // and the Terrarium format + // (red * 256 + green + blue / 256) - 32768 + // + if (encoding === 'mapbox') { + return (pixel[0] * 256 * 256 + pixel[1] * 256 + pixel[2]) * 0.1 - 10000; + } + if (encoding === 'terrarium') { + return pixel[0] * 256 + pixel[1] + pixel[2] / 256 - 32768; + } + } + for (pixelY = 0; pixelY <= maxY; ++pixelY) { + y0 = pixelY === 0 ? 0 : pixelY - 1; + y1 = pixelY === maxY ? maxY : pixelY + 1; + for (pixelX = 0; pixelX <= maxX; ++pixelX) { + x0 = pixelX === 0 ? 0 : pixelX - 1; + x1 = pixelX === maxX ? maxX : pixelX + 1; + // determine elevation for (x0, pixelY) + offset = (pixelY * width + x0) * 4; + pixel[0] = elevationData[offset]; + pixel[1] = elevationData[offset + 1]; + pixel[2] = elevationData[offset + 2]; + pixel[3] = elevationData[offset + 3]; + z0 = data.vert * calculateElevation(pixel, encoding); + // determine elevation for (x1, pixelY) + offset = (pixelY * width + x1) * 4; + pixel[0] = elevationData[offset]; + pixel[1] = elevationData[offset + 1]; + pixel[2] = elevationData[offset + 2]; + pixel[3] = elevationData[offset + 3]; + z1 = data.vert * calculateElevation(pixel, encoding); + dzdx = (z1 - z0) / dp; + // determine elevation for (pixelX, y0) + offset = (y0 * width + pixelX) * 4; + pixel[0] = elevationData[offset]; + pixel[1] = elevationData[offset + 1]; + pixel[2] = elevationData[offset + 2]; + pixel[3] = elevationData[offset + 3]; + z0 = data.vert * calculateElevation(pixel, encoding); + // determine elevation for (pixelX, y1) + offset = (y1 * width + pixelX) * 4; + pixel[0] = elevationData[offset]; + pixel[1] = elevationData[offset + 1]; + pixel[2] = elevationData[offset + 2]; + pixel[3] = elevationData[offset + 3]; + z1 = data.vert * calculateElevation(pixel, encoding); + dzdy = (z1 - z0) / dp; + aspect = Math.atan2(dzdy, -dzdx); + if (aspect < 0) { + aspect = halfPi - aspect; + } else if (aspect > halfPi) { + aspect = twoPi - aspect + halfPi; + } else { + aspect = halfPi - aspect; + } + // Bootstrap slope and corresponding incident values + slope = Math.atan(Math.sqrt(dzdx * dzdx + dzdy * dzdy)); + cosIncidence = sinSunEl * Math.cos(slope) + cosSunEl * Math.sin(slope) * Math.cos(sunAz - aspect); + accent = Math.cos(slope); + // 255 for Hex colors + scaled = 255 * cosIncidence; + /* + * The following is heavily inspired + * by [Maplibre's equivalent WebGL shader](https://github.com/maplibre/maplibre-gl-js/blob/main/src/shaders/hillshade.fragment.glsl) + */ + // Forces given value to stay between two given extremes + clamp = Math.min(Math.max(2 * data.sunEl, 0), 1); + // Intensity basis for hillshade opacity + slopeScaleBase = 1.875 - data.opacity * 1.75; + // Intensity interpolation so that higher intensity values create more opaque hillshading + scaledSlope = data.opacity !== 0.5 ? halfPi * ((Math.pow(slopeScaleBase, slope) - 1) / (Math.pow(slopeScaleBase, halfPi) - 1)) : slope; + // Accent hillshade color with given accentColor to emphasize rougher terrain + scaledAccentColor = { + r: (1 - accent) * accentColor.r * clamp * 255, + g: (1 - accent) * accentColor.g * clamp * 255, + b: (1 - accent) * accentColor.b * clamp * 255, + a: (1 - accent) * accentColor.a * clamp * 255 + }; + // Allows highlight vs shadow discrimination + shade = Math.abs(((aspect + sunAz) / Math.PI + 0.5) % 2 - 1); + // Creates a composite color mix between highlight & shadow colors to emphasize slopes + compositeShadeColor = { + r: (highlightColor.r * (1 - shade) + shadowColor.r * shade) * scaled, + g: (highlightColor.g * (1 - shade) + shadowColor.g * shade) * scaled, + b: (highlightColor.b * (1 - shade) + shadowColor.b * shade) * scaled, + a: (highlightColor.a * (1 - shade) + shadowColor.a * shade) * scaled + }; + // Fill in result color value + offset = (pixelY * width + pixelX) * 4; + shadeData[offset] = scaledAccentColor.r * (1 - shade) + compositeShadeColor.r; + shadeData[offset + 1] = scaledAccentColor.g * (1 - shade) + compositeShadeColor.g; + shadeData[offset + 2] = scaledAccentColor.b * (1 - shade) + compositeShadeColor.b; + // Key opacity on the scaledSlope to improve legibility by increasing higher elevation rates' contrast + shadeData[offset + 3] = elevationData[offset + 3] * data.opacity * clamp * Math.sin(scaledSlope); + } + } + return new ImageData(shadeData, width, height); +} + +/* +ol-mapbox-style - Use Mapbox Style objects with OpenLayers +Copyright 2016-present ol-mapbox-style contributors +License: https://raw.githubusercontent.com/openlayers/ol-mapbox-style/master/LICENSE +*/ +/** + * @typedef {Object} FeatureIdentifier + * @property {string|number} id The feature id. + * @property {string} source The source id. + */ +/** + * @typedef {Object} Options + * @property {string} [accessToken] Access token for 'mapbox://' urls. + * @property {function(string, import("./util.js").ResourceType): (Request|string|Promise|void)} [transformRequest] + * Function for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying + * the url, adding headers or setting credentials options. Called with the url and the resource + * type as arguments, this function is supposed to return a `Request` or a url `string`, or a promise tehereof. + * Without a return value the original request will not be modified. + * @property {string} [projection='EPSG:3857'] Only useful when working with non-standard projections. + * Code of a projection registered with OpenLayers. All sources of the style must be provided in this + * projection. The projection must also have a valid extent defined, which will be used to determine the + * origin and resolutions of the tile grid for all tiled sources of the style. When provided, the bbox + * placeholder in tile and geojson urls changes: the default is `{bbox-epsg-3857}`, when projection is e.g. + * set to `EPSG:4326`, the bbox placeholder will be `{bbox-epsg-4326}`. + * @property {Array} [resolutions] Only useful when working with non-standard projections. + * Resolutions for mapping resolution to the `zoom` used in the Mapbox style. + * @property {string} [styleUrl] URL of the Mapbox GL style. Required for styles that were provided + * as object, when they contain a relative sprite url, or sources referencing data by relative url. + * @property {string} [webfonts] Template for resolving webfonts. Can be used to specify where to fetch + * web fonts when no `ol:webfonts` metadata is set in the style object. See `getFonts()` and the + * "Font handling" section in `README.md` for details. + * @property {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined] + * Function that returns an image for an icon name. If the result is an HTMLImageElement, it must already be + * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished. + * This function be used for icons not in the sprite or to override sprite icons. + * @property {string} [accessTokenParam='access_token'] Access token param. For internal use. + */ +/** + * @typedef {Object} ApplyStyleOptions + * @property {string} [source=''] Source. Default is `''`, which causes the first source in the + * style to be used. + * @property {Array} [layers] Layers. If no source is provided, the layers with the + * provided ids will be used from the style's `layers` array. All layers need to use the same source. + * @property {boolean} [updateSource=true] Update or create vector (tile) layer source with parameters + * specified for the source in the mapbox style definition. + */ +/** + * @param {import("ol/proj/Projection.js").default} projection Projection. + * @param {number} [tileSize=512] Tile size. + * @return {Array} Resolutions. + */ +function getTileResolutions(projection, tileSize = 512) { + return projection.getExtent() ? createXYZ({ + extent: projection.getExtent(), + tileSize: tileSize, + maxZoom: 22 + }).getResolutions() : defaultResolutions; +} +/** + * @param {string} styleUrl Style URL. + * @param {Options} options Options. + * @return {Options} Completed options with accessToken and accessTokenParam. + */ +function completeOptions(styleUrl, options) { + if (!options.accessToken) { + options = Object.assign({}, options); + const searchParams = new URL(styleUrl).searchParams; + // The last search parameter is the access token + searchParams.forEach((value, key) => { + options.accessToken = value; + options.accessTokenParam = key; + }); + } + return options; +} +/** + * Applies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector` + * with an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source + * yet, it will be created and populated from the information in the `glStyle` (unless `updateSource` is + * set to `false`). + * + * **Example:** + * ```js + * import {applyStyle} from 'ol-mapbox-style'; + * import {VectorTile} from 'ol/layer.js'; + * + * const layer = new VectorTile({declutter: true}); + * applyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN'); + * ``` + * + * The style function will render all layers from the `glStyle` object that use the source + * of the first layer, the specified `source`, or a subset of layers from the same source. The + * source needs to be a `"type": "vector"` or `"type": "geojson"` source. + * + * Two additional properties will be set on the provided layer: + * + * * `mapbox-source`: The `id` of the Mapbox Style document's source that the + * OpenLayers layer was created from. Usually `apply()` creates one + * OpenLayers layer per Mapbox Style source, unless the layer stack has + * layers from different sources in between. + * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are + * included in the OpenLayers layer. + * + * @param {VectorTileLayer|VectorLayer} layer OpenLayers layer. When the layer has a source configured, + * it will be modified to use the configuration from the glStyle's `source`. Options specified on the + * layer's source will override those from the glStyle's `source`, except for `url` and + * `tileUrlFunction`. When the source projection is the default (`EPSG:3857`), the `tileGrid` will + * also be overridden. If you'd rather not have ol-mapbox-style modify the source, configure `applyStyle()` + * with the `updateSource: false` option. + * @param {string|Object} glStyle Mapbox Style object. + * @param {string|Array|Options&ApplyStyleOptions} [sourceOrLayersOrOptions] Options or + * `source` key or an array of layer `id`s from the Mapbox Style object. When a `source` key is + * provided, all layers for the specified source will be included in the style function. When layer + * `id`s are provided, they must be from layers that use the same source. When not provided or a falsey + * value, all layers using the first source specified in the glStyle will be rendered. + * @param {Options&ApplyStyleOptions|string} [optionsOrPath] **Deprecated**. Options. Alternatively the path of the style file + * (only required when a relative path is used for the `"sprite"` property of the style). + * @param {Array} [resolutions] **Deprecated**. Resolutions for mapping resolution to zoom level. + * Only needed when working with non-standard tile grids or projections, can also be supplied with + * options. + * @return {Promise} Promise which will be resolved when the style can be used + * for rendering. + */ +function applyStyle(layer, glStyle, sourceOrLayersOrOptions = '', optionsOrPath = {}, resolutions = undefined) { + let styleUrl, sourceId; + /** @type {Options&ApplyStyleOptions} */ + let options; + let sourceOrLayers; + let updateSource = true; + if (typeof sourceOrLayersOrOptions !== 'string' && !Array.isArray(sourceOrLayersOrOptions)) { + options = sourceOrLayersOrOptions; + sourceOrLayers = options.source || options.layers; + optionsOrPath = options; + } else { + sourceOrLayers = sourceOrLayersOrOptions; + } + if (typeof optionsOrPath === 'string') { + styleUrl = optionsOrPath; + options = {}; + } else { + styleUrl = optionsOrPath.styleUrl; + options = optionsOrPath; + } + if (options.updateSource === false) { + updateSource = false; + } + if (!resolutions) { + resolutions = options.resolutions; + } + if (!styleUrl && typeof glStyle === 'string' && !glStyle.trim().startsWith('{')) { + styleUrl = glStyle; + } + if (styleUrl) { + styleUrl = styleUrl.startsWith('data:') ? location.href : normalizeStyleUrl(styleUrl, options.accessToken); + options = completeOptions(styleUrl, options); + } + return new Promise(function (resolve, reject) { + // TODO: figure out where best place to check source type is + // Note that the source arg is an array of gl layer ids and each must be + // dereferenced to get source type to validate + getGlStyle(glStyle, options).then(function (glStyle) { + if (glStyle.version != 8) { + return reject(new Error('glStyle version 8 required.')); + } + if (!(layer instanceof VectorLayer || layer instanceof VectorTileLayer)) { + return reject(new Error('Can only apply to VectorLayer or VectorTileLayer')); + } + const type = layer instanceof VectorTileLayer ? 'vector' : 'geojson'; + if (!sourceOrLayers) { + sourceId = Object.keys(glStyle.sources).find(function (key) { + return glStyle.sources[key].type === type; + }); + sourceOrLayers = sourceId; + } else if (Array.isArray(sourceOrLayers)) { + sourceId = glStyle.layers.find(function (layer) { + return layer.id === sourceOrLayers[0]; + }).source; + } else { + sourceId = sourceOrLayers; + } + if (!sourceId) { + return reject(new Error(`No ${ type } source found in the glStyle.`)); + } + function assignSource() { + if (!updateSource) { + return Promise.resolve(); + } + if (layer instanceof VectorTileLayer) { + return setupVectorSource(glStyle.sources[sourceId], styleUrl, options).then(function (source) { + const targetSource = layer.getSource(); + if (!targetSource) { + layer.setSource(source); + } else if (source !== targetSource) { + targetSource.setTileUrlFunction(source.getTileUrlFunction()); + if (typeof targetSource.setUrls === 'function' && typeof source.getUrls === 'function') { + // to get correct keys for tile cache and queue + targetSource.setUrls(source.getUrls()); + } + //@ts-ignore + if (!targetSource.format_) { + //@ts-ignore + targetSource.format_ = source.format_; + } + if (!targetSource.getAttributions()) { + targetSource.setAttributions(source.getAttributions()); + } + if (targetSource.getTileLoadFunction() === defaultLoadFunction) { + targetSource.setTileLoadFunction(source.getTileLoadFunction()); + } + if (equivalent(targetSource.getProjection(), source.getProjection())) { + targetSource.tileGrid = source.getTileGrid(); + } + } + const tileGrid = layer.getSource().getTileGrid(); + if (!isFinite(layer.getMaxResolution()) && !isFinite(layer.getMinZoom()) && tileGrid.getMinZoom() > 0) { + layer.setMaxResolution(getResolutionForZoom(Math.max(0, tileGrid.getMinZoom() - 1e-12), tileGrid.getResolutions())); + } + }); + } + const glSource = glStyle.sources[sourceId]; + let source = layer.getSource(); + if (!source || source.get('mapbox-source') !== glSource) { + source = setupGeoJSONSource(glSource, styleUrl, options); + } + const targetSource = layer.getSource(); + if (!targetSource) { + layer.setSource(source); + } else if (source !== targetSource) { + if (!targetSource.getAttributions()) { + targetSource.setAttributions(source.getAttributions()); + } + //@ts-ignore + if (!targetSource.format_) { + //@ts-ignore + targetSource.format_ = source.getFormat(); + } + //@ts-ignore + targetSource.url_ = source.getUrl(); + } + return Promise.resolve(); + } + let spriteScale, spriteData, spriteImageUrl, style; + function onChange() { + if (!style && (!glStyle.sprite || spriteData)) { + if (options.projection && !resolutions) { + const projection = get$1(options.projection); + const units = projection.getUnits(); + if (units !== 'm') { + resolutions = defaultResolutions.map(resolution => resolution / METERS_PER_UNIT[units]); + } + } + style = stylefunction(layer, glStyle, sourceOrLayers, resolutions, spriteData, spriteImageUrl, (fonts, templateUrl = options.webfonts) => getFonts(fonts, templateUrl), options.getImage); + if (!layer.getStyle()) { + reject(new Error(`Nothing to show for source [${ sourceId }]`)); + } else { + assignSource().then(resolve).catch(reject); + } + } else if (style) { + layer.setStyle(style); + assignSource().then(resolve).catch(reject); + } else { + reject(new Error('Something went wrong trying to apply style.')); + } + } + if (glStyle.sprite) { + const sprite = new URL(normalizeSpriteUrl(glStyle.sprite, options.accessToken, styleUrl || location.href)); + spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1; + const sizeFactor = spriteScale == 0.5 ? '@2x' : ''; + let spriteUrl = sprite.origin + sprite.pathname + sizeFactor + '.json' + sprite.search; + new Promise(function (resolve, reject) { + fetchResource('Sprite', spriteUrl, options).then(resolve).catch(function (error) { + spriteUrl = sprite.origin + sprite.pathname + '.json' + sprite.search; + fetchResource('Sprite', spriteUrl, options).then(resolve).catch(reject); + }); + }).then(function (spritesJson) { + if (spritesJson === undefined) { + reject(new Error('No sprites found.')); + } + spriteData = spritesJson; + spriteImageUrl = sprite.origin + sprite.pathname + sizeFactor + '.png' + sprite.search; + if (options.transformRequest) { + const transformed = options.transformRequest(spriteImageUrl, 'SpriteImage') || spriteImageUrl; + if (transformed instanceof Request || transformed instanceof Promise) { + spriteImageUrl = transformed; + } + } + onChange(); + }).catch(function (err) { + reject(new Error(`Sprites cannot be loaded: ${ spriteUrl }: ${ err.message }`)); + }); + } else { + onChange(); + } + }).catch(reject); + }); +} +const emptyObj = {}; +function setFirstBackground(mapOrLayer, glStyle, options) { + glStyle.layers.some(function (layer) { + if (layer.type === 'background') { + if (mapOrLayer instanceof Layer) { + mapOrLayer.setBackground(function (resolution) { + return getBackgroundColor(layer, resolution, options, {}); + }); + return true; + } + if (mapOrLayer instanceof Map || mapOrLayer instanceof LayerGroup) { + mapOrLayer.getLayers().insertAt(0, setupBackgroundLayer(layer, options, {})); + return true; + } + } + }); +} +/** + * Applies properties of the Mapbox Style's first `background` layer to the + * provided map or layer (group). + * + * **Example:** + * ```js + * import {applyBackground} from 'ol-mapbox-style'; + * import {Map} from 'ol'; + * + * const map = new Map({target: 'map'}); + * applyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN'); + * ``` + * @param {Map|import("ol/layer/Base.js").default} mapOrLayer OpenLayers Map or layer (group). + * @param {Object|string} glStyle Mapbox Style object or url. + * @param {Options} options Options. + * @return {Promise} Promise that resolves when the background is applied. + */ +function applyBackground(mapOrLayer, glStyle, options = {}) { + return getGlStyle(glStyle, options).then(function (glStyle) { + setFirstBackground(mapOrLayer, glStyle, options); + }); +} +function getSourceIdByRef(layers, ref) { + let sourceId; + layers.some(function (layer) { + if (layer.id == ref) { + sourceId = layer.source; + return true; + } + }); + return sourceId; +} +function extentFromTileJSON(tileJSON, projection) { + const bounds = tileJSON.bounds; + if (bounds) { + const ll = fromLonLat([ + bounds[0], + bounds[1] + ], projection); + const tr = fromLonLat([ + bounds[2], + bounds[3] + ], projection); + return [ + ll[0], + ll[1], + tr[0], + tr[1] + ]; + } + return get$1(projection).getExtent(); +} +function sourceOptionsFromTileJSON(glSource, tileJSON, options) { + const tileJSONSource = new TileJSON({ + tileJSON: tileJSON, + tileSize: glSource.tileSize || tileJSON.tileSize || 512 + }); + const tileJSONDoc = tileJSONSource.getTileJSON(); + const tileGrid = tileJSONSource.getTileGrid(); + const projection = get$1(options.projection || 'EPSG:3857'); + const extent = extentFromTileJSON(tileJSONDoc, projection); + const projectionExtent = projection.getExtent(); + const minZoom = tileJSONDoc.minzoom || 0; + const maxZoom = tileJSONDoc.maxzoom || 22; + /** @type {import("ol/source/VectorTile.js").Options} */ + const sourceOptions = { + attributions: tileJSONSource.getAttributions(), + projection: projection, + tileGrid: new TileGrid({ + origin: projectionExtent ? getTopLeft(projectionExtent) : tileGrid.getOrigin(0), + extent: extent || tileGrid.getExtent(), + minZoom: minZoom, + resolutions: getTileResolutions(projection, tileJSON.tileSize).slice(0, maxZoom + 1), + tileSize: tileGrid.getTileSize(0) + }) + }; + if (Array.isArray(tileJSONDoc.tiles)) { + sourceOptions.urls = tileJSONDoc.tiles; + } else { + sourceOptions.url = tileJSONDoc.tiles; + } + return sourceOptions; +} +function getBackgroundColor(glLayer, resolution, options, functionCache) { + const background = { + id: glLayer.id, + type: glLayer.type + }; + const layout = glLayer.layout || {}; + const paint = glLayer.paint || {}; + background['paint'] = paint; + const zoom = getZoomForResolution(resolution, options.resolutions || defaultResolutions); + let opacity; + const bg = getValue(background, 'paint', 'background-color', zoom, emptyObj, functionCache); + if (paint['background-opacity'] !== undefined) { + opacity = getValue(background, 'paint', 'background-opacity', zoom, emptyObj, functionCache); + } + return layout.visibility == 'none' ? undefined : colorWithOpacity(bg, opacity); +} +/** + * @param {Object} glLayer Mapbox Style layer object. + * @param {Options} options Options. + * @param {Object} functionCache Cache for functions. + * @return {Layer} OpenLayers layer. + */ +function setupBackgroundLayer(glLayer, options, functionCache) { + const div = document.createElement('div'); + div.className = 'ol-mapbox-style-background'; + div.style.position = 'absolute'; + div.style.width = '100%'; + div.style.height = '100%'; + return new Layer({ + source: new Source({}), + render(frameState) { + const color = getBackgroundColor(glLayer, frameState.viewState.resolution, options, functionCache); + div.style.backgroundColor = color; + return div; + } + }); +} +/** + * Creates an OpenLayers VectorTile source for a gl source entry. + * @param {Object} glSource "source" entry from a Mapbox Style object. + * @param {string|undefined} styleUrl URL to use for the source. This is expected to be the complete http(s) url, + * with access key applied. + * @param {Options} options Options. + * @return {Promise} Promise resolving to a VectorTile source. + * @private + */ +function setupVectorSource(glSource, styleUrl, options) { + return new Promise(function (resolve, reject) { + getTileJson(glSource, styleUrl, options).then(function ({tileJson, tileLoadFunction}) { + const sourceOptions = sourceOptionsFromTileJSON(glSource, tileJson, options); + sourceOptions.tileLoadFunction = tileLoadFunction; + sourceOptions.format = new MVT(); + resolve(new VectorTileSource(sourceOptions)); + }).catch(reject); + }); +} +function setupVectorLayer(glSource, styleUrl, options) { + const layer = new VectorTileLayer({ + declutter: true, + visible: false + }); + setupVectorSource(glSource, styleUrl, options).then(function (source) { + source.set('mapbox-source', glSource); + layer.setSource(source); + }).catch(function (error) { + layer.setSource(undefined); + }); + return layer; +} +function getBboxTemplate(projection) { + const projCode = projection ? projection.getCode() : 'EPSG:3857'; + return `{bbox-${ projCode.toLowerCase().replace(/[^a-z0-9]/g, '-') }}`; +} +function setupRasterSource(glSource, styleUrl, options) { + return new Promise(function (resolve, reject) { + getTileJson(glSource, styleUrl, options).then(function ({tileJson, tileLoadFunction}) { + const source = new TileJSON({ + interpolate: options.interpolate === undefined ? true : options.interpolate, + transition: 0, + crossOrigin: 'anonymous', + tileJSON: tileJson + }); + source.tileGrid = sourceOptionsFromTileJSON(glSource, tileJson, options).tileGrid; + if (options.projection) { + //@ts-ignore + source.projection = get$1(options.projection); + } + const getTileUrl = source.getTileUrlFunction(); + if (tileLoadFunction) { + source.setTileLoadFunction(tileLoadFunction); + } + source.setTileUrlFunction(function (tileCoord, pixelRatio, projection) { + const bboxTemplate = getBboxTemplate(projection); + let src = getTileUrl(tileCoord, pixelRatio, projection); + if (src.indexOf(bboxTemplate) != -1) { + const bbox = source.getTileGrid().getTileCoordExtent(tileCoord); + src = src.replace(bboxTemplate, bbox.toString()); + } + return src; + }); + source.set('mapbox-source', glSource); + resolve(source); + }).catch(function (error) { + reject(error); + }); + }); +} +function setupRasterLayer(glSource, styleUrl, options) { + const layer = new TileLayer(); + setupRasterSource(glSource, styleUrl, options).then(function (source) { + layer.setSource(source); + }).catch(function () { + layer.setSource(undefined); + }); + return layer; +} +/** + * + * @param {Object} glSource "source" entry from a Mapbox Style object. + * @param {string} styleUrl Style url + * @param {Options} options ol-mapbox-style options. + * @return {ImageLayer} The raster layer + */ +function setupHillshadeLayer(glSource, styleUrl, options) { + const tileLayer = setupRasterLayer(glSource, styleUrl, options); + /** @type {ImageLayer} */ + const layer = new ImageLayer({ + source: new Raster({ + operationType: 'image', + operation: hillshade, + sources: [tileLayer] + }) + }); + return layer; +} +/** + * @param {Object} glSource glStyle source. + * @param {string} styleUrl Style URL. + * @param {Options} options Options. + * @return {VectorSource} Configured vector source. + */ +function setupGeoJSONSource(glSource, styleUrl, options) { + const geoJsonFormat = options.projection ? new GeoJSON({ dataProjection: options.projection }) : new GeoJSON(); + const data = glSource.data; + const sourceOptions = {}; + if (typeof data == 'string') { + const geoJsonUrl = normalizeSourceUrl(data, options.accessToken, options.accessTokenParam || 'access_token', styleUrl || location.href); + if (/\{bbox-[0-9a-z-]+\}/.test(geoJsonUrl)) { + const extentUrl = (extent, resolution, projection) => { + const bboxTemplate = getBboxTemplate(projection); + return geoJsonUrl.replace(bboxTemplate, `${ extent.join(',') }`); + }; + const source = new VectorSource({ + attributions: glSource.attribution, + format: geoJsonFormat, + loader: (extent, resolution, projection, success, failure) => { + const url = typeof extentUrl === 'function' ? extentUrl(extent, resolution, projection) : extentUrl; + fetchResource('GeoJSON', url, options).then(json => { + const features = source.getFormat().readFeatures(json, { featureProjection: projection }); + source.addFeatures(features); + success(features); + }).catch(response => { + source.removeLoadedExtent(extent); + failure(); + }); + }, + strategy: bbox + }); + source.set('mapbox-source', glSource); + return source; + } + const source = new VectorSource({ + attributions: glSource.attribution, + format: geoJsonFormat, + url: geoJsonUrl, + loader: (extent, resolution, projection, success, failure) => { + fetchResource('GeoJSON', geoJsonUrl, options).then(json => { + const features = source.getFormat().readFeatures(json, { featureProjection: projection }); + source.addFeatures(features); + success(features); + }).catch(response => { + source.removeLoadedExtent(extent); + failure(); + }); + } + }); + return source; + } + sourceOptions.features = geoJsonFormat.readFeatures(data, { featureProjection: getUserProjection() || 'EPSG:3857' }); + const source = new VectorSource(Object.assign({ + attributions: glSource.attribution, + format: geoJsonFormat + }, sourceOptions)); + source.set('mapbox-source', glSource); + return source; +} +function setupGeoJSONLayer(glSource, styleUrl, options) { + return new VectorLayer({ + declutter: true, + source: setupGeoJSONSource(glSource, styleUrl, options), + visible: false + }); +} +function prerenderRasterLayer(glLayer, layer, functionCache) { + let zoom = null; + return function (event) { + if (glLayer.paint && 'raster-opacity' in glLayer.paint && event.frameState.viewState.zoom !== zoom) { + zoom = event.frameState.viewState.zoom; + delete functionCache[glLayer.id]; + updateRasterLayerProperties(glLayer, layer, zoom, functionCache); + } + }; +} +function updateRasterLayerProperties(glLayer, layer, zoom, functionCache) { + const opacity = getValue(glLayer, 'paint', 'raster-opacity', zoom, emptyObj, functionCache); + layer.setOpacity(opacity); +} +function manageVisibility(layer, mapOrGroup) { + function onChange() { + const glStyle = mapOrGroup.get('mapbox-style'); + if (!glStyle) { + return; + } + const mapboxLayers = derefLayers(glStyle.layers); + const layerMapboxLayerids = layer.get('mapbox-layers'); + const visible = mapboxLayers.filter(function (mapboxLayer) { + return layerMapboxLayerids.includes(mapboxLayer.id); + }).some(function (mapboxLayer) { + return !mapboxLayer.layout || !mapboxLayer.layout.visibility || mapboxLayer.layout.visibility === 'visible'; + }); + if (layer.get('visible') !== visible) { + layer.setVisible(visible); + } + } + layer.on('change', onChange); + onChange(); +} +function setupLayer(glStyle, styleUrl, glLayer, options) { + const functionCache = getFunctionCache(glStyle); + const glLayers = glStyle.layers; + const type = glLayer.type; + const id = glLayer.source || getSourceIdByRef(glLayers, glLayer.ref); + const glSource = glStyle.sources[id]; + let layer; + if (type == 'background') { + layer = setupBackgroundLayer(glLayer, options, functionCache); + } else if (glSource.type == 'vector') { + layer = setupVectorLayer(glSource, styleUrl, options); + } else if (glSource.type == 'raster') { + layer = setupRasterLayer(glSource, styleUrl, options); + layer.setVisible(glLayer.layout ? glLayer.layout.visibility !== 'none' : true); + layer.on('prerender', prerenderRasterLayer(glLayer, layer, functionCache)); + } else if (glSource.type == 'geojson') { + layer = setupGeoJSONLayer(glSource, styleUrl, options); + } else if (glSource.type == 'raster-dem' && glLayer.type == 'hillshade') { + const hillshadeLayer = setupHillshadeLayer(glSource, styleUrl, options); + layer = hillshadeLayer; + hillshadeLayer.getSource().on('beforeoperations', function (event) { + const data = event.data; + data.resolution = getPointResolution(options.projection || 'EPSG:3857', event.resolution, getCenter(event.extent), 'm'); + const zoom = getZoomForResolution(event.resolution, options.resolutions || defaultResolutions); + data.encoding = glSource.encoding; + data.vert = 5 * getValue(glLayer, 'paint', 'hillshade-exaggeration', zoom, emptyObj, functionCache); + data.sunAz = getValue(glLayer, 'paint', 'hillshade-illumination-direction', zoom, emptyObj, functionCache); + data.sunEl = 35; + data.opacity = 0.3; + data.highlightColor = getValue(glLayer, 'paint', 'hillshade-highlight-color', zoom, emptyObj, functionCache); + data.shadowColor = getValue(glLayer, 'paint', 'hillshade-shadow-color', zoom, emptyObj, functionCache); + data.accentColor = getValue(glLayer, 'paint', 'hillshade-accent-color', zoom, emptyObj, functionCache); + }); + layer.setVisible(glLayer.layout ? glLayer.layout.visibility !== 'none' : true); + } + const glSourceId = id; + if (layer) { + layer.set('mapbox-source', glSourceId); + } + return layer; +} +/** + * @param {*} glStyle Mapbox Style. + * @param {Map|LayerGroup} mapOrGroup Map or layer group. + * @param {string} styleUrl Style URL. + * @param {Options} options Options. + * @return {Promise} Promise that resolves when the style is loaded. + */ +function processStyle(glStyle, mapOrGroup, styleUrl, options) { + const promises = []; + let view = null; + if (mapOrGroup instanceof Map) { + view = mapOrGroup.getView(); + if (!view.isDef() && !view.getRotation() && !view.getResolutions()) { + const projection = options.projection ? get$1(options.projection) : view.getProjection(); + view = new View(Object.assign(view.getProperties(), { + maxResolution: defaultResolutions[0] / METERS_PER_UNIT[projection.getUnits()], + projection: options.projection || view.getProjection() + })); + mapOrGroup.setView(view); + } + if ('center' in glStyle && !view.getCenter()) { + view.setCenter(fromLonLat(glStyle.center, view.getProjection())); + } + if ('zoom' in glStyle && view.getZoom() === undefined) { + view.setResolution(defaultResolutions[0] / METERS_PER_UNIT[view.getProjection().getUnits()] / Math.pow(2, glStyle.zoom)); + } + if (!view.getCenter() || view.getZoom() === undefined) { + view.fit(view.getProjection().getExtent(), { + nearest: true, + size: mapOrGroup.getSize() + }); + } + } + mapOrGroup.set('mapbox-style', glStyle); + mapOrGroup.set('mapbox-metadata', { + styleUrl, + options + }); + const glLayers = glStyle.layers; + let layerIds = []; + let layer, glSourceId, id; + for (let i = 0, ii = glLayers.length; i < ii; ++i) { + const glLayer = glLayers[i]; + const type = glLayer.type; + if (type == 'heatmap') { + //FIXME Unsupported layer type + // eslint-disable-next-line no-console + console.debug(`layers[${ i }].type "${ type }" not supported`); + continue; + } else { + id = glLayer.source || getSourceIdByRef(glLayers, glLayer.ref); + // this technique assumes gl layers will be in a particular order + if (!id || id != glSourceId) { + if (layerIds.length) { + promises.push(finalizeLayer(layer, layerIds, glStyle, styleUrl, mapOrGroup, options)); + layerIds = []; + } + layer = setupLayer(glStyle, styleUrl, glLayer, options); + if (!(layer instanceof VectorLayer || layer instanceof VectorTileLayer)) { + layerIds = []; + } + glSourceId = layer.get('mapbox-source'); + } + layerIds.push(glLayer.id); + } + } + promises.push(finalizeLayer(layer, layerIds, glStyle, styleUrl, mapOrGroup, options)); + return Promise.all(promises); +} +/** + * Loads and applies a Mapbox Style object into an OpenLayers Map or LayerGroup. + * This includes the map background, the layers, and for Map instances that did not + * have a View defined yet also the center and the zoom. + * + * **Example:** + * ```js + * import apply from 'ol-mapbox-style'; + * + * apply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'}); + * ``` + * + * The center and zoom will only be set if present in the Mapbox Style document, + * and if not already set on the OpenLayers map. + * + * Layers will be added to the OpenLayers map, without affecting any layers that + * might already be set on the map. + * + * Layers added by `apply()` will have two additional properties: + * + * * `mapbox-source`: The `id` of the Mapbox Style document's source that the + * OpenLayers layer was created from. Usually `apply()` creates one + * OpenLayers layer per Mapbox Style source, unless the layer stack has + * layers from different sources in between. + * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are + * included in the OpenLayers layer. + * + * This function sets an additional `mapbox-style` property on the OpenLayers + * Map or LayerGroup instance, which holds the Mapbox Style object. + * + * @param {Map|HTMLElement|string|LayerGroup} mapOrGroupOrElement Either an existing + * OpenLayers Map instance, or a HTML element, or the id of a HTML element that will be + * the target of a new OpenLayers Map, or a layer group. If layer group, styles + * releated to the map and view will be ignored. + * @param {string|Object} style JSON style object or style url pointing to a + * Mapbox Style object. When using Mapbox APIs, the url is the `styleUrl` + * shown in Mapbox Studio's "share" panel. In addition, the `accessToken` option + * (see below) must be set. + * When passed as JSON style object, all OpenLayers layers created by `apply()` + * will be immediately available, but they may not have a source yet (i.e. when + * they are defined by a TileJSON url in the Mapbox Style document). When passed + * as style url, layers will be added to the map when the Mapbox Style document + * is loaded and parsed. + * @param {Options} options Options. + * @return {Promise} A promise that resolves after all layers have been added to + * the OpenLayers Map instance or LayerGroup, their sources set, and their styles applied. The + * `resolve` callback will be called with the OpenLayers Map instance or LayerGroup as + * argument. + */ +function apply(mapOrGroupOrElement, style, options = {}) { + let promise; + /** @type {Map|LayerGroup} */ + let mapOrGroup; + if (typeof mapOrGroupOrElement === 'string' || mapOrGroupOrElement instanceof HTMLElement) { + mapOrGroup = new Map({ target: mapOrGroupOrElement }); + } else { + mapOrGroup = mapOrGroupOrElement; + } + if (typeof style === 'string') { + const styleUrl = style.startsWith('data:') ? location.href : normalizeStyleUrl(style, options.accessToken); + options = completeOptions(styleUrl, options); + promise = new Promise(function (resolve, reject) { + getGlStyle(style, options).then(function (glStyle) { + processStyle(glStyle, mapOrGroup, styleUrl, options).then(function () { + resolve(mapOrGroup); + }).catch(reject); + }).catch(function (err) { + reject(new Error(`Could not load ${ style }: ${ err.message }`)); + }); + }); + } else { + promise = new Promise(function (resolve, reject) { + processStyle(style, mapOrGroup, !options.styleUrl || options.styleUrl.startsWith('data:') ? location.href : normalizeStyleUrl(options.styleUrl, options.accessToken), options).then(function () { + resolve(mapOrGroup); + }).catch(reject); + }); + } + return promise; +} +/** + * If layerIds is not empty, applies the style specified in glStyle to the layer, + * and adds the layer to the map. + * + * The layer may not yet have a source when the function is called. If so, the style + * is applied to the layer via a once listener on the 'change:source' event. + * + * @param {Layer} layer An OpenLayers layer instance. + * @param {Array} layerIds Array containing layer ids of already-processed layers. + * @param {Object} glStyle Style as a JSON object. + * @param {string|undefined} styleUrl The original style URL. Only required + * when a relative path is used with the `"sprite"` property of the style. + * @param {Map|LayerGroup} mapOrGroup OpenLayers Map. + * @param {Options} options Options. + * @return {Promise} Returns a promise that resolves after the source has + * been set on the specified layer, and the style has been applied. + */ +function finalizeLayer(layer, layerIds, glStyle, styleUrl, mapOrGroup, options = {}) { + let minZoom = 24; + let maxZoom = 0; + const glLayers = glStyle.layers; + for (let i = 0, ii = glLayers.length; i < ii; ++i) { + const glLayer = glLayers[i]; + if (layerIds.indexOf(glLayer.id) !== -1) { + minZoom = Math.min('minzoom' in glLayer ? glLayer.minzoom : 0, minZoom); + maxZoom = Math.max('maxzoom' in glLayer ? glLayer.maxzoom : 24, maxZoom); + } + } + return new Promise(function (resolve, reject) { + const setStyle = function () { + const source = layer.getSource(); + if (!source || source.getState() === 'error') { + reject(new Error('Error accessing data for source ' + layer.get('mapbox-source'))); + return; + } + if ('getTileGrid' in source) { + const tileGrid = /** @type {import("ol/source/Tile.js").default|import("ol/source/VectorTile.js").default} */ + source.getTileGrid(); + if (tileGrid) { + const sourceMinZoom = tileGrid.getMinZoom(); + if (minZoom > 0 || sourceMinZoom > 0) { + layer.setMaxResolution(Math.min(getResolutionForZoom(Math.max(0, minZoom - 1e-12), defaultResolutions), getResolutionForZoom(Math.max(0, sourceMinZoom - 1e-12), tileGrid.getResolutions()))); + } + if (maxZoom < 24) { + layer.setMinResolution(getResolutionForZoom(maxZoom, defaultResolutions)); + } + } + } else { + if (minZoom > 0) { + layer.setMaxResolution(getResolutionForZoom(Math.max(0, minZoom - 1e-12), defaultResolutions)); + } + } + if (source instanceof VectorSource || source instanceof VectorTileSource) { + applyStyle(layer, glStyle, layerIds, Object.assign({ styleUrl: styleUrl }, options)).then(function () { + manageVisibility(layer, mapOrGroup); + resolve(); + }).catch(reject); + } else { + resolve(); + } + }; + layer.set('mapbox-layers', layerIds); + const layers = mapOrGroup.getLayers(); + if (layers.getArray().indexOf(layer) === -1) { + layers.push(layer); + } + if (layer.getSource()) { + setStyle(); + } else { + layer.once('change:source', setStyle); + } + }); +} +/** + * Get the Mapbox Layer object for the provided `layerId`. + * @param {Map|LayerGroup} mapOrGroup Map or LayerGroup. + * @param {string} layerId Mapbox Layer id. + * @return {Object} Mapbox Layer object. + */ +function getMapboxLayer(mapOrGroup, layerId) { + const style = mapOrGroup.get('mapbox-style'); + const layerStyle = style.layers.find(function (layer) { + return layer.id === layerId; + }); + return layerStyle; +} +/** + * Add a new Mapbox Layer object to the style. The map will be re-rendered. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {Object} mapboxLayer Mapbox Layer object. + * @param {string} [beforeLayerId] Optional id of the Mapbox Layer before the new layer that will be added. + * @return {Promise} Resolves when the added layer is available. + */ +function addMapboxLayer(mapOrGroup, mapboxLayer, beforeLayerId) { + const glStyle = mapOrGroup.get('mapbox-style'); + const mapboxLayers = glStyle.layers; + let spliceIndex; + let sourceIndex = -1; + if (beforeLayerId !== undefined) { + const beforeMapboxLayer = getMapboxLayer(mapOrGroup, beforeLayerId); + if (beforeMapboxLayer === undefined) { + throw new Error(`Layer with id "${ beforeLayerId }" not found.`); + } + spliceIndex = mapboxLayers.indexOf(beforeMapboxLayer); + } else { + spliceIndex = mapboxLayers.length; + } + let sourceOffset; + if (spliceIndex > 0 && mapboxLayers[spliceIndex - 1].source === mapboxLayer.source) { + sourceIndex = spliceIndex - 1; + sourceOffset = -1; + } else if (spliceIndex < mapboxLayers.length && mapboxLayers[spliceIndex].source === mapboxLayer.source) { + sourceIndex = spliceIndex; + sourceOffset = 0; + } + if (sourceIndex === -1) { + const {options, styleUrl} = mapOrGroup.get('mapbox-metadata'); + const layer = setupLayer(glStyle, styleUrl, mapboxLayer, options); + if (beforeLayerId) { + const beforeLayer = getLayer(mapOrGroup, beforeLayerId); + const beforeLayerIndex = mapOrGroup.getLayers().getArray().indexOf(beforeLayer); + mapOrGroup.getLayers().insertAt(beforeLayerIndex, layer); + } + mapboxLayers.splice(spliceIndex, 0, mapboxLayer); + return finalizeLayer(layer, [mapboxLayer.id], glStyle, styleUrl, mapOrGroup, options); + } + if (mapboxLayers.some(layer => layer.id === mapboxLayer.id)) { + throw new Error(`Layer with id "${ mapboxLayer.id }" already exists.`); + } + const sourceLayerId = mapboxLayers[sourceIndex].id; + const args = styleFunctionArgs[getStyleFunctionKey(mapOrGroup.get('mapbox-style'), getLayer(mapOrGroup, sourceLayerId))]; + mapboxLayers.splice(spliceIndex, 0, mapboxLayer); + if (args) { + const [olLayer, glStyle, sourceOrLayers, resolutions, spriteData, spriteImageUrl, getFonts, getImage] = args; + if (Array.isArray(sourceOrLayers)) { + const layerIndex = sourceOrLayers.indexOf(sourceLayerId) + sourceOffset; + sourceOrLayers.splice(layerIndex, 0, mapboxLayer.id); + } + stylefunction(olLayer, glStyle, sourceOrLayers, resolutions, spriteData, spriteImageUrl, getFonts, getImage); + } else { + getLayer(mapOrGroup, mapboxLayers[sourceIndex].id).changed(); + } + return Promise.resolve(); +} +/** + * Update a Mapbox Layer object in the style. The map will be re-rendered with the new style. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {Object} mapboxLayer Updated Mapbox Layer object. + */ +function updateMapboxLayer(mapOrGroup, mapboxLayer) { + const glStyle = mapOrGroup.get('mapbox-style'); + const mapboxLayers = glStyle.layers; + const index = mapboxLayers.findIndex(function (layer) { + return layer.id === mapboxLayer.id; + }); + if (index === -1) { + throw new Error(`Layer with id "${ mapboxLayer.id }" not found.`); + } + const oldLayer = mapboxLayers[index]; + if (oldLayer.source !== mapboxLayer.source) { + throw new Error('Updated layer and previous version must use the same source.'); + } + delete getFunctionCache(glStyle)[mapboxLayer.id]; + delete getFilterCache(glStyle)[mapboxLayer.id]; + mapboxLayers[index] = mapboxLayer; + const args = styleFunctionArgs[getStyleFunctionKey(mapOrGroup.get('mapbox-style'), getLayer(mapOrGroup, mapboxLayer.id))]; + if (args) { + stylefunction.apply(undefined, args); + } else { + getLayer(mapOrGroup, mapboxLayer.id).changed(); + } +} +/** + * Updates a Mapbox source object in the style. The according OpenLayers source will be replaced + * and the map will be re-rendered. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {string} id Key of the source in the `sources` object literal. + * @param {Object} mapboxSource Mapbox source object. + * @return {Promise} Promise that resolves when the source has been updated. + */ +function updateMapboxSource(mapOrGroup, id, mapboxSource) { + const currentSource = getSource(mapOrGroup, id); + const layers = mapOrGroup.getLayers().getArray().filter(function (layer) { + return (layer instanceof VectorLayer || layer instanceof TileLayer || layer instanceof VectorTileLayer) && layer.getSource() === currentSource; + }); + const metadata = mapOrGroup.get('mapbox-metadata'); + let newSourcePromise; + switch (mapboxSource.type) { + case 'vector': + newSourcePromise = setupVectorSource(mapboxSource, metadata.styleUrl, metadata.options); + break; + case 'geojson': + newSourcePromise = Promise.resolve(setupGeoJSONSource(mapboxSource, metadata.styleUrl, metadata.options)); + break; + case 'raster': + case 'raster-dem': + newSourcePromise = setupRasterSource(mapboxSource, metadata.styleUrl, metadata.options); + break; + default: + return Promise.reject(new Error('Unsupported source type ' + mapboxSource.type)); + } + newSourcePromise.then(function (newSource) { + layers.forEach(function (layer) { + layer.setSource(newSource); + }); + }); + return newSourcePromise; +} +/** + * Remove a Mapbox Layer object from the style. The map will be re-rendered. + * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on. + * @param {string|Object} mapboxLayerIdOrLayer Mapbox Layer id or Mapbox Layer object. + */ +function removeMapboxLayer(mapOrGroup, mapboxLayerIdOrLayer) { + const mapboxLayerId = typeof mapboxLayerIdOrLayer === 'string' ? mapboxLayerIdOrLayer : mapboxLayerIdOrLayer.id; + const layer = getLayer(mapOrGroup, mapboxLayerId); + /** @type {Array} */ + const layerMapboxLayers = layer.get('mapbox-layers'); + if (layerMapboxLayers.length === 1) { + throw new Error('Cannot remove last Mapbox layer from an OpenLayers layer.'); + } + layerMapboxLayers.splice(layerMapboxLayers.indexOf(mapboxLayerId), 1); + const glStyle = mapOrGroup.get('mapbox-style'); + const layers = glStyle.layers; + layers.splice(layers.findIndex(layer => layer.id === mapboxLayerId), 1); + const args = styleFunctionArgs[getStyleFunctionKey(glStyle, layer)]; + if (args) { + const [olLayer, glStyle, sourceOrLayers, resolutions, spriteData, spriteImageUrl, getFonts, getImage] = args; + if (Array.isArray(sourceOrLayers)) { + sourceOrLayers.splice(sourceOrLayers.findIndex(layer => layer === mapboxLayerId), 1); + } + stylefunction(olLayer, glStyle, sourceOrLayers, resolutions, spriteData, spriteImageUrl, getFonts, getImage); + } else { + getLayer(mapOrGroup, mapboxLayerId).changed(); + } +} +/** + * Get the OpenLayers layer instance that contains the provided Mapbox Style + * `layer`. Note that multiple Mapbox Style layers are combined in a single + * OpenLayers layer instance when they use the same Mapbox Style `source`. + * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup. + * @param {string} layerId Mapbox Style layer id. + * @return {Layer} OpenLayers layer instance. + */ +function getLayer(map, layerId) { + const layers = map.getLayers().getArray(); + for (let i = 0, ii = layers.length; i < ii; ++i) { + const mapboxLayers = layers[i].get('mapbox-layers'); + if (mapboxLayers && mapboxLayers.indexOf(layerId) !== -1) { + return layers[i]; + } + } + return undefined; +} +/** + * Get the OpenLayers layer instances for the provided Mapbox Style `source`. + * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup. + * @param {string} sourceId Mapbox Style source id. + * @return {Array} OpenLayers layer instances. + */ +function getLayers(map, sourceId) { + const result = []; + const layers = map.getLayers().getArray(); + for (let i = 0, ii = layers.length; i < ii; ++i) { + if (layers[i].get('mapbox-source') === sourceId) { + result.push(layers[i]); + } + } + return result; +} +/** + * Get the OpenLayers source instance for the provided Mapbox Style `source`. + * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup. + * @param {string} sourceId Mapbox Style source id. + * @return {Source} OpenLayers source instance. + */ +function getSource(map, sourceId) { + const layers = map.getLayers().getArray(); + for (let i = 0, ii = layers.length; i < ii; ++i) { + const source = /** @type {Layer} */ + layers[i].getSource(); + if (layers[i].get('mapbox-source') === sourceId) { + return source; + } + } + return undefined; +} +/** + * Sets or removes a feature state. The feature state is taken into account for styling, + * just like the feature's properties, and can be used e.g. to conditionally render selected + * features differently. + * + * The feature state will be stored on the OpenLayers layer matching the feature identifier, in the + * `mapbox-featurestate` property. + * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer OpenLayers Map or layer to set the feature + * state on. + * @param {FeatureIdentifier} feature Feature identifier. + * @param {Object|null} state Feature state. Set to `null` to remove the feature state. + */ +function setFeatureState(mapOrLayer, feature, state) { + const layers = 'getLayers' in mapOrLayer ? getLayers(mapOrLayer, feature.source) : [mapOrLayer]; + for (let i = 0, ii = layers.length; i < ii; ++i) { + const featureState = layers[i].get('mapbox-featurestate'); + if (featureState) { + if (state) { + featureState[feature.id] = state; + } else { + delete featureState[feature.id]; + } + layers[i].changed(); + } else { + throw new Error(`Map or layer for source "${ feature.source }" not found.`); + } + } +} +/** + * Sets or removes a feature state. The feature state is taken into account for styling, + * just like the feature's properties, and can be used e.g. to conditionally render selected + * features differently. + * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer Map or layer to set the feature state on. + * @param {FeatureIdentifier} feature Feature identifier. + * @return {Object|null} Feature state or `null` when no feature state is set for the given + * feature identifier. + */ +function getFeatureState(mapOrLayer, feature) { + const layers = 'getLayers' in mapOrLayer ? getLayers(mapOrLayer, feature.source) : [mapOrLayer]; + for (let i = 0, ii = layers.length; i < ii; ++i) { + const featureState = layers[i].get('mapbox-featurestate'); + if (featureState && featureState[feature.id]) { + return featureState[feature.id]; + } + } + return undefined; +} + +/** @typedef {import("ol/Map.js").default} Map */ +/** + * @classdesc + * Event emitted on configuration or loading error. + */ +class ErrorEvent extends BaseEvent { + /** + * @param {Error} error error object. + */ + constructor(error) { + super(EventType.ERROR); + /** + * @type {Error} + */ + this.error = error; + } +} +/** + * @typedef {Object} Options + * @property {string} styleUrl The URL of the Mapbox style object to use for this layer. For a + * style created with Mapbox Studio and hosted on Mapbox, this will look like + * 'mapbox://styles/you/your-style'. + * @property {string} [accessToken] The access token for your Mapbox style. This has to be provided + * for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query + * parameter of the style url. + * @property {string} [source] If your style uses more than one source, you need to use either the + * `source` property or the `layers` property to limit rendering to a single vector source. The + * `source` property corresponds to the id of a vector source in your Mapbox style. + * @property {Array} [layers] Limit rendering to the list of included layers. All layers + * must share the same vector source. If your style uses more than one source, you need to use + * either the `source` property or the `layers` property to limit rendering to a single vector + * source. + * @property {boolean} [declutter=true] Declutter images and text. Decluttering is applied to all + * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority + * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features. + * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has + * higher priority. + * + * As an optimization decluttered features from layers with the same `className` are rendered above + * the fill and stroke styles of all of those layers regardless of z-index. To opt out of this + * behavior and place declutterd features with their own layer configure the layer with a `className` + * other than `ol-layer`. + * @property {import("ol/layer/Base.js").BackgroundColor|false} [background] Background color for the layer. + * If not specified, the background from the Mapbox style object will be used. Set to `false` to prevent + * the Mapbox style's background from being used. + * @property {string} [className='ol-layer'] A CSS class name to set to the layer element. + * @property {number} [opacity=1] Opacity (0, 1). + * @property {boolean} [visible=true] Visibility. + * @property {import("ol/extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be + * rendered outside of this extent. + * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers + * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed + * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()` + * method was used. + * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be + * visible. + * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will + * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will + * match the style source's `minzoom`. + * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will + * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match + * the style source's `minzoom`. + * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will + * be visible. + * @property {import("ol/render.js").OrderFunction} [renderOrder] Render order. Function to be used when sorting + * features before rendering. By default features are drawn in the order that they are created. Use + * `null` to avoid the sort, but get an undefined draw order. + * @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the + * renderer when getting features from the vector tile for the rendering or hit-detection. + * Recommended value: Vector tiles are usually generated with a buffer, so this value should match + * the largest possible buffer of the used tiles. It should be at least the size of the largest + * point symbol or line width. + * @property {import("ol/layer/VectorTile.js").VectorTileRenderType} [renderMode='hybrid'] Render mode for vector tiles: + * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom + * animations. Point symbols and texts are accurately rendered as vectors and can stay upright on + * rotated views. + * * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector + * tile layers with only a few rendered features (e.g. for highlighting a subset of features of + * another layer with the same source). + * @property {import("ol/Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage + * this layer in its layers collection, and the layer will be rendered on top. This is useful for + * temporary layers. The standard way to add a layer to a map and have it managed by the map is to + * use `map.addLayer()`. + * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be + * recreated during animations. This means that no vectors will be shown clipped, but the setting + * will have a performance impact for large amounts of vector data. When set to `false`, batches + * will be recreated when no animation is active. + * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will be + * recreated during interactions. See also `updateWhileAnimating`. + * @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0` + * means no preloading. + * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error. + * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`. + */ +/** + * @classdesc + * ```js + * import {MapboxVectorLayer} from 'ol-mapbox-style'; + * ``` + * A vector tile layer based on a Mapbox style that uses a single vector source. Configure + * the layer with the `styleUrl` and `accessToken` shown in Mapbox Studio's share panel. + * If the style uses more than one source, use the `source` property to choose a single + * vector source. If you want to render a subset of the layers in the style, use the `layers` + * property (all layers must share the same vector source). See the constructor options for + * more detail. + * + * const map = new Map({ + * view: new View({ + * center: [0, 0], + * zoom: 1, + * }), + * layers: [ + * new MapboxVectorLayer({ + * styleUrl: 'mapbox://styles/mapbox/bright-v9', + * accessToken: 'your-mapbox-access-token-here', + * }), + * ], + * target: 'map', + * }); + * + * On configuration or loading error, the layer will trigger an `'error'` event. Listeners + * will receive an object with an `error` property that can be used to diagnose the problem. + * + * **Note for users of the full build**: The `MapboxVectorLayer` requires the + * [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) library to be loaded as well. + * + * @param {Options} options Options. + * @extends {VectorTileLayer} + * @fires module:ol/events/Event~BaseEvent#event:error + * @api + */ +class MapboxVectorLayer extends VectorTileLayer { + /** + * @param {Options} options Layer options. At a minimum, `styleUrl` and `accessToken` + * must be provided. + */ + constructor(options) { + const declutter = 'declutter' in options ? options.declutter : true; + const source = new VectorTileSource({ + state: 'loading', + format: new MVT() + }); + super({ + source: source, + background: options.background, + declutter: declutter, + className: options.className, + opacity: options.opacity, + visible: options.visible, + zIndex: options.zIndex, + minResolution: options.minResolution, + maxResolution: options.maxResolution, + minZoom: options.minZoom, + maxZoom: options.maxZoom, + renderOrder: options.renderOrder, + renderBuffer: options.renderBuffer, + renderMode: options.renderMode, + map: options.map, + updateWhileAnimating: options.updateWhileAnimating, + updateWhileInteracting: options.updateWhileInteracting, + preload: options.preload, + useInterimTilesOnError: options.useInterimTilesOnError, + properties: options.properties + }); + if (options.accessToken) { + this.accessToken = options.accessToken; + } + const url = options.styleUrl; + const promises = [applyStyle(this, url, options.layers || options.source, { accessToken: this.accessToken })]; + if (this.getBackground() === undefined) { + promises.push(applyBackground(this, options.styleUrl, { accessToken: this.accessToken })); + } + Promise.all(promises).then(() => { + source.setState('ready'); + }).catch(error => { + this.dispatchEvent(new ErrorEvent(error)); + const source = this.getSource(); + source.setState('error'); + }); + } +} + +export { MapboxVectorLayer, addMapboxLayer, apply, applyBackground, applyStyle, apply as default, getFeatureState, getLayer, getLayers, getMapboxLayer, getSource, getStyleForLayer, recordStyleLayer, removeMapboxLayer, renderTransparent, setFeatureState, stylefunction, updateMapboxLayer, updateMapboxSource }; +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 00000000..19edd7e8 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../node_modules/csscolorparser/csscolorparser.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/color.js","../node_modules/@mapbox/mapbox-gl-style-spec/function/convert.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/parsing_error.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/scope.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/types.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/types/collator.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/types/formatted.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/types/resolved_image.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/values.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/literal.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/runtime_error.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/assertion.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/format.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/image.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/coercion.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/evaluation_context.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/compound_expression.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/collator.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/within.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/is_constant.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/var.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/parsing_context.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/stops.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/step.js","../node_modules/@mapbox/unitbezier/index.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/interpolate.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/color_spaces.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/interpolate.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/coalesce.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/let.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/at.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/in.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/index_of.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/match.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/case.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/slice.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/comparison.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/number_format.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/length.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/index.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/result.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/properties.js","../node_modules/@mapbox/mapbox-gl-style-spec/function/index.js","../node_modules/@mapbox/mapbox-gl-style-spec/expression/index.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/unbundle_jsonlint.js","../node_modules/@mapbox/mapbox-gl-style-spec/reference/v8.json","../node_modules/@mapbox/mapbox-gl-style-spec/feature_filter/index.js","../node_modules/@mapbox/mapbox-gl-style-spec/util/ref_properties.js","../node_modules/@mapbox/mapbox-gl-style-spec/deref.js","../node_modules/mapbox-to-css-font/index.js","../src/mapbox.js","../src/util.js","../src/text.js","../src/stylefunction.js","../src/shaders.js","../src/apply.js","../src/MapboxVectorLayer.js"],"sourcesContent":["// (c) Dean McNamee , 2012.\n//\n// https://github.com/deanm/css-color-parser-js\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n// http://www.w3.org/TR/css3-color/\nvar kCSSColorTable = {\n \"transparent\": [0,0,0,0], \"aliceblue\": [240,248,255,1],\n \"antiquewhite\": [250,235,215,1], \"aqua\": [0,255,255,1],\n \"aquamarine\": [127,255,212,1], \"azure\": [240,255,255,1],\n \"beige\": [245,245,220,1], \"bisque\": [255,228,196,1],\n \"black\": [0,0,0,1], \"blanchedalmond\": [255,235,205,1],\n \"blue\": [0,0,255,1], \"blueviolet\": [138,43,226,1],\n \"brown\": [165,42,42,1], \"burlywood\": [222,184,135,1],\n \"cadetblue\": [95,158,160,1], \"chartreuse\": [127,255,0,1],\n \"chocolate\": [210,105,30,1], \"coral\": [255,127,80,1],\n \"cornflowerblue\": [100,149,237,1], \"cornsilk\": [255,248,220,1],\n \"crimson\": [220,20,60,1], \"cyan\": [0,255,255,1],\n \"darkblue\": [0,0,139,1], \"darkcyan\": [0,139,139,1],\n \"darkgoldenrod\": [184,134,11,1], \"darkgray\": [169,169,169,1],\n \"darkgreen\": [0,100,0,1], \"darkgrey\": [169,169,169,1],\n \"darkkhaki\": [189,183,107,1], \"darkmagenta\": [139,0,139,1],\n \"darkolivegreen\": [85,107,47,1], \"darkorange\": [255,140,0,1],\n \"darkorchid\": [153,50,204,1], \"darkred\": [139,0,0,1],\n \"darksalmon\": [233,150,122,1], \"darkseagreen\": [143,188,143,1],\n \"darkslateblue\": [72,61,139,1], \"darkslategray\": [47,79,79,1],\n \"darkslategrey\": [47,79,79,1], \"darkturquoise\": [0,206,209,1],\n \"darkviolet\": [148,0,211,1], \"deeppink\": [255,20,147,1],\n \"deepskyblue\": [0,191,255,1], \"dimgray\": [105,105,105,1],\n \"dimgrey\": [105,105,105,1], \"dodgerblue\": [30,144,255,1],\n \"firebrick\": [178,34,34,1], \"floralwhite\": [255,250,240,1],\n \"forestgreen\": [34,139,34,1], \"fuchsia\": [255,0,255,1],\n \"gainsboro\": [220,220,220,1], \"ghostwhite\": [248,248,255,1],\n \"gold\": [255,215,0,1], \"goldenrod\": [218,165,32,1],\n \"gray\": [128,128,128,1], \"green\": [0,128,0,1],\n \"greenyellow\": [173,255,47,1], \"grey\": [128,128,128,1],\n \"honeydew\": [240,255,240,1], \"hotpink\": [255,105,180,1],\n \"indianred\": [205,92,92,1], \"indigo\": [75,0,130,1],\n \"ivory\": [255,255,240,1], \"khaki\": [240,230,140,1],\n \"lavender\": [230,230,250,1], \"lavenderblush\": [255,240,245,1],\n \"lawngreen\": [124,252,0,1], \"lemonchiffon\": [255,250,205,1],\n \"lightblue\": [173,216,230,1], \"lightcoral\": [240,128,128,1],\n \"lightcyan\": [224,255,255,1], \"lightgoldenrodyellow\": [250,250,210,1],\n \"lightgray\": [211,211,211,1], \"lightgreen\": [144,238,144,1],\n \"lightgrey\": [211,211,211,1], \"lightpink\": [255,182,193,1],\n \"lightsalmon\": [255,160,122,1], \"lightseagreen\": [32,178,170,1],\n \"lightskyblue\": [135,206,250,1], \"lightslategray\": [119,136,153,1],\n \"lightslategrey\": [119,136,153,1], \"lightsteelblue\": [176,196,222,1],\n \"lightyellow\": [255,255,224,1], \"lime\": [0,255,0,1],\n \"limegreen\": [50,205,50,1], \"linen\": [250,240,230,1],\n \"magenta\": [255,0,255,1], \"maroon\": [128,0,0,1],\n \"mediumaquamarine\": [102,205,170,1], \"mediumblue\": [0,0,205,1],\n \"mediumorchid\": [186,85,211,1], \"mediumpurple\": [147,112,219,1],\n \"mediumseagreen\": [60,179,113,1], \"mediumslateblue\": [123,104,238,1],\n \"mediumspringgreen\": [0,250,154,1], \"mediumturquoise\": [72,209,204,1],\n \"mediumvioletred\": [199,21,133,1], \"midnightblue\": [25,25,112,1],\n \"mintcream\": [245,255,250,1], \"mistyrose\": [255,228,225,1],\n \"moccasin\": [255,228,181,1], \"navajowhite\": [255,222,173,1],\n \"navy\": [0,0,128,1], \"oldlace\": [253,245,230,1],\n \"olive\": [128,128,0,1], \"olivedrab\": [107,142,35,1],\n \"orange\": [255,165,0,1], \"orangered\": [255,69,0,1],\n \"orchid\": [218,112,214,1], \"palegoldenrod\": [238,232,170,1],\n \"palegreen\": [152,251,152,1], \"paleturquoise\": [175,238,238,1],\n \"palevioletred\": [219,112,147,1], \"papayawhip\": [255,239,213,1],\n \"peachpuff\": [255,218,185,1], \"peru\": [205,133,63,1],\n \"pink\": [255,192,203,1], \"plum\": [221,160,221,1],\n \"powderblue\": [176,224,230,1], \"purple\": [128,0,128,1],\n \"rebeccapurple\": [102,51,153,1],\n \"red\": [255,0,0,1], \"rosybrown\": [188,143,143,1],\n \"royalblue\": [65,105,225,1], \"saddlebrown\": [139,69,19,1],\n \"salmon\": [250,128,114,1], \"sandybrown\": [244,164,96,1],\n \"seagreen\": [46,139,87,1], \"seashell\": [255,245,238,1],\n \"sienna\": [160,82,45,1], \"silver\": [192,192,192,1],\n \"skyblue\": [135,206,235,1], \"slateblue\": [106,90,205,1],\n \"slategray\": [112,128,144,1], \"slategrey\": [112,128,144,1],\n \"snow\": [255,250,250,1], \"springgreen\": [0,255,127,1],\n \"steelblue\": [70,130,180,1], \"tan\": [210,180,140,1],\n \"teal\": [0,128,128,1], \"thistle\": [216,191,216,1],\n \"tomato\": [255,99,71,1], \"turquoise\": [64,224,208,1],\n \"violet\": [238,130,238,1], \"wheat\": [245,222,179,1],\n \"white\": [255,255,255,1], \"whitesmoke\": [245,245,245,1],\n \"yellow\": [255,255,0,1], \"yellowgreen\": [154,205,50,1]}\n\nfunction clamp_css_byte(i) { // Clamp to integer 0 .. 255.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clamp_css_float(f) { // Clamp to float 0.0 .. 1.0.\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parse_css_int(str) { // int or percentage.\n if (str[str.length - 1] === '%')\n return clamp_css_byte(parseFloat(str) / 100 * 255);\n return clamp_css_byte(parseInt(str));\n}\n\nfunction parse_css_float(str) { // float or percentage.\n if (str[str.length - 1] === '%')\n return clamp_css_float(parseFloat(str) / 100);\n return clamp_css_float(parseFloat(str));\n}\n\nfunction css_hue_to_rgb(m1, m2, h) {\n if (h < 0) h += 1;\n else if (h > 1) h -= 1;\n\n if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;\n if (h * 2 < 1) return m2;\n if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;\n return m1;\n}\n\nfunction parseCSSColor(css_str) {\n // Remove all whitespace, not compliant, but should just be more accepting.\n var str = css_str.replace(/ /g, '').toLowerCase();\n\n // Color keywords (and transparent) lookup.\n if (str in kCSSColorTable) return kCSSColorTable[str].slice(); // dup.\n\n // #abc and #abc123 syntax.\n if (str[0] === '#') {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xfff)) return null; // Covers NaN.\n return [((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n (iv & 0xf0) | ((iv & 0xf0) >> 4),\n (iv & 0xf) | ((iv & 0xf) << 4),\n 1];\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffff)) return null; // Covers NaN.\n return [(iv & 0xff0000) >> 16,\n (iv & 0xff00) >> 8,\n iv & 0xff,\n 1];\n }\n\n return null;\n }\n\n var op = str.indexOf('('), ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op+1, ep-(op+1)).split(',');\n var alpha = 1; // To allow case fallthrough.\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) return null;\n alpha = parse_css_float(params.pop());\n // Fall through.\n case 'rgb':\n if (params.length !== 3) return null;\n return [parse_css_int(params[0]),\n parse_css_int(params[1]),\n parse_css_int(params[2]),\n alpha];\n case 'hsla':\n if (params.length !== 4) return null;\n alpha = parse_css_float(params.pop());\n // Fall through.\n case 'hsl':\n if (params.length !== 3) return null;\n var h = (((parseFloat(params[0]) % 360) + 360) % 360) / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n var s = parse_css_float(params[1]);\n var l = parse_css_float(params[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n return [clamp_css_byte(css_hue_to_rgb(m1, m2, h+1/3) * 255),\n clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),\n clamp_css_byte(css_hue_to_rgb(m1, m2, h-1/3) * 255),\n alpha];\n default:\n return null;\n }\n }\n\n return null;\n}\n\ntry { exports.parseCSSColor = parseCSSColor } catch(e) { }\n","// @flow\n\nimport {parseCSSColor} from 'csscolorparser';\n\n/**\n * An RGBA color value. Create instances from color strings using the static\n * method `Color.parse`. The constructor accepts RGB channel values in the range\n * `[0, 1]`, premultiplied by A.\n *\n * @param {number} r The red channel.\n * @param {number} g The green channel.\n * @param {number} b The blue channel.\n * @param {number} a The alpha channel.\n * @private\n */\nclass Color {\n r: number;\n g: number;\n b: number;\n a: number;\n\n constructor(r: number, g: number, b: number, a: number = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }\n\n static black: Color;\n static white: Color;\n static transparent: Color;\n static red: Color;\n static blue: Color;\n\n /**\n * Parses valid CSS color strings and returns a `Color` instance.\n * @returns A `Color` instance, or `undefined` if the input is not a valid color string.\n */\n static parse(input?: string | Color | null): Color | void {\n if (!input) {\n return undefined;\n }\n\n if (input instanceof Color) {\n return input;\n }\n\n if (typeof input !== 'string') {\n return undefined;\n }\n\n const rgba = parseCSSColor(input);\n if (!rgba) {\n return undefined;\n }\n\n return new Color(\n rgba[0] / 255 * rgba[3],\n rgba[1] / 255 * rgba[3],\n rgba[2] / 255 * rgba[3],\n rgba[3]\n );\n }\n\n /**\n * Returns an RGBA string representing the color value.\n *\n * @returns An RGBA string.\n * @example\n * var purple = new Color.parse('purple');\n * purple.toString; // = \"rgba(128,0,128,1)\"\n * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');\n * translucentGreen.toString(); // = \"rgba(26,207,26,0.73)\"\n */\n toString(): string {\n const [r, g, b, a] = this.toArray();\n return `rgba(${Math.round(r)},${Math.round(g)},${Math.round(b)},${a})`;\n }\n\n /**\n * Returns an RGBA array of values representing the color, unpremultiplied by A.\n *\n * @returns An array of RGBA color values in the range [0, 255].\n */\n toArray(): [number, number, number, number] {\n const {r, g, b, a} = this;\n return a === 0 ? [0, 0, 0, 0] : [\n r * 255 / a,\n g * 255 / a,\n b * 255 / a,\n a\n ];\n }\n\n /**\n * Returns a RGBA array of float values representing the color, unpremultiplied by A.\n *\n * @returns An array of RGBA color values in the range [0, 1].\n */\n toArray01(): [number, number, number, number] {\n const {r, g, b, a} = this;\n return a === 0 ? [0, 0, 0, 0] : [\n r / a,\n g / a,\n b / a,\n a\n ];\n }\n\n /**\n * Returns an RGBA array of values representing the color, premultiplied by A.\n *\n * @returns An array of RGBA color values in the range [0, 1].\n */\n toArray01PremultipliedAlpha(): [number, number, number, number] {\n const {r, g, b, a} = this;\n return [\n r,\n g,\n b,\n a\n ];\n }\n}\n\nColor.black = new Color(0, 0, 0, 1);\nColor.white = new Color(1, 1, 1, 1);\nColor.transparent = new Color(0, 0, 0, 0);\nColor.red = new Color(1, 0, 0, 1);\nColor.blue = new Color(0, 0, 1, 1);\n\nexport default Color;\n","// @flow\n\nimport assert from 'assert';\n\nimport type {StylePropertySpecification} from '../style-spec.js';\nimport type {ExpressionSpecification} from '../types.js';\n\nfunction convertLiteral(value) {\n return typeof value === 'object' ? ['literal', value] : value;\n}\n\nexport default function convertFunction(parameters: any, propertySpec: StylePropertySpecification): ExpressionSpecification {\n let stops = parameters.stops;\n if (!stops) {\n // identity function\n return convertIdentityFunction(parameters, propertySpec);\n }\n\n const zoomAndFeatureDependent = stops && typeof stops[0][0] === 'object';\n const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n\n stops = stops.map((stop) => {\n if (!featureDependent && propertySpec.tokens && typeof stop[1] === 'string') {\n return [stop[0], convertTokenString(stop[1])];\n }\n return [stop[0], convertLiteral(stop[1])];\n });\n\n if (zoomAndFeatureDependent) {\n return convertZoomAndPropertyFunction(parameters, propertySpec, stops);\n } else if (zoomDependent) {\n return convertZoomFunction(parameters, propertySpec, stops);\n } else {\n return convertPropertyFunction(parameters, propertySpec, stops);\n }\n}\n\nfunction convertIdentityFunction(parameters, propertySpec): Array {\n const get = ['get', parameters.property];\n\n if (parameters.default === undefined) {\n // By default, expressions for string-valued properties get coerced. To preserve\n // legacy function semantics, insert an explicit assertion instead.\n return propertySpec.type === 'string' ? ['string', get] : get;\n } else if (propertySpec.type === 'enum') {\n return [\n 'match',\n get,\n Object.keys(propertySpec.values),\n get,\n parameters.default\n ];\n } else {\n const expression = [propertySpec.type === 'color' ? 'to-color' : propertySpec.type, get, convertLiteral(parameters.default)];\n if (propertySpec.type === 'array') {\n expression.splice(1, 0, propertySpec.value, propertySpec.length || null);\n }\n return expression;\n }\n}\n\nfunction getInterpolateOperator(parameters) {\n switch (parameters.colorSpace) {\n case 'hcl': return 'interpolate-hcl';\n case 'lab': return 'interpolate-lab';\n default: return 'interpolate';\n }\n}\n\nfunction convertZoomAndPropertyFunction(parameters, propertySpec, stops) {\n const featureFunctionParameters = {};\n const featureFunctionStops = {};\n const zoomStops = [];\n for (let s = 0; s < stops.length; s++) {\n const stop = stops[s];\n const zoom = stop[0].zoom;\n if (featureFunctionParameters[zoom] === undefined) {\n featureFunctionParameters[zoom] = {\n zoom,\n type: parameters.type,\n property: parameters.property,\n default: parameters.default,\n };\n featureFunctionStops[zoom] = [];\n zoomStops.push(zoom);\n }\n featureFunctionStops[zoom].push([stop[0].value, stop[1]]);\n }\n\n // the interpolation type for the zoom dimension of a zoom-and-property\n // function is determined directly from the style property specification\n // for which it's being used: linear for interpolatable properties, step\n // otherwise.\n const functionType = getFunctionType({}, propertySpec);\n if (functionType === 'exponential') {\n const expression = [getInterpolateOperator(parameters), ['linear'], ['zoom']];\n\n for (const z of zoomStops) {\n const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n appendStopPair(expression, z, output, false);\n }\n\n return expression;\n } else {\n const expression = ['step', ['zoom']];\n\n for (const z of zoomStops) {\n const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n appendStopPair(expression, z, output, true);\n }\n\n fixupDegenerateStepCurve(expression);\n\n return expression;\n }\n}\n\nfunction coalesce(a, b) {\n if (a !== undefined) return a;\n if (b !== undefined) return b;\n}\n\nfunction getFallback(parameters, propertySpec) {\n const defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default));\n\n /*\n * Some fields with type: resolvedImage have an undefined default.\n * Because undefined is an invalid value for resolvedImage, set fallback to\n * an empty string instead of undefined to ensure output\n * passes validation.\n */\n if (defaultValue === undefined && propertySpec.type === 'resolvedImage') {\n return '';\n }\n return defaultValue;\n}\n\nfunction convertPropertyFunction(parameters, propertySpec, stops) {\n const type = getFunctionType(parameters, propertySpec);\n const get = ['get', parameters.property];\n if (type === 'categorical' && typeof stops[0][0] === 'boolean') {\n assert(parameters.stops.length > 0 && parameters.stops.length <= 2);\n const expression = ['case'];\n for (const stop of stops) {\n expression.push(['==', get, stop[0]], stop[1]);\n }\n\n expression.push(getFallback(parameters, propertySpec));\n return expression;\n } else if (type === 'categorical') {\n const expression = ['match', get];\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], false);\n }\n expression.push(getFallback(parameters, propertySpec));\n return expression;\n } else if (type === 'interval') {\n const expression = ['step', ['number', get]];\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], true);\n }\n fixupDegenerateStepCurve(expression);\n return parameters.default === undefined ? expression : [\n 'case',\n ['==', ['typeof', get], 'number'],\n expression,\n convertLiteral(parameters.default)\n ];\n } else if (type === 'exponential') {\n const base = parameters.base !== undefined ? parameters.base : 1;\n const expression = [\n getInterpolateOperator(parameters),\n base === 1 ? [\"linear\"] : [\"exponential\", base],\n [\"number\", get]\n ];\n\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], false);\n }\n return parameters.default === undefined ? expression : [\n 'case',\n ['==', ['typeof', get], 'number'],\n expression,\n convertLiteral(parameters.default)\n ];\n } else {\n throw new Error(`Unknown property function type ${type}`);\n }\n}\n\nfunction convertZoomFunction(parameters, propertySpec, stops, input = ['zoom']) {\n const type = getFunctionType(parameters, propertySpec);\n let expression;\n let isStep = false;\n if (type === 'interval') {\n expression = ['step', input];\n isStep = true;\n } else if (type === 'exponential') {\n const base = parameters.base !== undefined ? parameters.base : 1;\n expression = [getInterpolateOperator(parameters), base === 1 ? [\"linear\"] : [\"exponential\", base], input];\n\n } else {\n throw new Error(`Unknown zoom function type \"${type}\"`);\n }\n\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], isStep);\n }\n\n fixupDegenerateStepCurve(expression);\n\n return expression;\n}\n\nfunction fixupDegenerateStepCurve(expression) {\n // degenerate step curve (i.e. a constant function): add a noop stop\n if (expression[0] === 'step' && expression.length === 3) {\n expression.push(0);\n expression.push(expression[3]);\n }\n}\n\nfunction appendStopPair(curve, input, output, isStep) {\n // Skip duplicate stop values. They were not validated for functions, but they are for expressions.\n // https://github.com/mapbox/mapbox-gl-js/issues/4107\n if (curve.length > 3 && input === curve[curve.length - 2]) {\n return;\n }\n // step curves don't get the first input value, as it is redundant.\n if (!(isStep && curve.length === 2)) {\n curve.push(input);\n }\n curve.push(output);\n}\n\nfunction getFunctionType(parameters, propertySpec) {\n if (parameters.type) {\n return parameters.type;\n } else {\n assert(propertySpec.expression);\n return (propertySpec.expression: any).interpolated ? 'exponential' : 'interval';\n }\n}\n\n// \"String with {name} token\" => [\"concat\", \"String with \", [\"get\", \"name\"], \" token\"]\nexport function convertTokenString(s: string): string | ExpressionSpecification {\n const result = ['concat'];\n const re = /{([^{}]+)}/g;\n let pos = 0;\n for (let match = re.exec(s); match !== null; match = re.exec(s)) {\n const literal = s.slice(pos, re.lastIndex - match[0].length);\n pos = re.lastIndex;\n if (literal.length > 0) result.push(literal);\n result.push(['get', match[1]]);\n }\n\n if (result.length === 1) {\n return s;\n }\n\n if (pos < s.length) {\n result.push(s.slice(pos));\n } else if (result.length === 2) {\n return ['to-string', result[1]];\n }\n\n return result;\n}\n\n","// @flow\n\nclass ParsingError extends Error {\n key: string;\n message: string;\n constructor(key: string, message: string) {\n super(message);\n this.message = message;\n this.key = key;\n }\n}\n\nexport default ParsingError;\n","// @flow\n\nimport type {Expression} from './expression.js';\n\n/**\n * Tracks `let` bindings during expression parsing.\n * @private\n */\nclass Scope {\n parent: ?Scope;\n bindings: {[_: string]: Expression};\n constructor(parent?: Scope, bindings: Array<[string, Expression]> = []) {\n this.parent = parent;\n this.bindings = {};\n for (const [name, expression] of bindings) {\n this.bindings[name] = expression;\n }\n }\n\n concat(bindings: Array<[string, Expression]>): Scope {\n return new Scope(this, bindings);\n }\n\n get(name: string): Expression {\n if (this.bindings[name]) { return this.bindings[name]; }\n if (this.parent) { return this.parent.get(name); }\n throw new Error(`${name} not found in scope.`);\n }\n\n has(name: string): boolean {\n if (this.bindings[name]) return true;\n return this.parent ? this.parent.has(name) : false;\n }\n}\n\nexport default Scope;\n","// @flow\n\nexport type NullTypeT = { kind: 'null' };\nexport type NumberTypeT = { kind: 'number' };\nexport type StringTypeT = { kind: 'string' };\nexport type BooleanTypeT = { kind: 'boolean' };\nexport type ColorTypeT = { kind: 'color' };\nexport type ObjectTypeT = { kind: 'object' };\nexport type ValueTypeT = { kind: 'value' };\nexport type ErrorTypeT = { kind: 'error' };\nexport type CollatorTypeT = { kind: 'collator' };\nexport type FormattedTypeT = { kind: 'formatted' };\nexport type ResolvedImageTypeT = { kind: 'resolvedImage' };\n\nexport type EvaluationKind = 'constant' | 'source' | 'camera' | 'composite';\n\nexport type Type =\n NullTypeT |\n NumberTypeT |\n StringTypeT |\n BooleanTypeT |\n ColorTypeT |\n ObjectTypeT |\n ValueTypeT |\n ArrayType | // eslint-disable-line no-use-before-define\n ErrorTypeT |\n CollatorTypeT |\n FormattedTypeT |\n ResolvedImageTypeT\n\nexport type ArrayType = {\n kind: 'array',\n itemType: Type,\n N: ?number\n}\n\nexport type NativeType = 'number' | 'string' | 'boolean' | 'null' | 'array' | 'object'\n\nexport const NullType = {kind: 'null'};\nexport const NumberType = {kind: 'number'};\nexport const StringType = {kind: 'string'};\nexport const BooleanType = {kind: 'boolean'};\nexport const ColorType = {kind: 'color'};\nexport const ObjectType = {kind: 'object'};\nexport const ValueType = {kind: 'value'};\nexport const ErrorType = {kind: 'error'};\nexport const CollatorType = {kind: 'collator'};\nexport const FormattedType = {kind: 'formatted'};\nexport const ResolvedImageType = {kind: 'resolvedImage'};\n\nexport function array(itemType: Type, N: ?number): ArrayType {\n return {\n kind: 'array',\n itemType,\n N\n };\n}\n\nexport function toString(type: Type): string {\n if (type.kind === 'array') {\n const itemType = toString(type.itemType);\n return typeof type.N === 'number' ?\n `array<${itemType}, ${type.N}>` :\n type.itemType.kind === 'value' ? 'array' : `array<${itemType}>`;\n } else {\n return type.kind;\n }\n}\n\nconst valueMemberTypes = [\n NullType,\n NumberType,\n StringType,\n BooleanType,\n ColorType,\n FormattedType,\n ObjectType,\n array(ValueType),\n ResolvedImageType\n];\n\n/**\n * Returns null if `t` is a subtype of `expected`; otherwise returns an\n * error message.\n * @private\n */\nexport function checkSubtype(expected: Type, t: Type): ?string {\n if (t.kind === 'error') {\n // Error is a subtype of every type\n return null;\n } else if (expected.kind === 'array') {\n if (t.kind === 'array' &&\n ((t.N === 0 && t.itemType.kind === 'value') || !checkSubtype(expected.itemType, t.itemType)) &&\n (typeof expected.N !== 'number' || expected.N === t.N)) {\n return null;\n }\n } else if (expected.kind === t.kind) {\n return null;\n } else if (expected.kind === 'value') {\n for (const memberType of valueMemberTypes) {\n if (!checkSubtype(memberType, t)) {\n return null;\n }\n }\n }\n\n return `Expected ${toString(expected)} but found ${toString(t)} instead.`;\n}\n\nexport function isValidType(provided: Type, allowedTypes: Array): boolean {\n return allowedTypes.some(t => t.kind === provided.kind);\n}\n\nexport function isValidNativeType(provided: any, allowedTypes: Array): boolean {\n return allowedTypes.some(t => {\n if (t === 'null') {\n return provided === null;\n } else if (t === 'array') {\n return Array.isArray(provided);\n } else if (t === 'object') {\n return provided && !Array.isArray(provided) && typeof provided === 'object';\n } else {\n return t === typeof provided;\n }\n });\n}\n","// @flow\n\n// Flow type declarations for Intl cribbed from\n// https://github.com/facebook/flow/issues/1270\n\ndeclare var Intl: {\n Collator: Class\n};\n\ndeclare class Intl$Collator {\n constructor (\n locales?: string | string[],\n options?: CollatorOptions\n ): Intl$Collator;\n\n static (\n locales?: string | string[],\n options?: CollatorOptions\n ): Intl$Collator;\n\n compare (a: string, b: string): number;\n\n resolvedOptions(): any;\n}\n\ntype CollatorOptions = {\n localeMatcher?: 'lookup' | 'best fit',\n usage?: 'sort' | 'search',\n sensitivity?: 'base' | 'accent' | 'case' | 'variant',\n ignorePunctuation?: boolean,\n numeric?: boolean,\n caseFirst?: 'upper' | 'lower' | 'false'\n}\n\nexport default class Collator {\n locale: string | null;\n sensitivity: 'base' | 'accent' | 'case' | 'variant';\n collator: Intl$Collator;\n\n constructor(caseSensitive: boolean, diacriticSensitive: boolean, locale: string | null) {\n if (caseSensitive)\n this.sensitivity = diacriticSensitive ? 'variant' : 'case';\n else\n this.sensitivity = diacriticSensitive ? 'accent' : 'base';\n\n this.locale = locale;\n this.collator = new Intl.Collator(this.locale ? this.locale : [],\n {sensitivity: this.sensitivity, usage: 'search'});\n }\n\n compare(lhs: string, rhs: string): number {\n return this.collator.compare(lhs, rhs);\n }\n\n resolvedLocale(): string {\n // We create a Collator without \"usage: search\" because we don't want\n // the search options encoded in our result (e.g. \"en-u-co-search\")\n return new Intl.Collator(this.locale ? this.locale : [])\n .resolvedOptions().locale;\n }\n}\n","// @flow\nimport type Color from '../../util/color.js';\nimport type ResolvedImage from '../types/resolved_image.js';\n\nexport class FormattedSection {\n text: string;\n image: ResolvedImage | null;\n scale: number | null;\n fontStack: string | null;\n textColor: Color | null;\n\n constructor(text: string, image: ResolvedImage | null, scale: number | null, fontStack: string | null, textColor: Color | null) {\n // combine characters so that diacritic marks are not separate code points\n this.text = text.normalize ? text.normalize() : text;\n this.image = image;\n this.scale = scale;\n this.fontStack = fontStack;\n this.textColor = textColor;\n }\n}\n\nexport default class Formatted {\n sections: Array;\n\n constructor(sections: Array) {\n this.sections = sections;\n }\n\n static fromString(unformatted: string): Formatted {\n return new Formatted([new FormattedSection(unformatted, null, null, null, null)]);\n }\n\n isEmpty(): boolean {\n if (this.sections.length === 0) return true;\n return !this.sections.some(section => section.text.length !== 0 ||\n (section.image && section.image.name.length !== 0));\n }\n\n static factory(text: Formatted | string): Formatted {\n if (text instanceof Formatted) {\n return text;\n } else {\n return Formatted.fromString(text);\n }\n }\n\n toString(): string {\n if (this.sections.length === 0) return '';\n return this.sections.map(section => section.text).join('');\n }\n\n serialize(): Array {\n const serialized: Array = [\"format\"];\n for (const section of this.sections) {\n if (section.image) {\n serialized.push([\"image\", section.image.name]);\n continue;\n }\n serialized.push(section.text);\n const options: { [key: string]: mixed } = {};\n if (section.fontStack) {\n options[\"text-font\"] = [\"literal\", section.fontStack.split(',')];\n }\n if (section.scale) {\n options[\"font-scale\"] = section.scale;\n }\n if (section.textColor) {\n options[\"text-color\"] = ([\"rgba\"]: Array).concat(section.textColor.toArray());\n }\n serialized.push(options);\n }\n return serialized;\n }\n}\n","// @flow\n\nexport type ResolvedImageOptions = {\n name: string,\n available: boolean\n};\n\nexport default class ResolvedImage {\n name: string;\n available: boolean;\n\n constructor(options: ResolvedImageOptions) {\n this.name = options.name;\n this.available = options.available;\n }\n\n toString(): string {\n return this.name;\n }\n\n static fromString(name: string): ResolvedImage | null {\n if (!name) return null; // treat empty values as no image\n return new ResolvedImage({name, available: false});\n }\n\n serialize(): Array {\n return [\"image\", this.name];\n }\n}\n","// @flow\n\nimport assert from 'assert';\n\nimport Color from '../util/color.js';\nimport Collator from './types/collator.js';\nimport Formatted from './types/formatted.js';\nimport ResolvedImage from './types/resolved_image.js';\nimport {NullType, NumberType, StringType, BooleanType, ColorType, ObjectType, ValueType, CollatorType, FormattedType, ResolvedImageType, array} from './types.js';\n\nimport type {Type} from './types.js';\n\nexport function validateRGBA(r: mixed, g: mixed, b: mixed, a?: mixed): string | null {\n if (!(\n typeof r === 'number' && r >= 0 && r <= 255 &&\n typeof g === 'number' && g >= 0 && g <= 255 &&\n typeof b === 'number' && b >= 0 && b <= 255\n )) {\n const value = typeof a === 'number' ? [r, g, b, a] : [r, g, b];\n return `Invalid rgba value [${value.join(', ')}]: 'r', 'g', and 'b' must be between 0 and 255.`;\n }\n\n if (!(\n typeof a === 'undefined' || (typeof a === 'number' && a >= 0 && a <= 1)\n )) {\n return `Invalid rgba value [${[r, g, b, a].join(', ')}]: 'a' must be between 0 and 1.`;\n }\n\n return null;\n}\n\nexport type Value = null | string | boolean | number | Color | Collator | Formatted | ResolvedImage | $ReadOnlyArray | { +[string]: Value }\n\nexport function isValue(mixed: mixed): boolean {\n if (mixed === null) {\n return true;\n } else if (typeof mixed === 'string') {\n return true;\n } else if (typeof mixed === 'boolean') {\n return true;\n } else if (typeof mixed === 'number') {\n return true;\n } else if (mixed instanceof Color) {\n return true;\n } else if (mixed instanceof Collator) {\n return true;\n } else if (mixed instanceof Formatted) {\n return true;\n } else if (mixed instanceof ResolvedImage) {\n return true;\n } else if (Array.isArray(mixed)) {\n for (const item of mixed) {\n if (!isValue(item)) {\n return false;\n }\n }\n return true;\n } else if (typeof mixed === 'object') {\n for (const key in mixed) {\n if (!isValue(mixed[key])) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n}\n\nexport function typeOf(value: Value): Type {\n if (value === null) {\n return NullType;\n } else if (typeof value === 'string') {\n return StringType;\n } else if (typeof value === 'boolean') {\n return BooleanType;\n } else if (typeof value === 'number') {\n return NumberType;\n } else if (value instanceof Color) {\n return ColorType;\n } else if (value instanceof Collator) {\n return CollatorType;\n } else if (value instanceof Formatted) {\n return FormattedType;\n } else if (value instanceof ResolvedImage) {\n return ResolvedImageType;\n } else if (Array.isArray(value)) {\n const length = value.length;\n let itemType: Type | typeof undefined;\n\n for (const item of value) {\n const t = typeOf(item);\n if (!itemType) {\n itemType = t;\n } else if (itemType === t) {\n continue;\n } else {\n itemType = ValueType;\n break;\n }\n }\n\n return array(itemType || ValueType, length);\n } else {\n assert(typeof value === 'object');\n return ObjectType;\n }\n}\n\nexport function toString(value: Value): string {\n const type = typeof value;\n if (value === null) {\n return '';\n } else if (type === 'string' || type === 'number' || type === 'boolean') {\n return String(value);\n } else if (value instanceof Color || value instanceof Formatted || value instanceof ResolvedImage) {\n return value.toString();\n } else {\n return JSON.stringify(value);\n }\n}\n\nexport {Color, Collator};\n","// @flow\n\nimport assert from 'assert';\nimport {isValue, typeOf, Color} from '../values.js';\nimport Formatted from '../types/formatted.js';\n\nimport type {Type} from '../types.js';\nimport type {Value} from '../values.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\n\nclass Literal implements Expression {\n type: Type;\n value: Value;\n\n constructor(type: Type, value: Value) {\n this.type = type;\n this.value = value;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): void | Literal {\n if (args.length !== 2)\n return context.error(`'literal' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n\n if (!isValue(args[1]))\n return context.error(`invalid value`);\n\n const value = (args[1]: any);\n let type = typeOf(value);\n\n // special case: infer the item type if possible for zero-length arrays\n const expected = context.expectedType;\n if (\n type.kind === 'array' &&\n type.N === 0 &&\n expected &&\n expected.kind === 'array' &&\n (typeof expected.N !== 'number' || expected.N === 0)\n ) {\n type = expected;\n }\n\n return new Literal(type, value);\n }\n\n evaluate(): Value {\n return this.value;\n }\n\n eachChild() {}\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n if (this.type.kind === 'array' || this.type.kind === 'object') {\n return [\"literal\", this.value];\n } else if (this.value instanceof Color) {\n // Constant-folding can generate Literal expressions that you\n // couldn't actually generate with a \"literal\" expression,\n // so we have to implement an equivalent serialization here\n return [\"rgba\"].concat(this.value.toArray());\n } else if (this.value instanceof Formatted) {\n // Same as Color\n return this.value.serialize();\n } else {\n assert(this.value === null ||\n typeof this.value === 'string' ||\n typeof this.value === 'number' ||\n typeof this.value === 'boolean');\n return (this.value: any);\n }\n }\n}\n\nexport default Literal;\n","// @flow\n\nclass RuntimeError {\n name: string;\n message: string;\n\n constructor(message: string) {\n this.name = 'ExpressionEvaluationError';\n this.message = message;\n }\n\n toJSON(): string {\n return this.message;\n }\n}\n\nexport default RuntimeError;\n","// @flow\n\nimport assert from 'assert';\n\nimport {\n ObjectType,\n ValueType,\n StringType,\n NumberType,\n BooleanType,\n checkSubtype,\n toString,\n array\n} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nconst types = {\n string: StringType,\n number: NumberType,\n boolean: BooleanType,\n object: ObjectType\n};\n\nclass Assertion implements Expression {\n type: Type;\n args: Array;\n\n constructor(type: Type, args: Array) {\n this.type = type;\n this.args = args;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length < 2)\n return context.error(`Expected at least one argument.`);\n\n let i = 1;\n let type;\n\n const name: string = (args[0]: any);\n if (name === 'array') {\n let itemType;\n if (args.length > 2) {\n const type = args[1];\n if (typeof type !== 'string' || !(type in types) || type === 'object')\n return context.error('The item type argument of \"array\" must be one of string, number, boolean', 1);\n itemType = types[type];\n i++;\n } else {\n itemType = ValueType;\n }\n\n let N;\n if (args.length > 3) {\n if (args[2] !== null &&\n (typeof args[2] !== 'number' ||\n args[2] < 0 ||\n args[2] !== Math.floor(args[2]))\n ) {\n return context.error('The length argument to \"array\" must be a positive integer literal', 2);\n }\n N = args[2];\n i++;\n }\n\n type = array(itemType, N);\n } else {\n assert(types[name], name);\n type = types[name];\n }\n\n const parsed = [];\n for (; i < args.length; i++) {\n const input = context.parse(args[i], i, ValueType);\n if (!input) return null;\n parsed.push(input);\n }\n\n return new Assertion(type, parsed);\n }\n\n evaluate(ctx: EvaluationContext): any | null {\n for (let i = 0; i < this.args.length; i++) {\n const value = this.args[i].evaluate(ctx);\n const error = checkSubtype(this.type, typeOf(value));\n if (!error) {\n return value;\n } else if (i === this.args.length - 1) {\n throw new RuntimeError(`Expected value to be of type ${toString(this.type)}, but found ${toString(typeOf(value))} instead.`);\n }\n }\n\n assert(false);\n return null;\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return this.args.every(arg => arg.outputDefined());\n }\n\n serialize(): SerializedExpression {\n const type = this.type;\n const serialized = [type.kind];\n if (type.kind === 'array') {\n const itemType = type.itemType;\n if (itemType.kind === 'string' ||\n itemType.kind === 'number' ||\n itemType.kind === 'boolean') {\n serialized.push(itemType.kind);\n const N = type.N;\n if (typeof N === 'number' || this.args.length > 1) {\n serialized.push(N);\n }\n }\n }\n return serialized.concat(this.args.map(arg => arg.serialize()));\n }\n}\n\nexport default Assertion;\n","// @flow\n\nimport {NumberType, ValueType, FormattedType, array, StringType, ColorType, ResolvedImageType} from '../types.js';\nimport Formatted, {FormattedSection} from '../types/formatted.js';\nimport {toString, typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\ntype FormattedSectionExpression = {\n // Content of a section may be Image expression or other\n // type of expression that is coercable to 'string'.\n content: Expression,\n scale: Expression | null;\n font: Expression | null;\n textColor: Expression | null;\n}\n\nexport default class FormatExpression implements Expression {\n type: Type;\n sections: Array;\n\n constructor(sections: Array) {\n this.type = FormattedType;\n this.sections = sections;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length < 2) {\n return context.error(`Expected at least one argument.`);\n }\n\n const firstArg = args[1];\n if (!Array.isArray(firstArg) && typeof firstArg === 'object') {\n return context.error(`First argument must be an image or text section.`);\n }\n\n const sections: Array = [];\n let nextTokenMayBeObject = false;\n for (let i = 1; i <= args.length - 1; ++i) {\n const arg = (args[i]: any);\n\n if (nextTokenMayBeObject && typeof arg === \"object\" && !Array.isArray(arg)) {\n nextTokenMayBeObject = false;\n\n let scale = null;\n if (arg['font-scale']) {\n scale = context.parse(arg['font-scale'], 1, NumberType);\n if (!scale) return null;\n }\n\n let font = null;\n if (arg['text-font']) {\n font = context.parse(arg['text-font'], 1, array(StringType));\n if (!font) return null;\n }\n\n let textColor = null;\n if (arg['text-color']) {\n textColor = context.parse(arg['text-color'], 1, ColorType);\n if (!textColor) return null;\n }\n\n const lastExpression = sections[sections.length - 1];\n lastExpression.scale = scale;\n lastExpression.font = font;\n lastExpression.textColor = textColor;\n } else {\n const content = context.parse(args[i], 1, ValueType);\n if (!content) return null;\n\n const kind = content.type.kind;\n if (kind !== 'string' && kind !== 'value' && kind !== 'null' && kind !== 'resolvedImage')\n return context.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);\n\n nextTokenMayBeObject = true;\n sections.push({content, scale: null, font: null, textColor: null});\n }\n }\n\n return new FormatExpression(sections);\n }\n\n evaluate(ctx: EvaluationContext): Formatted {\n const evaluateSection = section => {\n const evaluatedContent = section.content.evaluate(ctx);\n if (typeOf(evaluatedContent) === ResolvedImageType) {\n return new FormattedSection('', evaluatedContent, null, null, null);\n }\n\n return new FormattedSection(\n toString(evaluatedContent),\n null,\n section.scale ? section.scale.evaluate(ctx) : null,\n section.font ? section.font.evaluate(ctx).join(',') : null,\n section.textColor ? section.textColor.evaluate(ctx) : null\n );\n };\n\n return new Formatted(this.sections.map(evaluateSection));\n }\n\n eachChild(fn: (_: Expression) => void) {\n for (const section of this.sections) {\n fn(section.content);\n if (section.scale) {\n fn(section.scale);\n }\n if (section.font) {\n fn(section.font);\n }\n if (section.textColor) {\n fn(section.textColor);\n }\n }\n }\n\n outputDefined(): boolean {\n // Technically the combinatoric set of all children\n // Usually, this.text will be undefined anyway\n return false;\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"format\"];\n for (const section of this.sections) {\n serialized.push(section.content.serialize());\n const options = {};\n if (section.scale) {\n options['font-scale'] = section.scale.serialize();\n }\n if (section.font) {\n options['text-font'] = section.font.serialize();\n }\n if (section.textColor) {\n options['text-color'] = section.textColor.serialize();\n }\n serialized.push(options);\n }\n return serialized;\n }\n}\n","// @flow\n\nimport {ResolvedImageType, StringType} from '../types.js';\nimport ResolvedImage from '../types/resolved_image.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\nexport default class ImageExpression implements Expression {\n type: Type;\n input: Expression;\n\n constructor(input: Expression) {\n this.type = ResolvedImageType;\n this.input = input;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 2) {\n return context.error(`Expected two arguments.`);\n }\n\n const name = context.parse(args[1], 1, StringType);\n if (!name) return context.error(`No image name provided.`);\n\n return new ImageExpression(name);\n }\n\n evaluate(ctx: EvaluationContext): null | ResolvedImage {\n const evaluatedImageName = this.input.evaluate(ctx);\n\n const value = ResolvedImage.fromString(evaluatedImageName);\n if (value && ctx.availableImages) value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1;\n\n return value;\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n }\n\n outputDefined(): boolean {\n // The output of image is determined by the list of available images in the evaluation context\n return false;\n }\n\n serialize(): SerializedExpression {\n return [\"image\", this.input.serialize()];\n }\n}\n","// @flow\n\nimport assert from 'assert';\n\nimport {BooleanType, ColorType, NumberType, StringType, ValueType} from '../types.js';\nimport {Color, toString as valueToString, validateRGBA} from '../values.js';\nimport RuntimeError from '../runtime_error.js';\nimport Formatted from '../types/formatted.js';\nimport FormatExpression from '../definitions/format.js';\nimport ImageExpression from '../definitions/image.js';\nimport ResolvedImage from '../types/resolved_image.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nconst types = {\n 'to-boolean': BooleanType,\n 'to-color': ColorType,\n 'to-number': NumberType,\n 'to-string': StringType\n};\n\n/**\n * Special form for error-coalescing coercion expressions \"to-number\",\n * \"to-color\". Since these coercions can fail at runtime, they accept multiple\n * arguments, only evaluating one at a time until one succeeds.\n *\n * @private\n */\nclass Coercion implements Expression {\n type: Type;\n args: Array;\n\n constructor(type: Type, args: Array) {\n this.type = type;\n this.args = args;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length < 2)\n return context.error(`Expected at least one argument.`);\n\n const name: string = (args[0]: any);\n assert(types[name], name);\n\n if ((name === 'to-boolean' || name === 'to-string') && args.length !== 2)\n return context.error(`Expected one argument.`);\n\n const type = types[name];\n\n const parsed = [];\n for (let i = 1; i < args.length; i++) {\n const input = context.parse(args[i], i, ValueType);\n if (!input) return null;\n parsed.push(input);\n }\n\n return new Coercion(type, parsed);\n }\n\n evaluate(ctx: EvaluationContext): null | boolean | number | string | Color | Formatted | ResolvedImage {\n if (this.type.kind === 'boolean') {\n return Boolean(this.args[0].evaluate(ctx));\n } else if (this.type.kind === 'color') {\n let input;\n let error;\n for (const arg of this.args) {\n input = arg.evaluate(ctx);\n error = null;\n if (input instanceof Color) {\n return input;\n } else if (typeof input === 'string') {\n const c = ctx.parseColor(input);\n if (c) return c;\n } else if (Array.isArray(input)) {\n if (input.length < 3 || input.length > 4) {\n error = `Invalid rbga value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;\n } else {\n error = validateRGBA(input[0], input[1], input[2], input[3]);\n }\n if (!error) {\n return new Color((input[0]: any) / 255, (input[1]: any) / 255, (input[2]: any) / 255, (input[3]: any));\n }\n }\n }\n throw new RuntimeError(error || `Could not parse color from value '${typeof input === 'string' ? input : String(JSON.stringify(input))}'`);\n } else if (this.type.kind === 'number') {\n let value = null;\n for (const arg of this.args) {\n value = arg.evaluate(ctx);\n if (value === null) return 0;\n const num = Number(value);\n if (isNaN(num)) continue;\n return num;\n }\n throw new RuntimeError(`Could not convert ${JSON.stringify(value)} to number.`);\n } else if (this.type.kind === 'formatted') {\n // There is no explicit 'to-formatted' but this coercion can be implicitly\n // created by properties that expect the 'formatted' type.\n return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));\n } else if (this.type.kind === 'resolvedImage') {\n return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));\n } else {\n return valueToString(this.args[0].evaluate(ctx));\n }\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return this.args.every(arg => arg.outputDefined());\n }\n\n serialize(): SerializedExpression {\n if (this.type.kind === 'formatted') {\n return new FormatExpression([{content: this.args[0], scale: null, font: null, textColor: null}]).serialize();\n }\n\n if (this.type.kind === 'resolvedImage') {\n return new ImageExpression(this.args[0]).serialize();\n }\n\n const serialized = [`to-${this.type.kind}`];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Coercion;\n","// @flow\n\nimport {Color} from './values.js';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {FormattedSection} from './types/formatted.js';\nimport type {GlobalProperties, Feature, FeatureState} from './index.js';\nimport type {CanonicalTileID} from '../../source/tile_id.js';\nimport type {FeatureDistanceData} from '../feature_filter/index.js';\n\nconst geometryTypes = ['Unknown', 'Point', 'LineString', 'Polygon'];\n\nclass EvaluationContext {\n globals: GlobalProperties;\n feature: ?Feature;\n featureState: ?FeatureState;\n formattedSection: ?FormattedSection;\n availableImages: ?Array;\n canonical: null | CanonicalTileID;\n featureTileCoord: ?Point;\n featureDistanceData: ?FeatureDistanceData;\n\n _parseColorCache: {[_: string]: ?Color};\n\n constructor() {\n this.globals = (null: any);\n this.feature = null;\n this.featureState = null;\n this.formattedSection = null;\n this._parseColorCache = {};\n this.availableImages = null;\n this.canonical = null;\n this.featureTileCoord = null;\n this.featureDistanceData = null;\n }\n\n id(): number | null {\n return this.feature && this.feature.id !== undefined ? this.feature.id : null;\n }\n\n geometryType(): null | string {\n return this.feature ? typeof this.feature.type === 'number' ? geometryTypes[this.feature.type] : this.feature.type : null;\n }\n\n geometry(): ?Array> {\n return this.feature && 'geometry' in this.feature ? this.feature.geometry : null;\n }\n\n canonicalID(): null | CanonicalTileID {\n return this.canonical;\n }\n\n properties(): {[string]: any} {\n return (this.feature && this.feature.properties) || {};\n }\n\n distanceFromCenter(): number {\n if (this.featureTileCoord && this.featureDistanceData) {\n\n const c = this.featureDistanceData.center;\n const scale = this.featureDistanceData.scale;\n const {x, y} = this.featureTileCoord;\n\n // Calculate the distance vector `d` (left handed)\n const dX = x * scale - c[0];\n const dY = y * scale - c[1];\n\n // The bearing vector `b` (left handed)\n const bX = this.featureDistanceData.bearing[0];\n const bY = this.featureDistanceData.bearing[1];\n\n // Distance is calculated as `dot(d, v)`\n const dist = (bX * dX + bY * dY);\n return dist;\n }\n\n return 0;\n }\n\n parseColor(input: string): ?Color {\n let cached = this._parseColorCache[input];\n if (!cached) {\n cached = this._parseColorCache[input] = Color.parse(input);\n }\n return cached;\n }\n}\n\nexport default EvaluationContext;\n","// @flow\n\nimport {toString} from './types.js';\n\nimport ParsingContext from './parsing_context.js';\nimport EvaluationContext from './evaluation_context.js';\nimport assert from 'assert';\n\nimport type {Expression, ExpressionRegistry} from './expression.js';\nimport type {Type} from './types.js';\nimport type {Value} from './values.js';\n\nexport type Varargs = {| type: Type |};\ntype Signature = Array | Varargs;\ntype Evaluate = (EvaluationContext, Array) => Value;\ntype Definition = [Type, Signature, Evaluate] |\n {|type: Type, overloads: Array<[Signature, Evaluate]>|};\n\nclass CompoundExpression implements Expression {\n name: string;\n type: Type;\n _evaluate: Evaluate;\n args: Array;\n\n static definitions: {[_: string]: Definition };\n\n constructor(name: string, type: Type, evaluate: Evaluate, args: Array) {\n this.name = name;\n this.type = type;\n this._evaluate = evaluate;\n this.args = args;\n }\n\n evaluate(ctx: EvaluationContext): Value {\n return this._evaluate(ctx, this.args);\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): Array {\n return [this.name].concat(this.args.map(arg => arg.serialize()));\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n const op: string = (args[0]: any);\n const definition = CompoundExpression.definitions[op];\n if (!definition) {\n return context.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n }\n\n // Now check argument types against each signature\n const type = Array.isArray(definition) ?\n definition[0] : definition.type;\n\n const availableOverloads = Array.isArray(definition) ?\n [[definition[1], definition[2]]] :\n definition.overloads;\n\n const overloads = availableOverloads.filter(([signature]) => (\n !Array.isArray(signature) || // varags\n signature.length === args.length - 1 // correct param count\n ));\n\n let signatureContext: ParsingContext = (null: any);\n\n for (const [params, evaluate] of overloads) {\n // Use a fresh context for each attempted signature so that, if\n // we eventually succeed, we haven't polluted `context.errors`.\n signatureContext = new ParsingContext(context.registry, context.path, null, context.scope);\n\n // First parse all the args, potentially coercing to the\n // types expected by this overload.\n const parsedArgs: Array = [];\n let argParseFailed = false;\n for (let i = 1; i < args.length; i++) {\n const arg = args[i];\n const expectedType = Array.isArray(params) ?\n params[i - 1] :\n params.type;\n\n const parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType);\n if (!parsed) {\n argParseFailed = true;\n break;\n }\n parsedArgs.push(parsed);\n }\n if (argParseFailed) {\n // Couldn't coerce args of this overload to expected type, move\n // on to next one.\n continue;\n }\n\n if (Array.isArray(params)) {\n if (params.length !== parsedArgs.length) {\n signatureContext.error(`Expected ${params.length} arguments, but found ${parsedArgs.length} instead.`);\n continue;\n }\n }\n\n for (let i = 0; i < parsedArgs.length; i++) {\n const expected = Array.isArray(params) ? params[i] : params.type;\n const arg = parsedArgs[i];\n signatureContext.concat(i + 1).checkSubtype(expected, arg.type);\n }\n\n if (signatureContext.errors.length === 0) {\n return new CompoundExpression(op, type, evaluate, parsedArgs);\n }\n }\n\n assert(!signatureContext || signatureContext.errors.length > 0);\n\n if (overloads.length === 1) {\n context.errors.push(...signatureContext.errors);\n } else {\n const expected = overloads.length ? overloads : availableOverloads;\n const signatures = expected\n .map(([params]) => stringifySignature(params))\n .join(' | ');\n\n const actualTypes = [];\n // For error message, re-parse arguments without trying to\n // apply any coercions\n for (let i = 1; i < args.length; i++) {\n const parsed = context.parse(args[i], 1 + actualTypes.length);\n if (!parsed) return null;\n actualTypes.push(toString(parsed.type));\n }\n context.error(`Expected arguments of type ${signatures}, but found (${actualTypes.join(', ')}) instead.`);\n }\n\n return null;\n }\n\n static register(\n registry: ExpressionRegistry,\n definitions: {[_: string]: Definition }\n ) {\n assert(!CompoundExpression.definitions);\n CompoundExpression.definitions = definitions;\n for (const name in definitions) {\n registry[name] = CompoundExpression;\n }\n }\n}\n\nfunction stringifySignature(signature: Signature): string {\n if (Array.isArray(signature)) {\n return `(${signature.map(toString).join(', ')})`;\n } else {\n return `(${toString(signature.type)}...)`;\n }\n}\n\nexport default CompoundExpression;\n","// @flow\n\nimport {StringType, BooleanType, CollatorType} from '../types.js';\nimport Collator from '../types/collator.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\nexport default class CollatorExpression implements Expression {\n type: Type;\n caseSensitive: Expression;\n diacriticSensitive: Expression;\n locale: Expression | null;\n\n constructor(caseSensitive: Expression, diacriticSensitive: Expression, locale: Expression | null) {\n this.type = CollatorType;\n this.locale = locale;\n this.caseSensitive = caseSensitive;\n this.diacriticSensitive = diacriticSensitive;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 2)\n return context.error(`Expected one argument.`);\n\n const options = (args[1]: any);\n if (typeof options !== \"object\" || Array.isArray(options))\n return context.error(`Collator options argument must be an object.`);\n\n const caseSensitive = context.parse(\n options['case-sensitive'] === undefined ? false : options['case-sensitive'], 1, BooleanType);\n if (!caseSensitive) return null;\n\n const diacriticSensitive = context.parse(\n options['diacritic-sensitive'] === undefined ? false : options['diacritic-sensitive'], 1, BooleanType);\n if (!diacriticSensitive) return null;\n\n let locale = null;\n if (options['locale']) {\n locale = context.parse(options['locale'], 1, StringType);\n if (!locale) return null;\n }\n\n return new CollatorExpression(caseSensitive, diacriticSensitive, locale);\n }\n\n evaluate(ctx: EvaluationContext): Collator {\n return new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.caseSensitive);\n fn(this.diacriticSensitive);\n if (this.locale) {\n fn(this.locale);\n }\n }\n\n outputDefined(): boolean {\n // Technically the set of possible outputs is the combinatoric set of Collators produced\n // by all possible outputs of locale/caseSensitive/diacriticSensitive\n // But for the primary use of Collators in comparison operators, we ignore the Collator's\n // possible outputs anyway, so we can get away with leaving this false for now.\n return false;\n }\n\n serialize(): SerializedExpression {\n const options = {};\n options['case-sensitive'] = this.caseSensitive.serialize();\n options['diacritic-sensitive'] = this.diacriticSensitive.serialize();\n if (this.locale) {\n options['locale'] = this.locale.serialize();\n }\n return [\"collator\", options];\n }\n}\n","// @flow\n\nimport {isValue} from '../values.js';\nimport type {Type} from '../types.js';\nimport {BooleanType} from '../types.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {GeoJSON, GeoJSONPolygon, GeoJSONMultiPolygon} from '@mapbox/geojson-types';\nimport type {CanonicalTileID} from '../../../source/tile_id.js';\n\ntype GeoJSONPolygons =| GeoJSONPolygon | GeoJSONMultiPolygon;\n\n// minX, minY, maxX, maxY\ntype BBox = [number, number, number, number];\nconst EXTENT = 8192;\n\nfunction updateBBox(bbox: BBox, coord: [number, number]) {\n bbox[0] = Math.min(bbox[0], coord[0]);\n bbox[1] = Math.min(bbox[1], coord[1]);\n bbox[2] = Math.max(bbox[2], coord[0]);\n bbox[3] = Math.max(bbox[3], coord[1]);\n}\n\nfunction mercatorXfromLng(lng: number) {\n return (180 + lng) / 360;\n}\n\nfunction mercatorYfromLat(lat: number) {\n return (180 - (180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360)))) / 360;\n}\n\nfunction boxWithinBox(bbox1: BBox, bbox2: BBox) {\n if (bbox1[0] <= bbox2[0]) return false;\n if (bbox1[2] >= bbox2[2]) return false;\n if (bbox1[1] <= bbox2[1]) return false;\n if (bbox1[3] >= bbox2[3]) return false;\n return true;\n}\n\nfunction getTileCoordinates(p, canonical: CanonicalTileID) {\n const x = mercatorXfromLng(p[0]);\n const y = mercatorYfromLat(p[1]);\n const tilesAtZoom = Math.pow(2, canonical.z);\n return [Math.round(x * tilesAtZoom * EXTENT), Math.round(y * tilesAtZoom * EXTENT)];\n}\n\nfunction onBoundary(p, p1, p2) {\n const x1 = p[0] - p1[0];\n const y1 = p[1] - p1[1];\n const x2 = p[0] - p2[0];\n const y2 = p[1] - p2[1];\n return (x1 * y2 - x2 * y1 === 0) && (x1 * x2 <= 0) && (y1 * y2 <= 0);\n}\n\nfunction rayIntersect(p, p1, p2) {\n return ((p1[1] > p[1]) !== (p2[1] > p[1])) && (p[0] < (p2[0] - p1[0]) * (p[1] - p1[1]) / (p2[1] - p1[1]) + p1[0]);\n}\n\n// ray casting algorithm for detecting if point is in polygon\nfunction pointWithinPolygon(point, rings) {\n let inside = false;\n for (let i = 0, len = rings.length; i < len; i++) {\n const ring = rings[i];\n for (let j = 0, len2 = ring.length; j < len2 - 1; j++) {\n if (onBoundary(point, ring[j], ring[j + 1])) return false;\n if (rayIntersect(point, ring[j], ring[j + 1])) inside = !inside;\n }\n }\n return inside;\n}\n\nfunction pointWithinPolygons(point, polygons) {\n for (let i = 0; i < polygons.length; i++) {\n if (pointWithinPolygon(point, polygons[i])) return true;\n }\n return false;\n}\n\nfunction perp(v1, v2) {\n return (v1[0] * v2[1] - v1[1] * v2[0]);\n}\n\n// check if p1 and p2 are in different sides of line segment q1->q2\nfunction twoSided(p1, p2, q1, q2) {\n // q1->p1 (x1, y1), q1->p2 (x2, y2), q1->q2 (x3, y3)\n const x1 = p1[0] - q1[0];\n const y1 = p1[1] - q1[1];\n const x2 = p2[0] - q1[0];\n const y2 = p2[1] - q1[1];\n const x3 = q2[0] - q1[0];\n const y3 = q2[1] - q1[1];\n const det1 = (x1 * y3 - x3 * y1);\n const det2 = (x2 * y3 - x3 * y2);\n if ((det1 > 0 && det2 < 0) || (det1 < 0 && det2 > 0)) return true;\n return false;\n}\n// a, b are end points for line segment1, c and d are end points for line segment2\nfunction lineIntersectLine(a, b, c, d) {\n // check if two segments are parallel or not\n // precondition is end point a, b is inside polygon, if line a->b is\n // parallel to polygon edge c->d, then a->b won't intersect with c->d\n const vectorP = [b[0] - a[0], b[1] - a[1]];\n const vectorQ = [d[0] - c[0], d[1] - c[1]];\n if (perp(vectorQ, vectorP) === 0) return false;\n\n // If lines are intersecting with each other, the relative location should be:\n // a and b lie in different sides of segment c->d\n // c and d lie in different sides of segment a->b\n if (twoSided(a, b, c, d) && twoSided(c, d, a, b)) return true;\n return false;\n}\n\nfunction lineIntersectPolygon(p1, p2, polygon) {\n for (const ring of polygon) {\n // loop through every edge of the ring\n for (let j = 0; j < ring.length - 1; ++j) {\n if (lineIntersectLine(p1, p2, ring[j], ring[j + 1])) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction lineStringWithinPolygon(line, polygon) {\n // First, check if geometry points of line segments are all inside polygon\n for (let i = 0; i < line.length; ++i) {\n if (!pointWithinPolygon(line[i], polygon)) {\n return false;\n }\n }\n\n // Second, check if there is line segment intersecting polygon edge\n for (let i = 0; i < line.length - 1; ++i) {\n if (lineIntersectPolygon(line[i], line[i + 1], polygon)) {\n return false;\n }\n }\n return true;\n}\n\nfunction lineStringWithinPolygons(line, polygons) {\n for (let i = 0; i < polygons.length; i++) {\n if (lineStringWithinPolygon(line, polygons[i])) return true;\n }\n return false;\n}\n\nfunction getTilePolygon(coordinates, bbox: BBox, canonical: CanonicalTileID) {\n const polygon = [];\n for (let i = 0; i < coordinates.length; i++) {\n const ring = [];\n for (let j = 0; j < coordinates[i].length; j++) {\n const coord = getTileCoordinates(coordinates[i][j], canonical);\n updateBBox(bbox, coord);\n ring.push(coord);\n }\n polygon.push(ring);\n }\n return polygon;\n}\n\nfunction getTilePolygons(coordinates, bbox, canonical: CanonicalTileID) {\n const polygons = [];\n for (let i = 0; i < coordinates.length; i++) {\n const polygon = getTilePolygon(coordinates[i], bbox, canonical);\n polygons.push(polygon);\n }\n return polygons;\n}\n\nfunction updatePoint(p, bbox, polyBBox, worldSize) {\n if (p[0] < polyBBox[0] || p[0] > polyBBox[2]) {\n const halfWorldSize = worldSize * 0.5;\n let shift = (p[0] - polyBBox[0] > halfWorldSize) ? -worldSize : (polyBBox[0] - p[0] > halfWorldSize) ? worldSize : 0;\n if (shift === 0) {\n shift = (p[0] - polyBBox[2] > halfWorldSize) ? -worldSize : (polyBBox[2] - p[0] > halfWorldSize) ? worldSize : 0;\n }\n p[0] += shift;\n }\n updateBBox(bbox, p);\n}\n\nfunction resetBBox(bbox) {\n bbox[0] = bbox[1] = Infinity;\n bbox[2] = bbox[3] = -Infinity;\n}\n\nfunction getTilePoints(geometry, pointBBox, polyBBox, canonical: CanonicalTileID) {\n const worldSize = Math.pow(2, canonical.z) * EXTENT;\n const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n const tilePoints = [];\n if (!geometry) return tilePoints;\n for (const points of geometry) {\n for (const point of points) {\n const p = [point.x + shifts[0], point.y + shifts[1]];\n updatePoint(p, pointBBox, polyBBox, worldSize);\n tilePoints.push(p);\n }\n }\n return tilePoints;\n}\n\nfunction getTileLines(geometry, lineBBox, polyBBox, canonical: CanonicalTileID) {\n const worldSize = Math.pow(2, canonical.z) * EXTENT;\n const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n const tileLines = [];\n if (!geometry) return tileLines;\n for (const line of geometry) {\n const tileLine = [];\n for (const point of line) {\n const p = [point.x + shifts[0], point.y + shifts[1]];\n updateBBox(lineBBox, p);\n tileLine.push(p);\n }\n tileLines.push(tileLine);\n }\n if (lineBBox[2] - lineBBox[0] <= worldSize / 2) {\n resetBBox(lineBBox);\n for (const line of tileLines) {\n for (const p of line) {\n updatePoint(p, lineBBox, polyBBox, worldSize);\n }\n }\n }\n return tileLines;\n}\n\nfunction pointsWithinPolygons(ctx: EvaluationContext, polygonGeometry: GeoJSONPolygons) {\n const pointBBox = [Infinity, Infinity, -Infinity, -Infinity];\n const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n\n const canonical = ctx.canonicalID();\n if (!canonical) {\n return false;\n }\n\n if (polygonGeometry.type === 'Polygon') {\n const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n if (!boxWithinBox(pointBBox, polyBBox)) return false;\n\n for (const point of tilePoints) {\n if (!pointWithinPolygon(point, tilePolygon)) return false;\n }\n }\n if (polygonGeometry.type === 'MultiPolygon') {\n const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n if (!boxWithinBox(pointBBox, polyBBox)) return false;\n\n for (const point of tilePoints) {\n if (!pointWithinPolygons(point, tilePolygons)) return false;\n }\n }\n\n return true;\n}\n\nfunction linesWithinPolygons(ctx: EvaluationContext, polygonGeometry: GeoJSONPolygons) {\n const lineBBox = [Infinity, Infinity, -Infinity, -Infinity];\n const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n\n const canonical = ctx.canonicalID();\n if (!canonical) {\n return false;\n }\n\n if (polygonGeometry.type === 'Polygon') {\n const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n if (!boxWithinBox(lineBBox, polyBBox)) return false;\n\n for (const line of tileLines) {\n if (!lineStringWithinPolygon(line, tilePolygon)) return false;\n }\n }\n if (polygonGeometry.type === 'MultiPolygon') {\n const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n if (!boxWithinBox(lineBBox, polyBBox)) return false;\n\n for (const line of tileLines) {\n if (!lineStringWithinPolygons(line, tilePolygons)) return false;\n }\n }\n return true;\n}\n\nclass Within implements Expression {\n type: Type;\n geojson: GeoJSON\n geometries: GeoJSONPolygons;\n\n constructor(geojson: GeoJSON, geometries: GeoJSONPolygons) {\n this.type = BooleanType;\n this.geojson = geojson;\n this.geometries = geometries;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Within {\n if (args.length !== 2)\n return context.error(`'within' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n if (isValue(args[1])) {\n const geojson = (args[1]: Object);\n if (geojson.type === 'FeatureCollection') {\n for (let i = 0; i < geojson.features.length; ++i) {\n const type = geojson.features[i].geometry.type;\n if (type === 'Polygon' || type === 'MultiPolygon') {\n return new Within(geojson, geojson.features[i].geometry);\n }\n }\n } else if (geojson.type === 'Feature') {\n const type = geojson.geometry.type;\n if (type === 'Polygon' || type === 'MultiPolygon') {\n return new Within(geojson, geojson.geometry);\n }\n } else if (geojson.type === 'Polygon' || geojson.type === 'MultiPolygon') {\n return new Within(geojson, geojson);\n }\n }\n return context.error(`'within' expression requires valid geojson object that contains polygon geometry type.`);\n }\n\n evaluate(ctx: EvaluationContext): boolean {\n if (ctx.geometry() != null && ctx.canonicalID() != null) {\n if (ctx.geometryType() === 'Point') {\n return pointsWithinPolygons(ctx, this.geometries);\n } else if (ctx.geometryType() === 'LineString') {\n return linesWithinPolygons(ctx, this.geometries);\n }\n }\n return false;\n }\n\n eachChild() {}\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n return [\"within\", this.geojson];\n }\n\n}\n\nexport default Within;\n","// @flow\n\nimport CompoundExpression from './compound_expression.js';\nimport Within from './definitions/within.js';\nimport type {Expression} from './expression.js';\n\nfunction isFeatureConstant(e: Expression): boolean {\n if (e instanceof CompoundExpression) {\n if (e.name === 'get' && e.args.length === 1) {\n return false;\n } else if (e.name === 'feature-state') {\n return false;\n } else if (e.name === 'has' && e.args.length === 1) {\n return false;\n } else if (\n e.name === 'properties' ||\n e.name === 'geometry-type' ||\n e.name === 'id'\n ) {\n return false;\n } else if (/^filter-/.test(e.name)) {\n return false;\n }\n }\n\n if (e instanceof Within) {\n return false;\n }\n\n let result = true;\n e.eachChild(arg => {\n if (result && !isFeatureConstant(arg)) { result = false; }\n });\n return result;\n}\n\nfunction isStateConstant(e: Expression): boolean {\n if (e instanceof CompoundExpression) {\n if (e.name === 'feature-state') {\n return false;\n }\n }\n let result = true;\n e.eachChild(arg => {\n if (result && !isStateConstant(arg)) { result = false; }\n });\n return result;\n}\n\nfunction isGlobalPropertyConstant(e: Expression, properties: Array): boolean {\n if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) { return false; }\n let result = true;\n e.eachChild((arg) => {\n if (result && !isGlobalPropertyConstant(arg, properties)) { result = false; }\n });\n return result;\n}\n\nexport {isFeatureConstant, isGlobalPropertyConstant, isStateConstant};\n","// @flow\n\nimport type {Type} from '../types.js';\nimport type {Expression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\n\nclass Var implements Expression {\n type: Type;\n name: string;\n boundExpression: Expression;\n\n constructor(name: string, boundExpression: Expression) {\n this.type = boundExpression.type;\n this.name = name;\n this.boundExpression = boundExpression;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): void | Var {\n if (args.length !== 2 || typeof args[1] !== 'string')\n return context.error(`'var' expression requires exactly one string literal argument.`);\n\n const name = args[1];\n if (!context.scope.has(name)) {\n return context.error(`Unknown variable \"${name}\". Make sure \"${name}\" has been bound in an enclosing \"let\" expression before using it.`, 1);\n }\n\n return new Var(name, context.scope.get(name));\n }\n\n evaluate(ctx: EvaluationContext): any {\n return this.boundExpression.evaluate(ctx);\n }\n\n eachChild() {}\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): Array {\n return [\"var\", this.name];\n }\n}\n\nexport default Var;\n","// @flow\n\nimport Scope from './scope.js';\nimport {checkSubtype} from './types.js';\nimport ParsingError from './parsing_error.js';\nimport Literal from './definitions/literal.js';\nimport Assertion from './definitions/assertion.js';\nimport Coercion from './definitions/coercion.js';\nimport EvaluationContext from './evaluation_context.js';\nimport CompoundExpression from './compound_expression.js';\nimport CollatorExpression from './definitions/collator.js';\nimport Within from './definitions/within.js';\nimport {isGlobalPropertyConstant, isFeatureConstant} from './is_constant.js';\nimport Var from './definitions/var.js';\n\nimport type {Expression, ExpressionRegistry} from './expression.js';\nimport type {Type} from './types.js';\n\n/**\n * State associated parsing at a given point in an expression tree.\n * @private\n */\nclass ParsingContext {\n registry: ExpressionRegistry;\n path: Array;\n key: string;\n scope: Scope;\n errors: Array;\n\n // The expected type of this expression. Provided only to allow Expression\n // implementations to infer argument types: Expression#parse() need not\n // check that the output type of the parsed expression matches\n // `expectedType`.\n expectedType: ?Type;\n\n constructor(\n registry: ExpressionRegistry,\n path: Array = [],\n expectedType: ?Type,\n scope: Scope = new Scope(),\n errors: Array = []\n ) {\n this.registry = registry;\n this.path = path;\n this.key = path.map(part => `[${part}]`).join('');\n this.scope = scope;\n this.errors = errors;\n this.expectedType = expectedType;\n }\n\n /**\n * @param expr the JSON expression to parse\n * @param index the optional argument index if this expression is an argument of a parent expression that's being parsed\n * @param options\n * @param options.omitTypeAnnotations set true to omit inferred type annotations. Caller beware: with this option set, the parsed expression's type will NOT satisfy `expectedType` if it would normally be wrapped in an inferred annotation.\n * @private\n */\n parse(\n expr: mixed,\n index?: number,\n expectedType?: ?Type,\n bindings?: Array<[string, Expression]>,\n options: {typeAnnotation?: 'assert' | 'coerce' | 'omit'} = {}\n ): ?Expression {\n if (index) {\n return this.concat(index, expectedType, bindings)._parse(expr, options);\n }\n return this._parse(expr, options);\n }\n\n _parse(expr: mixed, options: {typeAnnotation?: 'assert' | 'coerce' | 'omit'}): ?Expression {\n if (expr === null || typeof expr === 'string' || typeof expr === 'boolean' || typeof expr === 'number') {\n expr = ['literal', expr];\n }\n\n function annotate(parsed, type, typeAnnotation: 'assert' | 'coerce' | 'omit') {\n if (typeAnnotation === 'assert') {\n return new Assertion(type, [parsed]);\n } else if (typeAnnotation === 'coerce') {\n return new Coercion(type, [parsed]);\n } else {\n return parsed;\n }\n }\n\n if (Array.isArray(expr)) {\n if (expr.length === 0) {\n return this.error(`Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].`);\n }\n\n const op = expr[0];\n if (typeof op !== 'string') {\n this.error(`Expression name must be a string, but found ${typeof op} instead. If you wanted a literal array, use [\"literal\", [...]].`, 0);\n return null;\n }\n\n const Expr = this.registry[op];\n if (Expr) {\n let parsed = Expr.parse(expr, this);\n if (!parsed) return null;\n\n if (this.expectedType) {\n const expected = this.expectedType;\n const actual = parsed.type;\n\n // When we expect a number, string, boolean, or array but have a value, wrap it in an assertion.\n // When we expect a color or formatted string, but have a string or value, wrap it in a coercion.\n // Otherwise, we do static type-checking.\n //\n // These behaviors are overridable for:\n // * The \"coalesce\" operator, which needs to omit type annotations.\n // * String-valued properties (e.g. `text-field`), where coercion is more convenient than assertion.\n //\n if ((expected.kind === 'string' || expected.kind === 'number' || expected.kind === 'boolean' || expected.kind === 'object' || expected.kind === 'array') && actual.kind === 'value') {\n parsed = annotate(parsed, expected, options.typeAnnotation || 'assert');\n } else if ((expected.kind === 'color' || expected.kind === 'formatted' || expected.kind === 'resolvedImage') && (actual.kind === 'value' || actual.kind === 'string')) {\n parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');\n } else if (this.checkSubtype(expected, actual)) {\n return null;\n }\n }\n\n // If an expression's arguments are all literals, we can evaluate\n // it immediately and replace it with a literal value in the\n // parsed/compiled result. Expressions that expect an image should\n // not be resolved here so we can later get the available images.\n if (!(parsed instanceof Literal) && (parsed.type.kind !== 'resolvedImage') && isConstant(parsed)) {\n const ec = new EvaluationContext();\n try {\n parsed = new Literal(parsed.type, parsed.evaluate(ec));\n } catch (e) {\n this.error(e.message);\n return null;\n }\n }\n\n return parsed;\n }\n\n return this.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n } else if (typeof expr === 'undefined') {\n return this.error(`'undefined' value invalid. Use null instead.`);\n } else if (typeof expr === 'object') {\n return this.error(`Bare objects invalid. Use [\"literal\", {...}] instead.`);\n } else {\n return this.error(`Expected an array, but found ${typeof expr} instead.`);\n }\n }\n\n /**\n * Returns a copy of this context suitable for parsing the subexpression at\n * index `index`, optionally appending to 'let' binding map.\n *\n * Note that `errors` property, intended for collecting errors while\n * parsing, is copied by reference rather than cloned.\n * @private\n */\n concat(index: number, expectedType?: ?Type, bindings?: Array<[string, Expression]>): ParsingContext {\n const path = typeof index === 'number' ? this.path.concat(index) : this.path;\n const scope = bindings ? this.scope.concat(bindings) : this.scope;\n return new ParsingContext(\n this.registry,\n path,\n expectedType || null,\n scope,\n this.errors\n );\n }\n\n /**\n * Push a parsing (or type checking) error into the `this.errors`\n * @param error The message\n * @param keys Optionally specify the source of the error at a child\n * of the current expression at `this.key`.\n * @private\n */\n error(error: string, ...keys: Array) {\n const key = `${this.key}${keys.map(k => `[${k}]`).join('')}`;\n this.errors.push(new ParsingError(key, error));\n }\n\n /**\n * Returns null if `t` is a subtype of `expected`; otherwise returns an\n * error message and also pushes it to `this.errors`.\n */\n checkSubtype(expected: Type, t: Type): ?string {\n const error = checkSubtype(expected, t);\n if (error) this.error(error);\n return error;\n }\n}\n\nexport default ParsingContext;\n\nfunction isConstant(expression: Expression) {\n if (expression instanceof Var) {\n return isConstant(expression.boundExpression);\n } else if (expression instanceof CompoundExpression && expression.name === 'error') {\n return false;\n } else if (expression instanceof CollatorExpression) {\n // Although the results of a Collator expression with fixed arguments\n // generally shouldn't change between executions, we can't serialize them\n // as constant expressions because results change based on environment.\n return false;\n } else if (expression instanceof Within) {\n return false;\n }\n\n const isTypeAnnotation = expression instanceof Coercion ||\n expression instanceof Assertion;\n\n let childrenConstant = true;\n expression.eachChild(child => {\n // We can _almost_ assume that if `expressions` children are constant,\n // they would already have been evaluated to Literal values when they\n // were parsed. Type annotations are the exception, because they might\n // have been inferred and added after a child was parsed.\n\n // So we recurse into isConstant() for the children of type annotations,\n // but otherwise simply check whether they are Literals.\n if (isTypeAnnotation) {\n childrenConstant = childrenConstant && isConstant(child);\n } else {\n childrenConstant = childrenConstant && child instanceof Literal;\n }\n });\n if (!childrenConstant) {\n return false;\n }\n\n return isFeatureConstant(expression) &&\n isGlobalPropertyConstant(expression, ['zoom', 'heatmap-density', 'line-progress', 'sky-radial-progress', 'accumulated', 'is-supported-script', 'pitch', 'distance-from-center']);\n}\n","// @flow\n\nimport RuntimeError from './runtime_error.js';\n\nimport type {Expression} from './expression.js';\n\nexport type Stops = Array<[number, Expression]>;\n\n/**\n * Returns the index of the last stop <= input, or 0 if it doesn't exist.\n * @private\n */\nexport function findStopLessThanOrEqualTo(stops: Array, input: number): number {\n const lastIndex = stops.length - 1;\n let lowerIndex = 0;\n let upperIndex = lastIndex;\n let currentIndex = 0;\n let currentValue, nextValue;\n\n while (lowerIndex <= upperIndex) {\n currentIndex = Math.floor((lowerIndex + upperIndex) / 2);\n currentValue = stops[currentIndex];\n nextValue = stops[currentIndex + 1];\n\n if (currentValue <= input) {\n if (currentIndex === lastIndex || input < nextValue) { // Search complete\n return currentIndex;\n }\n\n lowerIndex = currentIndex + 1;\n } else if (currentValue > input) {\n upperIndex = currentIndex - 1;\n } else {\n throw new RuntimeError('Input is not a number.');\n }\n }\n\n return 0;\n}\n","// @flow\n\nimport {NumberType} from '../types.js';\n\nimport {findStopLessThanOrEqualTo} from '../stops.js';\n\nimport type {Stops} from '../stops.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Step implements Expression {\n type: Type;\n\n input: Expression;\n labels: Array;\n outputs: Array;\n\n constructor(type: Type, input: Expression, stops: Stops) {\n this.type = type;\n this.input = input;\n\n this.labels = [];\n this.outputs = [];\n for (const [label, expression] of stops) {\n this.labels.push(label);\n this.outputs.push(expression);\n }\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Step {\n if (args.length - 1 < 4) {\n return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n }\n\n if ((args.length - 1) % 2 !== 0) {\n return context.error(`Expected an even number of arguments.`);\n }\n\n const input = context.parse(args[1], 1, NumberType);\n if (!input) return null;\n\n const stops: Stops = [];\n\n let outputType: Type = (null: any);\n if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n\n for (let i = 1; i < args.length; i += 2) {\n const label = i === 1 ? -Infinity : args[i];\n const value = args[i + 1];\n\n const labelKey = i;\n const valueKey = i + 1;\n\n if (typeof label !== 'number') {\n return context.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n }\n\n if (stops.length && stops[stops.length - 1][0] >= label) {\n return context.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n }\n\n const parsed = context.parse(value, valueKey, outputType);\n if (!parsed) return null;\n outputType = outputType || parsed.type;\n stops.push([label, parsed]);\n }\n\n return new Step(outputType, input, stops);\n }\n\n evaluate(ctx: EvaluationContext): any {\n const labels = this.labels;\n const outputs = this.outputs;\n\n if (labels.length === 1) {\n return outputs[0].evaluate(ctx);\n }\n\n const value = ((this.input.evaluate(ctx): any): number);\n if (value <= labels[0]) {\n return outputs[0].evaluate(ctx);\n }\n\n const stopCount = labels.length;\n if (value >= labels[stopCount - 1]) {\n return outputs[stopCount - 1].evaluate(ctx);\n }\n\n const index = findStopLessThanOrEqualTo(labels, value);\n return outputs[index].evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n for (const expression of this.outputs) {\n fn(expression);\n }\n }\n\n outputDefined(): boolean {\n return this.outputs.every(out => out.outputDefined());\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"step\", this.input.serialize()];\n for (let i = 0; i < this.labels.length; i++) {\n if (i > 0) {\n serialized.push(this.labels[i]);\n }\n serialized.push(this.outputs[i].serialize());\n }\n return serialized;\n }\n}\n\nexport default Step;\n","/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * Ported from Webkit\n * http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/platform/graphics/UnitBezier.h\n */\n\nmodule.exports = UnitBezier;\n\nfunction UnitBezier(p1x, p1y, p2x, p2y) {\n // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n this.cx = 3.0 * p1x;\n this.bx = 3.0 * (p2x - p1x) - this.cx;\n this.ax = 1.0 - this.cx - this.bx;\n\n this.cy = 3.0 * p1y;\n this.by = 3.0 * (p2y - p1y) - this.cy;\n this.ay = 1.0 - this.cy - this.by;\n\n this.p1x = p1x;\n this.p1y = p2y;\n this.p2x = p2x;\n this.p2y = p2y;\n}\n\nUnitBezier.prototype.sampleCurveX = function(t) {\n // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n return ((this.ax * t + this.bx) * t + this.cx) * t;\n};\n\nUnitBezier.prototype.sampleCurveY = function(t) {\n return ((this.ay * t + this.by) * t + this.cy) * t;\n};\n\nUnitBezier.prototype.sampleCurveDerivativeX = function(t) {\n return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n};\n\nUnitBezier.prototype.solveCurveX = function(x, epsilon) {\n if (typeof epsilon === 'undefined') epsilon = 1e-6;\n\n var t0, t1, t2, x2, i;\n\n // First try a few iterations of Newton's method -- normally very fast.\n for (t2 = x, i = 0; i < 8; i++) {\n\n x2 = this.sampleCurveX(t2) - x;\n if (Math.abs(x2) < epsilon) return t2;\n\n var d2 = this.sampleCurveDerivativeX(t2);\n if (Math.abs(d2) < 1e-6) break;\n\n t2 = t2 - x2 / d2;\n }\n\n // Fall back to the bisection method for reliability.\n t0 = 0.0;\n t1 = 1.0;\n t2 = x;\n\n if (t2 < t0) return t0;\n if (t2 > t1) return t1;\n\n while (t0 < t1) {\n\n x2 = this.sampleCurveX(t2);\n if (Math.abs(x2 - x) < epsilon) return t2;\n\n if (x > x2) {\n t0 = t2;\n } else {\n t1 = t2;\n }\n\n t2 = (t1 - t0) * 0.5 + t0;\n }\n\n // Failure.\n return t2;\n};\n\nUnitBezier.prototype.solve = function(x, epsilon) {\n return this.sampleCurveY(this.solveCurveX(x, epsilon));\n};\n","// @flow\n\nimport Color from './color.js';\n\nexport function number(a: number, b: number, t: number): number {\n return (a * (1 - t)) + (b * t);\n}\n\nexport function color(from: Color, to: Color, t: number): Color {\n return new Color(\n number(from.r, to.r, t),\n number(from.g, to.g, t),\n number(from.b, to.b, t),\n number(from.a, to.a, t)\n );\n}\n\nexport function array(from: Array, to: Array, t: number): Array {\n return from.map((d, i) => {\n return number(d, to[i], t);\n });\n}\n","// @flow\n\nimport Color from './color.js';\n\nimport {number as interpolateNumber} from './interpolate.js';\n\ntype LABColor = {\n l: number,\n a: number,\n b: number,\n alpha: number\n};\n\ntype HCLColor = {\n h: number,\n c: number,\n l: number,\n alpha: number\n};\n\n// Constants\nconst Xn = 0.950470, // D65 standard referent\n Yn = 1,\n Zn = 1.088830,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1,\n deg2rad = Math.PI / 180,\n rad2deg = 180 / Math.PI;\n\n// Utilities\nfunction xyz2lab(t: number) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t: number) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction xyz2rgb(x: number) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2xyz(x: number) {\n x /= 255;\n return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\n// LAB\nfunction rgbToLab(rgbColor: Color): LABColor {\n const b = rgb2xyz(rgbColor.r),\n a = rgb2xyz(rgbColor.g),\n l = rgb2xyz(rgbColor.b),\n x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn),\n y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.0721750 * l) / Yn),\n z = xyz2lab((0.0193339 * b + 0.1191920 * a + 0.9503041 * l) / Zn);\n\n return {\n l: 116 * y - 16,\n a: 500 * (x - y),\n b: 200 * (y - z),\n alpha: rgbColor.a\n };\n}\n\nfunction labToRgb(labColor: LABColor): Color {\n let y = (labColor.l + 16) / 116,\n x = isNaN(labColor.a) ? y : y + labColor.a / 500,\n z = isNaN(labColor.b) ? y : y - labColor.b / 200;\n y = Yn * lab2xyz(y);\n x = Xn * lab2xyz(x);\n z = Zn * lab2xyz(z);\n return new Color(\n xyz2rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB\n xyz2rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),\n xyz2rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z),\n labColor.alpha\n );\n}\n\nfunction interpolateLab(from: LABColor, to: LABColor, t: number): LABColor {\n return {\n l: interpolateNumber(from.l, to.l, t),\n a: interpolateNumber(from.a, to.a, t),\n b: interpolateNumber(from.b, to.b, t),\n alpha: interpolateNumber(from.alpha, to.alpha, t)\n };\n}\n\n// HCL\nfunction rgbToHcl(rgbColor: Color): HCLColor {\n const {l, a, b} = rgbToLab(rgbColor);\n const h = Math.atan2(b, a) * rad2deg;\n return {\n h: h < 0 ? h + 360 : h,\n c: Math.sqrt(a * a + b * b),\n l,\n alpha: rgbColor.a\n };\n}\n\nfunction hclToRgb(hclColor: HCLColor): Color {\n const h = hclColor.h * deg2rad,\n c = hclColor.c,\n l = hclColor.l;\n return labToRgb({\n l,\n a: Math.cos(h) * c,\n b: Math.sin(h) * c,\n alpha: hclColor.alpha\n });\n}\n\nfunction interpolateHue(a: number, b: number, t: number) {\n const d = b - a;\n return a + t * (d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d);\n}\n\nfunction interpolateHcl(from: HCLColor, to: HCLColor, t: number): HCLColor {\n return {\n h: interpolateHue(from.h, to.h, t),\n c: interpolateNumber(from.c, to.c, t),\n l: interpolateNumber(from.l, to.l, t),\n alpha: interpolateNumber(from.alpha, to.alpha, t)\n };\n}\n\nexport const lab = {\n forward: rgbToLab,\n reverse: labToRgb,\n interpolate: interpolateLab\n};\n\nexport const hcl = {\n forward: rgbToHcl,\n reverse: hclToRgb,\n interpolate: interpolateHcl\n};\n","// @flow\n\nimport UnitBezier from '@mapbox/unitbezier';\n\nimport * as interpolate from '../../util/interpolate.js';\nimport {toString, NumberType, ColorType} from '../types.js';\nimport {findStopLessThanOrEqualTo} from '../stops.js';\nimport {hcl, lab} from '../../util/color_spaces.js';\nimport Color from '../../util/color.js';\n\nimport type {Stops} from '../stops.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nexport type InterpolationType =\n { name: 'linear' } |\n { name: 'exponential', base: number } |\n { name: 'cubic-bezier', controlPoints: [number, number, number, number] };\n\nclass Interpolate implements Expression {\n type: Type;\n\n operator: 'interpolate' | 'interpolate-hcl' | 'interpolate-lab';\n interpolation: InterpolationType;\n input: Expression;\n labels: Array;\n outputs: Array;\n\n constructor(type: Type, operator: 'interpolate' | 'interpolate-hcl' | 'interpolate-lab', interpolation: InterpolationType, input: Expression, stops: Stops) {\n this.type = type;\n this.operator = operator;\n this.interpolation = interpolation;\n this.input = input;\n\n this.labels = [];\n this.outputs = [];\n for (const [label, expression] of stops) {\n this.labels.push(label);\n this.outputs.push(expression);\n }\n }\n\n static interpolationFactor(interpolation: InterpolationType, input: number, lower: number, upper: number): number {\n let t = 0;\n if (interpolation.name === 'exponential') {\n t = exponentialInterpolation(input, interpolation.base, lower, upper);\n } else if (interpolation.name === 'linear') {\n t = exponentialInterpolation(input, 1, lower, upper);\n } else if (interpolation.name === 'cubic-bezier') {\n const c = interpolation.controlPoints;\n const ub = new UnitBezier(c[0], c[1], c[2], c[3]);\n t = ub.solve(exponentialInterpolation(input, 1, lower, upper));\n }\n return t;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Interpolate {\n let [operator, interpolation, input, ...rest] = args;\n\n if (!Array.isArray(interpolation) || interpolation.length === 0) {\n return context.error(`Expected an interpolation type expression.`, 1);\n }\n\n if (interpolation[0] === 'linear') {\n interpolation = {name: 'linear'};\n } else if (interpolation[0] === 'exponential') {\n const base = interpolation[1];\n if (typeof base !== 'number')\n return context.error(`Exponential interpolation requires a numeric base.`, 1, 1);\n interpolation = {\n name: 'exponential',\n base\n };\n } else if (interpolation[0] === 'cubic-bezier') {\n const controlPoints = interpolation.slice(1);\n if (\n controlPoints.length !== 4 ||\n controlPoints.some(t => typeof t !== 'number' || t < 0 || t > 1)\n ) {\n return context.error('Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.', 1);\n }\n\n interpolation = {\n name: 'cubic-bezier',\n controlPoints: (controlPoints: any)\n };\n } else {\n return context.error(`Unknown interpolation type ${String(interpolation[0])}`, 1, 0);\n }\n\n if (args.length - 1 < 4) {\n return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n }\n\n if ((args.length - 1) % 2 !== 0) {\n return context.error(`Expected an even number of arguments.`);\n }\n\n input = context.parse(input, 2, NumberType);\n if (!input) return null;\n\n const stops: Stops = [];\n\n let outputType: Type = (null: any);\n if (operator === 'interpolate-hcl' || operator === 'interpolate-lab') {\n outputType = ColorType;\n } else if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n\n for (let i = 0; i < rest.length; i += 2) {\n const label = rest[i];\n const value = rest[i + 1];\n\n const labelKey = i + 3;\n const valueKey = i + 4;\n\n if (typeof label !== 'number') {\n return context.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n }\n\n if (stops.length && stops[stops.length - 1][0] >= label) {\n return context.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n }\n\n const parsed = context.parse(value, valueKey, outputType);\n if (!parsed) return null;\n outputType = outputType || parsed.type;\n stops.push([label, parsed]);\n }\n\n if (outputType.kind !== 'number' &&\n outputType.kind !== 'color' &&\n !(\n outputType.kind === 'array' &&\n outputType.itemType.kind === 'number' &&\n typeof outputType.N === 'number'\n )\n ) {\n return context.error(`Type ${toString(outputType)} is not interpolatable.`);\n }\n\n return new Interpolate(outputType, (operator: any), interpolation, input, stops);\n }\n\n evaluate(ctx: EvaluationContext): Color {\n const labels = this.labels;\n const outputs = this.outputs;\n\n if (labels.length === 1) {\n return outputs[0].evaluate(ctx);\n }\n\n const value = ((this.input.evaluate(ctx): any): number);\n if (value <= labels[0]) {\n return outputs[0].evaluate(ctx);\n }\n\n const stopCount = labels.length;\n if (value >= labels[stopCount - 1]) {\n return outputs[stopCount - 1].evaluate(ctx);\n }\n\n const index = findStopLessThanOrEqualTo(labels, value);\n const lower = labels[index];\n const upper = labels[index + 1];\n const t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper);\n\n const outputLower = outputs[index].evaluate(ctx);\n const outputUpper = outputs[index + 1].evaluate(ctx);\n\n if (this.operator === 'interpolate') {\n return (interpolate[this.type.kind.toLowerCase()]: any)(outputLower, outputUpper, t); // eslint-disable-line import/namespace\n } else if (this.operator === 'interpolate-hcl') {\n return hcl.reverse(hcl.interpolate(hcl.forward(outputLower), hcl.forward(outputUpper), t));\n } else {\n return lab.reverse(lab.interpolate(lab.forward(outputLower), lab.forward(outputUpper), t));\n }\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n for (const expression of this.outputs) {\n fn(expression);\n }\n }\n\n outputDefined(): boolean {\n return this.outputs.every(out => out.outputDefined());\n }\n\n serialize(): SerializedExpression {\n let interpolation;\n if (this.interpolation.name === 'linear') {\n interpolation = [\"linear\"];\n } else if (this.interpolation.name === 'exponential') {\n if (this.interpolation.base === 1) {\n interpolation = [\"linear\"];\n } else {\n interpolation = [\"exponential\", this.interpolation.base];\n }\n } else {\n interpolation = [\"cubic-bezier\" ].concat(this.interpolation.controlPoints);\n }\n\n const serialized = [this.operator, interpolation, this.input.serialize()];\n\n for (let i = 0; i < this.labels.length; i++) {\n serialized.push(\n this.labels[i],\n this.outputs[i].serialize()\n );\n }\n return serialized;\n }\n}\n\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n * How it works: Two consecutive stop values define a (scaled and shifted) exponential function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n * = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`. In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n*/\nfunction exponentialInterpolation(input, base, lowerValue, upperValue) {\n const difference = upperValue - lowerValue;\n const progress = input - lowerValue;\n\n if (difference === 0) {\n return 0;\n } else if (base === 1) {\n return progress / difference;\n } else {\n return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n }\n}\n\nexport default Interpolate;\n","// @flow\n\nimport assert from 'assert';\n\nimport {checkSubtype, ValueType} from '../types.js';\nimport ResolvedImage from '../types/resolved_image.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Coalesce implements Expression {\n type: Type;\n args: Array;\n\n constructor(type: Type, args: Array) {\n this.type = type;\n this.args = args;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Coalesce {\n if (args.length < 2) {\n return context.error(\"Expectected at least one argument.\");\n }\n let outputType: Type = (null: any);\n const expectedType = context.expectedType;\n if (expectedType && expectedType.kind !== 'value') {\n outputType = expectedType;\n }\n const parsedArgs = [];\n\n for (const arg of args.slice(1)) {\n const parsed = context.parse(arg, 1 + parsedArgs.length, outputType, undefined, {typeAnnotation: 'omit'});\n if (!parsed) return null;\n outputType = outputType || parsed.type;\n parsedArgs.push(parsed);\n }\n assert(outputType);\n\n // Above, we parse arguments without inferred type annotation so that\n // they don't produce a runtime error for `null` input, which would\n // preempt the desired null-coalescing behavior.\n // Thus, if any of our arguments would have needed an annotation, we\n // need to wrap the enclosing coalesce expression with it instead.\n const needsAnnotation = expectedType &&\n parsedArgs.some(arg => checkSubtype(expectedType, arg.type));\n\n return needsAnnotation ?\n new Coalesce(ValueType, parsedArgs) :\n new Coalesce((outputType: any), parsedArgs);\n }\n\n evaluate(ctx: EvaluationContext): any | null {\n let result = null;\n let argCount = 0;\n let firstImage;\n for (const arg of this.args) {\n argCount++;\n result = arg.evaluate(ctx);\n // we need to keep track of the first requested image in a coalesce statement\n // if coalesce can't find a valid image, we return the first image so styleimagemissing can fire\n if (result && result instanceof ResolvedImage && !result.available) {\n // set to first image\n if (!firstImage) {\n firstImage = result;\n }\n result = null;\n // if we reach the end, return the first image\n if (argCount === this.args.length) {\n return firstImage;\n }\n }\n\n if (result !== null) break;\n }\n return result;\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return this.args.every(arg => arg.outputDefined());\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"coalesce\"];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Coalesce;\n","// @flow\n\nimport type {Type} from '../types.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\n\nclass Let implements Expression {\n type: Type;\n bindings: Array<[string, Expression]>;\n result: Expression;\n\n constructor(bindings: Array<[string, Expression]>, result: Expression) {\n this.type = result.type;\n this.bindings = [].concat(bindings);\n this.result = result;\n }\n\n evaluate(ctx: EvaluationContext): any {\n return this.result.evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n for (const binding of this.bindings) {\n fn(binding[1]);\n }\n fn(this.result);\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Let {\n if (args.length < 4)\n return context.error(`Expected at least 3 arguments, but found ${args.length - 1} instead.`);\n\n const bindings: Array<[string, Expression]> = [];\n for (let i = 1; i < args.length - 1; i += 2) {\n const name = args[i];\n\n if (typeof name !== 'string') {\n return context.error(`Expected string, but found ${typeof name} instead.`, i);\n }\n\n if (/[^a-zA-Z0-9_]/.test(name)) {\n return context.error(`Variable names must contain only alphanumeric characters or '_'.`, i);\n }\n\n const value = context.parse(args[i + 1], i + 1);\n if (!value) return null;\n\n bindings.push([name, value]);\n }\n\n const result = context.parse(args[args.length - 1], args.length - 1, context.expectedType, bindings);\n if (!result) return null;\n\n return new Let(bindings, result);\n }\n\n outputDefined(): boolean {\n return this.result.outputDefined();\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"let\"];\n for (const [name, expr] of this.bindings) {\n serialized.push(name, expr.serialize());\n }\n serialized.push(this.result.serialize());\n return serialized;\n }\n}\n\nexport default Let;\n","// @flow\n\nimport {array, ValueType, NumberType} from '../types.js';\n\nimport RuntimeError from '../runtime_error.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type, ArrayType} from '../types.js';\nimport type {Value} from '../values.js';\n\nclass At implements Expression {\n type: Type;\n index: Expression;\n input: Expression;\n\n constructor(type: Type, index: Expression, input: Expression) {\n this.type = type;\n this.index = index;\n this.input = input;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?At {\n if (args.length !== 3)\n return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n\n const index = context.parse(args[1], 1, NumberType);\n const input = context.parse(args[2], 2, array(context.expectedType || ValueType));\n\n if (!index || !input) return null;\n\n const t: ArrayType = (input.type: any);\n return new At(t.itemType, index, input);\n }\n\n evaluate(ctx: EvaluationContext): Value {\n const index = ((this.index.evaluate(ctx): any): number);\n const array = ((this.input.evaluate(ctx): any): Array);\n\n if (index < 0) {\n throw new RuntimeError(`Array index out of bounds: ${index} < 0.`);\n }\n\n if (index >= array.length) {\n throw new RuntimeError(`Array index out of bounds: ${index} > ${array.length - 1}.`);\n }\n\n if (index !== Math.floor(index)) {\n throw new RuntimeError(`Array index must be an integer, but found ${index} instead.`);\n }\n\n return array[index];\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.index);\n fn(this.input);\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n return [\"at\", this.index.serialize(), this.input.serialize()];\n }\n}\n\nexport default At;\n","// @flow\n\nimport {BooleanType, StringType, ValueType, NullType, toString, NumberType, isValidType, isValidNativeType} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass In implements Expression {\n type: Type;\n needle: Expression;\n haystack: Expression;\n\n constructor(needle: Expression, haystack: Expression) {\n this.type = BooleanType;\n this.needle = needle;\n this.haystack = haystack;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?In {\n if (args.length !== 3) {\n return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n }\n\n const needle = context.parse(args[1], 1, ValueType);\n\n const haystack = context.parse(args[2], 2, ValueType);\n\n if (!needle || !haystack) return null;\n\n if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString(needle.type)} instead`);\n }\n\n return new In(needle, haystack);\n }\n\n evaluate(ctx: EvaluationContext): boolean {\n const needle = (this.needle.evaluate(ctx): any);\n const haystack = (this.haystack.evaluate(ctx): any);\n\n if (haystack == null) return false;\n\n if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString(typeOf(needle))} instead.`);\n }\n\n if (!isValidNativeType(haystack, ['string', 'array'])) {\n throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString(typeOf(haystack))} instead.`);\n }\n\n return haystack.indexOf(needle) >= 0;\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.needle);\n fn(this.haystack);\n }\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n return [\"in\", this.needle.serialize(), this.haystack.serialize()];\n }\n}\n\nexport default In;\n","// @flow\n\nimport {BooleanType, StringType, ValueType, NullType, toString, NumberType, isValidType, isValidNativeType} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass IndexOf implements Expression {\n type: Type;\n needle: Expression;\n haystack: Expression;\n fromIndex: ?Expression;\n\n constructor(needle: Expression, haystack: Expression, fromIndex?: Expression) {\n this.type = NumberType;\n this.needle = needle;\n this.haystack = haystack;\n this.fromIndex = fromIndex;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?IndexOf {\n if (args.length <= 2 || args.length >= 5) {\n return context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);\n }\n\n const needle = context.parse(args[1], 1, ValueType);\n\n const haystack = context.parse(args[2], 2, ValueType);\n\n if (!needle || !haystack) return null;\n if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString(needle.type)} instead`);\n }\n\n if (args.length === 4) {\n const fromIndex = context.parse(args[3], 3, NumberType);\n if (!fromIndex) return null;\n return new IndexOf(needle, haystack, fromIndex);\n } else {\n return new IndexOf(needle, haystack);\n }\n }\n\n evaluate(ctx: EvaluationContext): any {\n const needle = (this.needle.evaluate(ctx): any);\n const haystack = (this.haystack.evaluate(ctx): any);\n\n if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString(typeOf(needle))} instead.`);\n }\n\n if (!isValidNativeType(haystack, ['string', 'array'])) {\n throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString(typeOf(haystack))} instead.`);\n }\n\n if (this.fromIndex) {\n const fromIndex = (this.fromIndex.evaluate(ctx): number);\n return haystack.indexOf(needle, fromIndex);\n }\n\n return haystack.indexOf(needle);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.needle);\n fn(this.haystack);\n if (this.fromIndex) {\n fn(this.fromIndex);\n }\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n if (this.fromIndex != null && this.fromIndex !== undefined) {\n const fromIndex = this.fromIndex.serialize();\n return [\"index-of\", this.needle.serialize(), this.haystack.serialize(), fromIndex];\n }\n return [\"index-of\", this.needle.serialize(), this.haystack.serialize()];\n }\n}\n\nexport default IndexOf;\n","// @flow\n\nimport assert from 'assert';\n\nimport {typeOf} from '../values.js';\nimport {ValueType, type Type} from '../types.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\n\n// Map input label values to output expression index\ntype Cases = {[number | string]: number};\n\nclass Match implements Expression {\n type: Type;\n inputType: Type;\n\n input: Expression;\n cases: Cases;\n outputs: Array;\n otherwise: Expression;\n\n constructor(inputType: Type, outputType: Type, input: Expression, cases: Cases, outputs: Array, otherwise: Expression) {\n this.inputType = inputType;\n this.type = outputType;\n this.input = input;\n this.cases = cases;\n this.outputs = outputs;\n this.otherwise = otherwise;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Match {\n if (args.length < 5)\n return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n if (args.length % 2 !== 1)\n return context.error(`Expected an even number of arguments.`);\n\n let inputType;\n let outputType;\n if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n const cases = {};\n const outputs = [];\n for (let i = 2; i < args.length - 1; i += 2) {\n let labels = args[i];\n const value = args[i + 1];\n\n if (!Array.isArray(labels)) {\n labels = [labels];\n }\n\n const labelContext = context.concat(i);\n if (labels.length === 0) {\n return labelContext.error('Expected at least one branch label.');\n }\n\n for (const label of labels) {\n if (typeof label !== 'number' && typeof label !== 'string') {\n return labelContext.error(`Branch labels must be numbers or strings.`);\n } else if (typeof label === 'number' && Math.abs(label) > Number.MAX_SAFE_INTEGER) {\n return labelContext.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);\n\n } else if (typeof label === 'number' && Math.floor(label) !== label) {\n return labelContext.error(`Numeric branch labels must be integer values.`);\n\n } else if (!inputType) {\n inputType = typeOf(label);\n } else if (labelContext.checkSubtype(inputType, typeOf(label))) {\n return null;\n }\n\n if (typeof cases[String(label)] !== 'undefined') {\n return labelContext.error('Branch labels must be unique.');\n }\n\n cases[String(label)] = outputs.length;\n }\n\n const result = context.parse(value, i, outputType);\n if (!result) return null;\n outputType = outputType || result.type;\n outputs.push(result);\n }\n\n const input = context.parse(args[1], 1, ValueType);\n if (!input) return null;\n\n const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n if (!otherwise) return null;\n\n assert(inputType && outputType);\n\n if (input.type.kind !== 'value' && context.concat(1).checkSubtype((inputType: any), input.type)) {\n return null;\n }\n\n return new Match((inputType: any), (outputType: any), input, cases, outputs, otherwise);\n }\n\n evaluate(ctx: EvaluationContext): any {\n const input = (this.input.evaluate(ctx): any);\n const output = (typeOf(input) === this.inputType && this.outputs[this.cases[input]]) || this.otherwise;\n return output.evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n this.outputs.forEach(fn);\n fn(this.otherwise);\n }\n\n outputDefined(): boolean {\n return this.outputs.every(out => out.outputDefined()) && this.otherwise.outputDefined();\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"match\", this.input.serialize()];\n\n // Sort so serialization has an arbitrary defined order, even though\n // branch order doesn't affect evaluation\n const sortedLabels = Object.keys(this.cases).sort();\n\n // Group branches by unique match expression to support condensed\n // serializations of the form [case1, case2, ...] -> matchExpression\n const groupedByOutput: Array<[number, Array]> = [];\n const outputLookup: {[index: number]: number} = {}; // lookup index into groupedByOutput for a given output expression\n for (const label of sortedLabels) {\n const outputIndex = outputLookup[this.cases[label]];\n if (outputIndex === undefined) {\n // First time seeing this output, add it to the end of the grouped list\n outputLookup[this.cases[label]] = groupedByOutput.length;\n groupedByOutput.push([this.cases[label], [label]]);\n } else {\n // We've seen this expression before, add the label to that output's group\n groupedByOutput[outputIndex][1].push(label);\n }\n }\n\n const coerceLabel = (label) => this.inputType.kind === 'number' ? Number(label) : label;\n\n for (const [outputIndex, labels] of groupedByOutput) {\n if (labels.length === 1) {\n // Only a single label matches this output expression\n serialized.push(coerceLabel(labels[0]));\n } else {\n // Array of literal labels pointing to this output expression\n serialized.push(labels.map(coerceLabel));\n }\n serialized.push(this.outputs[outputIndex].serialize());\n }\n serialized.push(this.otherwise.serialize());\n return serialized;\n }\n}\n\nexport default Match;\n","// @flow\n\nimport assert from 'assert';\n\nimport {BooleanType} from '../types.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\ntype Branches = Array<[Expression, Expression]>;\n\nclass Case implements Expression {\n type: Type;\n\n branches: Branches;\n otherwise: Expression;\n\n constructor(type: Type, branches: Branches, otherwise: Expression) {\n this.type = type;\n this.branches = branches;\n this.otherwise = otherwise;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Case {\n if (args.length < 4)\n return context.error(`Expected at least 3 arguments, but found only ${args.length - 1}.`);\n if (args.length % 2 !== 0)\n return context.error(`Expected an odd number of arguments.`);\n\n let outputType: ?Type;\n if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n\n const branches = [];\n for (let i = 1; i < args.length - 1; i += 2) {\n const test = context.parse(args[i], i, BooleanType);\n if (!test) return null;\n\n const result = context.parse(args[i + 1], i + 1, outputType);\n if (!result) return null;\n\n branches.push([test, result]);\n\n outputType = outputType || result.type;\n }\n\n const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n if (!otherwise) return null;\n\n assert(outputType);\n return new Case((outputType: any), branches, otherwise);\n }\n\n evaluate(ctx: EvaluationContext): any {\n for (const [test, expression] of this.branches) {\n if (test.evaluate(ctx)) {\n return expression.evaluate(ctx);\n }\n }\n return this.otherwise.evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n for (const [test, expression] of this.branches) {\n fn(test);\n fn(expression);\n }\n fn(this.otherwise);\n }\n\n outputDefined(): boolean {\n return this.branches.every(([_, out]) => out.outputDefined()) && this.otherwise.outputDefined();\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"case\"];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Case;\n","// @flow\n\nimport {ValueType, NumberType, StringType, array, toString, isValidType, isValidNativeType} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Slice implements Expression {\n type: Type;\n input: Expression;\n beginIndex: Expression;\n endIndex: ?Expression;\n\n constructor(type: Type, input: Expression, beginIndex: Expression, endIndex?: Expression) {\n this.type = type;\n this.input = input;\n this.beginIndex = beginIndex;\n this.endIndex = endIndex;\n\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Slice {\n if (args.length <= 2 || args.length >= 5) {\n return context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);\n }\n\n const input = context.parse(args[1], 1, ValueType);\n const beginIndex = context.parse(args[2], 2, NumberType);\n\n if (!input || !beginIndex) return null;\n\n if (!isValidType(input.type, [array(ValueType), StringType, ValueType])) {\n return context.error(`Expected first argument to be of type array or string, but found ${toString(input.type)} instead`);\n }\n\n if (args.length === 4) {\n const endIndex = context.parse(args[3], 3, NumberType);\n if (!endIndex) return null;\n return new Slice(input.type, input, beginIndex, endIndex);\n } else {\n return new Slice(input.type, input, beginIndex);\n }\n }\n\n evaluate(ctx: EvaluationContext): any {\n const input = (this.input.evaluate(ctx): any);\n const beginIndex = (this.beginIndex.evaluate(ctx): number);\n\n if (!isValidNativeType(input, ['string', 'array'])) {\n throw new RuntimeError(`Expected first argument to be of type array or string, but found ${toString(typeOf(input))} instead.`);\n }\n\n if (this.endIndex) {\n const endIndex = (this.endIndex.evaluate(ctx): number);\n return input.slice(beginIndex, endIndex);\n }\n\n return input.slice(beginIndex);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n fn(this.beginIndex);\n if (this.endIndex) {\n fn(this.endIndex);\n }\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n if (this.endIndex != null && this.endIndex !== undefined) {\n const endIndex = this.endIndex.serialize();\n return [\"slice\", this.input.serialize(), this.beginIndex.serialize(), endIndex];\n }\n return [\"slice\", this.input.serialize(), this.beginIndex.serialize()];\n }\n}\n\nexport default Slice;\n","// @flow\n\nimport {toString, ValueType, BooleanType, CollatorType} from '../types.js';\nimport Assertion from './assertion.js';\nimport {typeOf} from '../values.js';\nimport RuntimeError from '../runtime_error.js';\n\nimport type {Expression, SerializedExpression, ExpressionRegistration} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\ntype ComparisonOperator = '==' | '!=' | '<' | '>' | '<=' | '>=' ;\n\nfunction isComparableType(op: ComparisonOperator, type: Type) {\n if (op === '==' || op === '!=') {\n // equality operator\n return type.kind === 'boolean' ||\n type.kind === 'string' ||\n type.kind === 'number' ||\n type.kind === 'null' ||\n type.kind === 'value';\n } else {\n // ordering operator\n return type.kind === 'string' ||\n type.kind === 'number' ||\n type.kind === 'value';\n }\n}\n\nfunction eq(ctx: EvaluationContext, a: any, b: any): boolean { return a === b; }\nfunction neq(ctx: EvaluationContext, a: any, b: any): boolean { return a !== b; }\nfunction lt(ctx: EvaluationContext, a: any, b: any): boolean { return a < b; }\nfunction gt(ctx: EvaluationContext, a: any, b: any): boolean { return a > b; }\nfunction lteq(ctx: EvaluationContext, a: any, b: any): boolean { return a <= b; }\nfunction gteq(ctx: EvaluationContext, a: any, b: any): boolean { return a >= b; }\n\nfunction eqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) === 0; }\nfunction neqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return !eqCollate(ctx, a, b, c); }\nfunction ltCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) < 0; }\nfunction gtCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) > 0; }\nfunction lteqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) <= 0; }\nfunction gteqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) >= 0; }\n\n/**\n * Special form for comparison operators, implementing the signatures:\n * - (T, T, ?Collator) => boolean\n * - (T, value, ?Collator) => boolean\n * - (value, T, ?Collator) => boolean\n *\n * For inequalities, T must be either value, string, or number. For ==/!=, it\n * can also be boolean or null.\n *\n * Equality semantics are equivalent to Javascript's strict equality (===/!==)\n * -- i.e., when the arguments' types don't match, == evaluates to false, != to\n * true.\n *\n * When types don't match in an ordering comparison, a runtime error is thrown.\n *\n * @private\n */\nfunction makeComparison(op: ComparisonOperator, compareBasic: (EvaluationContext, any, any) => boolean, compareWithCollator: (EvaluationContext, any, any, any) => boolean): ExpressionRegistration {\n const isOrderComparison = op !== '==' && op !== '!=';\n\n return class Comparison implements Expression {\n type: Type;\n lhs: Expression;\n rhs: Expression;\n collator: ?Expression;\n hasUntypedArgument: boolean;\n\n constructor(lhs: Expression, rhs: Expression, collator: ?Expression) {\n this.type = BooleanType;\n this.lhs = lhs;\n this.rhs = rhs;\n this.collator = collator;\n this.hasUntypedArgument = lhs.type.kind === 'value' || rhs.type.kind === 'value';\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 3 && args.length !== 4)\n return context.error(`Expected two or three arguments.`);\n\n const op: ComparisonOperator = (args[0]: any);\n\n let lhs = context.parse(args[1], 1, ValueType);\n if (!lhs) return null;\n if (!isComparableType(op, lhs.type)) {\n return context.concat(1).error(`\"${op}\" comparisons are not supported for type '${toString(lhs.type)}'.`);\n }\n let rhs = context.parse(args[2], 2, ValueType);\n if (!rhs) return null;\n if (!isComparableType(op, rhs.type)) {\n return context.concat(2).error(`\"${op}\" comparisons are not supported for type '${toString(rhs.type)}'.`);\n }\n\n if (\n lhs.type.kind !== rhs.type.kind &&\n lhs.type.kind !== 'value' &&\n rhs.type.kind !== 'value'\n ) {\n return context.error(`Cannot compare types '${toString(lhs.type)}' and '${toString(rhs.type)}'.`);\n }\n\n if (isOrderComparison) {\n // typing rules specific to less/greater than operators\n if (lhs.type.kind === 'value' && rhs.type.kind !== 'value') {\n // (value, T)\n lhs = new Assertion(rhs.type, [lhs]);\n } else if (lhs.type.kind !== 'value' && rhs.type.kind === 'value') {\n // (T, value)\n rhs = new Assertion(lhs.type, [rhs]);\n }\n }\n\n let collator = null;\n if (args.length === 4) {\n if (\n lhs.type.kind !== 'string' &&\n rhs.type.kind !== 'string' &&\n lhs.type.kind !== 'value' &&\n rhs.type.kind !== 'value'\n ) {\n return context.error(`Cannot use collator to compare non-string types.`);\n }\n collator = context.parse(args[3], 3, CollatorType);\n if (!collator) return null;\n }\n\n return new Comparison(lhs, rhs, collator);\n }\n\n evaluate(ctx: EvaluationContext): boolean {\n const lhs = this.lhs.evaluate(ctx);\n const rhs = this.rhs.evaluate(ctx);\n\n if (isOrderComparison && this.hasUntypedArgument) {\n const lt = typeOf(lhs);\n const rt = typeOf(rhs);\n // check that type is string or number, and equal\n if (lt.kind !== rt.kind || !(lt.kind === 'string' || lt.kind === 'number')) {\n throw new RuntimeError(`Expected arguments for \"${op}\" to be (string, string) or (number, number), but found (${lt.kind}, ${rt.kind}) instead.`);\n }\n }\n\n if (this.collator && !isOrderComparison && this.hasUntypedArgument) {\n const lt = typeOf(lhs);\n const rt = typeOf(rhs);\n if (lt.kind !== 'string' || rt.kind !== 'string') {\n return compareBasic(ctx, lhs, rhs);\n }\n }\n\n return this.collator ?\n compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx)) :\n compareBasic(ctx, lhs, rhs);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.lhs);\n fn(this.rhs);\n if (this.collator) {\n fn(this.collator);\n }\n }\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n const serialized = [op];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n };\n}\n\nexport const Equals: $Call = makeComparison('==', eq, eqCollate);\nexport const NotEquals: $Call = makeComparison('<', lt, ltCollate);\nexport const GreaterThan: $Call', typeof gt, typeof gtCollate> = makeComparison('>', gt, gtCollate);\nexport const LessThanOrEqual: $Call=', typeof gteq, typeof gteqCollate> = makeComparison('>=', gteq, gteqCollate);\n","// @flow\n\nimport {StringType, NumberType} from '../types.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\ndeclare var Intl: {\n NumberFormat: Class\n};\n\ndeclare class Intl$NumberFormat {\n constructor (\n locales?: string | string[],\n options?: NumberFormatOptions\n ): Intl$NumberFormat;\n\n static (\n locales?: string | string[],\n options?: NumberFormatOptions\n ): Intl$NumberFormat;\n\n format(a: number): string;\n\n resolvedOptions(): any;\n}\n\ntype NumberFormatOptions = {\n style?: 'decimal' | 'currency' | 'percent' | 'unit';\n currency?: null | string;\n unit?: null | string;\n minimumFractionDigits?: null | string;\n maximumFractionDigits?: null | string;\n};\n\nexport default class NumberFormat implements Expression {\n type: Type;\n number: Expression;\n locale: Expression | null; // BCP 47 language tag\n currency: Expression | null; // ISO 4217 currency code, required if style=currency\n unit: Expression | null; // Simple units sanctioned for use in ECMAScript, required if style=unit. https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\n minFractionDigits: Expression | null; // Default 0\n maxFractionDigits: Expression | null; // Default 3\n\n constructor(number: Expression,\n locale: Expression | null,\n currency: Expression | null,\n unit: Expression | null,\n minFractionDigits: Expression | null,\n maxFractionDigits: Expression | null) {\n this.type = StringType;\n this.number = number;\n this.locale = locale;\n this.currency = currency;\n this.unit = unit;\n this.minFractionDigits = minFractionDigits;\n this.maxFractionDigits = maxFractionDigits;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 3)\n return context.error(`Expected two arguments.`);\n\n const number = context.parse(args[1], 1, NumberType);\n if (!number) return null;\n\n const options = (args[2]: any);\n if (typeof options !== \"object\" || Array.isArray(options))\n return context.error(`NumberFormat options argument must be an object.`);\n\n let locale = null;\n if (options['locale']) {\n locale = context.parse(options['locale'], 1, StringType);\n if (!locale) return null;\n }\n\n let currency = null;\n if (options['currency']) {\n currency = context.parse(options['currency'], 1, StringType);\n if (!currency) return null;\n }\n\n let unit = null;\n if (options['unit']) {\n unit = context.parse(options['unit'], 1, StringType);\n if (!unit) return null;\n }\n\n let minFractionDigits = null;\n if (options['min-fraction-digits']) {\n minFractionDigits = context.parse(options['min-fraction-digits'], 1, NumberType);\n if (!minFractionDigits) return null;\n }\n\n let maxFractionDigits = null;\n if (options['max-fraction-digits']) {\n maxFractionDigits = context.parse(options['max-fraction-digits'], 1, NumberType);\n if (!maxFractionDigits) return null;\n }\n\n return new NumberFormat(number, locale, currency, unit, minFractionDigits, maxFractionDigits);\n }\n\n evaluate(ctx: EvaluationContext): string {\n return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [],\n {\n style:\n (this.currency && \"currency\") ||\n (this.unit && \"unit\") ||\n \"decimal\",\n currency: this.currency ? this.currency.evaluate(ctx) : undefined,\n unit: this.unit ? this.unit.evaluate(ctx) : undefined,\n minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : undefined,\n maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : undefined,\n }).format(this.number.evaluate(ctx));\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.number);\n if (this.locale) {\n fn(this.locale);\n }\n if (this.currency) {\n fn(this.currency);\n }\n if (this.unit) {\n fn(this.unit);\n }\n if (this.minFractionDigits) {\n fn(this.minFractionDigits);\n }\n if (this.maxFractionDigits) {\n fn(this.maxFractionDigits);\n }\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n const options = {};\n if (this.locale) {\n options['locale'] = this.locale.serialize();\n }\n if (this.currency) {\n options['currency'] = this.currency.serialize();\n }\n if (this.unit) {\n options['unit'] = this.unit.serialize();\n }\n if (this.minFractionDigits) {\n options['min-fraction-digits'] = this.minFractionDigits.serialize();\n }\n if (this.maxFractionDigits) {\n options['max-fraction-digits'] = this.maxFractionDigits.serialize();\n }\n return [\"number-format\", this.number.serialize(), options];\n }\n}\n","// @flow\n\nimport {NumberType, toString} from '../types.js';\n\nimport {typeOf} from '../values.js';\nimport RuntimeError from '../runtime_error.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Length implements Expression {\n type: Type;\n input: Expression;\n\n constructor(input: Expression) {\n this.type = NumberType;\n this.input = input;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Length {\n if (args.length !== 2)\n return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n\n const input = context.parse(args[1], 1);\n if (!input) return null;\n\n if (input.type.kind !== 'array' && input.type.kind !== 'string' && input.type.kind !== 'value')\n return context.error(`Expected argument of type string or array, but found ${toString(input.type)} instead.`);\n\n return new Length(input);\n }\n\n evaluate(ctx: EvaluationContext): any | number {\n const input = this.input.evaluate(ctx);\n if (typeof input === 'string') {\n return input.length;\n } else if (Array.isArray(input)) {\n return input.length;\n } else {\n throw new RuntimeError(`Expected value to be of type string or array, but found ${toString(typeOf(input))} instead.`);\n }\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"length\"];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Length;\n","// @flow\n\nimport {\n type Type,\n NumberType,\n StringType,\n BooleanType,\n ColorType,\n ObjectType,\n ValueType,\n ErrorType,\n CollatorType,\n array,\n toString as typeToString\n} from '../types.js';\n\nimport {typeOf, Color, validateRGBA, toString as valueToString} from '../values.js';\nimport CompoundExpression from '../compound_expression.js';\nimport RuntimeError from '../runtime_error.js';\nimport Let from './let.js';\nimport Var from './var.js';\nimport Literal from './literal.js';\nimport Assertion from './assertion.js';\nimport Coercion from './coercion.js';\nimport At from './at.js';\nimport In from './in.js';\nimport IndexOf from './index_of.js';\nimport Match from './match.js';\nimport Case from './case.js';\nimport Slice from './slice.js';\nimport Step from './step.js';\nimport Interpolate from './interpolate.js';\nimport Coalesce from './coalesce.js';\nimport {\n Equals,\n NotEquals,\n LessThan,\n GreaterThan,\n LessThanOrEqual,\n GreaterThanOrEqual\n} from './comparison.js';\nimport CollatorExpression from './collator.js';\nimport NumberFormat from './number_format.js';\nimport FormatExpression from './format.js';\nimport ImageExpression from './image.js';\nimport Length from './length.js';\nimport Within from './within.js';\n\nimport type {Varargs} from '../compound_expression.js';\nimport type {ExpressionRegistry} from '../expression.js';\n\nconst expressions: ExpressionRegistry = {\n // special forms\n '==': Equals,\n '!=': NotEquals,\n '>': GreaterThan,\n '<': LessThan,\n '>=': GreaterThanOrEqual,\n '<=': LessThanOrEqual,\n 'array': Assertion,\n 'at': At,\n 'boolean': Assertion,\n 'case': Case,\n 'coalesce': Coalesce,\n 'collator': CollatorExpression,\n 'format': FormatExpression,\n 'image': ImageExpression,\n 'in': In,\n 'index-of': IndexOf,\n 'interpolate': Interpolate,\n 'interpolate-hcl': Interpolate,\n 'interpolate-lab': Interpolate,\n 'length': Length,\n 'let': Let,\n 'literal': Literal,\n 'match': Match,\n 'number': Assertion,\n 'number-format': NumberFormat,\n 'object': Assertion,\n 'slice': Slice,\n 'step': Step,\n 'string': Assertion,\n 'to-boolean': Coercion,\n 'to-color': Coercion,\n 'to-number': Coercion,\n 'to-string': Coercion,\n 'var': Var,\n 'within': Within\n};\n\nfunction rgba(ctx, [r, g, b, a]) {\n r = r.evaluate(ctx);\n g = g.evaluate(ctx);\n b = b.evaluate(ctx);\n const alpha = a ? a.evaluate(ctx) : 1;\n const error = validateRGBA(r, g, b, alpha);\n if (error) throw new RuntimeError(error);\n return new Color(r / 255 * alpha, g / 255 * alpha, b / 255 * alpha, alpha);\n}\n\nfunction has(key, obj) {\n return key in obj;\n}\n\nfunction get(key, obj) {\n const v = obj[key];\n return typeof v === 'undefined' ? null : v;\n}\n\nfunction binarySearch(v, a, i, j) {\n while (i <= j) {\n const m = (i + j) >> 1;\n if (a[m] === v)\n return true;\n if (a[m] > v)\n j = m - 1;\n else\n i = m + 1;\n }\n return false;\n}\n\nfunction varargs(type: Type): Varargs {\n return {type};\n}\n\nCompoundExpression.register(expressions, {\n 'error': [\n ErrorType,\n [StringType],\n (ctx, [v]) => { throw new RuntimeError(v.evaluate(ctx)); }\n ],\n 'typeof': [\n StringType,\n [ValueType],\n (ctx, [v]) => typeToString(typeOf(v.evaluate(ctx)))\n ],\n 'to-rgba': [\n array(NumberType, 4),\n [ColorType],\n (ctx, [v]) => {\n return v.evaluate(ctx).toArray();\n }\n ],\n 'rgb': [\n ColorType,\n [NumberType, NumberType, NumberType],\n rgba\n ],\n 'rgba': [\n ColorType,\n [NumberType, NumberType, NumberType, NumberType],\n rgba\n ],\n 'has': {\n type: BooleanType,\n overloads: [\n [\n [StringType],\n (ctx, [key]) => has(key.evaluate(ctx), ctx.properties())\n ], [\n [StringType, ObjectType],\n (ctx, [key, obj]) => has(key.evaluate(ctx), obj.evaluate(ctx))\n ]\n ]\n },\n 'get': {\n type: ValueType,\n overloads: [\n [\n [StringType],\n (ctx, [key]) => get(key.evaluate(ctx), ctx.properties())\n ], [\n [StringType, ObjectType],\n (ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))\n ]\n ]\n },\n 'feature-state': [\n ValueType,\n [StringType],\n (ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})\n ],\n 'properties': [\n ObjectType,\n [],\n (ctx) => ctx.properties()\n ],\n 'geometry-type': [\n StringType,\n [],\n (ctx) => ctx.geometryType()\n ],\n 'id': [\n ValueType,\n [],\n (ctx) => ctx.id()\n ],\n 'zoom': [\n NumberType,\n [],\n (ctx) => ctx.globals.zoom\n ],\n 'pitch': [\n NumberType,\n [],\n (ctx) => ctx.globals.pitch || 0\n ],\n 'distance-from-center': [\n NumberType,\n [],\n (ctx) => ctx.distanceFromCenter()\n ],\n 'heatmap-density': [\n NumberType,\n [],\n (ctx) => ctx.globals.heatmapDensity || 0\n ],\n 'line-progress': [\n NumberType,\n [],\n (ctx) => ctx.globals.lineProgress || 0\n ],\n 'sky-radial-progress': [\n NumberType,\n [],\n (ctx) => ctx.globals.skyRadialProgress || 0\n ],\n 'accumulated': [\n ValueType,\n [],\n (ctx) => ctx.globals.accumulated === undefined ? null : ctx.globals.accumulated\n ],\n '+': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => {\n let result = 0;\n for (const arg of args) {\n result += arg.evaluate(ctx);\n }\n return result;\n }\n ],\n '*': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => {\n let result = 1;\n for (const arg of args) {\n result *= arg.evaluate(ctx);\n }\n return result;\n }\n ],\n '-': {\n type: NumberType,\n overloads: [\n [\n [NumberType, NumberType],\n (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx)\n ], [\n [NumberType],\n (ctx, [a]) => -a.evaluate(ctx)\n ]\n ]\n },\n '/': [\n NumberType,\n [NumberType, NumberType],\n (ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx)\n ],\n '%': [\n NumberType,\n [NumberType, NumberType],\n (ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx)\n ],\n 'ln2': [\n NumberType,\n [],\n () => Math.LN2\n ],\n 'pi': [\n NumberType,\n [],\n () => Math.PI\n ],\n 'e': [\n NumberType,\n [],\n () => Math.E\n ],\n '^': [\n NumberType,\n [NumberType, NumberType],\n (ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx))\n ],\n 'sqrt': [\n NumberType,\n [NumberType],\n (ctx, [x]) => Math.sqrt(x.evaluate(ctx))\n ],\n 'log10': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10\n ],\n 'ln': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.log(n.evaluate(ctx))\n ],\n 'log2': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2\n ],\n 'sin': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.sin(n.evaluate(ctx))\n ],\n 'cos': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.cos(n.evaluate(ctx))\n ],\n 'tan': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.tan(n.evaluate(ctx))\n ],\n 'asin': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.asin(n.evaluate(ctx))\n ],\n 'acos': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.acos(n.evaluate(ctx))\n ],\n 'atan': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.atan(n.evaluate(ctx))\n ],\n 'min': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))\n ],\n 'max': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))\n ],\n 'abs': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.abs(n.evaluate(ctx))\n ],\n 'round': [\n NumberType,\n [NumberType],\n (ctx, [n]) => {\n const v = n.evaluate(ctx);\n // Javascript's Math.round() rounds towards +Infinity for halfway\n // values, even when they're negative. It's more common to round\n // away from 0 (e.g., this is what python and C++ do)\n return v < 0 ? -Math.round(-v) : Math.round(v);\n }\n ],\n 'floor': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.floor(n.evaluate(ctx))\n ],\n 'ceil': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.ceil(n.evaluate(ctx))\n ],\n 'filter-==': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => ctx.properties()[(k: any).value] === (v: any).value\n ],\n 'filter-id-==': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => ctx.id() === (v: any).value\n ],\n 'filter-type-==': [\n BooleanType,\n [StringType],\n (ctx, [v]) => ctx.geometryType() === (v: any).value\n ],\n 'filter-<': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a < b;\n }\n ],\n 'filter-id-<': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a < b;\n }\n ],\n 'filter->': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a > b;\n }\n ],\n 'filter-id->': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a > b;\n }\n ],\n 'filter-<=': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a <= b;\n }\n ],\n 'filter-id-<=': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a <= b;\n }\n ],\n 'filter->=': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a >= b;\n }\n ],\n 'filter-id->=': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a >= b;\n }\n ],\n 'filter-has': [\n BooleanType,\n [ValueType],\n (ctx, [k]) => (k: any).value in ctx.properties()\n ],\n 'filter-has-id': [\n BooleanType,\n [],\n (ctx) => (ctx.id() !== null && ctx.id() !== undefined)\n ],\n 'filter-type-in': [\n BooleanType,\n [array(StringType)],\n (ctx, [v]) => (v: any).value.indexOf(ctx.geometryType()) >= 0\n ],\n 'filter-id-in': [\n BooleanType,\n [array(ValueType)],\n (ctx, [v]) => (v: any).value.indexOf(ctx.id()) >= 0\n ],\n 'filter-in-small': [\n BooleanType,\n [StringType, array(ValueType)],\n // assumes v is an array literal\n (ctx, [k, v]) => (v: any).value.indexOf(ctx.properties()[(k: any).value]) >= 0\n ],\n 'filter-in-large': [\n BooleanType,\n [StringType, array(ValueType)],\n // assumes v is a array literal with values sorted in ascending order and of a single type\n (ctx, [k, v]) => binarySearch(ctx.properties()[(k: any).value], (v: any).value, 0, (v: any).value.length - 1)\n ],\n 'all': {\n type: BooleanType,\n overloads: [\n [\n [BooleanType, BooleanType],\n (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)\n ],\n [\n varargs(BooleanType),\n (ctx, args) => {\n for (const arg of args) {\n if (!arg.evaluate(ctx))\n return false;\n }\n return true;\n }\n ]\n ]\n },\n 'any': {\n type: BooleanType,\n overloads: [\n [\n [BooleanType, BooleanType],\n (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)\n ],\n [\n varargs(BooleanType),\n (ctx, args) => {\n for (const arg of args) {\n if (arg.evaluate(ctx))\n return true;\n }\n return false;\n }\n ]\n ]\n },\n '!': [\n BooleanType,\n [BooleanType],\n (ctx, [b]) => !b.evaluate(ctx)\n ],\n 'is-supported-script': [\n BooleanType,\n [StringType],\n // At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant\n (ctx, [s]) => {\n const isSupportedScript = ctx.globals && ctx.globals.isSupportedScript;\n if (isSupportedScript) {\n return isSupportedScript(s.evaluate(ctx));\n }\n return true;\n }\n ],\n 'upcase': [\n StringType,\n [StringType],\n (ctx, [s]) => s.evaluate(ctx).toUpperCase()\n ],\n 'downcase': [\n StringType,\n [StringType],\n (ctx, [s]) => s.evaluate(ctx).toLowerCase()\n ],\n 'concat': [\n StringType,\n varargs(ValueType),\n (ctx, args) => args.map(arg => valueToString(arg.evaluate(ctx))).join('')\n ],\n 'resolved-locale': [\n StringType,\n [CollatorType],\n (ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()\n ]\n});\n\nexport default expressions;\n","// @flow\n\n/**\n * A type used for returning and propagating errors. The first element of the union\n * represents success and contains a value, and the second represents an error and\n * contains an error value.\n * @private\n */\nexport type Result =\n | {| result: 'success', value: T |}\n | {| result: 'error', value: E |};\n\nexport function success(value: T): Result {\n return {result: 'success', value};\n}\n\nexport function error(value: E): Result {\n return {result: 'error', value};\n}\n","// @flow\n\nimport type {StylePropertySpecification} from '../style-spec.js';\n\nexport function supportsPropertyExpression(spec: StylePropertySpecification): boolean {\n return spec['property-type'] === 'data-driven';\n}\n\nexport function supportsZoomExpression(spec: StylePropertySpecification): boolean {\n return !!spec.expression && spec.expression.parameters.indexOf('zoom') > -1;\n}\n\nexport function supportsInterpolation(spec: StylePropertySpecification): boolean {\n return !!spec.expression && spec.expression.interpolated;\n}\n","\nimport * as colorSpaces from '../util/color_spaces.js';\nimport Color from '../util/color.js';\nimport extend from '../util/extend.js';\nimport getType from '../util/get_type.js';\nimport * as interpolate from '../util/interpolate.js';\nimport Interpolate from '../expression/definitions/interpolate.js';\nimport Formatted from '../expression/types/formatted.js';\nimport ResolvedImage from '../expression/types/resolved_image.js';\nimport {supportsInterpolation} from '../util/properties.js';\nimport {findStopLessThanOrEqualTo} from '../expression/stops.js';\n\nexport function isFunction(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction identityFunction(x) {\n return x;\n}\n\nexport function createFunction(parameters, propertySpec) {\n const isColor = propertySpec.type === 'color';\n const zoomAndFeatureDependent = parameters.stops && typeof parameters.stops[0][0] === 'object';\n const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n const type = parameters.type || (supportsInterpolation(propertySpec) ? 'exponential' : 'interval');\n\n if (isColor) {\n parameters = extend({}, parameters);\n\n if (parameters.stops) {\n parameters.stops = parameters.stops.map((stop) => {\n return [stop[0], Color.parse(stop[1])];\n });\n }\n\n if (parameters.default) {\n parameters.default = Color.parse(parameters.default);\n } else {\n parameters.default = Color.parse(propertySpec.default);\n }\n }\n\n if (parameters.colorSpace && parameters.colorSpace !== 'rgb' && !colorSpaces[parameters.colorSpace]) { // eslint-disable-line import/namespace\n throw new Error(`Unknown color space: ${parameters.colorSpace}`);\n }\n\n let innerFun;\n let hashedStops;\n let categoricalKeyType;\n if (type === 'exponential') {\n innerFun = evaluateExponentialFunction;\n } else if (type === 'interval') {\n innerFun = evaluateIntervalFunction;\n } else if (type === 'categorical') {\n innerFun = evaluateCategoricalFunction;\n\n // For categorical functions, generate an Object as a hashmap of the stops for fast searching\n hashedStops = Object.create(null);\n for (const stop of parameters.stops) {\n hashedStops[stop[0]] = stop[1];\n }\n\n // Infer key type based on first stop key-- used to encforce strict type checking later\n categoricalKeyType = typeof parameters.stops[0][0];\n\n } else if (type === 'identity') {\n innerFun = evaluateIdentityFunction;\n } else {\n throw new Error(`Unknown function type \"${type}\"`);\n }\n\n if (zoomAndFeatureDependent) {\n const featureFunctions = {};\n const zoomStops = [];\n for (let s = 0; s < parameters.stops.length; s++) {\n const stop = parameters.stops[s];\n const zoom = stop[0].zoom;\n if (featureFunctions[zoom] === undefined) {\n featureFunctions[zoom] = {\n zoom,\n type: parameters.type,\n property: parameters.property,\n default: parameters.default,\n stops: []\n };\n zoomStops.push(zoom);\n }\n featureFunctions[zoom].stops.push([stop[0].value, stop[1]]);\n }\n\n const featureFunctionStops = [];\n for (const z of zoomStops) {\n featureFunctionStops.push([featureFunctions[z].zoom, createFunction(featureFunctions[z], propertySpec)]);\n }\n\n const interpolationType = {name: 'linear'};\n return {\n kind: 'composite',\n interpolationType,\n interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n zoomStops: featureFunctionStops.map(s => s[0]),\n evaluate({zoom}, properties) {\n return evaluateExponentialFunction({\n stops: featureFunctionStops,\n base: parameters.base\n }, propertySpec, zoom).evaluate(zoom, properties);\n }\n };\n } else if (zoomDependent) {\n const interpolationType = type === 'exponential' ?\n {name: 'exponential', base: parameters.base !== undefined ? parameters.base : 1} : null;\n return {\n kind: 'camera',\n interpolationType,\n interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n zoomStops: parameters.stops.map(s => s[0]),\n evaluate: ({zoom}) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)\n };\n } else {\n return {\n kind: 'source',\n evaluate(_, feature) {\n const value = feature && feature.properties ? feature.properties[parameters.property] : undefined;\n if (value === undefined) {\n return coalesce(parameters.default, propertySpec.default);\n }\n return innerFun(parameters, propertySpec, value, hashedStops, categoricalKeyType);\n }\n };\n }\n}\n\nfunction coalesce(a, b, c) {\n if (a !== undefined) return a;\n if (b !== undefined) return b;\n if (c !== undefined) return c;\n}\n\nfunction evaluateCategoricalFunction(parameters, propertySpec, input, hashedStops, keyType) {\n const evaluated = typeof input === keyType ? hashedStops[input] : undefined; // Enforce strict typing on input\n return coalesce(evaluated, parameters.default, propertySpec.default);\n}\n\nfunction evaluateIntervalFunction(parameters, propertySpec, input) {\n // Edge cases\n if (getType(input) !== 'number') return coalesce(parameters.default, propertySpec.default);\n const n = parameters.stops.length;\n if (n === 1) return parameters.stops[0][1];\n if (input <= parameters.stops[0][0]) return parameters.stops[0][1];\n if (input >= parameters.stops[n - 1][0]) return parameters.stops[n - 1][1];\n\n const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n\n return parameters.stops[index][1];\n}\n\nfunction evaluateExponentialFunction(parameters, propertySpec, input) {\n const base = parameters.base !== undefined ? parameters.base : 1;\n\n // Edge cases\n if (getType(input) !== 'number') return coalesce(parameters.default, propertySpec.default);\n const n = parameters.stops.length;\n if (n === 1) return parameters.stops[0][1];\n if (input <= parameters.stops[0][0]) return parameters.stops[0][1];\n if (input >= parameters.stops[n - 1][0]) return parameters.stops[n - 1][1];\n\n const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n const t = interpolationFactor(\n input, base,\n parameters.stops[index][0],\n parameters.stops[index + 1][0]);\n\n const outputLower = parameters.stops[index][1];\n const outputUpper = parameters.stops[index + 1][1];\n let interp = interpolate[propertySpec.type] || identityFunction; // eslint-disable-line import/namespace\n\n if (parameters.colorSpace && parameters.colorSpace !== 'rgb') {\n const colorspace = colorSpaces[parameters.colorSpace]; // eslint-disable-line import/namespace\n interp = (a, b) => colorspace.reverse(colorspace.interpolate(colorspace.forward(a), colorspace.forward(b), t));\n }\n\n if (typeof outputLower.evaluate === 'function') {\n return {\n evaluate(...args) {\n const evaluatedLower = outputLower.evaluate.apply(undefined, args);\n const evaluatedUpper = outputUpper.evaluate.apply(undefined, args);\n // Special case for fill-outline-color, which has no spec default.\n if (evaluatedLower === undefined || evaluatedUpper === undefined) {\n return undefined;\n }\n return interp(evaluatedLower, evaluatedUpper, t);\n }\n };\n }\n\n return interp(outputLower, outputUpper, t);\n}\n\nfunction evaluateIdentityFunction(parameters, propertySpec, input) {\n if (propertySpec.type === 'color') {\n input = Color.parse(input);\n } else if (propertySpec.type === 'formatted') {\n input = Formatted.fromString(input.toString());\n } else if (propertySpec.type === 'resolvedImage') {\n input = ResolvedImage.fromString(input.toString());\n } else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {\n input = undefined;\n }\n return coalesce(input, parameters.default, propertySpec.default);\n}\n\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n *\n * How it works:\n * Two consecutive stop values define a (scaled and shifted) exponential\n * function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n * = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`. In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n */\nfunction interpolationFactor(input, base, lowerValue, upperValue) {\n const difference = upperValue - lowerValue;\n const progress = input - lowerValue;\n\n if (difference === 0) {\n return 0;\n } else if (base === 1) {\n return progress / difference;\n } else {\n return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n }\n}\n","// @flow\n\nimport assert from 'assert';\n\nimport extend from '../util/extend.js';\nimport ParsingError from './parsing_error.js';\nimport ParsingContext from './parsing_context.js';\nimport EvaluationContext from './evaluation_context.js';\nimport CompoundExpression from './compound_expression.js';\nimport Step from './definitions/step.js';\nimport Interpolate from './definitions/interpolate.js';\nimport Coalesce from './definitions/coalesce.js';\nimport Let from './definitions/let.js';\nimport definitions from './definitions/index.js';\nimport * as isConstant from './is_constant.js';\nimport RuntimeError from './runtime_error.js';\nimport {success, error} from '../util/result.js';\nimport {supportsPropertyExpression, supportsZoomExpression, supportsInterpolation} from '../util/properties.js';\n\nimport type {Type, EvaluationKind} from './types.js';\nimport type {Value} from './values.js';\nimport type {Expression} from './expression.js';\nimport type {StylePropertySpecification} from '../style-spec.js';\nimport type {Result} from '../util/result.js';\nimport type {InterpolationType} from './definitions/interpolate.js';\nimport type {PropertyValueSpecification} from '../types.js';\nimport type {FormattedSection} from './types/formatted.js';\nimport type Point from '@mapbox/point-geometry';\nimport type {CanonicalTileID} from '../../source/tile_id.js';\nimport type {FeatureDistanceData} from '../feature_filter/index.js';\n\nexport type Feature = {\n +type: 1 | 2 | 3 | 'Unknown' | 'Point' | 'LineString' | 'Polygon',\n +id?: number | null,\n +properties: {[_: string]: any},\n +patterns?: {[_: string]: string},\n +geometry?: Array>\n};\n\nexport type FeatureState = {[_: string]: any};\n\nexport type GlobalProperties = $ReadOnly<{\n zoom: number,\n pitch?: number,\n heatmapDensity?: number,\n lineProgress?: number,\n skyRadialProgress?: number,\n isSupportedScript?: (_: string) => boolean,\n accumulated?: Value\n}>;\n\nexport class StyleExpression {\n expression: Expression;\n\n _evaluator: EvaluationContext;\n _defaultValue: Value;\n _warningHistory: {[key: string]: boolean};\n _enumValues: ?{[_: string]: any};\n\n constructor(expression: Expression, propertySpec: ?StylePropertySpecification) {\n this.expression = expression;\n this._warningHistory = {};\n this._evaluator = new EvaluationContext();\n this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;\n this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;\n }\n\n evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any {\n this._evaluator.globals = globals;\n this._evaluator.feature = feature;\n this._evaluator.featureState = featureState;\n this._evaluator.canonical = canonical || null;\n this._evaluator.availableImages = availableImages || null;\n this._evaluator.formattedSection = formattedSection;\n this._evaluator.featureTileCoord = featureTileCoord || null;\n this._evaluator.featureDistanceData = featureDistanceData || null;\n\n return this.expression.evaluate(this._evaluator);\n }\n\n evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any {\n this._evaluator.globals = globals;\n this._evaluator.feature = feature || null;\n this._evaluator.featureState = featureState || null;\n this._evaluator.canonical = canonical || null;\n this._evaluator.availableImages = availableImages || null;\n this._evaluator.formattedSection = formattedSection || null;\n this._evaluator.featureTileCoord = featureTileCoord || null;\n this._evaluator.featureDistanceData = featureDistanceData || null;\n\n try {\n const val = this.expression.evaluate(this._evaluator);\n // eslint-disable-next-line no-self-compare\n if (val === null || val === undefined || (typeof val === 'number' && val !== val)) {\n return this._defaultValue;\n }\n if (this._enumValues && !(val in this._enumValues)) {\n throw new RuntimeError(`Expected value to be one of ${Object.keys(this._enumValues).map(v => JSON.stringify(v)).join(', ')}, but found ${JSON.stringify(val)} instead.`);\n }\n return val;\n } catch (e) {\n if (!this._warningHistory[e.message]) {\n this._warningHistory[e.message] = true;\n if (typeof console !== 'undefined') {\n console.warn(e.message);\n }\n }\n return this._defaultValue;\n }\n }\n}\n\nexport function isExpression(expression: mixed): boolean {\n return Array.isArray(expression) && expression.length > 0 &&\n typeof expression[0] === 'string' && expression[0] in definitions;\n}\n\n/**\n * Parse and typecheck the given style spec JSON expression. If\n * options.defaultValue is provided, then the resulting StyleExpression's\n * `evaluate()` method will handle errors by logging a warning (once per\n * message) and returning the default value. Otherwise, it will throw\n * evaluation errors.\n *\n * @private\n */\nexport function createExpression(expression: mixed, propertySpec: ?StylePropertySpecification): Result> {\n const parser = new ParsingContext(definitions, [], propertySpec ? getExpectedType(propertySpec) : undefined);\n\n // For string-valued properties, coerce to string at the top level rather than asserting.\n const parsed = parser.parse(expression, undefined, undefined, undefined,\n propertySpec && propertySpec.type === 'string' ? {typeAnnotation: 'coerce'} : undefined);\n\n if (!parsed) {\n assert(parser.errors.length > 0);\n return error(parser.errors);\n }\n\n return success(new StyleExpression(parsed, propertySpec));\n}\n\nexport class ZoomConstantExpression {\n kind: Kind;\n isStateDependent: boolean;\n _styleExpression: StyleExpression;\n\n constructor(kind: Kind, expression: StyleExpression) {\n this.kind = kind;\n this._styleExpression = expression;\n this.isStateDependent = kind !== ('constant': EvaluationKind) && !isConstant.isStateConstant(expression.expression);\n }\n\n evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n\n evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n}\n\nexport class ZoomDependentExpression {\n kind: Kind;\n zoomStops: Array;\n isStateDependent: boolean;\n\n _styleExpression: StyleExpression;\n interpolationType: ?InterpolationType;\n\n constructor(kind: Kind, expression: StyleExpression, zoomStops: Array, interpolationType?: InterpolationType) {\n this.kind = kind;\n this.zoomStops = zoomStops;\n this._styleExpression = expression;\n this.isStateDependent = kind !== ('camera': EvaluationKind) && !isConstant.isStateConstant(expression.expression);\n this.interpolationType = interpolationType;\n }\n\n evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n\n evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n\n interpolationFactor(input: number, lower: number, upper: number): number {\n if (this.interpolationType) {\n return Interpolate.interpolationFactor(this.interpolationType, input, lower, upper);\n } else {\n return 0;\n }\n }\n}\n\nexport type ConstantExpression = {\n kind: 'constant',\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array) => any,\n}\n\nexport type SourceExpression = {\n kind: 'source',\n isStateDependent: boolean,\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection) => any,\n};\n\nexport type CameraExpression = {\n kind: 'camera',\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array) => any,\n +interpolationFactor: (input: number, lower: number, upper: number) => number,\n zoomStops: Array,\n interpolationType: ?InterpolationType\n};\n\nexport type CompositeExpression = {\n kind: 'composite',\n isStateDependent: boolean,\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection) => any,\n +interpolationFactor: (input: number, lower: number, upper: number) => number,\n zoomStops: Array,\n interpolationType: ?InterpolationType\n};\n\nexport type StylePropertyExpression =\n | ConstantExpression\n | SourceExpression\n | CameraExpression\n | CompositeExpression;\n\nexport function createPropertyExpression(expression: mixed, propertySpec: StylePropertySpecification): Result> {\n expression = createExpression(expression, propertySpec);\n if (expression.result === 'error') {\n return expression;\n }\n\n const parsed = expression.value.expression;\n\n const isFeatureConstant = isConstant.isFeatureConstant(parsed);\n if (!isFeatureConstant && !supportsPropertyExpression(propertySpec)) {\n return error([new ParsingError('', 'data expressions not supported')]);\n }\n\n const isZoomConstant = isConstant.isGlobalPropertyConstant(parsed, ['zoom', 'pitch', 'distance-from-center']);\n if (!isZoomConstant && !supportsZoomExpression(propertySpec)) {\n return error([new ParsingError('', 'zoom expressions not supported')]);\n }\n\n const zoomCurve = findZoomCurve(parsed);\n if (!zoomCurve && !isZoomConstant) {\n return error([new ParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);\n } else if (zoomCurve instanceof ParsingError) {\n return error([zoomCurve]);\n } else if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) {\n return error([new ParsingError('', '\"interpolate\" expressions cannot be used with this property')]);\n }\n\n if (!zoomCurve) {\n return success(isFeatureConstant ?\n (new ZoomConstantExpression('constant', expression.value): ConstantExpression) :\n (new ZoomConstantExpression('source', expression.value): SourceExpression));\n }\n\n const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : undefined;\n\n return success(isFeatureConstant ?\n (new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType): CameraExpression) :\n (new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType): CompositeExpression));\n}\n\nimport {isFunction, createFunction} from '../function/index.js';\nimport {Color} from './values.js';\n\n// serialization wrapper for old-style stop functions normalized to the\n// expression interface\nexport class StylePropertyFunction {\n _parameters: PropertyValueSpecification;\n _specification: StylePropertySpecification;\n\n kind: EvaluationKind;\n evaluate: (globals: GlobalProperties, feature?: Feature) => any;\n interpolationFactor: ?(input: number, lower: number, upper: number) => number;\n zoomStops: ?Array;\n\n constructor(parameters: PropertyValueSpecification, specification: StylePropertySpecification) {\n this._parameters = parameters;\n this._specification = specification;\n extend(this, createFunction(this._parameters, this._specification));\n }\n\n static deserialize(serialized: {_parameters: PropertyValueSpecification, _specification: StylePropertySpecification}): StylePropertyFunction {\n return new StylePropertyFunction(serialized._parameters, serialized._specification);\n }\n\n static serialize(input: StylePropertyFunction): {_parameters: PropertyValueSpecification, _specification: StylePropertySpecification} {\n return {\n _parameters: input._parameters,\n _specification: input._specification\n };\n }\n}\n\nexport function normalizePropertyExpression(value: PropertyValueSpecification, specification: StylePropertySpecification): StylePropertyExpression {\n if (isFunction(value)) {\n return (new StylePropertyFunction(value, specification): any);\n\n } else if (isExpression(value)) {\n const expression = createPropertyExpression(value, specification);\n if (expression.result === 'error') {\n // this should have been caught in validation\n throw new Error(expression.value.map(err => `${err.key}: ${err.message}`).join(', '));\n }\n return expression.value;\n\n } else {\n let constant: any = value;\n if (typeof value === 'string' && specification.type === 'color') {\n constant = Color.parse(value);\n }\n return {\n kind: 'constant',\n evaluate: () => constant\n };\n }\n}\n\n// Zoom-dependent expressions may only use [\"zoom\"] as the input to a top-level \"step\" or \"interpolate\"\n// expression (collectively referred to as a \"curve\"). The curve may be wrapped in one or more \"let\" or\n// \"coalesce\" expressions.\nfunction findZoomCurve(expression: Expression): Step | Interpolate | ParsingError | null {\n let result = null;\n if (expression instanceof Let) {\n result = findZoomCurve(expression.result);\n\n } else if (expression instanceof Coalesce) {\n for (const arg of expression.args) {\n result = findZoomCurve(arg);\n if (result) {\n break;\n }\n }\n\n } else if ((expression instanceof Step || expression instanceof Interpolate) &&\n expression.input instanceof CompoundExpression &&\n expression.input.name === 'zoom') {\n\n result = expression;\n }\n\n if (result instanceof ParsingError) {\n return result;\n }\n\n expression.eachChild((child) => {\n const childResult = findZoomCurve(child);\n if (childResult instanceof ParsingError) {\n result = childResult;\n } else if (!result && childResult) {\n result = new ParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.');\n } else if (result && childResult && result !== childResult) {\n result = new ParsingError('', 'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.');\n }\n });\n\n return result;\n}\n\nimport {ColorType, StringType, NumberType, BooleanType, ValueType, FormattedType, ResolvedImageType, array} from './types.js';\n\nfunction getExpectedType(spec: StylePropertySpecification): Type {\n const types = {\n color: ColorType,\n string: StringType,\n number: NumberType,\n enum: StringType,\n boolean: BooleanType,\n formatted: FormattedType,\n resolvedImage: ResolvedImageType\n };\n\n if (spec.type === 'array') {\n return array(types[spec.value] || ValueType, spec.length);\n }\n\n return types[spec.type];\n}\n\nfunction getDefaultValue(spec: StylePropertySpecification): Value {\n if (spec.type === 'color' && (isFunction(spec.default) || Array.isArray(spec.default))) {\n // Special case for heatmap-color: it uses the 'default:' to define a\n // default color ramp, but createExpression expects a simple value to fall\n // back to in case of runtime errors\n return new Color(0, 0, 0, 0);\n } else if (spec.type === 'color') {\n return Color.parse(spec.default) || null;\n } else if (spec.default === undefined) {\n return null;\n } else {\n return spec.default;\n }\n}\n","// @flow\n\n// Turn jsonlint-lines-primitives objects into primitive objects\nexport function unbundle(value: mixed): mixed {\n if (value instanceof Number || value instanceof String || value instanceof Boolean) {\n return value.valueOf();\n } else {\n return value;\n }\n}\n\nexport function deepUnbundle(value: mixed): mixed {\n if (Array.isArray(value)) {\n return value.map(deepUnbundle);\n } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {\n const unbundledValue: { [key: string]: mixed } = {};\n for (const key in value) {\n unbundledValue[key] = deepUnbundle(value[key]);\n }\n return unbundledValue;\n }\n\n return unbundle(value);\n}\n","{\n \"$version\": 8,\n \"$root\": {\n \"version\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": [\n 8\n ],\n \"doc\": \"Style specification version number. Must be 8.\",\n \"example\": 8\n },\n \"name\": {\n \"type\": \"string\",\n \"doc\": \"A human-readable name for the style.\",\n \"example\": \"Bright\"\n },\n \"metadata\": {\n \"type\": \"*\",\n \"doc\": \"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\"\n },\n \"center\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"doc\": \"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": [\n -73.9749,\n 40.7736\n ]\n },\n \"zoom\": {\n \"type\": \"number\",\n \"doc\": \"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": 12.5\n },\n \"bearing\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"units\": \"degrees\",\n \"doc\": \"Default bearing, in degrees. The bearing is the compass direction that is \\\"up\\\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": 29\n },\n \"pitch\": {\n \"type\": \"number\",\n \"default\": 0,\n \"units\": \"degrees\",\n \"doc\": \"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": 50\n },\n \"light\": {\n \"type\": \"light\",\n \"doc\": \"The global light source.\",\n \"example\": {\n \"anchor\": \"viewport\",\n \"color\": \"white\",\n \"intensity\": 0.4\n }\n },\n \"terrain\": {\n \"type\": \"terrain\",\n \"doc\": \"A global modifier that elevates layers and markers based on a DEM data source.\"\n },\n \"fog\": {\n \"type\": \"fog\",\n \"doc\": \"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0.\"\n },\n \"sources\": {\n \"required\": true,\n \"type\": \"sources\",\n \"doc\": \"Data source specifications.\",\n \"example\": {\n \"mapbox-streets\": {\n \"type\": \"vector\",\n \"url\": \"mapbox://mapbox.mapbox-streets-v6\"\n }\n }\n },\n \"sprite\": {\n \"type\": \"string\",\n \"doc\": \"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).\",\n \"example\": \"mapbox://sprites/mapbox/bright-v8\"\n },\n \"glyphs\": {\n \"type\": \"string\",\n \"doc\": \"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).\",\n \"example\": \"mapbox://fonts/mapbox/{fontstack}/{range}.pbf\"\n },\n \"transition\": {\n \"type\": \"transition\",\n \"doc\": \"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.\",\n \"example\": {\n \"duration\": 300,\n \"delay\": 0\n }\n },\n \"projection\": {\n \"type\": \"projection\",\n \"doc\": \"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.\",\n \"example\": {\n \"name\": \"albers\",\n \"center\": [-154, 50],\n \"parallels\": [55, 65]\n }\n },\n \"layers\": {\n \"required\": true,\n \"type\": \"array\",\n \"value\": \"layer\",\n \"doc\": \"Layers will be drawn in the order of this array.\",\n \"example\": [\n {\n \"id\": \"water\",\n \"source\": \"mapbox-streets\",\n \"source-layer\": \"water\",\n \"type\": \"fill\",\n \"paint\": {\n \"fill-color\": \"#00ffff\"\n }\n }\n ]\n }\n },\n \"sources\": {\n \"*\": {\n \"type\": \"source\",\n \"doc\": \"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided.\"\n }\n },\n \"source\": [\n \"source_vector\",\n \"source_raster\",\n \"source_raster_dem\",\n \"source_geojson\",\n \"source_video\",\n \"source_image\"\n ],\n \"source_vector\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"vector\": {\n \"doc\": \"A vector tile source.\"\n }\n },\n \"doc\": \"The type of the source.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"doc\": \"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`.\"\n },\n \"tiles\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"An array of one or more tile source URLs, as in the TileJSON spec.\"\n },\n \"bounds\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n -180,\n -85.051129,\n 180,\n 85.051129\n ],\n \"doc\": \"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\"\n },\n \"scheme\": {\n \"type\": \"enum\",\n \"values\": {\n \"xyz\": {\n \"doc\": \"Slippy map tilenames scheme.\"\n },\n \"tms\": {\n \"doc\": \"OSGeo spec scheme.\"\n }\n },\n \"default\": \"xyz\",\n \"doc\": \"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 22,\n \"doc\": \"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"promoteId\": {\n \"type\": \"promoteId\",\n \"doc\": \"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id\"\n },\n \"volatile\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"A setting to determine whether a source's tiles are cached locally.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.3.0\",\n \"ios\": \"5.10.0\"\n }\n }\n },\n \"*\": {\n \"type\": \"*\",\n \"doc\": \"Other keys to configure the data source.\"\n }\n },\n \"source_raster\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"raster\": {\n \"doc\": \"A raster tile source.\"\n }\n },\n \"doc\": \"The type of the source.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"doc\": \"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`.\"\n },\n \"tiles\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"An array of one or more tile source URLs, as in the TileJSON spec.\"\n },\n \"bounds\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n -180,\n -85.051129,\n 180,\n 85.051129\n ],\n \"doc\": \"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 22,\n \"doc\": \"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"\n },\n \"tileSize\": {\n \"type\": \"number\",\n \"default\": 512,\n \"units\": \"pixels\",\n \"doc\": \"The minimum visual size to display tiles for this layer. Only configurable for raster layers.\"\n },\n \"scheme\": {\n \"type\": \"enum\",\n \"values\": {\n \"xyz\": {\n \"doc\": \"Slippy map tilenames scheme.\"\n },\n \"tms\": {\n \"doc\": \"OSGeo spec scheme.\"\n }\n },\n \"default\": \"xyz\",\n \"doc\": \"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"volatile\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"A setting to determine whether a source's tiles are cached locally.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.3.0\",\n \"ios\": \"5.10.0\"\n }\n }\n },\n \"*\": {\n \"type\": \"*\",\n \"doc\": \"Other keys to configure the data source.\"\n }\n },\n \"source_raster_dem\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"raster-dem\": {\n \"doc\": \"A RGB-encoded raster DEM source\"\n }\n },\n \"doc\": \"The type of the source.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"doc\": \"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`.\"\n },\n \"tiles\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"An array of one or more tile source URLs, as in the TileJSON spec.\"\n },\n \"bounds\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n -180,\n -85.051129,\n 180,\n 85.051129\n ],\n \"doc\": \"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 22,\n \"doc\": \"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"\n },\n \"tileSize\": {\n \"type\": \"number\",\n \"default\": 512,\n \"units\": \"pixels\",\n \"doc\": \"The minimum visual size to display tiles for this layer. Only configurable for raster layers.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"encoding\": {\n \"type\": \"enum\",\n \"values\": {\n \"terrarium\": {\n \"doc\": \"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info.\"\n },\n \"mapbox\": {\n \"doc\": \"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info.\"\n }\n },\n \"default\": \"mapbox\",\n \"doc\": \"The encoding used by this source. Mapbox Terrain RGB is used by default\"\n },\n \"volatile\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"A setting to determine whether a source's tiles are cached locally.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.3.0\",\n \"ios\": \"5.10.0\"\n }\n }\n },\n \"*\": {\n \"type\": \"*\",\n \"doc\": \"Other keys to configure the data source.\"\n }\n },\n \"source_geojson\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"geojson\": {\n \"doc\": \"A GeoJSON data source.\"\n }\n },\n \"doc\": \"The data type of the GeoJSON source.\"\n },\n \"data\": {\n \"type\": \"*\",\n \"doc\": \"A URL to a GeoJSON file, or inline GeoJSON.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 18,\n \"doc\": \"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"buffer\": {\n \"type\": \"number\",\n \"default\": 128,\n \"maximum\": 512,\n \"minimum\": 0,\n \"doc\": \"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.\"\n },\n \"filter\": {\n \"type\": \"*\",\n \"doc\": \"An expression for filtering features prior to processing them for rendering.\"\n },\n \"tolerance\": {\n \"type\": \"number\",\n \"default\": 0.375,\n \"doc\": \"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).\"\n },\n \"cluster\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count\"\n },\n \"clusterRadius\": {\n \"type\": \"number\",\n \"default\": 50,\n \"minimum\": 0,\n \"doc\": \"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.\"\n },\n \"clusterMaxZoom\": {\n \"type\": \"number\",\n \"doc\": \"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.\"\n },\n \"clusterMinPoints\": {\n \"type\": \"number\",\n \"doc\": \"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`.\"\n },\n \"clusterProperties\": {\n \"type\": \"*\",\n \"doc\": \"An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{\\\"property_name\\\": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `\\\"+\\\"` or `\\\"max\\\"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{\\\"sum\\\": [\\\"+\\\", [\\\"get\\\", \\\"scalerank\\\"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `[\\\"accumulated\\\"]` value, e.g.:\\n`{\\\"sum\\\": [[\\\"+\\\", [\\\"accumulated\\\"], [\\\"get\\\", \\\"sum\\\"]], [\\\"get\\\", \\\"scalerank\\\"]]}`\"\n },\n \"lineMetrics\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values.\"\n },\n \"generateId\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values.\"\n },\n \"promoteId\": {\n \"type\": \"promoteId\",\n \"doc\": \"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`.\"\n }\n },\n \"source_video\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"video\": {\n \"doc\": \"A video data source.\"\n }\n },\n \"doc\": \"The data type of the video source.\"\n },\n \"urls\": {\n \"required\": true,\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"URLs to video content in order of preferred format.\"\n },\n \"coordinates\": {\n \"required\": true,\n \"doc\": \"Corners of video specified in longitude, latitude pairs.\",\n \"type\": \"array\",\n \"length\": 4,\n \"value\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"doc\": \"A single longitude, latitude pair.\"\n }\n }\n },\n \"source_image\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"image\": {\n \"doc\": \"An image data source.\"\n }\n },\n \"doc\": \"The data type of the image source.\"\n },\n \"url\": {\n \"required\": true,\n \"type\": \"string\",\n \"doc\": \"URL that points to an image.\"\n },\n \"coordinates\": {\n \"required\": true,\n \"doc\": \"Corners of image specified in longitude, latitude pairs.\",\n \"type\": \"array\",\n \"length\": 4,\n \"value\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"doc\": \"A single longitude, latitude pair.\"\n }\n }\n },\n \"layer\": {\n \"id\": {\n \"type\": \"string\",\n \"doc\": \"Unique layer name.\",\n \"required\": true\n },\n \"type\": {\n \"type\": \"enum\",\n \"values\": {\n \"fill\": {\n \"doc\": \"A filled polygon with an optional stroked border.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"line\": {\n \"doc\": \"A stroked line.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"symbol\": {\n \"doc\": \"An icon or a text label.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"circle\": {\n \"doc\": \"A filled circle.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"heatmap\": {\n \"doc\": \"A heatmap.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"fill-extrusion\": {\n \"doc\": \"An extruded (3D) polygon.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"raster\": {\n \"doc\": \"Raster map textures such as satellite imagery.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"hillshade\": {\n \"doc\": \"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"background\": {\n \"doc\": \"The background color or pattern of the map.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"sky\": {\n \"doc\": \"A spherical dome around the map that is always rendered behind all other layers.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n }\n },\n \"doc\": \"Rendering type of this layer.\",\n \"required\": true\n },\n \"metadata\": {\n \"type\": \"*\",\n \"doc\": \"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\"\n },\n \"source\": {\n \"type\": \"string\",\n \"doc\": \"Name of a source description to be used for this layer. Required for all layer types except `background`.\"\n },\n \"source-layer\": {\n \"type\": \"string\",\n \"doc\": \"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 24,\n \"doc\": \"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 24,\n \"doc\": \"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.\"\n },\n \"filter\": {\n \"type\": \"filter\",\n \"doc\": \"An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\\\"feature-state\\\", ...]` expression is not supported in filter expressions. The `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions are supported only for filter expressions on the symbol layer.\"\n },\n \"layout\": {\n \"type\": \"layout\",\n \"doc\": \"Layout properties for the layer.\"\n },\n \"paint\": {\n \"type\": \"paint\",\n \"doc\": \"Default paint properties for this layer.\"\n }\n },\n \"layout\": [\n \"layout_fill\",\n \"layout_line\",\n \"layout_circle\",\n \"layout_heatmap\",\n \"layout_fill-extrusion\",\n \"layout_symbol\",\n \"layout_raster\",\n \"layout_hillshade\",\n \"layout_background\",\n \"layout_sky\"\n ],\n \"layout_background\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_sky\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_fill\": {\n \"fill-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n },\n \"data-driven styling\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_circle\": {\n \"circle-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.2.0\",\n \"ios\": \"5.9.0\",\n \"macos\": \"0.16.0\"\n },\n \"data-driven styling\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.2.0\",\n \"ios\": \"5.9.0\",\n \"macos\": \"0.16.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_heatmap\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_fill-extrusion\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"property-type\": \"constant\"\n },\n \"fill-extrusion-edge-radius\": {\n \"type\": \"number\",\n \"private\": true,\n \"default\": 0,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"v2.10.0\",\n \"android\": \"10.7.0\",\n \"ios\": \"10.7.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_line\": {\n \"line-cap\": {\n \"type\": \"enum\",\n \"values\": {\n \"butt\": {\n \"doc\": \"A cap with a squared-off end which is drawn to the exact endpoint of the line.\"\n },\n \"round\": {\n \"doc\": \"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.\"\n },\n \"square\": {\n \"doc\": \"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.\"\n }\n },\n \"default\": \"butt\",\n \"doc\": \"The display of line endings.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"2.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-join\": {\n \"type\": \"enum\",\n \"values\": {\n \"bevel\": {\n \"doc\": \"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.\"\n },\n \"round\": {\n \"doc\": \"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.\"\n },\n \"miter\": {\n \"doc\": \"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.\"\n }\n },\n \"default\": \"miter\",\n \"doc\": \"The display of lines when joining.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-miter-limit\": {\n \"type\": \"number\",\n \"default\": 2,\n \"doc\": \"Used to automatically convert miter joins to bevel joins for sharp angles.\",\n \"requires\": [\n {\n \"line-join\": \"miter\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-round-limit\": {\n \"type\": \"number\",\n \"default\": 1.05,\n \"doc\": \"Used to automatically convert round joins to miter joins for shallow angles.\",\n \"requires\": [\n {\n \"line-join\": \"round\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n },\n \"data-driven styling\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_symbol\": {\n \"symbol-placement\": {\n \"type\": \"enum\",\n \"values\": {\n \"point\": {\n \"doc\": \"The label is placed at the point where the geometry is located.\"\n },\n \"line\": {\n \"doc\": \"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.\"\n },\n \"line-center\": {\n \"doc\": \"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries.\"\n }\n },\n \"default\": \"point\",\n \"doc\": \"Label placement relative to its geometry.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"`line-center` value\": {\n \"js\": \"0.47.0\",\n \"android\": \"6.4.0\",\n \"ios\": \"4.3.0\",\n \"macos\": \"0.10.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"symbol-spacing\": {\n \"type\": \"number\",\n \"default\": 250,\n \"minimum\": 1,\n \"units\": \"pixels\",\n \"doc\": \"Distance between two symbol anchors.\",\n \"requires\": [\n {\n \"symbol-placement\": \"line\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"symbol-avoid-edges\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"symbol-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.53.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.11.0\",\n \"macos\": \"0.14.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.53.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.11.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"symbol-z-order\": {\n \"type\": \"enum\",\n \"values\": {\n \"auto\": {\n \"doc\": \"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.\"\n },\n \"viewport-y\": {\n \"doc\": \"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.\"\n },\n \"source\": {\n \"doc\": \"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.6.0\",\n \"ios\": \"4.5.0\",\n \"macos\": \"0.12.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-allow-overlap\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the icon will be visible even if it collides with other previously drawn symbols.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-ignore-placement\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, other symbols can be visible even if they collide with the icon.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-optional\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.\",\n \"requires\": [\n \"icon-image\",\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-rotation-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line.\"\n },\n \"viewport\": {\n \"doc\": \"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.\"\n },\n \"auto\": {\n \"doc\": \"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"In combination with `symbol-placement`, determines the rotation behavior of icons.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"`auto` value\": {\n \"js\": \"0.25.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-size\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"units\": \"factor of the original icon size\",\n \"doc\": \"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-text-fit\": {\n \"type\": \"enum\",\n \"values\": {\n \"none\": {\n \"doc\": \"The icon is displayed at its intrinsic aspect ratio.\"\n },\n \"width\": {\n \"doc\": \"The icon is scaled in the x-dimension to fit the width of the text.\"\n },\n \"height\": {\n \"doc\": \"The icon is scaled in the y-dimension to fit the height of the text.\"\n },\n \"both\": {\n \"doc\": \"The icon is scaled in both x- and y-dimensions.\"\n }\n },\n \"default\": \"none\",\n \"doc\": \"Scales the icon to fit around the associated text.\",\n \"requires\": [\n \"icon-image\",\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n },\n \"stretchable icons\": {\n \"js\": \"1.6.0\",\n \"android\": \"9.2.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-text-fit-padding\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"units\": \"pixels\",\n \"doc\": \"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.\",\n \"requires\": [\n \"icon-image\",\n \"text-field\",\n {\n \"icon-text-fit\": [\n \"both\",\n \"width\",\n \"height\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-image\": {\n \"type\": \"resolvedImage\",\n \"doc\": \"Name of image in sprite to use for drawing an image background.\",\n \"tokens\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-rotate\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"units\": \"degrees\",\n \"doc\": \"Rotates the icon clockwise.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.21.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-padding\": {\n \"type\": \"number\",\n \"default\": 2,\n \"minimum\": 0,\n \"units\": \"pixels\",\n \"doc\": \"Size of the additional area around the icon bounding box used for detecting symbol collisions.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-keep-upright\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the icon may be flipped to prevent it from being rendered upside-down.\",\n \"requires\": [\n \"icon-image\",\n {\n \"icon-rotation-alignment\": \"map\"\n },\n {\n \"symbol-placement\": [\n \"line\",\n \"line-center\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-offset\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"doc\": \"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"center\": {\n \"doc\": \"The center of the icon is placed closest to the anchor.\"\n },\n \"left\": {\n \"doc\": \"The left side of the icon is placed closest to the anchor.\"\n },\n \"right\": {\n \"doc\": \"The right side of the icon is placed closest to the anchor.\"\n },\n \"top\": {\n \"doc\": \"The top of the icon is placed closest to the anchor.\"\n },\n \"bottom\": {\n \"doc\": \"The bottom of the icon is placed closest to the anchor.\"\n },\n \"top-left\": {\n \"doc\": \"The top left corner of the icon is placed closest to the anchor.\"\n },\n \"top-right\": {\n \"doc\": \"The top right corner of the icon is placed closest to the anchor.\"\n },\n \"bottom-left\": {\n \"doc\": \"The bottom left corner of the icon is placed closest to the anchor.\"\n },\n \"bottom-right\": {\n \"doc\": \"The bottom right corner of the icon is placed closest to the anchor.\"\n }\n },\n \"default\": \"center\",\n \"doc\": \"Part of the icon placed closest to the anchor.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-pitch-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The icon is aligned to the plane of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The icon is aligned to the plane of the viewport.\"\n },\n \"auto\": {\n \"doc\": \"Automatically matches the value of `icon-rotation-alignment`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"Orientation of icon when map is pitched.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-pitch-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The text is aligned to the plane of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The text is aligned to the plane of the viewport.\"\n },\n \"auto\": {\n \"doc\": \"Automatically matches the value of `text-rotation-alignment`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"Orientation of text when map is pitched.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n },\n \"`auto` value\": {\n \"js\": \"0.25.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-rotation-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line.\"\n },\n \"viewport\": {\n \"doc\": \"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.\"\n },\n \"auto\": {\n \"doc\": \"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"`auto` value\": {\n \"js\": \"0.25.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-field\": {\n \"type\": \"formatted\",\n \"default\": \"\",\n \"tokens\": true,\n \"doc\": \"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-font\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"default\": [\n \"Open Sans Regular\",\n \"Arial Unicode MS Regular\"\n ],\n \"doc\": \"Font stack to use for displaying text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-size\": {\n \"type\": \"number\",\n \"default\": 16,\n \"minimum\": 0,\n \"units\": \"pixels\",\n \"doc\": \"Font size.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-max-width\": {\n \"type\": \"number\",\n \"default\": 10,\n \"minimum\": 0,\n \"units\": \"ems\",\n \"doc\": \"The maximum line width for text wrapping.\",\n \"requires\": [\n \"text-field\",\n {\n \"symbol-placement\": [\n \"point\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-line-height\": {\n \"type\": \"number\",\n \"default\": 1.2,\n \"units\": \"ems\",\n \"doc\": \"Text leading value for multi-line text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-letter-spacing\": {\n \"type\": \"number\",\n \"default\": 0,\n \"units\": \"ems\",\n \"doc\": \"Text tracking amount.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-justify\": {\n \"type\": \"enum\",\n \"values\": {\n \"auto\": {\n \"doc\": \"The text is aligned towards the anchor position.\"\n },\n \"left\": {\n \"doc\": \"The text is aligned to the left.\"\n },\n \"center\": {\n \"doc\": \"The text is centered.\"\n },\n \"right\": {\n \"doc\": \"The text is aligned to the right.\"\n }\n },\n \"default\": \"center\",\n \"doc\": \"Text justification options.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n },\n \"auto\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-radial-offset\": {\n \"type\": \"number\",\n \"units\": \"ems\",\n \"default\": 0,\n \"doc\": \"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"requires\": [\n \"text-field\"\n ],\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n }\n },\n \"text-variable-anchor\": {\n \"type\": \"array\",\n \"value\": \"enum\",\n \"values\": {\n \"center\": {\n \"doc\": \"The center of the text is placed closest to the anchor.\"\n },\n \"left\": {\n \"doc\": \"The left side of the text is placed closest to the anchor.\"\n },\n \"right\": {\n \"doc\": \"The right side of the text is placed closest to the anchor.\"\n },\n \"top\": {\n \"doc\": \"The top of the text is placed closest to the anchor.\"\n },\n \"bottom\": {\n \"doc\": \"The bottom of the text is placed closest to the anchor.\"\n },\n \"top-left\": {\n \"doc\": \"The top left corner of the text is placed closest to the anchor.\"\n },\n \"top-right\": {\n \"doc\": \"The top right corner of the text is placed closest to the anchor.\"\n },\n \"bottom-left\": {\n \"doc\": \"The bottom left corner of the text is placed closest to the anchor.\"\n },\n \"bottom-right\": {\n \"doc\": \"The bottom right corner of the text is placed closest to the anchor.\"\n }\n },\n \"requires\": [\n \"text-field\",\n {\n \"symbol-placement\": [\n \"point\"\n ]\n }\n ],\n \"doc\": \"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"center\": {\n \"doc\": \"The center of the text is placed closest to the anchor.\"\n },\n \"left\": {\n \"doc\": \"The left side of the text is placed closest to the anchor.\"\n },\n \"right\": {\n \"doc\": \"The right side of the text is placed closest to the anchor.\"\n },\n \"top\": {\n \"doc\": \"The top of the text is placed closest to the anchor.\"\n },\n \"bottom\": {\n \"doc\": \"The bottom of the text is placed closest to the anchor.\"\n },\n \"top-left\": {\n \"doc\": \"The top left corner of the text is placed closest to the anchor.\"\n },\n \"top-right\": {\n \"doc\": \"The top right corner of the text is placed closest to the anchor.\"\n },\n \"bottom-left\": {\n \"doc\": \"The bottom left corner of the text is placed closest to the anchor.\"\n },\n \"bottom-right\": {\n \"doc\": \"The bottom right corner of the text is placed closest to the anchor.\"\n }\n },\n \"default\": \"center\",\n \"doc\": \"Part of the text placed closest to the anchor.\",\n \"requires\": [\n \"text-field\",\n {\n \"!\": \"text-variable-anchor\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-max-angle\": {\n \"type\": \"number\",\n \"default\": 45,\n \"units\": \"degrees\",\n \"doc\": \"Maximum angle change between adjacent characters.\",\n \"requires\": [\n \"text-field\",\n {\n \"symbol-placement\": [\n \"line\",\n \"line-center\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-writing-mode\": {\n \"type\": \"array\",\n \"value\": \"enum\",\n \"values\": {\n \"horizontal\": {\n \"doc\": \"If a text's language supports horizontal writing mode, symbols would be laid out horizontally.\"\n },\n \"vertical\": {\n \"doc\": \"If a text's language supports vertical writing mode, symbols would be laid out vertically.\"\n }\n },\n \"doc\": \"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.3.0\",\n \"android\": \"8.3.0\",\n \"ios\": \"5.3.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-rotate\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"units\": \"degrees\",\n \"doc\": \"Rotates the text clockwise.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-padding\": {\n \"type\": \"number\",\n \"default\": 2,\n \"minimum\": 0,\n \"units\": \"pixels\",\n \"doc\": \"Size of the additional area around the text bounding box used for detecting symbol collisions.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-keep-upright\": {\n \"type\": \"boolean\",\n \"default\": true,\n \"doc\": \"If true, the text may be flipped vertically to prevent it from being rendered upside-down.\",\n \"requires\": [\n \"text-field\",\n {\n \"text-rotation-alignment\": \"map\"\n },\n {\n \"symbol-placement\": [\n \"line\",\n \"line-center\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-transform\": {\n \"type\": \"enum\",\n \"values\": {\n \"none\": {\n \"doc\": \"The text is not altered.\"\n },\n \"uppercase\": {\n \"doc\": \"Forces all letters to be displayed in uppercase.\"\n },\n \"lowercase\": {\n \"doc\": \"Forces all letters to be displayed in lowercase.\"\n }\n },\n \"default\": \"none\",\n \"doc\": \"Specifies how to capitalize text, similar to the CSS `text-transform` property.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-offset\": {\n \"type\": \"array\",\n \"doc\": \"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.\",\n \"value\": \"number\",\n \"units\": \"ems\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"requires\": [\n \"text-field\",\n {\n \"!\": \"text-radial-offset\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-allow-overlap\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the text will be visible even if it collides with other previously drawn symbols.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-ignore-placement\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, other symbols can be visible even if they collide with the text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-optional\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.\",\n \"requires\": [\n \"text-field\",\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_raster\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_hillshade\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"filter\": {\n \"type\": \"array\",\n \"value\": \"*\",\n \"doc\": \"A filter selects specific features from a layer.\"\n },\n \"filter_symbol\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\", \"pitch\", \"distance-from-center\"]\n }\n },\n \"filter_fill\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_line\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_circle\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_fill-extrusion\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_heatmap\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_operator\": {\n \"type\": \"enum\",\n \"values\": {\n \"==\": {\n \"doc\": \"`[\\\"==\\\", key, value]` equality: `feature[key] = value`\"\n },\n \"!=\": {\n \"doc\": \"`[\\\"!=\\\", key, value]` inequality: `feature[key] ≠ value`\"\n },\n \">\": {\n \"doc\": \"`[\\\">\\\", key, value]` greater than: `feature[key] > value`\"\n },\n \">=\": {\n \"doc\": \"`[\\\">=\\\", key, value]` greater than or equal: `feature[key] ≥ value`\"\n },\n \"<\": {\n \"doc\": \"`[\\\"<\\\", key, value]` less than: `feature[key] < value`\"\n },\n \"<=\": {\n \"doc\": \"`[\\\"<=\\\", key, value]` less than or equal: `feature[key] ≤ value`\"\n },\n \"in\": {\n \"doc\": \"`[\\\"in\\\", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`\"\n },\n \"!in\": {\n \"doc\": \"`[\\\"!in\\\", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`\"\n },\n \"all\": {\n \"doc\": \"`[\\\"all\\\", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`\"\n },\n \"any\": {\n \"doc\": \"`[\\\"any\\\", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`\"\n },\n \"none\": {\n \"doc\": \"`[\\\"none\\\", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`\"\n },\n \"has\": {\n \"doc\": \"`[\\\"has\\\", key]` `feature[key]` exists\"\n },\n \"!has\": {\n \"doc\": \"`[\\\"!has\\\", key]` `feature[key]` does not exist\"\n },\n \"within\": {\n \"doc\": \"`[\\\"within\\\", object]` feature geometry is within object geometry\"\n }\n },\n \"doc\": \"The filter operator.\"\n },\n \"geometry_type\": {\n \"type\": \"enum\",\n \"values\": {\n \"Point\": {\n \"doc\": \"Filter to point geometries.\"\n },\n \"LineString\": {\n \"doc\": \"Filter to line geometries.\"\n },\n \"Polygon\": {\n \"doc\": \"Filter to polygon geometries.\"\n }\n },\n \"doc\": \"The geometry type for the filter to select.\"\n },\n \"function\": {\n \"expression\": {\n \"type\": \"expression\",\n \"doc\": \"An expression.\"\n },\n \"stops\": {\n \"type\": \"array\",\n \"doc\": \"An array of stops.\",\n \"value\": \"function_stop\"\n },\n \"base\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"doc\": \"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly.\"\n },\n \"property\": {\n \"type\": \"string\",\n \"doc\": \"The name of a feature property to use as the function input.\",\n \"default\": \"$zoom\"\n },\n \"type\": {\n \"type\": \"enum\",\n \"values\": {\n \"identity\": {\n \"doc\": \"Return the input value as the output value.\"\n },\n \"exponential\": {\n \"doc\": \"Generate an output by interpolating between stops just less than and just greater than the function input.\"\n },\n \"interval\": {\n \"doc\": \"Return the output value of the stop just less than the function input.\"\n },\n \"categorical\": {\n \"doc\": \"Return the output value of the stop equal to the function input.\"\n }\n },\n \"doc\": \"The interpolation strategy to use in function evaluation.\",\n \"default\": \"exponential\"\n },\n \"colorSpace\": {\n \"type\": \"enum\",\n \"values\": {\n \"rgb\": {\n \"doc\": \"Use the RGB color space to interpolate color values\"\n },\n \"lab\": {\n \"doc\": \"Use the LAB color space to interpolate color values.\"\n },\n \"hcl\": {\n \"doc\": \"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually.\"\n }\n },\n \"doc\": \"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.\",\n \"default\": \"rgb\"\n },\n \"default\": {\n \"type\": \"*\",\n \"required\": false,\n \"doc\": \"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property's default is used in these circumstances.\"\n }\n },\n \"function_stop\": {\n \"type\": \"array\",\n \"minimum\": 0,\n \"maximum\": 24,\n \"value\": [\n \"number\",\n \"color\"\n ],\n \"length\": 2,\n \"doc\": \"Zoom level and value pair.\"\n },\n \"expression\": {\n \"type\": \"array\",\n \"value\": \"*\",\n \"minimum\": 1,\n \"doc\": \"An expression defines a function that can be used for data-driven style properties or feature filters.\"\n },\n \"expression_name\": {\n \"doc\": \"\",\n \"type\": \"enum\",\n \"values\": {\n \"let\": {\n \"doc\": \"Binds expressions to named variables, which can then be referenced in the result expression using [\\\"var\\\", \\\"variable_name\\\"].\",\n \"group\": \"Variable binding\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"var\": {\n \"doc\": \"References variable bound using \\\"let\\\".\",\n \"group\": \"Variable binding\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"literal\": {\n \"doc\": \"Provides a literal array or object value.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"array\": {\n \"doc\": \"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"at\": {\n \"doc\": \"Retrieves an item from an array.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"in\": {\n \"doc\": \"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.6.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"index-of\": {\n \"doc\": \"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.10.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n }\n },\n \"slice\": {\n \"doc\": \"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.10.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n }\n },\n \"case\": {\n \"doc\": \"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"match\": {\n \"doc\": \"Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\\\"get\\\", \\\"building_type\\\"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\\\"c\\\", \\\"b\\\"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `\\\"in\\\"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"coalesce\": {\n \"doc\": \"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"step\": {\n \"doc\": \"Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\\\"stops\\\"). The `input` may be any numeric expression (e.g., `[\\\"get\\\", \\\"population\\\"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.42.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"interpolate\": {\n \"doc\": \"Produces continuous, smooth results by interpolating between pairs of input and output values (\\\"stops\\\"). The `input` may be any numeric expression (e.g., `[\\\"get\\\", \\\"population\\\"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\\n\\nInterpolation types:\\n- `[\\\"linear\\\"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `[\\\"exponential\\\", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `[\\\"cubic-bezier\\\", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.42.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"interpolate-hcl\": {\n \"doc\": \"Produces continuous, smooth results by interpolating between pairs of input and output values (\\\"stops\\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.49.0\"\n }\n }\n },\n \"interpolate-lab\": {\n \"doc\": \"Produces continuous, smooth results by interpolating between pairs of input and output values (\\\"stops\\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.49.0\"\n }\n }\n },\n \"ln2\": {\n \"doc\": \"Returns mathematical constant ln(2).\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"pi\": {\n \"doc\": \"Returns the mathematical constant pi.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"e\": {\n \"doc\": \"Returns the mathematical constant e.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"typeof\": {\n \"doc\": \"Returns a string describing the type of the given value.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"string\": {\n \"doc\": \"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"number\": {\n \"doc\": \"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"boolean\": {\n \"doc\": \"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"object\": {\n \"doc\": \"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"collator\": {\n \"doc\": \"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"format\": {\n \"doc\": \"Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`'image'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `\\\"text-font\\\"`: Overrides the font stack specified by the root layout property.\\n- `\\\"text-color\\\"`: Overrides the color specified by the root paint property.\\n- `\\\"font-scale\\\"`: Applies a scaling factor on `text-size` as specified by the root layout property.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.48.0\",\n \"android\": \"6.7.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n },\n \"text-font\": {\n \"js\": \"0.48.0\",\n \"android\": \"6.7.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n },\n \"font-scale\": {\n \"js\": \"0.48.0\",\n \"android\": \"6.7.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n },\n \"text-color\": {\n \"js\": \"1.3.0\",\n \"android\": \"7.3.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n },\n \"image\": {\n \"js\": \"1.6.0\",\n \"android\": \"8.6.0\",\n \"ios\": \"5.7.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"image\": {\n \"doc\": \"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.4.0\",\n \"android\": \"8.6.0\",\n \"ios\": \"5.7.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"number-format\": {\n \"doc\": \"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.54.0\",\n \"android\" : \"8.4.0\",\n \"ios\": \"5.4.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"to-string\": {\n \"doc\": \"Converts the input value to a string. If the input is `null`, the result is `\\\"\\\"`. If the input is a [`boolean`](#types-boolean), the result is `\\\"true\\\"` or `\\\"false\\\"`. If the input is a number, it is converted to a string as specified by the [\\\"NumberToString\\\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `\\\"rgba(r,g,b,a)\\\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`'image'`](#types-image) expression, `'to-string'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-number\": {\n \"doc\": \"Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the [\\\"ToNumber Applied to the String Type\\\" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-boolean\": {\n \"doc\": \"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-rgba\": {\n \"doc\": \"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.\",\n \"group\": \"Color\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-color\": {\n \"doc\": \"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"rgb\": {\n \"doc\": \"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.\",\n \"group\": \"Color\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"rgba\": {\n \"doc\": \"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.\",\n \"group\": \"Color\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"get\": {\n \"doc\": \"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"has\": {\n \"doc\": \"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"length\": {\n \"doc\": \"Returns the length of an array or string.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"properties\": {\n \"doc\": \"Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\\\"get\\\", \\\"property_name\\\"]` directly.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"feature-state\": {\n \"doc\": \"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\\"feature-state\\\"] can only be used with paint properties that support data-driven styling.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.46.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n }\n },\n \"geometry-type\": {\n \"doc\": \"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"id\": {\n \"doc\": \"Returns the feature's id, if it has one.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"zoom\": {\n \"doc\": \"Returns the current zoom level. Note that in style layout and paint properties, [\\\"zoom\\\"] may only appear as the input to a top-level \\\"step\\\" or \\\"interpolate\\\" expression.\",\n \"group\": \"Camera\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"pitch\": {\n \"doc\": \"Returns the current pitch in degrees. `[\\\"pitch\\\"]` may only be used in the `filter` expression for a `symbol` layer.\",\n \"group\": \"Camera\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\",\n \"android\": \"10.9.0\",\n \"ios\": \"10.9.0\"\n }\n }\n },\n \"distance-from-center\": {\n \"doc\": \"Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `[\\\"distance-from-center\\\"]` may only be used in the `filter` expression for a `symbol` layer.\",\n \"group\": \"Camera\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\",\n \"android\": \"10.9.0\",\n \"ios\": \"10.9.0\"\n }\n }\n },\n \"heatmap-density\": {\n \"doc\": \"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.\",\n \"group\": \"Heatmap\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"line-progress\": {\n \"doc\": \"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n }\n }\n },\n \"sky-radial-progress\": {\n \"doc\": \"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.\",\n \"group\": \"sky\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n },\n \"accumulated\": {\n \"doc\": \"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.53.0\",\n \"android\": \"8.4.0\",\n \"ios\": \"5.5.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"+\": {\n \"doc\": \"Returns the sum of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"*\": {\n \"doc\": \"Returns the product of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"-\": {\n \"doc\": \"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"/\": {\n \"doc\": \"Returns the result of floating point division of the first input by the second.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"%\": {\n \"doc\": \"Returns the remainder after integer division of the first input by the second.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"^\": {\n \"doc\": \"Returns the result of raising the first input to the power specified by the second.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"sqrt\": {\n \"doc\": \"Returns the square root of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.42.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"log10\": {\n \"doc\": \"Returns the base-ten logarithm of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"ln\": {\n \"doc\": \"Returns the natural logarithm of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"log2\": {\n \"doc\": \"Returns the base-two logarithm of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"sin\": {\n \"doc\": \"Returns the sine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"cos\": {\n \"doc\": \"Returns the cosine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"tan\": {\n \"doc\": \"Returns the tangent of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"asin\": {\n \"doc\": \"Returns the arcsine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"acos\": {\n \"doc\": \"Returns the arccosine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"atan\": {\n \"doc\": \"Returns the arctangent of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"min\": {\n \"doc\": \"Returns the minimum value of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"max\": {\n \"doc\": \"Returns the maximum value of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"round\": {\n \"doc\": \"Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `[\\\"round\\\", -1.5]` evaluates to -2.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"abs\": {\n \"doc\": \"Returns the absolute value of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"ceil\": {\n \"doc\": \"Returns the smallest integer that is greater than or equal to the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"floor\": {\n \"doc\": \"Returns the largest integer that is less than or equal to the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"distance\": {\n \"doc\": \"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.2.0\",\n \"ios\": \"5.9.0\",\n \"macos\": \"0.16.0\"\n }\n }\n },\n \"==\": {\n \"doc\": \"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"!=\": {\n \"doc\": \"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \">\": {\n \"doc\": \"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"<\": {\n \"doc\": \"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \">=\": {\n \"doc\": \"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"<=\": {\n \"doc\": \"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"all\": {\n \"doc\": \"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"any\": {\n \"doc\": \"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"!\": {\n \"doc\": \"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"within\": {\n \"doc\": \"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.9.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"is-supported-script\": {\n \"doc\": \"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.6.0\",\n \"ios\": \"4.1.0\",\n \"macos\": \"0.8.0\"\n }\n }\n },\n \"upcase\": {\n \"doc\": \"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"downcase\": {\n \"doc\": \"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"concat\": {\n \"doc\": \"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"resolved-locale\": {\n \"doc\": \"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n }\n }\n },\n \"fog\": {\n \"range\": {\n \"type\": \"array\",\n \"default\": [\n 0.5,\n 10\n ],\n \"minimum\": -20,\n \"maximum\": 20,\n \"length\": 2,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"transition\": true,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"doc\": \"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.\",\n \"example\": [\n 0.5,\n 10\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n \"default\": \"#ffffff\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"high-color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n \"default\": \"#245cdf\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"space-color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n\n \"default\":\n [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"zoom\"\n ],\n 4,\n \"#010b19\",\n 7,\n \"#367ab9\"\n ],\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"horizon-blend\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\":\n [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"zoom\"\n ],\n 4,\n 0.2,\n 7,\n 0.1\n ],\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"star-intensity\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\":\n [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"zoom\"\n ],\n 5,\n 0.35,\n 6,\n 0\n ],\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n }\n },\n \"light\": {\n \"anchor\": {\n \"type\": \"enum\",\n \"default\": \"viewport\",\n \"values\": {\n \"map\": {\n \"doc\": \"The position of the light source is aligned to the rotation of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The position of the light source is aligned to the rotation of the viewport.\"\n }\n },\n \"property-type\": \"data-constant\",\n \"transition\": false,\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"doc\": \"Whether extruded geometries are lit relative to the map or viewport.\",\n \"example\": \"map\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"position\": {\n \"type\": \"array\",\n \"default\": [\n 1.15,\n 210,\n 30\n ],\n \"length\": 3,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"transition\": true,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"doc\": \"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).\",\n \"example\": [\n 1.5,\n 90,\n 80\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n \"default\": \"#ffffff\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Color tint for lighting extruded geometries.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"intensity\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\": 0.5,\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n }\n },\n \"projection\": {\n \"name\": {\n \"type\": \"enum\",\n \"values\": {\n \"albers\": {\n \"doc\": \"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region.\"\n },\n \"equalEarth\": {\n \"doc\": \"An Equal Earth projection.\"\n },\n \"equirectangular\": {\n \"doc\": \"An Equirectangular projection. This projection is very similar to the Plate Carrée projection.\"\n },\n \"lambertConformalConic\": {\n \"doc\": \"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region.\"\n },\n \"mercator\": {\n \"doc\": \"The Mercator projection is the default projection.\"\n },\n \"naturalEarth\": {\n \"doc\": \"A Natural Earth projection.\"\n },\n \"winkelTripel\": {\n \"doc\": \"A Winkel Tripel projection.\"\n },\n \"globe\": {\n \"doc\": \"A globe projection.\"\n }\n },\n \"default\": \"mercator\",\n \"doc\": \"The name of the projection to be used for rendering the map.\",\n \"required\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\"\n }\n }\n },\n \"center\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"minimum\": [-180, -90],\n \"maximum\": [180, 90],\n \"transition\": false,\n \"doc\": \"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].\",\n \"example\": [\n -96,\n 37.5\n ],\n \"requires\": [\n {\n \"name\": [\n \"albers\",\n \"lambertConformalConic\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\"\n }\n }\n },\n \"parallels\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"minimum\": [-90, -90],\n \"maximum\": [90, 90],\n \"transition\": false,\n \"doc\": \"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).\",\n \"example\": [\n 29.5,\n 45.5\n ],\n \"requires\": [\n {\n \"name\": [\n \"albers\",\n \"lambertConformalConic\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\"\n }\n }\n }\n },\n \"terrain\" : {\n \"source\": {\n \"type\": \"string\",\n \"doc\": \"Name of a source of `raster_dem` type to be used for terrain elevation.\",\n \"required\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n },\n \"exaggeration\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\": 1.0,\n \"minimum\": 0,\n \"maximum\": 1000,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.\",\n \"requires\": [\n \"source\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n }\n },\n \"paint\": [\n \"paint_fill\",\n \"paint_line\",\n \"paint_circle\",\n \"paint_heatmap\",\n \"paint_fill-extrusion\",\n \"paint_symbol\",\n \"paint_raster\",\n \"paint_hillshade\",\n \"paint_background\",\n \"paint_sky\"\n ],\n \"paint_fill\": {\n \"fill-antialias\": {\n \"type\": \"boolean\",\n \"default\": true,\n \"doc\": \"Whether or not the fill should be antialiased.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.21.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"fill-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.19.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-outline-color\": {\n \"type\": \"color\",\n \"doc\": \"The outline color of the fill. Matches the value of `fill-color` if unspecified.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"fill-pattern\"\n },\n {\n \"fill-antialias\": true\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.19.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The fill is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The fill is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `fill-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"fill-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.5.0\",\n \"macos\": \"0.11.0\",\n \"ios\": \"4.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n }\n },\n \"paint_fill-extrusion\": {\n \"fill-extrusion-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"fill-extrusion-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The fill extrusion is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The fill extrusion is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `fill-extrusion-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"fill-extrusion-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.5.0\",\n \"macos\": \"0.11.0\",\n \"ios\": \"4.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-height\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"units\": \"meters\",\n \"doc\": \"The height with which to extrude this layer.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-base\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"units\": \"meters\",\n \"doc\": \"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.\",\n \"transition\": true,\n \"requires\": [\n \"fill-extrusion-height\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-vertical-gradient\": {\n \"type\": \"boolean\",\n \"default\": true,\n \"doc\": \"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.\",\n \"transition\": false,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.50.0\",\n \"android\": \"7.0.0\",\n \"ios\": \"4.7.0\",\n \"macos\": \"0.13.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-ambient-occlusion-intensity\": {\n \"property-type\": \"data-constant\",\n \"type\": \"number\",\n \"private\": true,\n \"default\": 0.0,\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.10.0\",\n \"android\": \"10.7.0\",\n \"ios\": \"10.7.0\"\n }\n }\n },\n \"fill-extrusion-ambient-occlusion-radius\": {\n \"property-type\": \"data-constant\",\n \"type\": \"number\",\n \"private\": true,\n \"default\": 3.0,\n \"minimum\": 0,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.\",\n \"requires\": [\n \"fill-extrusion-edge-radius\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.10.0\",\n \"android\": \"10.7.0\",\n \"ios\": \"10.7.0\"\n }\n }\n }\n },\n \"paint_line\": {\n \"line-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the line will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-color\": {\n \"type\": \"color\",\n \"doc\": \"The color with which the line will be drawn.\",\n \"default\": \"#000000\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"line-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.23.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The line is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The line is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `line-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"line-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-width\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Stroke thickness.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-gap-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"doc\": \"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.\",\n \"transition\": true,\n \"units\": \"pixels\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-offset\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.\",\n \"transition\": true,\n \"units\": \"pixels\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.12.1\",\n \"android\": \"3.0.0\",\n \"ios\": \"3.1.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Blur applied to the line, in pixels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-dasharray\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"doc\": \"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"minimum\": 0,\n \"transition\": false,\n \"units\": \"line widths\",\n \"requires\": [\n {\n \"!\": \"line-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"2.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.5.0\",\n \"macos\": \"0.11.0\",\n \"ios\": \"4.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-gradient\": {\n \"type\": \"color\",\n \"doc\": \"Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `\\\"lineMetrics\\\": true`.\",\n \"transition\": false,\n \"requires\": [\n {\n \"!\": \"line-pattern\"\n },\n {\n \"source\": \"geojson\",\n \"has\": {\n \"lineMetrics\": true\n }\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.4.0\",\n \"macos\": \"0.11.0\"\n },\n \"data-driven styling\": {}\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"line-progress\"\n ]\n },\n \"property-type\": \"color-ramp\"\n },\n \"line-trim-offset\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"doc\": \"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].\",\n \"length\": 2,\n \"default\": [0.0, 0.0],\n \"minimum\": [0.0, 0.0],\n \"maximum\": [1.0, 1.0],\n \"transition\": false,\n \"requires\": [\n {\n \"source\": \"geojson\",\n \"has\": {\n \"lineMetrics\": true\n }\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.5.0\",\n \"ios\": \"10.5.0\",\n \"macos\": \"10.5.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"paint_circle\": {\n \"circle-radius\": {\n \"type\": \"number\",\n \"default\": 5,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Circle radius.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.18.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The fill color of the circle.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.18.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.20.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the circle will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.20.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The circle is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The circle is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `circle-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"circle-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-pitch-scale\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"Circles are scaled according to their apparent distance to the camera.\"\n },\n \"viewport\": {\n \"doc\": \"Circles are not scaled.\"\n }\n },\n \"default\": \"map\",\n \"doc\": \"Controls the scaling behavior of the circle when the map is pitched.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-pitch-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The circle is aligned to the plane of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The circle is aligned to the plane of the viewport.\"\n }\n },\n \"default\": \"viewport\",\n \"doc\": \"Orientation of circle when map is pitched.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-stroke-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-stroke-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The stroke color of the circle.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-stroke-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity of the circle's stroke.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n }\n },\n \"paint_heatmap\": {\n \"heatmap-radius\": {\n \"type\": \"number\",\n \"default\": 30,\n \"minimum\": 1,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"heatmap-weight\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"transition\": false,\n \"doc\": \"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"heatmap-intensity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"transition\": true,\n \"doc\": \"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"heatmap-color\": {\n \"type\": \"color\",\n \"default\": [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"heatmap-density\"\n ],\n 0,\n \"rgba(0, 0, 255, 0)\",\n 0.1,\n \"royalblue\",\n 0.3,\n \"cyan\",\n 0.5,\n \"lime\",\n 0.7,\n \"yellow\",\n 1,\n \"red\"\n ],\n \"doc\": \"Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\\\"heatmap-density\\\"]` as input.\",\n \"transition\": false,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"data-driven styling\": {}\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"heatmap-density\"\n ]\n },\n \"property-type\": \"color-ramp\"\n },\n \"heatmap-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The global opacity at which the heatmap layer will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_symbol\": {\n \"icon-opacity\": {\n \"doc\": \"The opacity at which the icon will be drawn.\",\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"transition\": true,\n \"doc\": \"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-halo-color\": {\n \"type\": \"color\",\n \"default\": \"rgba(0, 0, 0, 0)\",\n \"transition\": true,\n \"doc\": \"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-halo-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance of halo to the icon outline.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-halo-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Fade out the halo towards the outside.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"Icons are translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"Icons are translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `icon-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"icon-image\",\n \"icon-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the text will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-color\": {\n \"type\": \"color\",\n \"doc\": \"The color with which the text will be drawn.\",\n \"default\": \"#000000\",\n \"transition\": true,\n \"overridable\": true,\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-halo-color\": {\n \"type\": \"color\",\n \"default\": \"rgba(0, 0, 0, 0)\",\n \"transition\": true,\n \"doc\": \"The color of the text's halo, which helps it stand out from backgrounds.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-halo-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-halo-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The halo's fadeout distance towards the outside.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The text is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The text is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `text-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"text-field\",\n \"text-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_raster\": {\n \"raster-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the image will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-hue-rotate\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"transition\": true,\n \"units\": \"degrees\",\n \"doc\": \"Rotates hues around the color wheel.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-brightness-min\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the brightness of the image. The value is the minimum brightness.\",\n \"default\": 0,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-brightness-max\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the brightness of the image. The value is the maximum brightness.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-saturation\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the saturation of the image.\",\n \"default\": 0,\n \"minimum\": -1,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-contrast\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the contrast of the image.\",\n \"default\": 0,\n \"minimum\": -1,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-resampling\": {\n \"type\": \"enum\",\n \"doc\": \"The resampling/interpolation method to use for overscaling, also known as texture magnification filter\",\n \"values\": {\n \"linear\": {\n \"doc\": \"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled\"\n },\n \"nearest\": {\n \"doc\": \"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled\"\n }\n },\n \"default\": \"linear\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.47.0\",\n \"android\": \"6.3.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-fade-duration\": {\n \"type\": \"number\",\n \"default\": 300,\n \"minimum\": 0,\n \"transition\": false,\n \"units\": \"milliseconds\",\n \"doc\": \"Fade duration when a new tile is added.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_hillshade\": {\n \"hillshade-illumination-direction\": {\n \"type\": \"number\",\n \"default\": 335,\n \"minimum\": 0,\n \"maximum\": 359,\n \"doc\": \"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.\",\n \"transition\": false,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-illumination-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The hillshade illumination is relative to the north direction.\"\n },\n \"viewport\": {\n \"doc\": \"The hillshade illumination is relative to the top of the viewport.\"\n }\n },\n \"default\": \"viewport\",\n \"doc\": \"Direction of light source when map is rotated.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-exaggeration\": {\n \"type\": \"number\",\n \"doc\": \"Intensity of the hillshade\",\n \"default\": 0.5,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-shadow-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The shading color of areas that face away from the light source.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-highlight-color\": {\n \"type\": \"color\",\n \"default\": \"#FFFFFF\",\n \"doc\": \"The shading color of areas that faces towards the light source.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-accent-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_background\": {\n \"background-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The color with which the background will be drawn.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"background-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"background-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"background-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity at which the background will be drawn.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_sky\": {\n \"sky-type\": {\n \"type\": \"enum\",\n \"values\": {\n \"gradient\": {\n \"doc\": \"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`.\"\n },\n \"atmosphere\": {\n \"doc\": \"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`.\"\n }\n },\n \"default\": \"atmosphere\",\n \"doc\": \"The type of the sky\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-atmosphere-sun\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"units\": \"degrees\",\n \"minimum\": [0, 0],\n \"maximum\": [360, 180],\n \"transition\": false,\n \"doc\": \"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-atmosphere-sun-intensity\": {\n \"type\": \"number\",\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"default\": 10,\n \"minimum\": 0,\n \"maximum\": 100,\n \"transition\": false,\n \"doc\": \"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-gradient-center\": {\n \"type\": \"array\",\n \"requires\": [\n {\n \"sky-type\": \"gradient\"\n }\n ],\n \"value\": \"number\",\n \"default\": [\n 0,\n 0\n ],\n \"length\": 2,\n \"units\": \"degrees\",\n \"minimum\": [0, 0],\n \"maximum\": [360, 180],\n \"transition\": false,\n \"doc\": \"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-gradient-radius\": {\n \"type\": \"number\",\n \"requires\": [\n {\n \"sky-type\": \"gradient\"\n }\n ],\n \"default\": 90,\n \"minimum\": 0,\n \"maximum\": 180,\n \"transition\": false,\n \"doc\": \"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-gradient\": {\n \"type\": \"color\",\n \"default\": [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"sky-radial-progress\"\n ],\n 0.8,\n \"#87ceeb\",\n 1,\n \"white\"\n ],\n \"doc\": \"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.\",\n \"transition\": false,\n \"requires\": [\n {\n \"sky-type\": \"gradient\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n },\n \"data-driven styling\": {}\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"sky-radial-progress\"\n ]\n },\n \"property-type\": \"color-ramp\"\n },\n \"sky-atmosphere-halo-color\": {\n \"type\": \"color\",\n \"default\": \"white\",\n \"doc\": \"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.\",\n \"transition\": false,\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-atmosphere-color\": {\n \"type\": \"color\",\n \"default\": \"white\",\n \"doc\": \"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.\",\n \"transition\": false,\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity of the entire sky layer.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"transition\": {\n \"duration\": {\n \"type\": \"number\",\n \"default\": 300,\n \"minimum\": 0,\n \"units\": \"milliseconds\",\n \"doc\": \"Time allotted for transitions to complete.\"\n },\n \"delay\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"units\": \"milliseconds\",\n \"doc\": \"Length of time before a transition begins.\"\n }\n },\n \"property-type\": {\n \"data-driven\": {\n \"type\": \"property-type\",\n \"doc\": \"Property is interpolable and can be represented using a property expression.\"\n },\n \"color-ramp\": {\n \"type\": \"property-type\",\n \"doc\": \"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation.\"\n },\n \"data-constant\": {\n \"type\": \"property-type\",\n \"doc\": \"Property is interpolable but cannot be represented using a property expression.\"\n },\n \"constant\": {\n \"type\": \"property-type\",\n \"doc\": \"Property is constant across all zoom levels and property values.\"\n }\n },\n \"promoteId\": {\n \"*\": {\n \"type\": \"string\",\n \"doc\": \"A name of a feature property to use as ID for feature state.\"\n }\n }\n}\n","// @flow\n\nimport {createExpression} from '../expression/index.js';\nimport {isFeatureConstant} from '../expression/is_constant.js';\nimport {deepUnbundle} from '../util/unbundle_jsonlint.js';\nimport latest from '../reference/latest.js';\nimport type {GlobalProperties, Feature} from '../expression/index.js';\nimport type {CanonicalTileID} from '../../source/tile_id.js';\nimport type Point from '@mapbox/point-geometry';\n\nexport type FeatureDistanceData = {bearing: [number, number], center: [number, number], scale: number};\nexport type FilterExpression = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData) => boolean;\nexport type FeatureFilter = {filter: FilterExpression, dynamicFilter?: FilterExpression, needGeometry: boolean, needFeature: boolean};\n\nexport default createFilter;\nexport {isExpressionFilter, isDynamicFilter, extractStaticFilter};\n\nfunction isExpressionFilter(filter: any): boolean {\n if (filter === true || filter === false) {\n return true;\n }\n\n if (!Array.isArray(filter) || filter.length === 0) {\n return false;\n }\n switch (filter[0]) {\n case 'has':\n return filter.length >= 2 && filter[1] !== '$id' && filter[1] !== '$type';\n\n case 'in':\n return filter.length >= 3 && (typeof filter[1] !== 'string' || Array.isArray(filter[2]));\n\n case '!in':\n case '!has':\n case 'none':\n return false;\n\n case '==':\n case '!=':\n case '>':\n case '>=':\n case '<':\n case '<=':\n return filter.length !== 3 || (Array.isArray(filter[1]) || Array.isArray(filter[2]));\n\n case 'any':\n case 'all':\n for (const f of filter.slice(1)) {\n if (!isExpressionFilter(f) && typeof f !== 'boolean') {\n return false;\n }\n }\n return true;\n\n default:\n return true;\n }\n}\n\n/**\n * Given a filter expressed as nested arrays, return a new function\n * that evaluates whether a given feature (with a .properties or .tags property)\n * passes its test.\n *\n * @private\n * @param {Array} filter mapbox gl filter\n * @param {string} layerType the type of the layer this filter will be applied to.\n * @returns {Function} filter-evaluating function\n */\nfunction createFilter(filter: any, layerType?: string = 'fill'): FeatureFilter {\n if (filter === null || filter === undefined) {\n return {filter: () => true, needGeometry: false, needFeature: false};\n }\n\n if (!isExpressionFilter(filter)) {\n filter = convertFilter(filter);\n }\n const filterExp = ((filter: any): string[] | string | boolean);\n\n let staticFilter = true;\n try {\n staticFilter = extractStaticFilter(filterExp);\n } catch (e) {\n console.warn(\n`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(filterExp, null, 2)}\n `);\n }\n\n // Compile the static component of the filter\n const filterSpec = latest[`filter_${layerType}`];\n const compiledStaticFilter = createExpression(staticFilter, filterSpec);\n\n let filterFunc = null;\n if (compiledStaticFilter.result === 'error') {\n throw new Error(compiledStaticFilter.value.map(err => `${err.key}: ${err.message}`).join(', '));\n } else {\n filterFunc = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);\n }\n\n // If the static component is not equal to the entire filter then we have a dynamic component\n // Compile the dynamic component separately\n let dynamicFilterFunc = null;\n let needFeature = null;\n if (staticFilter !== filterExp) {\n const compiledDynamicFilter = createExpression(filterExp, filterSpec);\n\n if (compiledDynamicFilter.result === 'error') {\n throw new Error(compiledDynamicFilter.value.map(err => `${err.key}: ${err.message}`).join(', '));\n } else {\n dynamicFilterFunc = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData) => compiledDynamicFilter.value.evaluate(globalProperties, feature, {}, canonical, undefined, undefined, featureTileCoord, featureDistanceData);\n needFeature = !isFeatureConstant(compiledDynamicFilter.value.expression);\n }\n }\n\n filterFunc = ((filterFunc: any): FilterExpression);\n const needGeometry = geometryNeeded(staticFilter);\n\n return {\n filter: filterFunc,\n dynamicFilter: dynamicFilterFunc ? dynamicFilterFunc : undefined,\n needGeometry,\n needFeature: !!needFeature\n };\n}\n\nfunction extractStaticFilter(filter: any): any {\n if (!isDynamicFilter(filter)) {\n return filter;\n }\n\n // Shallow copy so we can replace expressions in-place\n let result = deepUnbundle(filter);\n\n // 1. Union branches\n unionDynamicBranches(result);\n\n // 2. Collapse dynamic conditions to `true`\n result = collapseDynamicBooleanExpressions(result);\n\n return result;\n}\n\nfunction collapseDynamicBooleanExpressions(expression: any): any {\n if (!Array.isArray(expression)) {\n return expression;\n }\n\n const collapsed = collapsedExpression(expression);\n if (collapsed === true) {\n return collapsed;\n } else {\n return collapsed.map((subExpression) => collapseDynamicBooleanExpressions(subExpression));\n }\n}\n\n/**\n * Traverses the expression and replaces all instances of branching on a\n * `dynamic` conditional (such as `['pitch']` or `['distance-from-center']`)\n * into an `any` expression.\n * This ensures that all possible outcomes of a `dynamic` branch are considered\n * when evaluating the expression upfront during filtering.\n *\n * @param {Array} filter the filter expression mutated in-place.\n */\nfunction unionDynamicBranches(filter: any) {\n let isBranchingDynamically = false;\n const branches = [];\n\n if (filter[0] === 'case') {\n for (let i = 1; i < filter.length - 1; i += 2) {\n isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[i]);\n branches.push(filter[i + 1]);\n }\n\n branches.push(filter[filter.length - 1]);\n } else if (filter[0] === 'match') {\n isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[1]);\n\n for (let i = 2; i < filter.length - 1; i += 2) {\n branches.push(filter[i + 1]);\n }\n branches.push(filter[filter.length - 1]);\n } else if (filter[0] === 'step') {\n isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[1]);\n\n for (let i = 1; i < filter.length - 1; i += 2) {\n branches.push(filter[i + 1]);\n }\n }\n\n if (isBranchingDynamically) {\n filter.length = 0;\n filter.push('any', ...branches);\n }\n\n // traverse and recurse into children\n for (let i = 1; i < filter.length; i++) {\n unionDynamicBranches(filter[i]);\n }\n}\n\nfunction isDynamicFilter(filter: any): boolean {\n // Base Cases\n if (!Array.isArray(filter)) {\n return false;\n }\n if (isRootExpressionDynamic(filter[0])) {\n return true;\n }\n\n for (let i = 1; i < filter.length; i++) {\n const child = filter[i];\n if (isDynamicFilter(child)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isRootExpressionDynamic(expression: string): boolean {\n return expression === 'pitch' ||\n expression === 'distance-from-center';\n}\n\nconst dynamicConditionExpressions = new Set([\n 'in',\n '==',\n '!=',\n '>',\n '>=',\n '<',\n '<=',\n 'to-boolean'\n]);\n\nfunction collapsedExpression(expression: any): any {\n if (dynamicConditionExpressions.has(expression[0])) {\n\n for (let i = 1; i < expression.length; i++) {\n const param = expression[i];\n if (isDynamicFilter(param)) {\n return true;\n }\n }\n }\n return expression;\n}\n\n// Comparison function to sort numbers and strings\nfunction compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nfunction geometryNeeded(filter) {\n if (!Array.isArray(filter)) return false;\n if (filter[0] === 'within') return true;\n for (let index = 1; index < filter.length; index++) {\n if (geometryNeeded(filter[index])) return true;\n }\n return false;\n}\n\nfunction convertFilter(filter: ?Array): mixed {\n if (!filter) return true;\n const op = filter[0];\n if (filter.length <= 1) return (op !== 'any');\n const converted =\n op === '==' ? convertComparisonOp(filter[1], filter[2], '==') :\n op === '!=' ? convertNegation(convertComparisonOp(filter[1], filter[2], '==')) :\n op === '<' ||\n op === '>' ||\n op === '<=' ||\n op === '>=' ? convertComparisonOp(filter[1], filter[2], op) :\n op === 'any' ? convertDisjunctionOp(filter.slice(1)) :\n op === 'all' ? ['all'].concat(filter.slice(1).map(convertFilter)) :\n op === 'none' ? ['all'].concat(filter.slice(1).map(convertFilter).map(convertNegation)) :\n op === 'in' ? convertInOp(filter[1], filter.slice(2)) :\n op === '!in' ? convertNegation(convertInOp(filter[1], filter.slice(2))) :\n op === 'has' ? convertHasOp(filter[1]) :\n op === '!has' ? convertNegation(convertHasOp(filter[1])) :\n op === 'within' ? filter :\n true;\n return converted;\n}\n\nfunction convertComparisonOp(property: string, value: any, op: string) {\n switch (property) {\n case '$type':\n return [`filter-type-${op}`, value];\n case '$id':\n return [`filter-id-${op}`, value];\n default:\n return [`filter-${op}`, property, value];\n }\n}\n\nfunction convertDisjunctionOp(filters: Array>) {\n return ['any'].concat(filters.map(convertFilter));\n}\n\nfunction convertInOp(property: string, values: Array) {\n if (values.length === 0) { return false; }\n switch (property) {\n case '$type':\n return [`filter-type-in`, ['literal', values]];\n case '$id':\n return [`filter-id-in`, ['literal', values]];\n default:\n if (values.length > 200 && !values.some(v => typeof v !== typeof values[0])) {\n return ['filter-in-large', property, ['literal', values.sort(compare)]];\n } else {\n return ['filter-in-small', property, ['literal', values]];\n }\n }\n}\n\nfunction convertHasOp(property: string) {\n switch (property) {\n case '$type':\n return true;\n case '$id':\n return [`filter-has-id`];\n default:\n return [`filter-has`, property];\n }\n}\n\nfunction convertNegation(filter: mixed) {\n return ['!', filter];\n}\n","// @flow\nexport default ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n","// @flow\n\nimport refProperties from './util/ref_properties.js';\n\nimport type {LayerSpecification} from './types.js';\n\nfunction deref(layer: LayerSpecification, parent: LayerSpecification): LayerSpecification {\n const result = {};\n\n for (const k in layer) {\n if (k !== 'ref') {\n result[k] = layer[k];\n }\n }\n\n refProperties.forEach((k) => {\n if (k in parent) {\n result[k] = (parent: any)[k];\n }\n });\n\n return ((result: any): LayerSpecification);\n}\n\n/**\n * Given an array of layers, some of which may contain `ref` properties\n * whose value is the `id` of another property, return a new array where\n * such layers have been augmented with the 'type', 'source', etc. properties\n * from the parent layer, and the `ref` property has been removed.\n *\n * The input is not modified. The output may contain references to portions\n * of the input.\n *\n * @private\n * @param {Array} layers\n * @returns {Array}\n */\nexport default function derefLayers(layers: Array): Array {\n layers = layers.slice();\n\n const map = Object.create(null);\n for (let i = 0; i < layers.length; i++) {\n map[layers[i].id] = layers[i];\n }\n\n for (let i = 0; i < layers.length; i++) {\n if ('ref' in layers[i]) {\n layers[i] = deref(layers[i], map[(layers[i]: any).ref]);\n }\n }\n\n return layers;\n}\n","var fontWeights = {\n thin: 100,\n hairline: 100,\n 'ultra-light': 200,\n 'extra-light': 200,\n light: 300,\n book: 300,\n regular: 400,\n normal: 400,\n plain: 400,\n roman: 400,\n standard: 400,\n medium: 500,\n 'semi-bold': 600,\n 'demi-bold': 600,\n bold: 700,\n 'extra-bold': 800,\n 'ultra-bold': 800,\n heavy: 900,\n black: 900,\n 'heavy-black': 900,\n fat: 900,\n poster: 900,\n 'ultra-black': 950,\n 'extra-black': 950\n};\nvar sp = ' ';\nvar italicRE = /(italic|oblique)$/i;\n\nvar fontCache = {};\n\nmodule.exports = function(fonts, size, lineHeight) {\n var cssData = fontCache[fonts];\n if (!cssData) {\n if (!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n var weight = 400;\n var style = 'normal';\n var fontFamilies = [];\n var haveWeight, haveStyle;\n for (var i = 0, ii = fonts.length; i < ii; ++i) {\n var font = fonts[i];\n var parts = font.split(' ');\n var maybeWeight = parts[parts.length - 1].toLowerCase();\n if (maybeWeight == 'normal' || maybeWeight == 'italic' || maybeWeight == 'oblique') {\n style = haveStyle ? style : maybeWeight;\n haveStyle = true;\n parts.pop();\n maybeWeight = parts[parts.length - 1].toLowerCase();\n } else if (italicRE.test(maybeWeight)) {\n maybeWeight = maybeWeight.replace(italicRE, '');\n style = haveStyle ? style : parts[parts.length - 1].replace(maybeWeight, '');\n haveStyle = true;\n }\n for (var w in fontWeights) {\n var previousPart = parts.length > 1 ? parts[parts.length - 2].toLowerCase() : '';\n if (maybeWeight == w || maybeWeight == w.replace('-', '') || previousPart + '-' + maybeWeight == w) {\n weight = haveWeight ? weight : fontWeights[w];\n parts.pop();\n if (previousPart && w.startsWith(previousPart)) {\n parts.pop();\n }\n break;\n }\n }\n if (!haveWeight && typeof maybeWeight == 'number') {\n weight = maybeWeight;\n haveWeight = true;\n }\n var fontFamily = parts.join(sp)\n .replace('Klokantech Noto Sans', 'Noto Sans');\n if (fontFamily.indexOf(sp) !== -1) {\n fontFamily = '\"' + fontFamily + '\"';\n }\n fontFamilies.push(fontFamily);\n }\n // CSS font property: font-style font-weight font-size/line-height font-family\n cssData = fontCache[fonts] = [style, weight, fontFamilies];\n }\n return cssData[0] + sp + cssData[1] + sp + size + 'px' + (lineHeight ? '/' + lineHeight : '') + sp + cssData[2];\n};\n","const mapboxBaseUrl = 'https://api.mapbox.com';\n\n/**\n * Gets the path from a mapbox:// URL.\n * @param {string} url The Mapbox URL.\n * @return {string} The path.\n * @private\n */\nexport function getMapboxPath(url) {\n const startsWith = 'mapbox://';\n if (url.indexOf(startsWith) !== 0) {\n return '';\n }\n return url.slice(startsWith.length);\n}\n\n/**\n * Turns mapbox:// sprite URLs into resolvable URLs.\n * @param {string} url The sprite URL.\n * @param {string} token The access token.\n * @param {string} styleUrl The style URL.\n * @return {string} A resolvable URL.\n * @private\n */\nexport function normalizeSpriteUrl(url, token, styleUrl) {\n const mapboxPath = getMapboxPath(url);\n if (!mapboxPath) {\n return decodeURI(new URL(url, styleUrl).href);\n }\n const startsWith = 'sprites/';\n if (mapboxPath.indexOf(startsWith) !== 0) {\n throw new Error(`unexpected sprites url: ${url}`);\n }\n const sprite = mapboxPath.slice(startsWith.length);\n\n return `${mapboxBaseUrl}/styles/v1/${sprite}/sprite?access_token=${token}`;\n}\n\n/**\n * Turns mapbox:// style URLs into resolvable URLs.\n * @param {string} url The style URL.\n * @param {string} token The access token.\n * @return {string} A resolvable URL.\n * @private\n */\nexport function normalizeStyleUrl(url, token) {\n const mapboxPath = getMapboxPath(url);\n if (!mapboxPath) {\n return decodeURI(new URL(url, location.href).href);\n }\n const startsWith = 'styles/';\n if (mapboxPath.indexOf(startsWith) !== 0) {\n throw new Error(`unexpected style url: ${url}`);\n }\n const style = mapboxPath.slice(startsWith.length);\n\n return `${mapboxBaseUrl}/styles/v1/${style}?&access_token=${token}`;\n}\n\n/**\n * Turns mapbox:// source URLs into vector tile URL templates.\n * @param {string} url The source URL.\n * @param {string} token The access token.\n * @param {string} tokenParam The access token key.\n * @param {string} styleUrl The style URL.\n * @return {string} A vector tile template.\n * @private\n */\nexport function normalizeSourceUrl(url, token, tokenParam, styleUrl) {\n const urlObject = new URL(url, styleUrl);\n const mapboxPath = getMapboxPath(url);\n if (!mapboxPath) {\n if (!token) {\n return decodeURI(urlObject.href);\n }\n if (!urlObject.searchParams.has(tokenParam)) {\n urlObject.searchParams.set(tokenParam, token);\n }\n return decodeURI(urlObject.href);\n }\n\n if (mapboxPath === 'mapbox.satellite') {\n const sizeFactor = window.devicePixelRatio >= 1.5 ? '@2x' : '';\n return `https://api.mapbox.com/v4/${mapboxPath}/{z}/{x}/{y}${sizeFactor}.webp?access_token=${token}`;\n }\n return `https://{a-d}.tiles.mapbox.com/v4/${mapboxPath}/{z}/{x}/{y}.vector.pbf?access_token=${token}`;\n}\n","import TileState from 'ol/TileState.js';\nimport {VectorTile} from 'ol';\nimport {expandUrl} from 'ol/tileurlfunction.js';\nimport {getUid} from 'ol/util.js';\nimport {normalizeSourceUrl, normalizeStyleUrl} from './mapbox.js';\nimport {toPromise} from 'ol/functions.js';\n\n/** @typedef {'Style'|'Source'|'Sprite'|'SpriteImage'|'Tiles'|'GeoJSON'} ResourceType */\n\n/** @typedef {import(\"ol\").Map} Map */\n/** @typedef {import(\"ol/layer\").Layer} Layer */\n/** @typedef {import(\"ol/layer\").Group} LayerGroup */\n/** @typedef {import(\"ol/layer\").Vector} VectorLayer */\n/** @typedef {import(\"ol/layer\").VectorTile} VectorTileLayer */\n/** @typedef {import(\"ol/source\").Source} Source */\n\nconst functionCacheByStyleId = {};\nconst filterCacheByStyleId = {};\n\nlet styleId = 0;\nexport function getStyleId(glStyle) {\n if (!glStyle.id) {\n glStyle.id = styleId++;\n }\n return glStyle.id;\n}\n\nexport function getStyleFunctionKey(glStyle, olLayer) {\n return getStyleId(glStyle) + '.' + getUid(olLayer);\n}\n\n/**\n * @param {Object} glStyle Mapboox style object.\n * @return {Object} Function cache.\n */\nexport function getFunctionCache(glStyle) {\n let functionCache = functionCacheByStyleId[glStyle.id];\n if (!functionCache) {\n functionCache = {};\n functionCacheByStyleId[getStyleId(glStyle)] = functionCache;\n }\n return functionCache;\n}\n\nexport function clearFunctionCache() {\n for (const key in functionCacheByStyleId) {\n delete functionCacheByStyleId[key];\n }\n}\n\n/**\n * @param {Object} glStyle Mapboox style object.\n * @return {Object} Filter cache.\n */\nexport function getFilterCache(glStyle) {\n let filterCache = filterCacheByStyleId[glStyle.id];\n if (!filterCache) {\n filterCache = {};\n filterCacheByStyleId[getStyleId(glStyle)] = filterCache;\n }\n return filterCache;\n}\n\nexport function deg2rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n\nexport const defaultResolutions = (function () {\n const resolutions = [];\n for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) {\n resolutions.push(res);\n }\n return resolutions;\n})();\n\n/**\n * @param {number} width Width of the canvas.\n * @param {number} height Height of the canvas.\n * @return {HTMLCanvasElement} Canvas.\n */\nexport function createCanvas(width, height) {\n if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && typeof OffscreenCanvas !== 'undefined') { // eslint-disable-line\n return /** @type {?} */ (new OffscreenCanvas(width, height));\n }\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n return canvas;\n}\n\nexport function getZoomForResolution(resolution, resolutions) {\n let i = 0;\n const ii = resolutions.length;\n for (; i < ii; ++i) {\n const candidate = resolutions[i];\n if (candidate < resolution && i + 1 < ii) {\n const zoomFactor = resolutions[i] / resolutions[i + 1];\n return i + Math.log(resolutions[i] / resolution) / Math.log(zoomFactor);\n }\n }\n return ii - 1;\n}\n\nexport function getResolutionForZoom(zoom, resolutions) {\n const base = Math.floor(zoom);\n const factor = Math.pow(2, zoom - base);\n return resolutions[base] / factor;\n}\n\nconst pendingRequests = {};\n/**\n * @param {ResourceType} resourceType Type of resource to load.\n * @param {string} url Url of the resource.\n * @param {Options} [options={}] Options.\n * @param {{request?: Request}} [metadata] Object to be filled with the request.\n * @return {Promise} Promise that resolves with the loaded resource\n * or rejects with the Response object.\n * @private\n */\nexport function fetchResource(resourceType, url, options = {}, metadata) {\n if (url in pendingRequests) {\n if (metadata) {\n metadata.request = pendingRequests[url][0];\n }\n return pendingRequests[url][1];\n }\n const transformedRequest = options.transformRequest\n ? options.transformRequest(url, resourceType) || url\n : url;\n const pendingRequest = toPromise(() => transformedRequest).then(\n (transformedRequest) => {\n if (!(transformedRequest instanceof Request)) {\n transformedRequest = new Request(transformedRequest);\n }\n if (!transformedRequest.headers.get('Accept')) {\n transformedRequest.headers.set('Accept', 'application/json');\n }\n if (metadata) {\n metadata.request = transformedRequest;\n }\n return fetch(transformedRequest)\n .then(function (response) {\n delete pendingRequests[url];\n return response.ok\n ? response.json()\n : Promise.reject(new Error('Error fetching source ' + url));\n })\n .catch(function (error) {\n delete pendingRequests[url];\n return Promise.reject(new Error('Error fetching source ' + url));\n });\n },\n );\n pendingRequests[url] = [transformedRequest, pendingRequest];\n return pendingRequest;\n}\n\nexport function getGlStyle(glStyleOrUrl, options) {\n if (typeof glStyleOrUrl === 'string') {\n if (glStyleOrUrl.trim().startsWith('{')) {\n try {\n const glStyle = JSON.parse(glStyleOrUrl);\n return Promise.resolve(glStyle);\n } catch (error) {\n return Promise.reject(error);\n }\n } else {\n glStyleOrUrl = normalizeStyleUrl(glStyleOrUrl, options.accessToken);\n return fetchResource('Style', glStyleOrUrl, options);\n }\n } else {\n return Promise.resolve(glStyleOrUrl);\n }\n}\n\nconst tilejsonCache = {};\n/**\n * @param {Object} glSource glStyle source object.\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {Promise<{tileJson: Object, tileLoadFunction: import('ol/Tile.js').LoadFunction}?>} TileJson and load function\n */\nexport function getTileJson(glSource, styleUrl, options = {}) {\n const cacheKey = [styleUrl, JSON.stringify(glSource)].toString();\n let promise = tilejsonCache[cacheKey];\n if (!promise || options.transformRequest) {\n let tileLoadFunction;\n if (options.transformRequest) {\n tileLoadFunction = (tile, src) => {\n const transformedRequest = options.transformRequest\n ? options.transformRequest(src, 'Tiles') || src\n : src;\n if (tile instanceof VectorTile) {\n tile.setLoader((extent, resolution, projection) => {\n toPromise(() => transformedRequest).then((transformedRequest) => {\n fetch(transformedRequest)\n .then((response) => response.arrayBuffer())\n .then((data) => {\n const format = tile.getFormat();\n const features = format.readFeatures(data, {\n extent: extent,\n featureProjection: projection,\n });\n // @ts-ignore\n tile.setFeatures(features);\n })\n .catch((e) => tile.setState(TileState.ERROR));\n });\n });\n } else {\n const img = tile.getImage();\n toPromise(() => transformedRequest).then((transformedRequest) => {\n if (transformedRequest instanceof Request) {\n fetch(transformedRequest)\n .then((response) => response.blob())\n .then((blob) => {\n const url = URL.createObjectURL(blob);\n img.addEventListener('load', () => URL.revokeObjectURL(url));\n img.addEventListener('error', () => URL.revokeObjectURL(url));\n img.src = url;\n })\n .catch((e) => tile.setState(TileState.ERROR));\n } else {\n img.src = transformedRequest;\n }\n });\n }\n };\n }\n const url = glSource.url;\n if (url && !glSource.tiles) {\n const normalizedSourceUrl = normalizeSourceUrl(\n url,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n styleUrl || location.href,\n );\n if (url.startsWith('mapbox://')) {\n promise = Promise.resolve({\n tileJson: Object.assign({}, glSource, {\n url: undefined,\n tiles: expandUrl(normalizedSourceUrl),\n }),\n tileLoadFunction,\n });\n } else {\n const metadata = {};\n promise = fetchResource(\n 'Source',\n normalizedSourceUrl,\n options,\n metadata,\n ).then(function (tileJson) {\n tileJson.tiles = tileJson.tiles.map(function (tileUrl) {\n if (tileJson.scheme === 'tms') {\n tileUrl = tileUrl.replace('{y}', '{-y}');\n }\n return normalizeSourceUrl(\n tileUrl,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n metadata.request.url,\n );\n });\n return Promise.resolve({tileJson, tileLoadFunction});\n });\n }\n } else {\n glSource = Object.assign({}, glSource, {\n tiles: glSource.tiles.map(function (tileUrl) {\n if (glSource.scheme === 'tms') {\n tileUrl = tileUrl.replace('{y}', '{-y}');\n }\n return normalizeSourceUrl(\n tileUrl,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n styleUrl || location.href,\n );\n }),\n });\n promise = Promise.resolve({\n tileJson: Object.assign({}, glSource),\n tileLoadFunction,\n });\n }\n tilejsonCache[cacheKey] = promise;\n }\n return promise;\n}\n\n/**\n * @param {HTMLImageElement|HTMLCanvasElement} spriteImage Sprite image id.\n * @param {{x: number, y: number, width: number, height: number, pixelRatio: number}} spriteImageData Sprite image data.\n * @param {number} haloWidth Halo width.\n * @param {{r: number, g: number, b: number, a: number}} haloColor Halo color.\n * @return {HTMLCanvasElement} Canvas element with the halo.\n */\nexport function drawIconHalo(\n spriteImage,\n spriteImageData,\n haloWidth,\n haloColor,\n) {\n const imgSize = [\n 2 * haloWidth * spriteImageData.pixelRatio + spriteImageData.width,\n 2 * haloWidth * spriteImageData.pixelRatio + spriteImageData.height,\n ];\n const imageCanvas = createCanvas(imgSize[0], imgSize[1]);\n const imageContext = imageCanvas.getContext('2d');\n imageContext.drawImage(\n spriteImage,\n spriteImageData.x,\n spriteImageData.y,\n spriteImageData.width,\n spriteImageData.height,\n haloWidth * spriteImageData.pixelRatio,\n haloWidth * spriteImageData.pixelRatio,\n spriteImageData.width,\n spriteImageData.height,\n );\n const imageData = imageContext.getImageData(0, 0, imgSize[0], imgSize[1]);\n imageContext.globalCompositeOperation = 'destination-over';\n imageContext.fillStyle = `rgba(${haloColor.r * 255},${haloColor.g * 255},${\n haloColor.b * 255\n },${haloColor.a})`;\n const data = imageData.data;\n for (let i = 0, ii = imageData.width; i < ii; ++i) {\n for (let j = 0, jj = imageData.height; j < jj; ++j) {\n const index = (j * ii + i) * 4;\n const alpha = data[index + 3];\n if (alpha > 0) {\n imageContext.arc(\n i,\n j,\n haloWidth * spriteImageData.pixelRatio,\n 0,\n 2 * Math.PI,\n );\n }\n }\n }\n imageContext.fill();\n return imageCanvas;\n}\n\nfunction smoothstep(min, max, value) {\n const x = Math.max(0, Math.min(1, (value - min) / (max - min)));\n return x * x * (3 - 2 * x);\n}\n\n/**\n * @param {HTMLImageElement} image SDF image\n * @param {{x: number, y: number, width: number, height: number}} area Area to unSDF\n * @param {{r: number, g: number, b: number, a: number}} color Color to use\n * @return {HTMLCanvasElement} Regular image\n */\nexport function drawSDF(image, area, color) {\n const imageCanvas = createCanvas(area.width, area.height);\n const imageContext = imageCanvas.getContext('2d');\n imageContext.drawImage(\n image,\n area.x,\n area.y,\n area.width,\n area.height,\n 0,\n 0,\n area.width,\n area.height,\n );\n const imageData = imageContext.getImageData(0, 0, area.width, area.height);\n const data = imageData.data;\n for (let i = 0, ii = imageData.width; i < ii; ++i) {\n for (let j = 0, jj = imageData.height; j < jj; ++j) {\n const index = (j * ii + i) * 4;\n const dist = data[index + 3] / 255;\n\n const buffer = 0.75;\n const gamma = 0.1;\n\n const alpha = smoothstep(buffer - gamma, buffer + gamma, dist);\n if (alpha > 0) {\n data[index + 0] = Math.round(255 * color.r * alpha);\n data[index + 1] = Math.round(255 * color.g * alpha);\n data[index + 2] = Math.round(255 * color.b * alpha);\n data[index + 3] = Math.round(255 * alpha);\n } else {\n data[index + 3] = 0;\n }\n }\n }\n imageContext.putImageData(imageData, 0, 0);\n return imageCanvas;\n}\n\n/**\n * @typedef {import(\"./apply.js\").Options} Options\n * @private\n */\n","import mb2css from 'mapbox-to-css-font';\nimport {checkedFonts, registerFont} from 'ol/render/canvas.js';\nimport {createCanvas} from './util.js';\n\nconst hairSpacePool = Array(256).join('\\u200A');\nexport function applyLetterSpacing(text, letterSpacing) {\n if (letterSpacing >= 0.05) {\n let textWithLetterSpacing = '';\n const lines = text.split('\\n');\n const joinSpaceString = hairSpacePool.slice(\n 0,\n Math.round(letterSpacing / 0.1),\n );\n for (let l = 0, ll = lines.length; l < ll; ++l) {\n if (l > 0) {\n textWithLetterSpacing += '\\n';\n }\n textWithLetterSpacing += lines[l].split('').join(joinSpaceString);\n }\n return textWithLetterSpacing;\n }\n return text;\n}\n\nlet measureContext;\nfunction getMeasureContext() {\n if (!measureContext) {\n measureContext = createCanvas(1, 1).getContext('2d');\n }\n return measureContext;\n}\n\nfunction measureText(text, letterSpacing) {\n return (\n getMeasureContext().measureText(text).width +\n (text.length - 1) * letterSpacing\n );\n}\n\nconst measureCache = {};\nexport function wrapText(text, font, em, letterSpacing) {\n if (text.indexOf('\\n') !== -1) {\n const hardLines = text.split('\\n');\n const lines = [];\n for (let i = 0, ii = hardLines.length; i < ii; ++i) {\n lines.push(wrapText(hardLines[i], font, em, letterSpacing));\n }\n return lines.join('\\n');\n }\n const key = em + ',' + font + ',' + text + ',' + letterSpacing;\n let wrappedText = measureCache[key];\n if (!wrappedText) {\n const words = text.split(' ');\n if (words.length > 1) {\n const ctx = getMeasureContext();\n ctx.font = font;\n const oneEm = ctx.measureText('M').width;\n const maxWidth = oneEm * em;\n let line = '';\n const lines = [];\n // Pass 1 - wrap lines to not exceed maxWidth\n for (let i = 0, ii = words.length; i < ii; ++i) {\n const word = words[i];\n const testLine = line + (line ? ' ' : '') + word;\n if (measureText(testLine, letterSpacing) <= maxWidth) {\n line = testLine;\n } else {\n if (line) {\n lines.push(line);\n }\n line = word;\n }\n }\n if (line) {\n lines.push(line);\n }\n // Pass 2 - add lines with a width of less than 30% of maxWidth to the previous or next line\n for (let i = 0, ii = lines.length; i < ii && ii > 1; ++i) {\n const line = lines[i];\n if (measureText(line, letterSpacing) < maxWidth * 0.35) {\n const prevWidth =\n i > 0 ? measureText(lines[i - 1], letterSpacing) : Infinity;\n const nextWidth =\n i < ii - 1 ? measureText(lines[i + 1], letterSpacing) : Infinity;\n lines.splice(i, 1);\n ii -= 1;\n if (prevWidth < nextWidth) {\n lines[i - 1] += ' ' + line;\n i -= 1;\n } else {\n lines[i] = line + ' ' + lines[i];\n }\n }\n }\n // Pass 3 - try to fill 80% of maxWidth for each line\n for (let i = 0, ii = lines.length - 1; i < ii; ++i) {\n const line = lines[i];\n const next = lines[i + 1];\n if (\n measureText(line, letterSpacing) > maxWidth * 0.7 &&\n measureText(next, letterSpacing) < maxWidth * 0.6\n ) {\n const lineWords = line.split(' ');\n const lastWord = lineWords.pop();\n if (measureText(lastWord, letterSpacing) < maxWidth * 0.2) {\n lines[i] = lineWords.join(' ');\n lines[i + 1] = lastWord + ' ' + next;\n }\n ii -= 1;\n }\n }\n wrappedText = lines.join('\\n');\n } else {\n wrappedText = text;\n }\n wrappedText = applyLetterSpacing(wrappedText, letterSpacing);\n measureCache[key] = wrappedText;\n }\n return wrappedText;\n}\n\nconst fontFamilyRegEx = /font-family: ?([^;]*);/;\nconst stripQuotesRegEx = /(\"|')/g;\nlet loadedFontFamilies;\nfunction hasFontFamily(family) {\n if (!loadedFontFamilies) {\n loadedFontFamilies = {};\n const styleSheets = document.styleSheets;\n for (let i = 0, ii = styleSheets.length; i < ii; ++i) {\n const styleSheet = /** @type {CSSStyleSheet} */ (styleSheets[i]);\n try {\n const cssRules = styleSheet.rules || styleSheet.cssRules;\n if (cssRules) {\n for (let j = 0, jj = cssRules.length; j < jj; ++j) {\n const cssRule = cssRules[j];\n if (cssRule.type == 5) {\n const match = cssRule.cssText.match(fontFamilyRegEx);\n loadedFontFamilies[match[1].replace(stripQuotesRegEx, '')] = true;\n }\n }\n }\n } catch (e) {\n // empty catch block\n }\n }\n }\n return family in loadedFontFamilies;\n}\n\nconst processedFontFamilies = {};\n\n/**\n * @param {Array} fonts Fonts.\n * @param {string} [templateUrl] Template URL.\n * @return {Array} Processed fonts.\n * @private\n */\nexport function getFonts(\n fonts,\n templateUrl = 'https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css',\n) {\n const fontsKey = fonts.toString();\n if (fontsKey in processedFontFamilies) {\n return processedFontFamilies[fontsKey];\n }\n const fontDescriptions = [];\n for (let i = 0, ii = fonts.length; i < ii; ++i) {\n fonts[i] = fonts[i].replace('Arial Unicode MS', 'Arial');\n const font = fonts[i];\n const cssFont = mb2css(font, 1);\n registerFont(cssFont);\n const parts = cssFont.split(' ');\n fontDescriptions.push([\n parts.slice(3).join(' ').replace(/\"/g, ''),\n parts[1],\n parts[0],\n ]);\n }\n for (let i = 0, ii = fontDescriptions.length; i < ii; ++i) {\n const fontDescription = fontDescriptions[i];\n const family = fontDescription[0];\n if (!hasFontFamily(family)) {\n if (\n checkedFonts.get(\n `${fontDescription[2]}\\n${fontDescription[1]} \\n${family}`,\n ) !== 100\n ) {\n const fontUrl = templateUrl\n .replace('{font-family}', family.replace(/ /g, '-').toLowerCase())\n .replace('{Font+Family}', family.replace(/ /g, '+'))\n .replace('{fontweight}', fontDescription[1])\n .replace(\n '{-fontstyle}',\n fontDescription[2].replace('normal', '').replace(/(.+)/, '-$1'),\n )\n .replace('{fontstyle}', fontDescription[2]);\n if (!document.querySelector('link[href=\"' + fontUrl + '\"]')) {\n const markup = document.createElement('link');\n markup.href = fontUrl;\n markup.rel = 'stylesheet';\n document.head.appendChild(markup);\n }\n }\n }\n }\n processedFontFamilies[fontsKey] = fonts;\n return fonts;\n}\n","/*\nol-mapbox-style - Use Mapbox Style objects with OpenLayers\nCopyright 2016-present ol-mapbox-style contributors\nLicense: https://raw.githubusercontent.com/openlayers/ol-mapbox-style/master/LICENSE\n*/\n\nimport Circle from 'ol/style/Circle.js';\nimport Fill from 'ol/style/Fill.js';\nimport Icon from 'ol/style/Icon.js';\nimport RenderFeature from 'ol/render/Feature.js';\nimport Stroke from 'ol/style/Stroke.js';\nimport Style from 'ol/style/Style.js';\nimport Text from 'ol/style/Text.js';\nimport {toPromise} from 'ol/functions.js';\n\nimport Color from '@mapbox/mapbox-gl-style-spec/util/color.js';\nimport convertFunction from '@mapbox/mapbox-gl-style-spec/function/convert.js';\nimport createFilter from '@mapbox/mapbox-gl-style-spec/feature_filter/index.js';\nimport derefLayers from '@mapbox/mapbox-gl-style-spec/deref.js';\nimport mb2css from 'mapbox-to-css-font';\nimport spec from '@mapbox/mapbox-gl-style-spec/reference/v8.json';\nimport {applyLetterSpacing, wrapText} from './text.js';\nimport {\n clearFunctionCache,\n createCanvas,\n defaultResolutions,\n deg2rad,\n drawIconHalo,\n drawSDF,\n getFilterCache,\n getFunctionCache,\n getStyleFunctionKey,\n getZoomForResolution,\n} from './util.js';\nimport {\n createPropertyExpression,\n isExpression,\n} from '@mapbox/mapbox-gl-style-spec/expression/index.js';\nimport {isFunction} from '@mapbox/mapbox-gl-style-spec/function/index.js';\n\n/**\n * @typedef {import(\"ol/layer/Vector\").default} VectorLayer\n * @typedef {import(\"ol/layer/VectorTile\").default} VectorTileLayer\n * @typedef {import(\"ol/style/Style\").StyleFunction} StyleFunction\n * @typedef {import('./util.js').ResourceType} ResourceType\n */\n\nconst types = {\n 'Point': 1,\n 'MultiPoint': 1,\n 'LineString': 2,\n 'MultiLineString': 2,\n 'Polygon': 3,\n 'MultiPolygon': 3,\n};\nconst anchor = {\n 'center': [0.5, 0.5],\n 'left': [0, 0.5],\n 'right': [1, 0.5],\n 'top': [0.5, 0],\n 'bottom': [0.5, 1],\n 'top-left': [0, 0],\n 'top-right': [1, 0],\n 'bottom-left': [0, 1],\n 'bottom-right': [1, 1],\n};\n\nconst expressionData = function (rawExpression, propertySpec) {\n const compiledExpression = createPropertyExpression(\n rawExpression,\n propertySpec,\n );\n if (compiledExpression.result === 'error') {\n throw new Error(\n compiledExpression.value\n .map((err) => `${err.key}: ${err.message}`)\n .join(', '),\n );\n }\n return compiledExpression.value;\n};\n\nconst emptyObj = {};\nconst zoomObj = {zoom: 0};\nlet renderFeatureCoordinates, renderFeature;\n\n/**\n * @private\n * @param {Object} layer Gl object layer.\n * @param {string} layoutOrPaint 'layout' or 'paint'.\n * @param {string} property Feature property.\n * @param {number} zoom Zoom.\n * @param {Object} feature Gl feature.\n * @param {Object} [functionCache] Function cache.\n * @param {Object} [featureState] Feature state.\n * @return {?} Value.\n */\nexport function getValue(\n layer,\n layoutOrPaint,\n property,\n zoom,\n feature,\n functionCache,\n featureState,\n) {\n const layerId = layer.id;\n if (!functionCache) {\n functionCache = {};\n console.warn('No functionCache provided to getValue()'); //eslint-disable-line no-console\n }\n if (!functionCache[layerId]) {\n functionCache[layerId] = {};\n }\n const functions = functionCache[layerId];\n if (!functions[property]) {\n let value = (layer[layoutOrPaint] || emptyObj)[property];\n const propertySpec = spec[`${layoutOrPaint}_${layer.type}`][property];\n if (value === undefined) {\n value = propertySpec.default;\n }\n let isExpr = isExpression(value);\n if (!isExpr && isFunction(value)) {\n value = convertFunction(value, propertySpec);\n isExpr = true;\n }\n if (isExpr) {\n const compiledExpression = expressionData(value, propertySpec);\n functions[property] =\n compiledExpression.evaluate.bind(compiledExpression);\n } else {\n if (propertySpec.type == 'color') {\n value = Color.parse(value);\n }\n functions[property] = function () {\n return value;\n };\n }\n }\n zoomObj.zoom = zoom;\n return functions[property](zoomObj, feature, featureState);\n}\n\n/**\n * @private\n * @param {Object} layer Gl object layer.\n * @param {number} zoom Zoom.\n * @param {Object} feature Gl feature.\n * @param {\"icon\"|\"text\"} prefix Style property prefix.\n * @param {Object} [functionCache] Function cache.\n * @return {\"declutter\"|\"obstacle\"|\"none\"} Value.\n */\nfunction getDeclutterMode(layer, zoom, feature, prefix, functionCache) {\n const allowOverlap = getValue(\n layer,\n 'layout',\n `${prefix}-allow-overlap`,\n zoom,\n feature,\n functionCache,\n );\n if (!allowOverlap) {\n return 'declutter';\n }\n const ignorePlacement = getValue(\n layer,\n 'layout',\n `${prefix}-ignore-placement`,\n zoom,\n feature,\n functionCache,\n );\n if (!ignorePlacement) {\n return 'obstacle';\n }\n return 'none';\n}\n\n/**\n * @private\n * @param {string} layerId Layer id.\n * @param {?} filter Filter.\n * @param {Object} feature Feature.\n * @param {number} zoom Zoom.\n * @param {Object} [filterCache] Filter cache.\n * @return {boolean} Filter result.\n */\nfunction evaluateFilter(layerId, filter, feature, zoom, filterCache) {\n if (!filterCache) {\n console.warn('No filterCache provided to evaluateFilter()'); //eslint-disable-line no-console\n }\n if (!(layerId in filterCache)) {\n filterCache[layerId] = createFilter(filter).filter;\n }\n zoomObj.zoom = zoom;\n return filterCache[layerId](zoomObj, feature);\n}\n\nlet renderTransparentEnabled = false;\n\n/**\n * Configure whether features with a transparent style should be rendered. When\n * set to `true`, it will be possible to hit detect content that is not visible,\n * like transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or\n * `ol/Map#getFeaturesAtPixel()`\n * @param {boolean} enabled Rendering of transparent elements is enabled.\n * Default is `false`.\n */\nexport function renderTransparent(enabled) {\n if (enabled !== renderTransparentEnabled) {\n clearFunctionCache();\n renderTransparentEnabled = enabled;\n }\n}\n\n/**\n * @private\n * @param {?} color Color.\n * @param {number} [opacity] Opacity.\n * @return {string} Color.\n */\nfunction colorWithOpacity(color, opacity) {\n if (color) {\n if (!renderTransparentEnabled && (color.a === 0 || opacity === 0)) {\n return undefined;\n }\n const a = color.a;\n opacity = opacity === undefined ? 1 : opacity;\n return a === 0\n ? 'transparent'\n : 'rgba(' +\n Math.round((color.r * 255) / a) +\n ',' +\n Math.round((color.g * 255) / a) +\n ',' +\n Math.round((color.b * 255) / a) +\n ',' +\n a * opacity +\n ')';\n }\n return color;\n}\n\nconst templateRegEx = /\\{[^{}}]*\\}/g;\n\n/**\n * @private\n * @param {string} text Text.\n * @param {Object} properties Properties.\n * @return {string} Text.\n */\nfunction fromTemplate(text, properties) {\n return text.replace(templateRegEx, function (match) {\n return properties[match.slice(1, -1)] || '';\n });\n}\n\nlet recordLayer = false;\n\n/**\n * Turns recording of the Mapbox Style's `layer` on and off. When turned on,\n * the layer that a rendered feature belongs to will be set as the feature's\n * `mapbox-layer` property.\n * @param {boolean} record Recording of the style layer is on.\n */\nexport function recordStyleLayer(record = false) {\n recordLayer = record;\n}\n\nexport const styleFunctionArgs = {};\n\n/**\n * Creates a style function from the `glStyle` object for all layers that use\n * the specified `source`, which needs to be a `\"type\": \"vector\"` or\n * `\"type\": \"geojson\"` source and applies it to the specified OpenLayers layer.\n *\n * Two additional properties will be set on the provided layer:\n *\n * * `mapbox-source`: The `id` of the Mapbox Style document's source that the\n * OpenLayers layer was created from. Usually `apply()` creates one\n * OpenLayers layer per Mapbox Style source, unless the layer stack has\n * layers from different sources in between.\n * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are\n * included in the OpenLayers layer.\n *\n * This function also works in a web worker. In worker mode, the main thread needs\n * to listen to messages from the worker and respond with another message to make\n * sure that sprite image loading works:\n *\n * ```js\n * worker.addEventListener('message', event => {\n * if (event.data.action === 'loadImage') {\n * const image = new Image();\n * image.crossOrigin = 'anonymous';\n * image.addEventListener('load', function() {\n * createImageBitmap(image, 0, 0, image.width, image.height).then(imageBitmap => {\n * worker.postMessage({\n * action: 'imageLoaded',\n * image: imageBitmap,\n * src: event.data.src\n * }, [imageBitmap]);\n * });\n * });\n * image.src = event.data.src;\n * }\n * });\n * ```\n *\n * @param {VectorLayer|VectorTileLayer} olLayer OpenLayers layer to\n * apply the style to. In addition to the style, the layer will get two\n * properties: `mapbox-source` will be the `id` of the `glStyle`'s source used\n * for the layer, and `mapbox-layers` will be an array of the `id`s of the\n * `glStyle`'s layers.\n * @param {string|Object} glStyle Mapbox Style object.\n * @param {string|Array} sourceOrLayers `source` key or an array of layer `id`s\n * from the Mapbox Style object. When a `source` key is provided, all layers for\n * the specified source will be included in the style function. When layer `id`s\n * are provided, they must be from layers that use the same source.\n * @param {Array} resolutions\n * Resolutions for mapping resolution to zoom level.\n * @param {Object} spriteData Sprite data from the url specified in\n * the Mapbox Style object's `sprite` property. Only required if a `sprite`\n * property is specified in the Mapbox Style object.\n * @param {string|Request|Promise} spriteImageUrl Sprite image url for the sprite\n * specified in the Mapbox Style object's `sprite` property. Only required if a\n * `sprite` property is specified in the Mapbox Style object.\n * @param {function(Array, string=):Array} getFonts Function that\n * receives a font stack and the url template from the GL style's `metadata['ol:webfonts']`\n * property (if set) as arguments, and returns a (modified) font stack that\n * is available. Font names are the names used in the Mapbox Style object. If\n * not provided, the font stack will be used as-is. This function can also be\n * used for loading web fonts.\n * @param {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined]\n * Function that returns an image or a URL for an image name. If the result is an HTMLImageElement, it must already be\n * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished.\n * This function can be used for icons not in the sprite or to override sprite icons.\n * @return {StyleFunction} Style function for use in\n * `ol.layer.Vector` or `ol.layer.VectorTile`.\n */\nexport function stylefunction(\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions = defaultResolutions,\n spriteData = undefined,\n spriteImageUrl = undefined,\n getFonts = undefined,\n getImage = undefined,\n) {\n if (typeof glStyle == 'string') {\n glStyle = JSON.parse(glStyle);\n }\n if (glStyle.version != 8) {\n throw new Error('glStyle version 8 required.');\n }\n styleFunctionArgs[getStyleFunctionKey(glStyle, olLayer)] =\n Array.from(arguments);\n\n let spriteImage, spriteImageSize;\n let spriteImageUnSDFed;\n\n if (spriteImageUrl) {\n if (typeof Image !== 'undefined') {\n const img = new Image();\n let blobUrl;\n toPromise(() => spriteImageUrl).then((spriteImageUrl) => {\n if (spriteImageUrl instanceof Request) {\n fetch(spriteImageUrl)\n .then((response) => response.blob())\n .then((blob) => {\n blobUrl = URL.createObjectURL(blob);\n img.src = blobUrl;\n })\n .catch(() => {});\n } else {\n img.crossOrigin = 'anonymous';\n img.src = spriteImageUrl;\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n }\n }\n });\n img.onload = function () {\n spriteImage = img;\n spriteImageSize = [img.width, img.height];\n olLayer.changed();\n img.onload = null;\n };\n } else if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { //eslint-disable-line\n const worker = /** @type {*} */ (self);\n // Main thread needs to handle 'loadImage' and dispatch 'imageLoaded'\n worker.postMessage({\n action: 'loadImage',\n src: spriteImageUrl,\n });\n worker.addEventListener('message', function handler(event) {\n if (\n event.data.action === 'imageLoaded' &&\n event.data.src === spriteImageUrl\n ) {\n spriteImage = event.data.image;\n spriteImageSize = [spriteImage.width, spriteImage.height];\n }\n });\n }\n }\n\n const allLayers = derefLayers(glStyle.layers);\n\n const layersBySourceLayer = {};\n const mapboxLayers = [];\n\n const iconImageCache = {};\n const patternCache = {};\n const functionCache = getFunctionCache(glStyle);\n const filterCache = getFilterCache(glStyle);\n\n let mapboxSource;\n for (let i = 0, ii = allLayers.length; i < ii; ++i) {\n const layer = allLayers[i];\n const layerId = layer.id;\n if (\n (typeof sourceOrLayers == 'string' && layer.source == sourceOrLayers) ||\n (Array.isArray(sourceOrLayers) && sourceOrLayers.indexOf(layerId) !== -1)\n ) {\n const sourceLayer = layer['source-layer'];\n if (!mapboxSource) {\n mapboxSource = layer.source;\n const source = glStyle.sources[mapboxSource];\n if (!source) {\n throw new Error(`Source \"${mapboxSource}\" is not defined`);\n }\n const type = source.type;\n if (type !== 'vector' && type !== 'geojson') {\n throw new Error(\n `Source \"${mapboxSource}\" is not of type \"vector\" or \"geojson\", but \"${type}\"`,\n );\n }\n } else if (layer.source !== mapboxSource) {\n throw new Error(\n `Layer \"${layerId}\" does not use source \"${mapboxSource}`,\n );\n }\n let layers = layersBySourceLayer[sourceLayer];\n if (!layers) {\n layers = [];\n layersBySourceLayer[sourceLayer] = layers;\n }\n layers.push({\n layer: layer,\n index: i,\n });\n mapboxLayers.push(layerId);\n }\n }\n\n const textHalo = new Stroke();\n const textColor = new Fill();\n\n const styles = [];\n\n /**\n * @param {import(\"ol/Feature\").default|import(\"ol/render/Feature\").default} feature Feature.\n * @param {number} resolution Resolution.\n * @param {string} [onlyLayer] Calculate style for this layer only.\n * @return {Array} Style.\n */\n const styleFunction = function (feature, resolution, onlyLayer) {\n const properties = feature.getProperties();\n const layers = layersBySourceLayer[properties.layer];\n if (!layers) {\n return undefined;\n }\n let zoom = resolutions.indexOf(resolution);\n if (zoom == -1) {\n zoom = getZoomForResolution(resolution, resolutions);\n }\n const type = types[feature.getGeometry().getType()];\n const f = {\n id: feature.getId(),\n properties: properties,\n type: type,\n };\n const featureState = olLayer.get('mapbox-featurestate')[feature.getId()];\n let stylesLength = -1;\n let featureBelongsToLayer;\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const layerData = layers[i];\n const layer = layerData.layer;\n const layerId = layer.id;\n if (onlyLayer !== undefined && onlyLayer !== layerId) {\n continue;\n }\n\n const layout = layer.layout || emptyObj;\n const paint = layer.paint || emptyObj;\n if (\n layout.visibility === 'none' ||\n ('minzoom' in layer && zoom < layer.minzoom) ||\n ('maxzoom' in layer && zoom >= layer.maxzoom)\n ) {\n continue;\n }\n const filter = layer.filter;\n if (!filter || evaluateFilter(layerId, filter, f, zoom, filterCache)) {\n featureBelongsToLayer = layer;\n let color, opacity, fill, stroke, strokeColor, style;\n const index = layerData.index;\n if (\n type == 3 &&\n (layer.type == 'fill' || layer.type == 'fill-extrusion')\n ) {\n opacity = getValue(\n layer,\n 'paint',\n layer.type + '-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (layer.type + '-pattern' in paint) {\n const fillIcon = getValue(\n layer,\n 'paint',\n layer.type + '-pattern',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (fillIcon) {\n const icon =\n typeof fillIcon === 'string'\n ? fromTemplate(fillIcon, properties)\n : fillIcon.toString();\n if (spriteImage && spriteData && spriteData[icon]) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getFill() ||\n style.getStroke() ||\n style.getText()\n ) {\n style = new Style({\n fill: new Fill(),\n });\n styles[stylesLength] = style;\n }\n fill = style.getFill();\n style.setZIndex(index);\n const icon_cache_key = icon + '.' + opacity;\n let pattern = patternCache[icon_cache_key];\n if (!pattern) {\n const spriteImageData = spriteData[icon];\n const canvas = createCanvas(\n spriteImageData.width,\n spriteImageData.height,\n );\n const ctx = /** @type {CanvasRenderingContext2D} */ (\n canvas.getContext('2d')\n );\n ctx.globalAlpha = opacity;\n ctx.drawImage(\n spriteImage,\n spriteImageData.x,\n spriteImageData.y,\n spriteImageData.width,\n spriteImageData.height,\n 0,\n 0,\n spriteImageData.width,\n spriteImageData.height,\n );\n pattern = ctx.createPattern(canvas, 'repeat');\n patternCache[icon_cache_key] = pattern;\n }\n fill.setColor(pattern);\n }\n }\n } else {\n color = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n layer.type + '-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n );\n if (layer.type + '-outline-color' in paint) {\n strokeColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n layer.type + '-outline-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n );\n }\n if (!strokeColor) {\n strokeColor = color;\n }\n if (color || strokeColor) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n (color && !style.getFill()) ||\n (!color && style.getFill()) ||\n (strokeColor && !style.getStroke()) ||\n (!strokeColor && style.getStroke()) ||\n style.getText()\n ) {\n style = new Style({\n fill: color ? new Fill() : undefined,\n stroke: strokeColor ? new Stroke() : undefined,\n });\n styles[stylesLength] = style;\n }\n if (color) {\n fill = style.getFill();\n fill.setColor(color);\n }\n if (strokeColor) {\n stroke = style.getStroke();\n stroke.setColor(strokeColor);\n stroke.setWidth(0.5);\n }\n style.setZIndex(index);\n }\n }\n }\n if (type != 1 && layer.type == 'line') {\n if (!('line-pattern' in paint)) {\n color = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'line-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n getValue(\n layer,\n 'paint',\n 'line-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n } else {\n color = undefined;\n }\n const width = getValue(\n layer,\n 'paint',\n 'line-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (color && width > 0) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getStroke() ||\n style.getFill() ||\n style.getText()\n ) {\n style = new Style({\n stroke: new Stroke(),\n });\n styles[stylesLength] = style;\n }\n stroke = style.getStroke();\n stroke.setLineCap(\n getValue(\n layer,\n 'layout',\n 'line-cap',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n stroke.setLineJoin(\n getValue(\n layer,\n 'layout',\n 'line-join',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n stroke.setMiterLimit(\n getValue(\n layer,\n 'layout',\n 'line-miter-limit',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n stroke.setColor(color);\n stroke.setWidth(width);\n stroke.setLineDash(\n paint['line-dasharray']\n ? getValue(\n layer,\n 'paint',\n 'line-dasharray',\n zoom,\n f,\n functionCache,\n featureState,\n ).map(function (x) {\n return x * width;\n })\n : null,\n );\n style.setZIndex(index);\n }\n }\n\n let hasImage = false;\n let text = null;\n let placementAngle = 0;\n let icon, iconImg, skipLabel;\n if ((type == 1 || type == 2) && 'icon-image' in layout) {\n const iconImage = getValue(\n layer,\n 'layout',\n 'icon-image',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (iconImage) {\n icon =\n typeof iconImage === 'string'\n ? fromTemplate(iconImage, properties)\n : iconImage.toString();\n let styleGeom = undefined;\n const imageElement = getImage ? getImage(olLayer, icon) : undefined;\n if (\n (spriteImage && spriteData && spriteData[icon]) ||\n imageElement\n ) {\n const iconRotationAlignment = getValue(\n layer,\n 'layout',\n 'icon-rotation-alignment',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (type == 2) {\n const geom = /** @type {*} */ (feature.getGeometry());\n // ol package and ol-debug.js only\n if (geom.getFlatMidpoint || geom.getFlatMidpoints) {\n const extent = geom.getExtent();\n const size = Math.sqrt(\n Math.max(\n Math.pow((extent[2] - extent[0]) / resolution, 2),\n Math.pow((extent[3] - extent[1]) / resolution, 2),\n ),\n );\n if (size > 150) {\n //FIXME Do not hard-code a size of 150\n const midpoint =\n geom.getType() === 'MultiLineString'\n ? geom.getFlatMidpoints()\n : geom.getFlatMidpoint();\n if (!renderFeature) {\n renderFeatureCoordinates = [NaN, NaN];\n renderFeature = new RenderFeature(\n 'Point',\n renderFeatureCoordinates,\n [],\n 2,\n {},\n undefined,\n );\n }\n styleGeom = renderFeature;\n renderFeatureCoordinates[0] = midpoint[0];\n renderFeatureCoordinates[1] = midpoint[1];\n const placement = getValue(\n layer,\n 'layout',\n 'symbol-placement',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (\n placement === 'line' &&\n iconRotationAlignment === 'map'\n ) {\n const stride = geom.getStride();\n const coordinates = geom.getFlatCoordinates();\n for (\n let i = 0, ii = coordinates.length - stride;\n i < ii;\n i += stride\n ) {\n const x1 = coordinates[i];\n const y1 = coordinates[i + 1];\n const x2 = coordinates[i + stride];\n const y2 = coordinates[i + stride + 1];\n const minX = Math.min(x1, x2);\n const minY = Math.min(y1, y2);\n const maxX = Math.max(x1, x2);\n const maxY = Math.max(y1, y2);\n if (\n midpoint[0] >= minX &&\n midpoint[0] <= maxX &&\n midpoint[1] >= minY &&\n midpoint[1] <= maxY\n ) {\n placementAngle = Math.atan2(y1 - y2, x2 - x1);\n break;\n }\n }\n }\n }\n }\n }\n if (type !== 2 || styleGeom) {\n const iconSize = getValue(\n layer,\n 'layout',\n 'icon-size',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const iconColor =\n paint['icon-color'] !== undefined\n ? getValue(\n layer,\n 'paint',\n 'icon-color',\n zoom,\n f,\n functionCache,\n featureState,\n )\n : null;\n if (!iconColor || iconColor.a !== 0) {\n const haloColor = getValue(\n layer,\n 'paint',\n 'icon-halo-color',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const haloWidth = getValue(\n layer,\n 'paint',\n 'icon-halo-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n let iconCacheKey = `${icon}.${iconSize}.${haloWidth}.${haloColor}`;\n if (iconColor !== null) {\n iconCacheKey += `.${iconColor}`;\n }\n iconImg = iconImageCache[iconCacheKey];\n if (!iconImg) {\n const declutterMode = getDeclutterMode(\n layer,\n zoom,\n f,\n 'icon',\n functionCache,\n );\n let displacement;\n if ('icon-offset' in layout) {\n displacement = getValue(\n layer,\n 'layout',\n 'icon-offset',\n zoom,\n f,\n functionCache,\n featureState,\n ).slice(0);\n displacement[0] *= iconSize;\n displacement[1] *= -iconSize;\n }\n let color = iconColor\n ? [\n iconColor.r * 255,\n iconColor.g * 255,\n iconColor.b * 255,\n iconColor.a,\n ]\n : undefined;\n if (imageElement) {\n const iconOptions = {\n color: color,\n rotateWithView: iconRotationAlignment === 'map',\n displacement: displacement,\n declutterMode: declutterMode,\n scale: iconSize,\n };\n if (typeof imageElement === 'string') {\n // it is a src URL\n iconOptions.src = imageElement;\n } else {\n iconOptions.img = imageElement;\n iconOptions.imgSize = [\n imageElement.width,\n imageElement.height,\n ];\n }\n iconImg = new Icon(iconOptions);\n } else {\n const spriteImageData = spriteData[icon];\n let img, size, offset;\n if (haloWidth) {\n if (spriteImageData.sdf) {\n img = drawIconHalo(\n drawSDF(\n spriteImage,\n spriteImageData,\n iconColor || [0, 0, 0, 1],\n ),\n {\n x: 0,\n y: 0,\n width: spriteImageData.width,\n height: spriteImageData.height,\n pixelRatio: spriteImageData.pixelRatio,\n },\n haloWidth,\n haloColor,\n );\n color = undefined; // do not tint haloed icons\n } else {\n img = drawIconHalo(\n spriteImage,\n spriteImageData,\n haloWidth,\n haloColor,\n );\n }\n } else {\n if (spriteImageData.sdf) {\n if (!spriteImageUnSDFed) {\n spriteImageUnSDFed = drawSDF(\n spriteImage,\n {\n x: 0,\n y: 0,\n width: spriteImageSize[0],\n height: spriteImageSize[1],\n },\n {r: 1, g: 1, b: 1, a: 1},\n );\n }\n img = spriteImageUnSDFed;\n } else {\n img = spriteImage;\n }\n size = [spriteImageData.width, spriteImageData.height];\n offset = [spriteImageData.x, spriteImageData.y];\n }\n iconImg = new Icon({\n color: color,\n img: img,\n // @ts-ignore\n imgSize: spriteImageSize,\n size: size,\n offset: offset,\n rotateWithView: iconRotationAlignment === 'map',\n scale: iconSize / spriteImageData.pixelRatio,\n displacement: displacement,\n declutterMode: declutterMode,\n });\n }\n iconImageCache[iconCacheKey] = iconImg;\n }\n }\n if (iconImg) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getImage() ||\n style.getFill() ||\n style.getStroke()\n ) {\n style = new Style();\n styles[stylesLength] = style;\n }\n style.setGeometry(styleGeom);\n iconImg.setRotation(\n placementAngle +\n deg2rad(\n getValue(\n layer,\n 'layout',\n 'icon-rotate',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n ),\n );\n iconImg.setOpacity(\n getValue(\n layer,\n 'paint',\n 'icon-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n iconImg.setAnchor(\n anchor[\n getValue(\n layer,\n 'layout',\n 'icon-anchor',\n zoom,\n f,\n functionCache,\n featureState,\n )\n ],\n );\n style.setImage(iconImg);\n text = style.getText();\n style.setText(undefined);\n style.setZIndex(index);\n hasImage = true;\n skipLabel = false;\n }\n } else {\n skipLabel = true;\n }\n }\n }\n }\n\n if (type == 1 && layer.type === 'circle') {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getImage() ||\n style.getFill() ||\n style.getStroke()\n ) {\n style = new Style();\n styles[stylesLength] = style;\n }\n const circleRadius =\n 'circle-radius' in paint\n ? getValue(\n layer,\n 'paint',\n 'circle-radius',\n zoom,\n f,\n functionCache,\n featureState,\n )\n : 5;\n const circleStrokeColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'circle-stroke-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n getValue(\n layer,\n 'paint',\n 'circle-stroke-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n\n const circleTranslate = getValue(\n layer,\n 'paint',\n 'circle-translate',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const circleColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'circle-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n getValue(\n layer,\n 'paint',\n 'circle-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n const circleStrokeWidth = getValue(\n layer,\n 'paint',\n 'circle-stroke-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const cache_key =\n circleRadius +\n '.' +\n circleStrokeColor +\n '.' +\n circleColor +\n '.' +\n circleStrokeWidth +\n '.' +\n circleTranslate[0] +\n '.' +\n circleTranslate[1];\n\n iconImg = iconImageCache[cache_key];\n if (!iconImg) {\n iconImg = new Circle({\n radius: circleRadius,\n displacement: [circleTranslate[0], -circleTranslate[1]],\n stroke:\n circleStrokeColor && circleStrokeWidth > 0\n ? new Stroke({\n width: circleStrokeWidth,\n color: circleStrokeColor,\n })\n : undefined,\n fill: circleColor\n ? new Fill({\n color: circleColor,\n })\n : undefined,\n declutterMode: 'none',\n });\n iconImageCache[cache_key] = iconImg;\n }\n style.setImage(iconImg);\n text = style.getText();\n style.setText(undefined);\n style.setGeometry(undefined);\n style.setZIndex(index);\n hasImage = true;\n }\n\n let label, font, textLineHeight, textSize, letterSpacing, maxTextWidth;\n if ('text-field' in layout) {\n textSize = Math.round(\n getValue(\n layer,\n 'layout',\n 'text-size',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n const fontArray = getValue(\n layer,\n 'layout',\n 'text-font',\n zoom,\n f,\n functionCache,\n featureState,\n );\n textLineHeight = getValue(\n layer,\n 'layout',\n 'text-line-height',\n zoom,\n f,\n functionCache,\n featureState,\n );\n font = mb2css(\n getFonts\n ? getFonts(\n fontArray,\n glStyle.metadata\n ? glStyle.metadata['ol:webfonts']\n : undefined,\n )\n : fontArray,\n textSize,\n textLineHeight,\n );\n if (!font.includes('sans-serif')) {\n font += ',sans-serif';\n }\n letterSpacing = getValue(\n layer,\n 'layout',\n 'text-letter-spacing',\n zoom,\n f,\n functionCache,\n featureState,\n );\n maxTextWidth = getValue(\n layer,\n 'layout',\n 'text-max-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const textField = getValue(\n layer,\n 'layout',\n 'text-field',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (typeof textField === 'object' && textField.sections) {\n if (textField.sections.length === 1) {\n label = textField.toString();\n } else {\n label = textField.sections.reduce((acc, chunk, i) => {\n const fonts = chunk.fontStack\n ? chunk.fontStack.split(',')\n : fontArray;\n const chunkFont = mb2css(\n getFonts ? getFonts(fonts) : fonts,\n textSize * (chunk.scale || 1),\n textLineHeight,\n );\n let text = chunk.text;\n if (text === '\\n') {\n acc.push('\\n', '');\n return acc;\n }\n if (type == 2) {\n acc.push(applyLetterSpacing(text, letterSpacing), chunkFont);\n return;\n }\n text = wrapText(\n text,\n chunkFont,\n maxTextWidth,\n letterSpacing,\n ).split('\\n');\n for (let i = 0, ii = text.length; i < ii; ++i) {\n if (i > 0) {\n acc.push('\\n', '');\n }\n acc.push(text[i], chunkFont);\n }\n return acc;\n }, []);\n }\n } else {\n label = fromTemplate(textField, properties).trim();\n }\n opacity = getValue(\n layer,\n 'paint',\n 'text-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n );\n }\n if (label && opacity && !skipLabel) {\n if (!hasImage) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getText() ||\n style.getFill() ||\n style.getStroke()\n ) {\n style = new Style();\n styles[stylesLength] = style;\n }\n style.setImage(undefined);\n style.setGeometry(undefined);\n }\n const declutterMode = getDeclutterMode(\n layer,\n zoom,\n f,\n 'text',\n functionCache,\n );\n if (!style.getText()) {\n style.setText(text);\n }\n text = style.getText();\n if (\n !text ||\n ('getDeclutterMode' in text &&\n text.getDeclutterMode() !== declutterMode)\n ) {\n text = new Text({\n padding: [2, 2, 2, 2],\n // @ts-ignore\n declutterMode: declutterMode,\n });\n style.setText(text);\n }\n const textTransform = getValue(\n layer,\n 'layout',\n 'text-transform',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (textTransform == 'uppercase') {\n label = Array.isArray(label)\n ? label.map((t, i) => (i % 2 ? t : t.toUpperCase()))\n : label.toUpperCase();\n } else if (textTransform == 'lowercase') {\n label = Array.isArray(label)\n ? label.map((t, i) => (i % 2 ? t : t.toLowerCase()))\n : label.toLowerCase();\n }\n const wrappedLabel = Array.isArray(label)\n ? label\n : type == 2\n ? applyLetterSpacing(label, letterSpacing)\n : wrapText(label, font, maxTextWidth, letterSpacing);\n text.setText(wrappedLabel);\n text.setFont(font);\n text.setRotation(\n deg2rad(\n getValue(\n layer,\n 'layout',\n 'text-rotate',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n ),\n );\n const textAnchor = getValue(\n layer,\n 'layout',\n 'text-anchor',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const placement =\n hasImage || type == 1\n ? 'point'\n : getValue(\n layer,\n 'layout',\n 'symbol-placement',\n zoom,\n f,\n functionCache,\n featureState,\n );\n let textAlign;\n if (placement === 'line-center') {\n text.setPlacement('line');\n textAlign = 'center';\n } else {\n text.setPlacement(placement);\n }\n if (placement === 'line' && typeof text.setRepeat === 'function') {\n const symbolSpacing = getValue(\n layer,\n 'layout',\n 'symbol-spacing',\n zoom,\n f,\n functionCache,\n featureState,\n );\n text.setRepeat(symbolSpacing * 2);\n }\n text.setOverflow(placement === 'point');\n let textHaloWidth = getValue(\n layer,\n 'paint',\n 'text-halo-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const textOffset = getValue(\n layer,\n 'layout',\n 'text-offset',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const textTranslate = getValue(\n layer,\n 'paint',\n 'text-translate',\n zoom,\n f,\n functionCache,\n featureState,\n );\n // Text offset has to take halo width and line height into account\n let vOffset = 0;\n let hOffset = 0;\n if (placement == 'point') {\n textAlign = 'center';\n if (textAnchor.indexOf('left') !== -1) {\n textAlign = 'left';\n hOffset = textHaloWidth;\n } else if (textAnchor.indexOf('right') !== -1) {\n textAlign = 'right';\n hOffset = -textHaloWidth;\n }\n const textRotationAlignment = getValue(\n layer,\n 'layout',\n 'text-rotation-alignment',\n zoom,\n f,\n functionCache,\n featureState,\n );\n text.setRotateWithView(textRotationAlignment == 'map');\n } else {\n text.setMaxAngle(\n (deg2rad(\n getValue(\n layer,\n 'layout',\n 'text-max-angle',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n ) *\n label.length) /\n wrappedLabel.length,\n );\n text.setRotateWithView(false);\n }\n text.setTextAlign(textAlign);\n let textBaseline = 'middle';\n if (textAnchor.indexOf('bottom') == 0) {\n textBaseline = 'bottom';\n vOffset = -textHaloWidth - 0.5 * (textLineHeight - 1) * textSize;\n } else if (textAnchor.indexOf('top') == 0) {\n textBaseline = 'top';\n vOffset = textHaloWidth + 0.5 * (textLineHeight - 1) * textSize;\n }\n text.setTextBaseline(textBaseline);\n const textJustify = getValue(\n layer,\n 'layout',\n 'text-justify',\n zoom,\n f,\n functionCache,\n featureState,\n );\n text.setJustify(textJustify === 'auto' ? undefined : textJustify);\n text.setOffsetX(\n textOffset[0] * textSize + hOffset + textTranslate[0],\n );\n text.setOffsetY(\n textOffset[1] * textSize + vOffset + textTranslate[1],\n );\n textColor.setColor(\n colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'text-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n ),\n );\n text.setFill(textColor);\n const haloColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'text-halo-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n );\n if (haloColor && textHaloWidth > 0) {\n textHalo.setColor(haloColor);\n // spec here : https://docs.mapbox.com/mapbox-gl-js/style-spec/#paint-symbol-text-halo-width\n // Halo width must be doubled because it is applied around the center of the text outline\n textHaloWidth *= 2;\n // 1/4 of text size (spec) x 2\n const halfTextSize = 0.5 * textSize;\n textHalo.setWidth(\n textHaloWidth <= halfTextSize ? textHaloWidth : halfTextSize,\n );\n text.setStroke(textHalo);\n } else {\n text.setStroke(undefined);\n }\n const textPadding = getValue(\n layer,\n 'layout',\n 'text-padding',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const padding = text.getPadding();\n if (textPadding !== padding[0]) {\n padding[0] = textPadding;\n padding[1] = textPadding;\n padding[2] = textPadding;\n padding[3] = textPadding;\n }\n style.setZIndex(index);\n }\n }\n }\n\n if (stylesLength > -1) {\n styles.length = stylesLength + 1;\n if (recordLayer) {\n if ('set' in feature) {\n // ol/Feature\n feature.set('mapbox-layer', featureBelongsToLayer);\n } else {\n // ol/render/Feature\n feature.getProperties()['mapbox-layer'] = featureBelongsToLayer;\n }\n }\n return styles;\n }\n return undefined;\n };\n\n olLayer.setStyle(styleFunction);\n olLayer.set('mapbox-source', mapboxSource);\n olLayer.set('mapbox-layers', mapboxLayers);\n olLayer.set('mapbox-featurestate', olLayer.get('mapbox-featurestate') || {});\n return styleFunction;\n}\n\n/**\n * Get the the style for a specific Mapbox layer only. This can be useful for creating a legend.\n * @param {import(\"ol/Feature\").default|import(\"ol/render/Feature\").default} feature OpenLayers feature.\n * @param {number} resolution View resolution.\n * @param {import(\"ol/layer\").Vector|import(\"ol/layer\").VectorTile} olLayer OpenLayers layer.\n * @param {string} layerId Id of the Mapbox layer to get the style for\n * @return {Array} Styles for the provided Mapbox layer.\n */\nexport function getStyleForLayer(feature, resolution, olLayer, layerId) {\n const evaluateStyle = olLayer.getStyleFunction();\n if (evaluateStyle.length === 3) {\n // @ts-ignore\n return evaluateStyle(feature, resolution, layerId);\n }\n return undefined;\n}\n\nexport {\n colorWithOpacity as _colorWithOpacity,\n evaluateFilter as _evaluateFilter,\n fromTemplate as _fromTemplate,\n getValue as _getValue,\n};\n","/**\n * Generates a shaded relief image given elevation data. Uses a 3x3\n * neighborhood for determining slope and aspect.\n * @param {Array} inputs Array of input images.\n * @param {Object} data Data added in the \"beforeoperations\" event.\n * @return {ImageData} Output image.\n */\nexport function hillshade(inputs, data) {\n const elevationImage = inputs[0];\n const width = elevationImage.width;\n const height = elevationImage.height;\n const elevationData = elevationImage.data;\n const shadeData = new Uint8ClampedArray(elevationData.length);\n const dp = data.resolution * 2;\n const maxX = width - 1;\n const maxY = height - 1;\n const pixel = [0, 0, 0, 0];\n const twoPi = 2 * Math.PI;\n const halfPi = Math.PI / 2;\n const sunEl = (Math.PI * data.sunEl) / 180;\n const sunAz = (Math.PI * data.sunAz) / 180;\n const cosSunEl = Math.cos(sunEl);\n const sinSunEl = Math.sin(sunEl);\n const highlightColor = data.highlightColor;\n const shadowColor = data.shadowColor;\n const accentColor = data.accentColor;\n const encoding = data.encoding;\n\n let pixelX,\n pixelY,\n x0,\n x1,\n y0,\n y1,\n offset,\n z0,\n z1,\n dzdx,\n dzdy,\n slope,\n aspect,\n accent,\n scaled,\n shade,\n scaledAccentColor,\n compositeShadeColor,\n clamp,\n slopeScaleBase,\n scaledSlope,\n cosIncidence;\n\n function calculateElevation(pixel, encoding = 'mapbox') {\n // The method used to extract elevations from the DEM.\n //\n // The supported methods are the Mapbox format\n // (red * 256 * 256 + green * 256 + blue) * 0.1 - 10000\n // and the Terrarium format\n // (red * 256 + green + blue / 256) - 32768\n //\n if (encoding === 'mapbox') {\n return (pixel[0] * 256 * 256 + pixel[1] * 256 + pixel[2]) * 0.1 - 10000;\n }\n if (encoding === 'terrarium') {\n return pixel[0] * 256 + pixel[1] + pixel[2] / 256 - 32768;\n }\n }\n for (pixelY = 0; pixelY <= maxY; ++pixelY) {\n y0 = pixelY === 0 ? 0 : pixelY - 1;\n y1 = pixelY === maxY ? maxY : pixelY + 1;\n for (pixelX = 0; pixelX <= maxX; ++pixelX) {\n x0 = pixelX === 0 ? 0 : pixelX - 1;\n x1 = pixelX === maxX ? maxX : pixelX + 1;\n\n // determine elevation for (x0, pixelY)\n offset = (pixelY * width + x0) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z0 = data.vert * calculateElevation(pixel, encoding);\n\n // determine elevation for (x1, pixelY)\n offset = (pixelY * width + x1) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z1 = data.vert * calculateElevation(pixel, encoding);\n\n dzdx = (z1 - z0) / dp;\n\n // determine elevation for (pixelX, y0)\n offset = (y0 * width + pixelX) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z0 = data.vert * calculateElevation(pixel, encoding);\n\n // determine elevation for (pixelX, y1)\n offset = (y1 * width + pixelX) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z1 = data.vert * calculateElevation(pixel, encoding);\n\n dzdy = (z1 - z0) / dp;\n\n aspect = Math.atan2(dzdy, -dzdx);\n if (aspect < 0) {\n aspect = halfPi - aspect;\n } else if (aspect > halfPi) {\n aspect = twoPi - aspect + halfPi;\n } else {\n aspect = halfPi - aspect;\n }\n\n // Bootstrap slope and corresponding incident values\n slope = Math.atan(Math.sqrt(dzdx * dzdx + dzdy * dzdy));\n cosIncidence =\n sinSunEl * Math.cos(slope) +\n cosSunEl * Math.sin(slope) * Math.cos(sunAz - aspect);\n accent = Math.cos(slope);\n // 255 for Hex colors\n scaled = 255 * cosIncidence;\n\n /*\n * The following is heavily inspired\n * by [Maplibre's equivalent WebGL shader](https://github.com/maplibre/maplibre-gl-js/blob/main/src/shaders/hillshade.fragment.glsl)\n */\n\n // Forces given value to stay between two given extremes\n clamp = Math.min(Math.max(2 * data.sunEl, 0), 1);\n\n // Intensity basis for hillshade opacity\n slopeScaleBase = 1.875 - data.opacity * 1.75;\n // Intensity interpolation so that higher intensity values create more opaque hillshading\n scaledSlope =\n data.opacity !== 0.5\n ? halfPi *\n ((Math.pow(slopeScaleBase, slope) - 1) /\n (Math.pow(slopeScaleBase, halfPi) - 1))\n : slope;\n\n // Accent hillshade color with given accentColor to emphasize rougher terrain\n scaledAccentColor = {\n r: (1 - accent) * accentColor.r * clamp * 255,\n g: (1 - accent) * accentColor.g * clamp * 255,\n b: (1 - accent) * accentColor.b * clamp * 255,\n a: (1 - accent) * accentColor.a * clamp * 255,\n };\n\n // Allows highlight vs shadow discrimination\n shade = Math.abs((((aspect + sunAz) / Math.PI + 0.5) % 2) - 1);\n // Creates a composite color mix between highlight & shadow colors to emphasize slopes\n compositeShadeColor = {\n r: (highlightColor.r * (1 - shade) + shadowColor.r * shade) * scaled,\n g: (highlightColor.g * (1 - shade) + shadowColor.g * shade) * scaled,\n b: (highlightColor.b * (1 - shade) + shadowColor.b * shade) * scaled,\n a: (highlightColor.a * (1 - shade) + shadowColor.a * shade) * scaled,\n };\n\n // Fill in result color value\n offset = (pixelY * width + pixelX) * 4;\n shadeData[offset] =\n scaledAccentColor.r * (1 - shade) + compositeShadeColor.r;\n shadeData[offset + 1] =\n scaledAccentColor.g * (1 - shade) + compositeShadeColor.g;\n shadeData[offset + 2] =\n scaledAccentColor.b * (1 - shade) + compositeShadeColor.b;\n // Key opacity on the scaledSlope to improve legibility by increasing higher elevation rates' contrast\n shadeData[offset + 3] =\n elevationData[offset + 3] *\n data.opacity *\n clamp *\n Math.sin(scaledSlope);\n }\n }\n\n return new ImageData(shadeData, width, height);\n}\n","/*\nol-mapbox-style - Use Mapbox Style objects with OpenLayers\nCopyright 2016-present ol-mapbox-style contributors\nLicense: https://raw.githubusercontent.com/openlayers/ol-mapbox-style/master/LICENSE\n*/\n\nimport GeoJSON from 'ol/format/GeoJSON.js';\nimport ImageLayer from 'ol/layer/Image.js';\nimport Layer from 'ol/layer/Layer.js';\nimport LayerGroup from 'ol/layer/Group.js';\nimport MVT from 'ol/format/MVT.js';\nimport Map from 'ol/Map.js';\nimport Raster from 'ol/source/Raster.js';\nimport Source from 'ol/source/Source.js';\nimport TileGrid from 'ol/tilegrid/TileGrid.js';\nimport TileJSON from 'ol/source/TileJSON.js';\nimport TileLayer from 'ol/layer/Tile.js';\nimport VectorLayer from 'ol/layer/Vector.js';\nimport VectorSource from 'ol/source/Vector.js';\nimport VectorTileLayer from 'ol/layer/VectorTile.js';\nimport VectorTileSource, {defaultLoadFunction} from 'ol/source/VectorTile.js';\nimport View from 'ol/View.js';\nimport derefLayers from '@mapbox/mapbox-gl-style-spec/deref.js';\nimport {METERS_PER_UNIT} from 'ol/proj/Units.js';\nimport {\n _colorWithOpacity,\n stylefunction as applyStylefunction,\n getValue,\n styleFunctionArgs,\n} from './stylefunction.js';\nimport {bbox as bboxStrategy} from 'ol/loadingstrategy.js';\nimport {createXYZ} from 'ol/tilegrid.js';\nimport {\n defaultResolutions,\n fetchResource,\n getFilterCache,\n getFunctionCache,\n getGlStyle,\n getResolutionForZoom,\n getStyleFunctionKey,\n getTileJson,\n getZoomForResolution,\n} from './util.js';\nimport {\n equivalent,\n fromLonLat,\n getPointResolution,\n get as getProjection,\n getUserProjection,\n} from 'ol/proj.js';\nimport {getCenter, getTopLeft} from 'ol/extent.js';\nimport {getFonts} from './text.js';\nimport {hillshade} from './shaders.js';\nimport {\n normalizeSourceUrl,\n normalizeSpriteUrl,\n normalizeStyleUrl,\n} from './mapbox.js';\n\n/**\n * @typedef {Object} FeatureIdentifier\n * @property {string|number} id The feature id.\n * @property {string} source The source id.\n */\n\n/**\n * @typedef {Object} Options\n * @property {string} [accessToken] Access token for 'mapbox://' urls.\n * @property {function(string, import(\"./util.js\").ResourceType): (Request|string|Promise|void)} [transformRequest]\n * Function for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying\n * the url, adding headers or setting credentials options. Called with the url and the resource\n * type as arguments, this function is supposed to return a `Request` or a url `string`, or a promise tehereof.\n * Without a return value the original request will not be modified.\n * @property {string} [projection='EPSG:3857'] Only useful when working with non-standard projections.\n * Code of a projection registered with OpenLayers. All sources of the style must be provided in this\n * projection. The projection must also have a valid extent defined, which will be used to determine the\n * origin and resolutions of the tile grid for all tiled sources of the style. When provided, the bbox\n * placeholder in tile and geojson urls changes: the default is `{bbox-epsg-3857}`, when projection is e.g.\n * set to `EPSG:4326`, the bbox placeholder will be `{bbox-epsg-4326}`.\n * @property {Array} [resolutions] Only useful when working with non-standard projections.\n * Resolutions for mapping resolution to the `zoom` used in the Mapbox style.\n * @property {string} [styleUrl] URL of the Mapbox GL style. Required for styles that were provided\n * as object, when they contain a relative sprite url, or sources referencing data by relative url.\n * @property {string} [webfonts] Template for resolving webfonts. Can be used to specify where to fetch\n * web fonts when no `ol:webfonts` metadata is set in the style object. See `getFonts()` and the\n * \"Font handling\" section in `README.md` for details.\n * @property {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined]\n * Function that returns an image for an icon name. If the result is an HTMLImageElement, it must already be\n * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished.\n * This function be used for icons not in the sprite or to override sprite icons.\n * @property {string} [accessTokenParam='access_token'] Access token param. For internal use.\n */\n\n/**\n * @typedef {Object} ApplyStyleOptions\n * @property {string} [source=''] Source. Default is `''`, which causes the first source in the\n * style to be used.\n * @property {Array} [layers] Layers. If no source is provided, the layers with the\n * provided ids will be used from the style's `layers` array. All layers need to use the same source.\n * @property {boolean} [updateSource=true] Update or create vector (tile) layer source with parameters\n * specified for the source in the mapbox style definition.\n */\n\n/**\n * @param {import(\"ol/proj/Projection.js\").default} projection Projection.\n * @param {number} [tileSize=512] Tile size.\n * @return {Array} Resolutions.\n */\nfunction getTileResolutions(projection, tileSize = 512) {\n return projection.getExtent()\n ? createXYZ({\n extent: projection.getExtent(),\n tileSize: tileSize,\n maxZoom: 22,\n }).getResolutions()\n : defaultResolutions;\n}\n\n/**\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {Options} Completed options with accessToken and accessTokenParam.\n */\nfunction completeOptions(styleUrl, options) {\n if (!options.accessToken) {\n options = Object.assign({}, options);\n const searchParams = new URL(styleUrl).searchParams;\n // The last search parameter is the access token\n searchParams.forEach((value, key) => {\n options.accessToken = value;\n options.accessTokenParam = key;\n });\n }\n return options;\n}\n\n/**\n * Applies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector`\n * with an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source\n * yet, it will be created and populated from the information in the `glStyle` (unless `updateSource` is\n * set to `false`).\n *\n * **Example:**\n * ```js\n * import {applyStyle} from 'ol-mapbox-style';\n * import {VectorTile} from 'ol/layer.js';\n *\n * const layer = new VectorTile({declutter: true});\n * applyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');\n * ```\n *\n * The style function will render all layers from the `glStyle` object that use the source\n * of the first layer, the specified `source`, or a subset of layers from the same source. The\n * source needs to be a `\"type\": \"vector\"` or `\"type\": \"geojson\"` source.\n *\n * Two additional properties will be set on the provided layer:\n *\n * * `mapbox-source`: The `id` of the Mapbox Style document's source that the\n * OpenLayers layer was created from. Usually `apply()` creates one\n * OpenLayers layer per Mapbox Style source, unless the layer stack has\n * layers from different sources in between.\n * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are\n * included in the OpenLayers layer.\n *\n * @param {VectorTileLayer|VectorLayer} layer OpenLayers layer. When the layer has a source configured,\n * it will be modified to use the configuration from the glStyle's `source`. Options specified on the\n * layer's source will override those from the glStyle's `source`, except for `url` and\n * `tileUrlFunction`. When the source projection is the default (`EPSG:3857`), the `tileGrid` will\n * also be overridden. If you'd rather not have ol-mapbox-style modify the source, configure `applyStyle()`\n * with the `updateSource: false` option.\n * @param {string|Object} glStyle Mapbox Style object.\n * @param {string|Array|Options&ApplyStyleOptions} [sourceOrLayersOrOptions] Options or\n * `source` key or an array of layer `id`s from the Mapbox Style object. When a `source` key is\n * provided, all layers for the specified source will be included in the style function. When layer\n * `id`s are provided, they must be from layers that use the same source. When not provided or a falsey\n * value, all layers using the first source specified in the glStyle will be rendered.\n * @param {Options&ApplyStyleOptions|string} [optionsOrPath] **Deprecated**. Options. Alternatively the path of the style file\n * (only required when a relative path is used for the `\"sprite\"` property of the style).\n * @param {Array} [resolutions] **Deprecated**. Resolutions for mapping resolution to zoom level.\n * Only needed when working with non-standard tile grids or projections, can also be supplied with\n * options.\n * @return {Promise} Promise which will be resolved when the style can be used\n * for rendering.\n */\nexport function applyStyle(\n layer,\n glStyle,\n sourceOrLayersOrOptions = '',\n optionsOrPath = {},\n resolutions = undefined,\n) {\n let styleUrl, sourceId;\n /** @type {Options&ApplyStyleOptions} */\n let options;\n let sourceOrLayers;\n let updateSource = true;\n if (\n typeof sourceOrLayersOrOptions !== 'string' &&\n !Array.isArray(sourceOrLayersOrOptions)\n ) {\n options = sourceOrLayersOrOptions;\n sourceOrLayers = options.source || options.layers;\n optionsOrPath = options;\n } else {\n sourceOrLayers = sourceOrLayersOrOptions;\n }\n if (typeof optionsOrPath === 'string') {\n styleUrl = optionsOrPath;\n options = {};\n } else {\n styleUrl = optionsOrPath.styleUrl;\n options = optionsOrPath;\n }\n if (options.updateSource === false) {\n updateSource = false;\n }\n if (!resolutions) {\n resolutions = options.resolutions;\n }\n if (\n !styleUrl &&\n typeof glStyle === 'string' &&\n !glStyle.trim().startsWith('{')\n ) {\n styleUrl = glStyle;\n }\n if (styleUrl) {\n styleUrl = styleUrl.startsWith('data:')\n ? location.href\n : normalizeStyleUrl(styleUrl, options.accessToken);\n options = completeOptions(styleUrl, options);\n }\n\n return new Promise(function (resolve, reject) {\n // TODO: figure out where best place to check source type is\n // Note that the source arg is an array of gl layer ids and each must be\n // dereferenced to get source type to validate\n getGlStyle(glStyle, options)\n .then(function (glStyle) {\n if (glStyle.version != 8) {\n return reject(new Error('glStyle version 8 required.'));\n }\n if (\n !(layer instanceof VectorLayer || layer instanceof VectorTileLayer)\n ) {\n return reject(\n new Error('Can only apply to VectorLayer or VectorTileLayer'),\n );\n }\n\n const type = layer instanceof VectorTileLayer ? 'vector' : 'geojson';\n if (!sourceOrLayers) {\n sourceId = Object.keys(glStyle.sources).find(function (key) {\n return glStyle.sources[key].type === type;\n });\n sourceOrLayers = sourceId;\n } else if (Array.isArray(sourceOrLayers)) {\n sourceId = glStyle.layers.find(function (layer) {\n return layer.id === sourceOrLayers[0];\n }).source;\n } else {\n sourceId = sourceOrLayers;\n }\n if (!sourceId) {\n return reject(new Error(`No ${type} source found in the glStyle.`));\n }\n\n function assignSource() {\n if (!updateSource) {\n return Promise.resolve();\n }\n if (layer instanceof VectorTileLayer) {\n return setupVectorSource(\n glStyle.sources[sourceId],\n styleUrl,\n options,\n ).then(function (source) {\n const targetSource = layer.getSource();\n if (!targetSource) {\n layer.setSource(source);\n } else if (source !== targetSource) {\n targetSource.setTileUrlFunction(source.getTileUrlFunction());\n if (\n typeof targetSource.setUrls === 'function' &&\n typeof source.getUrls === 'function'\n ) {\n // to get correct keys for tile cache and queue\n targetSource.setUrls(source.getUrls());\n }\n //@ts-ignore\n if (!targetSource.format_) {\n //@ts-ignore\n targetSource.format_ = source.format_;\n }\n if (!targetSource.getAttributions()) {\n targetSource.setAttributions(source.getAttributions());\n }\n if (\n targetSource.getTileLoadFunction() === defaultLoadFunction\n ) {\n targetSource.setTileLoadFunction(\n source.getTileLoadFunction(),\n );\n }\n if (\n equivalent(\n targetSource.getProjection(),\n source.getProjection(),\n )\n ) {\n targetSource.tileGrid = source.getTileGrid();\n }\n }\n const tileGrid = layer.getSource().getTileGrid();\n if (\n !isFinite(layer.getMaxResolution()) &&\n !isFinite(layer.getMinZoom()) &&\n tileGrid.getMinZoom() > 0\n ) {\n layer.setMaxResolution(\n getResolutionForZoom(\n Math.max(0, tileGrid.getMinZoom() - 1e-12),\n tileGrid.getResolutions(),\n ),\n );\n }\n });\n }\n const glSource = glStyle.sources[sourceId];\n let source = layer.getSource();\n if (!source || source.get('mapbox-source') !== glSource) {\n source = setupGeoJSONSource(glSource, styleUrl, options);\n }\n const targetSource = /** @type {VectorSource} */ (layer.getSource());\n if (!targetSource) {\n layer.setSource(source);\n } else if (source !== targetSource) {\n if (!targetSource.getAttributions()) {\n targetSource.setAttributions(source.getAttributions());\n }\n //@ts-ignore\n if (!targetSource.format_) {\n //@ts-ignore\n targetSource.format_ = source.getFormat();\n }\n //@ts-ignore\n targetSource.url_ = source.getUrl();\n }\n return Promise.resolve();\n }\n\n let spriteScale, spriteData, spriteImageUrl, style;\n function onChange() {\n if (!style && (!glStyle.sprite || spriteData)) {\n if (options.projection && !resolutions) {\n const projection = getProjection(options.projection);\n const units = projection.getUnits();\n if (units !== 'm') {\n resolutions = defaultResolutions.map(\n (resolution) => resolution / METERS_PER_UNIT[units],\n );\n }\n }\n style = applyStylefunction(\n layer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n (fonts, templateUrl = options.webfonts) =>\n getFonts(fonts, templateUrl),\n options.getImage,\n );\n if (!layer.getStyle()) {\n reject(new Error(`Nothing to show for source [${sourceId}]`));\n } else {\n assignSource().then(resolve).catch(reject);\n }\n } else if (style) {\n layer.setStyle(style);\n assignSource().then(resolve).catch(reject);\n } else {\n reject(new Error('Something went wrong trying to apply style.'));\n }\n }\n\n if (glStyle.sprite) {\n const sprite = new URL(\n normalizeSpriteUrl(\n glStyle.sprite,\n options.accessToken,\n styleUrl || location.href,\n ),\n );\n spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;\n const sizeFactor = spriteScale == 0.5 ? '@2x' : '';\n let spriteUrl =\n sprite.origin +\n sprite.pathname +\n sizeFactor +\n '.json' +\n sprite.search;\n\n new Promise(function (resolve, reject) {\n fetchResource('Sprite', spriteUrl, options)\n .then(resolve)\n .catch(function (error) {\n spriteUrl =\n sprite.origin + sprite.pathname + '.json' + sprite.search;\n fetchResource('Sprite', spriteUrl, options)\n .then(resolve)\n .catch(reject);\n });\n })\n .then(function (spritesJson) {\n if (spritesJson === undefined) {\n reject(new Error('No sprites found.'));\n }\n spriteData = spritesJson;\n spriteImageUrl =\n sprite.origin +\n sprite.pathname +\n sizeFactor +\n '.png' +\n sprite.search;\n if (options.transformRequest) {\n const transformed =\n options.transformRequest(spriteImageUrl, 'SpriteImage') ||\n spriteImageUrl;\n if (\n transformed instanceof Request ||\n transformed instanceof Promise\n ) {\n spriteImageUrl = transformed;\n }\n }\n onChange();\n })\n .catch(function (err) {\n reject(\n new Error(\n `Sprites cannot be loaded: ${spriteUrl}: ${err.message}`,\n ),\n );\n });\n } else {\n onChange();\n }\n })\n .catch(reject);\n });\n}\n\nconst emptyObj = {};\n\nfunction setFirstBackground(mapOrLayer, glStyle, options) {\n glStyle.layers.some(function (layer) {\n if (layer.type === 'background') {\n if (mapOrLayer instanceof Layer) {\n mapOrLayer.setBackground(function (resolution) {\n return getBackgroundColor(layer, resolution, options, {});\n });\n return true;\n }\n if (mapOrLayer instanceof Map || mapOrLayer instanceof LayerGroup) {\n mapOrLayer\n .getLayers()\n .insertAt(0, setupBackgroundLayer(layer, options, {}));\n return true;\n }\n }\n });\n}\n\n/**\n * Applies properties of the Mapbox Style's first `background` layer to the\n * provided map or layer (group).\n *\n * **Example:**\n * ```js\n * import {applyBackground} from 'ol-mapbox-style';\n * import {Map} from 'ol';\n *\n * const map = new Map({target: 'map'});\n * applyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');\n * ```\n * @param {Map|import(\"ol/layer/Base.js\").default} mapOrLayer OpenLayers Map or layer (group).\n * @param {Object|string} glStyle Mapbox Style object or url.\n * @param {Options} options Options.\n * @return {Promise} Promise that resolves when the background is applied.\n */\nexport function applyBackground(mapOrLayer, glStyle, options = {}) {\n return getGlStyle(glStyle, options).then(function (glStyle) {\n setFirstBackground(mapOrLayer, glStyle, options);\n });\n}\n\nfunction getSourceIdByRef(layers, ref) {\n let sourceId;\n layers.some(function (layer) {\n if (layer.id == ref) {\n sourceId = layer.source;\n return true;\n }\n });\n return sourceId;\n}\n\nfunction extentFromTileJSON(tileJSON, projection) {\n const bounds = tileJSON.bounds;\n if (bounds) {\n const ll = fromLonLat([bounds[0], bounds[1]], projection);\n const tr = fromLonLat([bounds[2], bounds[3]], projection);\n return [ll[0], ll[1], tr[0], tr[1]];\n }\n return getProjection(projection).getExtent();\n}\n\nfunction sourceOptionsFromTileJSON(glSource, tileJSON, options) {\n const tileJSONSource = new TileJSON({\n tileJSON: tileJSON,\n tileSize: glSource.tileSize || tileJSON.tileSize || 512,\n });\n const tileJSONDoc = tileJSONSource.getTileJSON();\n const tileGrid = tileJSONSource.getTileGrid();\n const projection = getProjection(options.projection || 'EPSG:3857');\n const extent = extentFromTileJSON(tileJSONDoc, projection);\n const projectionExtent = projection.getExtent();\n const minZoom = tileJSONDoc.minzoom || 0;\n const maxZoom = tileJSONDoc.maxzoom || 22;\n /** @type {import(\"ol/source/VectorTile.js\").Options} */\n const sourceOptions = {\n attributions: tileJSONSource.getAttributions(),\n projection: projection,\n tileGrid: new TileGrid({\n origin: projectionExtent\n ? getTopLeft(projectionExtent)\n : tileGrid.getOrigin(0),\n extent: extent || tileGrid.getExtent(),\n minZoom: minZoom,\n resolutions: getTileResolutions(projection, tileJSON.tileSize).slice(\n 0,\n maxZoom + 1,\n ),\n tileSize: tileGrid.getTileSize(0),\n }),\n };\n if (Array.isArray(tileJSONDoc.tiles)) {\n sourceOptions.urls = tileJSONDoc.tiles;\n } else {\n sourceOptions.url = tileJSONDoc.tiles;\n }\n return sourceOptions;\n}\n\nfunction getBackgroundColor(glLayer, resolution, options, functionCache) {\n const background = {\n id: glLayer.id,\n type: glLayer.type,\n };\n const layout = glLayer.layout || {};\n const paint = glLayer.paint || {};\n background['paint'] = paint;\n const zoom = getZoomForResolution(\n resolution,\n options.resolutions || defaultResolutions,\n );\n let opacity;\n const bg = getValue(\n background,\n 'paint',\n 'background-color',\n zoom,\n emptyObj,\n functionCache,\n );\n if (paint['background-opacity'] !== undefined) {\n opacity = getValue(\n background,\n 'paint',\n 'background-opacity',\n zoom,\n emptyObj,\n functionCache,\n );\n }\n return layout.visibility == 'none'\n ? undefined\n : _colorWithOpacity(bg, opacity);\n}\n\n/**\n * @param {Object} glLayer Mapbox Style layer object.\n * @param {Options} options Options.\n * @param {Object} functionCache Cache for functions.\n * @return {Layer} OpenLayers layer.\n */\nfunction setupBackgroundLayer(glLayer, options, functionCache) {\n const div = document.createElement('div');\n div.className = 'ol-mapbox-style-background';\n div.style.position = 'absolute';\n div.style.width = '100%';\n div.style.height = '100%';\n return new Layer({\n source: new Source({}),\n render(frameState) {\n const color = getBackgroundColor(\n glLayer,\n frameState.viewState.resolution,\n options,\n functionCache,\n );\n div.style.backgroundColor = color;\n return div;\n },\n });\n}\n\n/**\n * Creates an OpenLayers VectorTile source for a gl source entry.\n * @param {Object} glSource \"source\" entry from a Mapbox Style object.\n * @param {string|undefined} styleUrl URL to use for the source. This is expected to be the complete http(s) url,\n * with access key applied.\n * @param {Options} options Options.\n * @return {Promise} Promise resolving to a VectorTile source.\n * @private\n */\nexport function setupVectorSource(glSource, styleUrl, options) {\n return new Promise(function (resolve, reject) {\n getTileJson(glSource, styleUrl, options)\n .then(function ({tileJson, tileLoadFunction}) {\n const sourceOptions = sourceOptionsFromTileJSON(\n glSource,\n tileJson,\n options,\n );\n sourceOptions.tileLoadFunction = tileLoadFunction;\n sourceOptions.format = new MVT();\n resolve(new VectorTileSource(sourceOptions));\n })\n .catch(reject);\n });\n}\n\nfunction setupVectorLayer(glSource, styleUrl, options) {\n const layer = new VectorTileLayer({\n declutter: true,\n visible: false,\n });\n setupVectorSource(glSource, styleUrl, options)\n .then(function (source) {\n source.set('mapbox-source', glSource);\n layer.setSource(source);\n })\n .catch(function (error) {\n layer.setSource(undefined);\n });\n return layer;\n}\n\nfunction getBboxTemplate(projection) {\n const projCode = projection ? projection.getCode() : 'EPSG:3857';\n return `{bbox-${projCode.toLowerCase().replace(/[^a-z0-9]/g, '-')}}`;\n}\n\nfunction setupRasterSource(glSource, styleUrl, options) {\n return new Promise(function (resolve, reject) {\n getTileJson(glSource, styleUrl, options)\n .then(function ({tileJson, tileLoadFunction}) {\n const source = new TileJSON({\n interpolate:\n options.interpolate === undefined ? true : options.interpolate,\n transition: 0,\n crossOrigin: 'anonymous',\n tileJSON: tileJson,\n });\n source.tileGrid = sourceOptionsFromTileJSON(\n glSource,\n tileJson,\n options,\n ).tileGrid;\n if (options.projection) {\n //@ts-ignore\n source.projection = getProjection(options.projection);\n }\n const getTileUrl = source.getTileUrlFunction();\n if (tileLoadFunction) {\n source.setTileLoadFunction(tileLoadFunction);\n }\n source.setTileUrlFunction(function (tileCoord, pixelRatio, projection) {\n const bboxTemplate = getBboxTemplate(projection);\n let src = getTileUrl(tileCoord, pixelRatio, projection);\n if (src.indexOf(bboxTemplate) != -1) {\n const bbox = source.getTileGrid().getTileCoordExtent(tileCoord);\n src = src.replace(bboxTemplate, bbox.toString());\n }\n return src;\n });\n source.set('mapbox-source', glSource);\n resolve(source);\n })\n .catch(function (error) {\n reject(error);\n });\n });\n}\n\nfunction setupRasterLayer(glSource, styleUrl, options) {\n const layer = new TileLayer();\n setupRasterSource(glSource, styleUrl, options)\n .then(function (source) {\n layer.setSource(source);\n })\n .catch(function () {\n layer.setSource(undefined);\n });\n return layer;\n}\n\n/**\n *\n * @param {Object} glSource \"source\" entry from a Mapbox Style object.\n * @param {string} styleUrl Style url\n * @param {Options} options ol-mapbox-style options.\n * @return {ImageLayer} The raster layer\n */\nfunction setupHillshadeLayer(glSource, styleUrl, options) {\n const tileLayer = setupRasterLayer(glSource, styleUrl, options);\n /** @type {ImageLayer} */\n const layer = new ImageLayer({\n source: new Raster({\n operationType: 'image',\n operation: hillshade,\n sources: [tileLayer],\n }),\n });\n return layer;\n}\n\n/**\n * @param {Object} glSource glStyle source.\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {VectorSource} Configured vector source.\n */\nfunction setupGeoJSONSource(glSource, styleUrl, options) {\n const geoJsonFormat = options.projection\n ? new GeoJSON({dataProjection: options.projection})\n : new GeoJSON();\n const data = glSource.data;\n const sourceOptions = {};\n if (typeof data == 'string') {\n const geoJsonUrl = normalizeSourceUrl(\n data,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n styleUrl || location.href,\n );\n if (/\\{bbox-[0-9a-z-]+\\}/.test(geoJsonUrl)) {\n const extentUrl = (extent, resolution, projection) => {\n const bboxTemplate = getBboxTemplate(projection);\n return geoJsonUrl.replace(bboxTemplate, `${extent.join(',')}`);\n };\n const source = new VectorSource({\n attributions: glSource.attribution,\n format: geoJsonFormat,\n loader: (extent, resolution, projection, success, failure) => {\n const url =\n typeof extentUrl === 'function'\n ? extentUrl(extent, resolution, projection)\n : extentUrl;\n fetchResource('GeoJSON', url, options)\n .then((json) => {\n const features = /** @type {*} */ (\n source\n .getFormat()\n .readFeatures(json, {featureProjection: projection})\n );\n source.addFeatures(features);\n success(features);\n })\n .catch((response) => {\n source.removeLoadedExtent(extent);\n failure();\n });\n },\n strategy: bboxStrategy,\n });\n source.set('mapbox-source', glSource);\n return source;\n }\n const source = new VectorSource({\n attributions: glSource.attribution,\n format: geoJsonFormat,\n url: geoJsonUrl,\n loader: (extent, resolution, projection, success, failure) => {\n fetchResource('GeoJSON', geoJsonUrl, options)\n .then((json) => {\n const features = /** @type {*} */ (\n source\n .getFormat()\n .readFeatures(json, {featureProjection: projection})\n );\n source.addFeatures(features);\n success(features);\n })\n .catch((response) => {\n source.removeLoadedExtent(extent);\n failure();\n });\n },\n });\n return source;\n }\n sourceOptions.features = geoJsonFormat.readFeatures(data, {\n featureProjection: getUserProjection() || 'EPSG:3857',\n });\n\n const source = new VectorSource(\n Object.assign(\n {\n attributions: glSource.attribution,\n format: geoJsonFormat,\n },\n sourceOptions,\n ),\n );\n source.set('mapbox-source', glSource);\n return /** @type {VectorSource} */ (source);\n}\n\nfunction setupGeoJSONLayer(glSource, styleUrl, options) {\n return new VectorLayer({\n declutter: true,\n source: setupGeoJSONSource(glSource, styleUrl, options),\n visible: false,\n });\n}\n\nfunction prerenderRasterLayer(glLayer, layer, functionCache) {\n let zoom = null;\n return function (event) {\n if (\n glLayer.paint &&\n 'raster-opacity' in glLayer.paint &&\n event.frameState.viewState.zoom !== zoom\n ) {\n zoom = event.frameState.viewState.zoom;\n delete functionCache[glLayer.id];\n updateRasterLayerProperties(glLayer, layer, zoom, functionCache);\n }\n };\n}\n\nfunction updateRasterLayerProperties(glLayer, layer, zoom, functionCache) {\n const opacity = getValue(\n glLayer,\n 'paint',\n 'raster-opacity',\n zoom,\n emptyObj,\n functionCache,\n );\n layer.setOpacity(opacity);\n}\n\nfunction manageVisibility(layer, mapOrGroup) {\n function onChange() {\n const glStyle = mapOrGroup.get('mapbox-style');\n if (!glStyle) {\n return;\n }\n const mapboxLayers = derefLayers(glStyle.layers);\n const layerMapboxLayerids = layer.get('mapbox-layers');\n const visible = mapboxLayers\n .filter(function (mapboxLayer) {\n return layerMapboxLayerids.includes(mapboxLayer.id);\n })\n .some(function (mapboxLayer) {\n return (\n !mapboxLayer.layout ||\n !mapboxLayer.layout.visibility ||\n mapboxLayer.layout.visibility === 'visible'\n );\n });\n if (layer.get('visible') !== visible) {\n layer.setVisible(visible);\n }\n }\n layer.on('change', onChange);\n onChange();\n}\n\nexport function setupLayer(glStyle, styleUrl, glLayer, options) {\n const functionCache = getFunctionCache(glStyle);\n const glLayers = glStyle.layers;\n const type = glLayer.type;\n\n const id = glLayer.source || getSourceIdByRef(glLayers, glLayer.ref);\n const glSource = glStyle.sources[id];\n let layer;\n if (type == 'background') {\n layer = setupBackgroundLayer(glLayer, options, functionCache);\n } else if (glSource.type == 'vector') {\n layer = setupVectorLayer(glSource, styleUrl, options);\n } else if (glSource.type == 'raster') {\n layer = setupRasterLayer(glSource, styleUrl, options);\n layer.setVisible(\n glLayer.layout ? glLayer.layout.visibility !== 'none' : true,\n );\n layer.on('prerender', prerenderRasterLayer(glLayer, layer, functionCache));\n } else if (glSource.type == 'geojson') {\n layer = setupGeoJSONLayer(glSource, styleUrl, options);\n } else if (glSource.type == 'raster-dem' && glLayer.type == 'hillshade') {\n const hillshadeLayer = setupHillshadeLayer(glSource, styleUrl, options);\n layer = hillshadeLayer;\n hillshadeLayer.getSource().on('beforeoperations', function (event) {\n const data = event.data;\n data.resolution = getPointResolution(\n options.projection || 'EPSG:3857',\n event.resolution,\n getCenter(event.extent),\n 'm',\n );\n const zoom = getZoomForResolution(\n event.resolution,\n options.resolutions || defaultResolutions,\n );\n data.encoding = glSource.encoding;\n data.vert =\n 5 *\n getValue(\n glLayer,\n 'paint',\n 'hillshade-exaggeration',\n zoom,\n emptyObj,\n functionCache,\n );\n data.sunAz = getValue(\n glLayer,\n 'paint',\n 'hillshade-illumination-direction',\n zoom,\n emptyObj,\n functionCache,\n );\n data.sunEl = 35;\n data.opacity = 0.3;\n data.highlightColor = getValue(\n glLayer,\n 'paint',\n 'hillshade-highlight-color',\n zoom,\n emptyObj,\n functionCache,\n );\n data.shadowColor = getValue(\n glLayer,\n 'paint',\n 'hillshade-shadow-color',\n zoom,\n emptyObj,\n functionCache,\n );\n data.accentColor = getValue(\n glLayer,\n 'paint',\n 'hillshade-accent-color',\n zoom,\n emptyObj,\n functionCache,\n );\n });\n layer.setVisible(\n glLayer.layout ? glLayer.layout.visibility !== 'none' : true,\n );\n }\n const glSourceId = id;\n if (layer) {\n layer.set('mapbox-source', glSourceId);\n }\n return layer;\n}\n\n/**\n * @param {*} glStyle Mapbox Style.\n * @param {Map|LayerGroup} mapOrGroup Map or layer group.\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {Promise} Promise that resolves when the style is loaded.\n */\nfunction processStyle(glStyle, mapOrGroup, styleUrl, options) {\n const promises = [];\n\n let view = null;\n if (mapOrGroup instanceof Map) {\n view = mapOrGroup.getView();\n if (!view.isDef() && !view.getRotation() && !view.getResolutions()) {\n const projection = options.projection\n ? getProjection(options.projection)\n : view.getProjection();\n view = new View(\n Object.assign(view.getProperties(), {\n maxResolution:\n defaultResolutions[0] / METERS_PER_UNIT[projection.getUnits()],\n projection: options.projection || view.getProjection(),\n }),\n );\n mapOrGroup.setView(view);\n }\n\n if ('center' in glStyle && !view.getCenter()) {\n view.setCenter(fromLonLat(glStyle.center, view.getProjection()));\n }\n if ('zoom' in glStyle && view.getZoom() === undefined) {\n view.setResolution(\n defaultResolutions[0] /\n METERS_PER_UNIT[view.getProjection().getUnits()] /\n Math.pow(2, glStyle.zoom),\n );\n }\n if (!view.getCenter() || view.getZoom() === undefined) {\n view.fit(view.getProjection().getExtent(), {\n nearest: true,\n size: mapOrGroup.getSize(),\n });\n }\n }\n mapOrGroup.set('mapbox-style', glStyle);\n mapOrGroup.set('mapbox-metadata', {styleUrl, options});\n\n const glLayers = glStyle.layers;\n let layerIds = [];\n\n let layer, glSourceId, id;\n for (let i = 0, ii = glLayers.length; i < ii; ++i) {\n const glLayer = glLayers[i];\n const type = glLayer.type;\n if (type == 'heatmap') {\n //FIXME Unsupported layer type\n // eslint-disable-next-line no-console\n console.debug(`layers[${i}].type \"${type}\" not supported`);\n continue;\n } else {\n id = glLayer.source || getSourceIdByRef(glLayers, glLayer.ref);\n // this technique assumes gl layers will be in a particular order\n if (!id || id != glSourceId) {\n if (layerIds.length) {\n promises.push(\n finalizeLayer(\n layer,\n layerIds,\n glStyle,\n styleUrl,\n mapOrGroup,\n options,\n ),\n );\n layerIds = [];\n }\n\n layer = setupLayer(glStyle, styleUrl, glLayer, options);\n if (\n !(layer instanceof VectorLayer || layer instanceof VectorTileLayer)\n ) {\n layerIds = [];\n }\n glSourceId = layer.get('mapbox-source');\n }\n layerIds.push(glLayer.id);\n }\n }\n promises.push(\n finalizeLayer(layer, layerIds, glStyle, styleUrl, mapOrGroup, options),\n );\n return Promise.all(promises);\n}\n\n/**\n * Loads and applies a Mapbox Style object into an OpenLayers Map or LayerGroup.\n * This includes the map background, the layers, and for Map instances that did not\n * have a View defined yet also the center and the zoom.\n *\n * **Example:**\n * ```js\n * import apply from 'ol-mapbox-style';\n *\n * apply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});\n * ```\n *\n * The center and zoom will only be set if present in the Mapbox Style document,\n * and if not already set on the OpenLayers map.\n *\n * Layers will be added to the OpenLayers map, without affecting any layers that\n * might already be set on the map.\n *\n * Layers added by `apply()` will have two additional properties:\n *\n * * `mapbox-source`: The `id` of the Mapbox Style document's source that the\n * OpenLayers layer was created from. Usually `apply()` creates one\n * OpenLayers layer per Mapbox Style source, unless the layer stack has\n * layers from different sources in between.\n * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are\n * included in the OpenLayers layer.\n *\n * This function sets an additional `mapbox-style` property on the OpenLayers\n * Map or LayerGroup instance, which holds the Mapbox Style object.\n *\n * @param {Map|HTMLElement|string|LayerGroup} mapOrGroupOrElement Either an existing\n * OpenLayers Map instance, or a HTML element, or the id of a HTML element that will be\n * the target of a new OpenLayers Map, or a layer group. If layer group, styles\n * releated to the map and view will be ignored.\n * @param {string|Object} style JSON style object or style url pointing to a\n * Mapbox Style object. When using Mapbox APIs, the url is the `styleUrl`\n * shown in Mapbox Studio's \"share\" panel. In addition, the `accessToken` option\n * (see below) must be set.\n * When passed as JSON style object, all OpenLayers layers created by `apply()`\n * will be immediately available, but they may not have a source yet (i.e. when\n * they are defined by a TileJSON url in the Mapbox Style document). When passed\n * as style url, layers will be added to the map when the Mapbox Style document\n * is loaded and parsed.\n * @param {Options} options Options.\n * @return {Promise} A promise that resolves after all layers have been added to\n * the OpenLayers Map instance or LayerGroup, their sources set, and their styles applied. The\n * `resolve` callback will be called with the OpenLayers Map instance or LayerGroup as\n * argument.\n */\nexport function apply(mapOrGroupOrElement, style, options = {}) {\n let promise;\n /** @type {Map|LayerGroup} */\n let mapOrGroup;\n if (\n typeof mapOrGroupOrElement === 'string' ||\n mapOrGroupOrElement instanceof HTMLElement\n ) {\n mapOrGroup = new Map({\n target: mapOrGroupOrElement,\n });\n } else {\n mapOrGroup = mapOrGroupOrElement;\n }\n\n if (typeof style === 'string') {\n const styleUrl = style.startsWith('data:')\n ? location.href\n : normalizeStyleUrl(style, options.accessToken);\n options = completeOptions(styleUrl, options);\n\n promise = new Promise(function (resolve, reject) {\n getGlStyle(style, options)\n .then(function (glStyle) {\n processStyle(glStyle, mapOrGroup, styleUrl, options)\n .then(function () {\n resolve(mapOrGroup);\n })\n .catch(reject);\n })\n .catch(function (err) {\n reject(new Error(`Could not load ${style}: ${err.message}`));\n });\n });\n } else {\n promise = new Promise(function (resolve, reject) {\n processStyle(\n style,\n mapOrGroup,\n !options.styleUrl || options.styleUrl.startsWith('data:')\n ? location.href\n : normalizeStyleUrl(options.styleUrl, options.accessToken),\n options,\n )\n .then(function () {\n resolve(mapOrGroup);\n })\n .catch(reject);\n });\n }\n\n return promise;\n}\n\n/**\n * If layerIds is not empty, applies the style specified in glStyle to the layer,\n * and adds the layer to the map.\n *\n * The layer may not yet have a source when the function is called. If so, the style\n * is applied to the layer via a once listener on the 'change:source' event.\n *\n * @param {Layer} layer An OpenLayers layer instance.\n * @param {Array} layerIds Array containing layer ids of already-processed layers.\n * @param {Object} glStyle Style as a JSON object.\n * @param {string|undefined} styleUrl The original style URL. Only required\n * when a relative path is used with the `\"sprite\"` property of the style.\n * @param {Map|LayerGroup} mapOrGroup OpenLayers Map.\n * @param {Options} options Options.\n * @return {Promise} Returns a promise that resolves after the source has\n * been set on the specified layer, and the style has been applied.\n */\nexport function finalizeLayer(\n layer,\n layerIds,\n glStyle,\n styleUrl,\n mapOrGroup,\n options = {},\n) {\n let minZoom = 24;\n let maxZoom = 0;\n const glLayers = glStyle.layers;\n for (let i = 0, ii = glLayers.length; i < ii; ++i) {\n const glLayer = glLayers[i];\n if (layerIds.indexOf(glLayer.id) !== -1) {\n minZoom = Math.min('minzoom' in glLayer ? glLayer.minzoom : 0, minZoom);\n maxZoom = Math.max('maxzoom' in glLayer ? glLayer.maxzoom : 24, maxZoom);\n }\n }\n return new Promise(function (resolve, reject) {\n const setStyle = function () {\n const source = layer.getSource();\n if (!source || source.getState() === 'error') {\n reject(\n new Error(\n 'Error accessing data for source ' + layer.get('mapbox-source'),\n ),\n );\n return;\n }\n if ('getTileGrid' in source) {\n const tileGrid =\n /** @type {import(\"ol/source/Tile.js\").default|import(\"ol/source/VectorTile.js\").default} */ (\n source\n ).getTileGrid();\n if (tileGrid) {\n const sourceMinZoom = tileGrid.getMinZoom();\n if (minZoom > 0 || sourceMinZoom > 0) {\n layer.setMaxResolution(\n Math.min(\n getResolutionForZoom(\n Math.max(0, minZoom - 1e-12),\n defaultResolutions,\n ),\n getResolutionForZoom(\n Math.max(0, sourceMinZoom - 1e-12),\n tileGrid.getResolutions(),\n ),\n ),\n );\n }\n if (maxZoom < 24) {\n layer.setMinResolution(\n getResolutionForZoom(maxZoom, defaultResolutions),\n );\n }\n }\n } else {\n if (minZoom > 0) {\n layer.setMaxResolution(\n getResolutionForZoom(\n Math.max(0, minZoom - 1e-12),\n defaultResolutions,\n ),\n );\n }\n }\n if (\n source instanceof VectorSource ||\n source instanceof VectorTileSource\n ) {\n applyStyle(\n /** @type {import(\"ol/layer/Vector\").default|import(\"ol/layer/VectorTile\").default} */ (\n layer\n ),\n glStyle,\n layerIds,\n Object.assign({styleUrl: styleUrl}, options),\n )\n .then(function () {\n manageVisibility(layer, mapOrGroup);\n resolve();\n })\n .catch(reject);\n } else {\n resolve();\n }\n };\n\n layer.set('mapbox-layers', layerIds);\n const layers = mapOrGroup.getLayers();\n if (layers.getArray().indexOf(layer) === -1) {\n layers.push(layer);\n }\n\n if (layer.getSource()) {\n setStyle();\n } else {\n layer.once('change:source', setStyle);\n }\n });\n}\n\n/**\n * Get the Mapbox Layer object for the provided `layerId`.\n * @param {Map|LayerGroup} mapOrGroup Map or LayerGroup.\n * @param {string} layerId Mapbox Layer id.\n * @return {Object} Mapbox Layer object.\n */\nexport function getMapboxLayer(mapOrGroup, layerId) {\n const style = mapOrGroup.get('mapbox-style');\n const layerStyle = style.layers.find(function (layer) {\n return layer.id === layerId;\n });\n return layerStyle;\n}\n\n/**\n * Add a new Mapbox Layer object to the style. The map will be re-rendered.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {Object} mapboxLayer Mapbox Layer object.\n * @param {string} [beforeLayerId] Optional id of the Mapbox Layer before the new layer that will be added.\n * @return {Promise} Resolves when the added layer is available.\n */\nexport function addMapboxLayer(mapOrGroup, mapboxLayer, beforeLayerId) {\n const glStyle = mapOrGroup.get('mapbox-style');\n const mapboxLayers = glStyle.layers;\n let spliceIndex;\n let sourceIndex = -1;\n if (beforeLayerId !== undefined) {\n const beforeMapboxLayer = getMapboxLayer(mapOrGroup, beforeLayerId);\n if (beforeMapboxLayer === undefined) {\n throw new Error(`Layer with id \"${beforeLayerId}\" not found.`);\n }\n spliceIndex = mapboxLayers.indexOf(beforeMapboxLayer);\n } else {\n spliceIndex = mapboxLayers.length;\n }\n let sourceOffset;\n if (\n spliceIndex > 0 &&\n mapboxLayers[spliceIndex - 1].source === mapboxLayer.source\n ) {\n sourceIndex = spliceIndex - 1;\n sourceOffset = -1;\n } else if (\n spliceIndex < mapboxLayers.length &&\n mapboxLayers[spliceIndex].source === mapboxLayer.source\n ) {\n sourceIndex = spliceIndex;\n sourceOffset = 0;\n }\n if (sourceIndex === -1) {\n const {options, styleUrl} = mapOrGroup.get('mapbox-metadata');\n const layer = setupLayer(glStyle, styleUrl, mapboxLayer, options);\n if (beforeLayerId) {\n const beforeLayer = getLayer(mapOrGroup, beforeLayerId);\n const beforeLayerIndex = mapOrGroup\n .getLayers()\n .getArray()\n .indexOf(beforeLayer);\n mapOrGroup.getLayers().insertAt(beforeLayerIndex, layer);\n }\n mapboxLayers.splice(spliceIndex, 0, mapboxLayer);\n return finalizeLayer(\n layer,\n [mapboxLayer.id],\n glStyle,\n styleUrl,\n mapOrGroup,\n options,\n );\n }\n\n if (mapboxLayers.some((layer) => layer.id === mapboxLayer.id)) {\n throw new Error(`Layer with id \"${mapboxLayer.id}\" already exists.`);\n }\n const sourceLayerId = mapboxLayers[sourceIndex].id;\n const args =\n styleFunctionArgs[\n getStyleFunctionKey(\n mapOrGroup.get('mapbox-style'),\n getLayer(mapOrGroup, sourceLayerId),\n )\n ];\n mapboxLayers.splice(spliceIndex, 0, mapboxLayer);\n if (args) {\n const [\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n ] = args;\n if (Array.isArray(sourceOrLayers)) {\n const layerIndex = sourceOrLayers.indexOf(sourceLayerId) + sourceOffset;\n sourceOrLayers.splice(layerIndex, 0, mapboxLayer.id);\n }\n applyStylefunction(\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n );\n } else {\n getLayer(mapOrGroup, mapboxLayers[sourceIndex].id).changed();\n }\n return Promise.resolve();\n}\n\n/**\n * Update a Mapbox Layer object in the style. The map will be re-rendered with the new style.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {Object} mapboxLayer Updated Mapbox Layer object.\n */\nexport function updateMapboxLayer(mapOrGroup, mapboxLayer) {\n const glStyle = mapOrGroup.get('mapbox-style');\n const mapboxLayers = glStyle.layers;\n const index = mapboxLayers.findIndex(function (layer) {\n return layer.id === mapboxLayer.id;\n });\n if (index === -1) {\n throw new Error(`Layer with id \"${mapboxLayer.id}\" not found.`);\n }\n const oldLayer = mapboxLayers[index];\n if (oldLayer.source !== mapboxLayer.source) {\n throw new Error(\n 'Updated layer and previous version must use the same source.',\n );\n }\n delete getFunctionCache(glStyle)[mapboxLayer.id];\n delete getFilterCache(glStyle)[mapboxLayer.id];\n mapboxLayers[index] = mapboxLayer;\n const args =\n styleFunctionArgs[\n getStyleFunctionKey(\n mapOrGroup.get('mapbox-style'),\n getLayer(mapOrGroup, mapboxLayer.id),\n )\n ];\n if (args) {\n applyStylefunction.apply(undefined, args);\n } else {\n getLayer(mapOrGroup, mapboxLayer.id).changed();\n }\n}\n\n/**\n * Updates a Mapbox source object in the style. The according OpenLayers source will be replaced\n * and the map will be re-rendered.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {string} id Key of the source in the `sources` object literal.\n * @param {Object} mapboxSource Mapbox source object.\n * @return {Promise} Promise that resolves when the source has been updated.\n */\nexport function updateMapboxSource(mapOrGroup, id, mapboxSource) {\n const currentSource = getSource(mapOrGroup, id);\n const layers = /** @type {Array} */ (\n mapOrGroup\n .getLayers()\n .getArray()\n .filter(function (layer) {\n return (\n (layer instanceof VectorLayer ||\n layer instanceof TileLayer ||\n layer instanceof VectorTileLayer) &&\n layer.getSource() === currentSource\n );\n })\n );\n const metadata = mapOrGroup.get('mapbox-metadata');\n let newSourcePromise;\n switch (mapboxSource.type) {\n case 'vector':\n newSourcePromise = setupVectorSource(\n mapboxSource,\n metadata.styleUrl,\n metadata.options,\n );\n break;\n case 'geojson':\n newSourcePromise = Promise.resolve(\n setupGeoJSONSource(mapboxSource, metadata.styleUrl, metadata.options),\n );\n break;\n case 'raster':\n case 'raster-dem':\n newSourcePromise = setupRasterSource(\n mapboxSource,\n metadata.styleUrl,\n metadata.options,\n );\n break;\n default:\n return Promise.reject(\n new Error('Unsupported source type ' + mapboxSource.type),\n );\n }\n newSourcePromise.then(function (newSource) {\n layers.forEach(function (layer) {\n layer.setSource(newSource);\n });\n });\n return newSourcePromise;\n}\n\n/**\n * Remove a Mapbox Layer object from the style. The map will be re-rendered.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {string|Object} mapboxLayerIdOrLayer Mapbox Layer id or Mapbox Layer object.\n */\nexport function removeMapboxLayer(mapOrGroup, mapboxLayerIdOrLayer) {\n const mapboxLayerId =\n typeof mapboxLayerIdOrLayer === 'string'\n ? mapboxLayerIdOrLayer\n : mapboxLayerIdOrLayer.id;\n const layer = getLayer(mapOrGroup, mapboxLayerId);\n /** @type {Array} */\n const layerMapboxLayers = layer.get('mapbox-layers');\n if (layerMapboxLayers.length === 1) {\n throw new Error(\n 'Cannot remove last Mapbox layer from an OpenLayers layer.',\n );\n }\n layerMapboxLayers.splice(layerMapboxLayers.indexOf(mapboxLayerId), 1);\n const glStyle = mapOrGroup.get('mapbox-style');\n const layers = glStyle.layers;\n layers.splice(\n layers.findIndex((layer) => layer.id === mapboxLayerId),\n 1,\n );\n const args = styleFunctionArgs[getStyleFunctionKey(glStyle, layer)];\n if (args) {\n const [\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n ] = args;\n if (Array.isArray(sourceOrLayers)) {\n sourceOrLayers.splice(\n sourceOrLayers.findIndex((layer) => layer === mapboxLayerId),\n 1,\n );\n }\n applyStylefunction(\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n );\n } else {\n getLayer(mapOrGroup, mapboxLayerId).changed();\n }\n}\n\n/**\n * Get the OpenLayers layer instance that contains the provided Mapbox Style\n * `layer`. Note that multiple Mapbox Style layers are combined in a single\n * OpenLayers layer instance when they use the same Mapbox Style `source`.\n * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup.\n * @param {string} layerId Mapbox Style layer id.\n * @return {Layer} OpenLayers layer instance.\n */\nexport function getLayer(map, layerId) {\n const layers = map.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const mapboxLayers = layers[i].get('mapbox-layers');\n if (mapboxLayers && mapboxLayers.indexOf(layerId) !== -1) {\n return /** @type {Layer} */ (layers[i]);\n }\n }\n return undefined;\n}\n\n/**\n * Get the OpenLayers layer instances for the provided Mapbox Style `source`.\n * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup.\n * @param {string} sourceId Mapbox Style source id.\n * @return {Array} OpenLayers layer instances.\n */\nexport function getLayers(map, sourceId) {\n const result = [];\n const layers = map.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n if (layers[i].get('mapbox-source') === sourceId) {\n result.push(/** @type {Layer} */ (layers[i]));\n }\n }\n return result;\n}\n\n/**\n * Get the OpenLayers source instance for the provided Mapbox Style `source`.\n * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup.\n * @param {string} sourceId Mapbox Style source id.\n * @return {Source} OpenLayers source instance.\n */\nexport function getSource(map, sourceId) {\n const layers = map.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const source = /** @type {Layer} */ (layers[i]).getSource();\n if (layers[i].get('mapbox-source') === sourceId) {\n return source;\n }\n }\n return undefined;\n}\n\n/**\n * Sets or removes a feature state. The feature state is taken into account for styling,\n * just like the feature's properties, and can be used e.g. to conditionally render selected\n * features differently.\n *\n * The feature state will be stored on the OpenLayers layer matching the feature identifier, in the\n * `mapbox-featurestate` property.\n * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer OpenLayers Map or layer to set the feature\n * state on.\n * @param {FeatureIdentifier} feature Feature identifier.\n * @param {Object|null} state Feature state. Set to `null` to remove the feature state.\n */\nexport function setFeatureState(mapOrLayer, feature, state) {\n const layers =\n 'getLayers' in mapOrLayer\n ? getLayers(mapOrLayer, feature.source)\n : [mapOrLayer];\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const featureState = layers[i].get('mapbox-featurestate');\n if (featureState) {\n if (state) {\n featureState[feature.id] = state;\n } else {\n delete featureState[feature.id];\n }\n layers[i].changed();\n } else {\n throw new Error(`Map or layer for source \"${feature.source}\" not found.`);\n }\n }\n}\n\n/**\n * Sets or removes a feature state. The feature state is taken into account for styling,\n * just like the feature's properties, and can be used e.g. to conditionally render selected\n * features differently.\n * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer Map or layer to set the feature state on.\n * @param {FeatureIdentifier} feature Feature identifier.\n * @return {Object|null} Feature state or `null` when no feature state is set for the given\n * feature identifier.\n */\nexport function getFeatureState(mapOrLayer, feature) {\n const layers =\n 'getLayers' in mapOrLayer\n ? getLayers(mapOrLayer, feature.source)\n : [mapOrLayer];\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const featureState = layers[i].get('mapbox-featurestate');\n if (featureState && featureState[feature.id]) {\n return featureState[feature.id];\n }\n }\n return undefined;\n}\n","import BaseEvent from 'ol/events/Event.js';\nimport EventType from 'ol/events/EventType.js';\nimport MVT from 'ol/format/MVT.js';\nimport VectorTileLayer from 'ol/layer/VectorTile.js';\nimport VectorTileSource from 'ol/source/VectorTile.js';\nimport {applyBackground, applyStyle} from './apply.js';\n\n/** @typedef {import(\"ol/Map.js\").default} Map */\n\n/**\n * @classdesc\n * Event emitted on configuration or loading error.\n */\nclass ErrorEvent extends BaseEvent {\n /**\n * @param {Error} error error object.\n */\n constructor(error) {\n super(EventType.ERROR);\n\n /**\n * @type {Error}\n */\n this.error = error;\n }\n}\n\n/**\n * @typedef {Object} Options\n * @property {string} styleUrl The URL of the Mapbox style object to use for this layer. For a\n * style created with Mapbox Studio and hosted on Mapbox, this will look like\n * 'mapbox://styles/you/your-style'.\n * @property {string} [accessToken] The access token for your Mapbox style. This has to be provided\n * for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query\n * parameter of the style url.\n * @property {string} [source] If your style uses more than one source, you need to use either the\n * `source` property or the `layers` property to limit rendering to a single vector source. The\n * `source` property corresponds to the id of a vector source in your Mapbox style.\n * @property {Array} [layers] Limit rendering to the list of included layers. All layers\n * must share the same vector source. If your style uses more than one source, you need to use\n * either the `source` property or the `layers` property to limit rendering to a single vector\n * source.\n * @property {boolean} [declutter=true] Declutter images and text. Decluttering is applied to all\n * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority\n * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.\n * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has\n * higher priority.\n *\n * As an optimization decluttered features from layers with the same `className` are rendered above\n * the fill and stroke styles of all of those layers regardless of z-index. To opt out of this\n * behavior and place declutterd features with their own layer configure the layer with a `className`\n * other than `ol-layer`.\n * @property {import(\"ol/layer/Base.js\").BackgroundColor|false} [background] Background color for the layer.\n * If not specified, the background from the Mapbox style object will be used. Set to `false` to prevent\n * the Mapbox style's background from being used.\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"ol/extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will\n * match the style source's `minzoom`.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will\n * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match\n * the style source's `minzoom`.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {import(\"ol/render.js\").OrderFunction} [renderOrder] Render order. Function to be used when sorting\n * features before rendering. By default features are drawn in the order that they are created. Use\n * `null` to avoid the sort, but get an undefined draw order.\n * @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the\n * renderer when getting features from the vector tile for the rendering or hit-detection.\n * Recommended value: Vector tiles are usually generated with a buffer, so this value should match\n * the largest possible buffer of the used tiles. It should be at least the size of the largest\n * point symbol or line width.\n * @property {import(\"ol/layer/VectorTile.js\").VectorTileRenderType} [renderMode='hybrid'] Render mode for vector tiles:\n * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom\n * animations. Point symbols and texts are accurately rendered as vectors and can stay upright on\n * rotated views.\n * * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector\n * tile layers with only a few rendered features (e.g. for highlighting a subset of features of\n * another layer with the same source).\n * @property {import(\"ol/Map.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use `map.addLayer()`.\n * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be\n * recreated during animations. This means that no vectors will be shown clipped, but the setting\n * will have a performance impact for large amounts of vector data. When set to `false`, batches\n * will be recreated when no animation is active.\n * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will be\n * recreated during interactions. See also `updateWhileAnimating`.\n * @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`\n * means no preloading.\n * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.\n * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @classdesc\n * ```js\n * import {MapboxVectorLayer} from 'ol-mapbox-style';\n * ```\n * A vector tile layer based on a Mapbox style that uses a single vector source. Configure\n * the layer with the `styleUrl` and `accessToken` shown in Mapbox Studio's share panel.\n * If the style uses more than one source, use the `source` property to choose a single\n * vector source. If you want to render a subset of the layers in the style, use the `layers`\n * property (all layers must share the same vector source). See the constructor options for\n * more detail.\n *\n * const map = new Map({\n * view: new View({\n * center: [0, 0],\n * zoom: 1,\n * }),\n * layers: [\n * new MapboxVectorLayer({\n * styleUrl: 'mapbox://styles/mapbox/bright-v9',\n * accessToken: 'your-mapbox-access-token-here',\n * }),\n * ],\n * target: 'map',\n * });\n *\n * On configuration or loading error, the layer will trigger an `'error'` event. Listeners\n * will receive an object with an `error` property that can be used to diagnose the problem.\n *\n * **Note for users of the full build**: The `MapboxVectorLayer` requires the\n * [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) library to be loaded as well.\n *\n * @param {Options} options Options.\n * @extends {VectorTileLayer}\n * @fires module:ol/events/Event~BaseEvent#event:error\n * @api\n */\nexport default class MapboxVectorLayer extends VectorTileLayer {\n /**\n * @param {Options} options Layer options. At a minimum, `styleUrl` and `accessToken`\n * must be provided.\n */\n constructor(options) {\n const declutter = 'declutter' in options ? options.declutter : true;\n const source = new VectorTileSource({\n state: 'loading',\n format: new MVT(),\n });\n\n super({\n source: source,\n background: options.background,\n declutter: declutter,\n className: options.className,\n opacity: options.opacity,\n visible: options.visible,\n zIndex: options.zIndex,\n minResolution: options.minResolution,\n maxResolution: options.maxResolution,\n minZoom: options.minZoom,\n maxZoom: options.maxZoom,\n renderOrder: options.renderOrder,\n renderBuffer: options.renderBuffer,\n renderMode: options.renderMode,\n map: options.map,\n updateWhileAnimating: options.updateWhileAnimating,\n updateWhileInteracting: options.updateWhileInteracting,\n preload: options.preload,\n useInterimTilesOnError: options.useInterimTilesOnError,\n properties: options.properties,\n });\n\n if (options.accessToken) {\n this.accessToken = options.accessToken;\n }\n const url = options.styleUrl;\n const promises = [\n applyStyle(this, url, options.layers || options.source, {\n accessToken: this.accessToken,\n }),\n ];\n if (this.getBackground() === undefined) {\n promises.push(\n applyBackground(this, options.styleUrl, {\n accessToken: this.accessToken,\n }),\n );\n }\n Promise.all(promises)\n .then(() => {\n source.setState('ready');\n })\n .catch((error) => {\n this.dispatchEvent(new ErrorEvent(error));\n const source = this.getSource();\n source.setState('error');\n });\n }\n}\n"],"names":["kCSSColorTable","clamp_css_byte","i","Math","round","clamp_css_float","f","parse_css_int","str","length","parseFloat","parseInt","parse_css_float","css_hue_to_rgb","m1","m2","h","parseCSSColor","css_str","replace","toLowerCase","slice","iv","substr","op","indexOf","ep","fname","params","split","alpha","pop","s","l","exports","e","Color","constructor","r","g","b","a","parse","input","undefined","rgba","toString","toArray","toArray01","toArray01PremultipliedAlpha","black","white","transparent","red","blue","convertLiteral","value","convertFunction","parameters","propertySpec","stops","convertIdentityFunction","zoomAndFeatureDependent","featureDependent","property","zoomDependent","map","stop","tokens","convertTokenString","convertZoomAndPropertyFunction","convertZoomFunction","convertPropertyFunction","get","default","type","Object","keys","values","expression","splice","getInterpolateOperator","colorSpace","featureFunctionParameters","featureFunctionStops","zoomStops","zoom","push","functionType","getFunctionType","z","output","appendStopPair","fixupDegenerateStepCurve","coalesce","getFallback","defaultValue","base","Error","isStep","curve","interpolated","result","re","pos","match","exec","literal","lastIndex","ParsingError","key","message","Scope","parent","bindings","name","concat","has","NullType","kind","NumberType","StringType","BooleanType","ColorType","ObjectType","ValueType","ErrorType","CollatorType","FormattedType","ResolvedImageType","array","itemType","N","valueMemberTypes","checkSubtype","expected","t","memberType","isValidType","provided","allowedTypes","some","isValidNativeType","Array","isArray","Collator","caseSensitive","diacriticSensitive","locale","sensitivity","collator","Intl","usage","compare","lhs","rhs","resolvedLocale","resolvedOptions","FormattedSection","text","image","scale","fontStack","textColor","normalize","Formatted","sections","fromString","unformatted","isEmpty","section","factory","join","serialize","serialized","options","ResolvedImage","available","validateRGBA","isValue","mixed","item","typeOf","String","JSON","stringify","Literal","args","context","error","expectedType","evaluate","eachChild","outputDefined","RuntimeError","toJSON","types","string","number","boolean","object","Assertion","floor","parsed","ctx","fn","forEach","every","arg","FormatExpression","firstArg","nextTokenMayBeObject","font","lastExpression","content","evaluateSection","evaluatedContent","ImageExpression","evaluatedImageName","availableImages","Coercion","Boolean","c","parseColor","num","Number","isNaN","valueToString","child","geometryTypes","EvaluationContext","globals","feature","featureState","formattedSection","_parseColorCache","canonical","featureTileCoord","featureDistanceData","id","geometryType","geometry","canonicalID","properties","distanceFromCenter","center","x","y","dX","dY","bX","bearing","bY","dist","cached","CompoundExpression","_evaluate","definition","definitions","availableOverloads","overloads","filter","signature","signatureContext","ParsingContext","registry","path","scope","parsedArgs","argParseFailed","errors","signatures","stringifySignature","actualTypes","register","CollatorExpression","EXTENT","updateBBox","bbox","coord","min","max","mercatorXfromLng","lng","mercatorYfromLat","lat","PI","log","tan","boxWithinBox","bbox1","bbox2","getTileCoordinates","p","tilesAtZoom","pow","onBoundary","p1","p2","x1","y1","x2","y2","rayIntersect","pointWithinPolygon","point","rings","inside","len","ring","j","len2","pointWithinPolygons","polygons","perp","v1","v2","twoSided","q1","q2","x3","y3","det1","det2","lineIntersectLine","d","vectorP","vectorQ","lineIntersectPolygon","polygon","lineStringWithinPolygon","line","lineStringWithinPolygons","getTilePolygon","coordinates","getTilePolygons","updatePoint","polyBBox","worldSize","halfWorldSize","shift","resetBBox","Infinity","getTilePoints","pointBBox","shifts","tilePoints","points","getTileLines","lineBBox","tileLines","tileLine","pointsWithinPolygons","polygonGeometry","tilePolygon","tilePolygons","linesWithinPolygons","Within","geojson","geometries","features","isFeatureConstant","test","isStateConstant","isGlobalPropertyConstant","Var","boundExpression","part","expr","index","_parse","annotate","typeAnnotation","Expr","actual","isConstant","ec","k","isTypeAnnotation","childrenConstant","findStopLessThanOrEqualTo","lowerIndex","upperIndex","currentIndex","currentValue","nextValue","Step","labels","outputs","label","outputType","labelKey","valueKey","stopCount","out","module","UnitBezier","p1x","p1y","p2x","p2y","cx","bx","ax","cy","by","ay","prototype","sampleCurveX","sampleCurveY","sampleCurveDerivativeX","solveCurveX","epsilon","t0","t1","t2","abs","d2","solve","color","from","to","Xn","Yn","Zn","t3","deg2rad","rad2deg","xyz2lab","lab2xyz","xyz2rgb","rgb2xyz","rgbToLab","rgbColor","labToRgb","labColor","interpolateLab","interpolateNumber","rgbToHcl","atan2","sqrt","hclToRgb","hclColor","cos","sin","interpolateHue","interpolateHcl","lab","forward","reverse","interpolate","hcl","Interpolate","operator","interpolation","interpolationFactor","lower","upper","exponentialInterpolation","controlPoints","ub","rest","outputLower","outputUpper","lowerValue","upperValue","difference","progress","Coalesce","needsAnnotation","argCount","firstImage","Let","binding","At","In","needle","haystack","IndexOf","fromIndex","Match","inputType","cases","otherwise","labelContext","MAX_SAFE_INTEGER","sortedLabels","sort","groupedByOutput","outputLookup","outputIndex","coerceLabel","Case","branches","_","Slice","beginIndex","endIndex","isComparableType","eq","neq","lt","gt","lteq","gteq","eqCollate","neqCollate","ltCollate","gtCollate","lteqCollate","gteqCollate","makeComparison","compareBasic","compareWithCollator","isOrderComparison","Comparison","hasUntypedArgument","rt","Equals","NotEquals","LessThan","GreaterThan","LessThanOrEqual","GreaterThanOrEqual","NumberFormat","currency","unit","minFractionDigits","maxFractionDigits","style","minimumFractionDigits","maximumFractionDigits","format","Length","expressions","obj","v","binarySearch","m","varargs","typeToString","pitch","heatmapDensity","lineProgress","skyRadialProgress","accumulated","LN2","E","n","LN10","asin","acos","atan","ceil","isSupportedScript","toUpperCase","success","supportsPropertyExpression","spec","supportsZoomExpression","supportsInterpolation","isFunction","StyleExpression","_warningHistory","_evaluator","_defaultValue","getDefaultValue","_enumValues","evaluateWithoutErrorHandling","val","console","warn","isExpression","createExpression","parser","getExpectedType","ZoomConstantExpression","_styleExpression","isStateDependent","ZoomDependentExpression","interpolationType","createPropertyExpression","isZoomConstant","zoomCurve","findZoomCurve","childResult","enum","formatted","resolvedImage","unbundle","valueOf","deepUnbundle","unbundledValue","isExpressionFilter","createFilter","layerType","needGeometry","needFeature","convertFilter","filterExp","staticFilter","extractStaticFilter","filterSpec","latest","compiledStaticFilter","filterFunc","err","globalProperties","dynamicFilterFunc","compiledDynamicFilter","geometryNeeded","dynamicFilter","isDynamicFilter","unionDynamicBranches","collapseDynamicBooleanExpressions","collapsed","collapsedExpression","subExpression","isBranchingDynamically","isRootExpressionDynamic","dynamicConditionExpressions","Set","param","converted","convertComparisonOp","convertNegation","convertDisjunctionOp","convertInOp","convertHasOp","filters","deref","layer","refProperties","derefLayers","layers","create","ref","fontWeights","thin","hairline","light","book","regular","normal","plain","roman","standard","medium","bold","heavy","fat","poster","sp","italicRE","fontCache","fonts","size","lineHeight","cssData","weight","fontFamilies","haveWeight","haveStyle","ii","parts","maybeWeight","w","previousPart","startsWith","fontFamily","mapboxBaseUrl","getMapboxPath","url","normalizeSpriteUrl","token","styleUrl","mapboxPath","decodeURI","URL","href","sprite","normalizeStyleUrl","location","normalizeSourceUrl","tokenParam","urlObject","searchParams","set","sizeFactor","window","devicePixelRatio","functionCacheByStyleId","filterCacheByStyleId","styleId","getStyleId","glStyle","getStyleFunctionKey","olLayer","getUid","getFunctionCache","functionCache","clearFunctionCache","getFilterCache","filterCache","degrees","defaultResolutions","resolutions","res","createCanvas","width","height","WorkerGlobalScope","self","OffscreenCanvas","canvas","document","createElement","getZoomForResolution","resolution","candidate","zoomFactor","getResolutionForZoom","factor","pendingRequests","fetchResource","resourceType","metadata","request","transformedRequest","transformRequest","pendingRequest","toPromise","then","Request","headers","fetch","response","ok","json","Promise","reject","catch","getGlStyle","glStyleOrUrl","trim","resolve","accessToken","tilejsonCache","getTileJson","glSource","cacheKey","promise","tileLoadFunction","tile","src","VectorTile","setLoader","extent","projection","arrayBuffer","data","getFormat","readFeatures","featureProjection","setFeatures","setState","TileState","ERROR","img","getImage","blob","createObjectURL","addEventListener","revokeObjectURL","tiles","normalizedSourceUrl","accessTokenParam","tileJson","assign","expandUrl","tileUrl","scheme","drawIconHalo","spriteImage","spriteImageData","haloWidth","haloColor","imgSize","pixelRatio","imageCanvas","imageContext","getContext","drawImage","imageData","getImageData","globalCompositeOperation","fillStyle","jj","arc","fill","smoothstep","drawSDF","area","buffer","gamma","putImageData","hairSpacePool","applyLetterSpacing","letterSpacing","textWithLetterSpacing","lines","joinSpaceString","ll","measureContext","getMeasureContext","measureText","measureCache","wrapText","em","hardLines","wrappedText","words","oneEm","maxWidth","word","testLine","prevWidth","nextWidth","next","lineWords","lastWord","fontFamilyRegEx","stripQuotesRegEx","loadedFontFamilies","hasFontFamily","family","styleSheets","styleSheet","cssRules","rules","cssRule","cssText","processedFontFamilies","getFonts","templateUrl","fontsKey","fontDescriptions","cssFont","mb2css","registerFont","fontDescription","checkedFonts","fontUrl","querySelector","markup","rel","head","appendChild","anchor","expressionData","rawExpression","compiledExpression","emptyObj","zoomObj","renderFeatureCoordinates","renderFeature","getValue","layoutOrPaint","layerId","functions","isExpr","bind","getDeclutterMode","prefix","allowOverlap","ignorePlacement","evaluateFilter","renderTransparentEnabled","renderTransparent","enabled","colorWithOpacity","opacity","templateRegEx","fromTemplate","recordLayer","recordStyleLayer","record","styleFunctionArgs","stylefunction","sourceOrLayers","spriteData","spriteImageUrl","version","arguments","spriteImageSize","spriteImageUnSDFed","Image","blobUrl","crossOrigin","onload","changed","worker","postMessage","action","handler","event","allLayers","layersBySourceLayer","mapboxLayers","iconImageCache","patternCache","mapboxSource","source","sourceLayer","sources","textHalo","Stroke","Fill","styles","styleFunction","onlyLayer","getProperties","getGeometry","getType","getId","stylesLength","featureBelongsToLayer","layerData","layout","paint","visibility","minzoom","maxzoom","stroke","strokeColor","fillIcon","icon","getFill","getStroke","getText","Style","setZIndex","icon_cache_key","pattern","globalAlpha","createPattern","setColor","setWidth","setLineCap","setLineJoin","setMiterLimit","setLineDash","hasImage","placementAngle","iconImg","skipLabel","iconImage","styleGeom","imageElement","iconRotationAlignment","geom","getFlatMidpoint","getFlatMidpoints","getExtent","midpoint","NaN","RenderFeature","placement","stride","getStride","getFlatCoordinates","minX","minY","maxX","maxY","iconSize","iconColor","iconCacheKey","declutterMode","displacement","iconOptions","rotateWithView","Icon","offset","sdf","setGeometry","setRotation","setOpacity","setAnchor","setImage","setText","circleRadius","circleStrokeColor","circleTranslate","circleColor","circleStrokeWidth","cache_key","Circle","radius","textLineHeight","textSize","maxTextWidth","fontArray","includes","textField","reduce","acc","chunk","chunkFont","Text","padding","textTransform","wrappedLabel","setFont","textAnchor","textAlign","setPlacement","setRepeat","symbolSpacing","setOverflow","textHaloWidth","textOffset","textTranslate","vOffset","hOffset","textRotationAlignment","setRotateWithView","setMaxAngle","setTextAlign","textBaseline","setTextBaseline","textJustify","setJustify","setOffsetX","setOffsetY","setFill","halfTextSize","setStroke","textPadding","getPadding","setStyle","getStyleForLayer","evaluateStyle","getStyleFunction","hillshade","inputs","elevationImage","elevationData","shadeData","Uint8ClampedArray","dp","pixel","twoPi","halfPi","sunEl","sunAz","cosSunEl","sinSunEl","highlightColor","shadowColor","accentColor","encoding","pixelX","pixelY","x0","y0","z0","z1","dzdx","dzdy","slope","aspect","accent","scaled","shade","scaledAccentColor","compositeShadeColor","clamp","slopeScaleBase","scaledSlope","cosIncidence","calculateElevation","vert","ImageData","getTileResolutions","tileSize","createXYZ","maxZoom","getResolutions","completeOptions","applyStyle","sourceOrLayersOrOptions","optionsOrPath","sourceId","updateSource","VectorLayer","VectorTileLayer","find","assignSource","setupVectorSource","targetSource","getSource","setSource","setTileUrlFunction","getTileUrlFunction","setUrls","getUrls","format_","getAttributions","setAttributions","getTileLoadFunction","defaultLoadFunction","setTileLoadFunction","equivalent","getProjection","tileGrid","getTileGrid","isFinite","getMaxResolution","getMinZoom","setMaxResolution","setupGeoJSONSource","url_","getUrl","spriteScale","onChange","units","getUnits","METERS_PER_UNIT","applyStylefunction","webfonts","getStyle","spriteUrl","origin","pathname","search","spritesJson","transformed","setFirstBackground","mapOrLayer","Layer","setBackground","getBackgroundColor","Map","LayerGroup","getLayers","insertAt","setupBackgroundLayer","applyBackground","getSourceIdByRef","extentFromTileJSON","tileJSON","bounds","fromLonLat","tr","sourceOptionsFromTileJSON","tileJSONSource","TileJSON","tileJSONDoc","getTileJSON","projectionExtent","minZoom","sourceOptions","attributions","TileGrid","getTopLeft","getOrigin","getTileSize","urls","glLayer","background","bg","_colorWithOpacity","div","className","position","Source","render","frameState","viewState","backgroundColor","MVT","VectorTileSource","setupVectorLayer","declutter","visible","getBboxTemplate","projCode","getCode","setupRasterSource","transition","getTileUrl","tileCoord","bboxTemplate","getTileCoordExtent","setupRasterLayer","TileLayer","setupHillshadeLayer","tileLayer","ImageLayer","Raster","operationType","operation","geoJsonFormat","GeoJSON","dataProjection","geoJsonUrl","extentUrl","VectorSource","attribution","loader","failure","addFeatures","removeLoadedExtent","strategy","bboxStrategy","getUserProjection","setupGeoJSONLayer","prerenderRasterLayer","updateRasterLayerProperties","manageVisibility","mapOrGroup","layerMapboxLayerids","mapboxLayer","setVisible","on","setupLayer","glLayers","hillshadeLayer","getPointResolution","getCenter","glSourceId","processStyle","promises","view","getView","isDef","getRotation","View","maxResolution","setView","setCenter","getZoom","setResolution","fit","nearest","getSize","layerIds","debug","finalizeLayer","all","apply","mapOrGroupOrElement","HTMLElement","target","getState","sourceMinZoom","setMinResolution","getArray","once","getMapboxLayer","layerStyle","addMapboxLayer","beforeLayerId","spliceIndex","sourceIndex","beforeMapboxLayer","sourceOffset","beforeLayer","getLayer","beforeLayerIndex","sourceLayerId","layerIndex","updateMapboxLayer","findIndex","oldLayer","updateMapboxSource","currentSource","newSourcePromise","newSource","removeMapboxLayer","mapboxLayerIdOrLayer","mapboxLayerId","layerMapboxLayers","setFeatureState","state","getFeatureState","ErrorEvent","BaseEvent","EventType","MapboxVectorLayer","zIndex","minResolution","renderOrder","renderBuffer","renderMode","updateWhileAnimating","updateWhileInteracting","preload","useInterimTilesOnError","getBackground","dispatchEvent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAIA,cAAA,GAAiB;AAAA,IACnB,aAAe,EAAA;AAAA,QAAC,CAAD;AAAA,QAAG,CAAH;AAAA,QAAK,CAAL;AAAA,QAAO,CAAP;AAAA,KADI;AAAA,IACO,WAAa,EAAA;AAAA,QAAC,GAAD;AAAA,QAAK,GAAL;AAAA,QAAS,GAAT;AAAA,QAAa,CAAb;AAAA,KADpB;AAAA,IAEnB,cAAgB,EAAA;AAAA,QAAC,GAAD;AAAA,QAAK,GAAL;AAAA,QAAS,GAAT;AAAA,Q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ox.d.ts @@ -0,0 +1,34 @@ +/** + * Gets the path from a mapbox:// URL. + * @param {string} url The Mapbox URL. + * @return {string} The path. + * @private + */ +export function getMapboxPath(url: string): string; +/** + * Turns mapbox:// sprite URLs into resolvable URLs. + * @param {string} url The sprite URL. + * @param {string} token The access token. + * @param {string} styleUrl The style URL. + * @return {string} A resolvable URL. + * @private + */ +export function normalizeSpriteUrl(url: string, token: string, styleUrl: string): string; +/** + * Turns mapbox:// style URLs into resolvable URLs. + * @param {string} url The style URL. + * @param {string} token The access token. + * @return {string} A resolvable URL. + * @private + */ +export function normalizeStyleUrl(url: string, token: string): string; +/** + * Turns mapbox:// source URLs into vector tile URL templates. + * @param {string} url The source URL. + * @param {string} token The access token. + * @param {string} tokenParam The access token key. + * @param {string} styleUrl The style URL. + * @return {string} A vector tile template. + * @private + */ +export function normalizeSourceUrl(url: string, token: string, tokenParam: string, styleUrl: string): string; diff --git a/dist/olms.js b/dist/olms.js new file mode 100644 index 00000000..bb49c5fa --- /dev/null +++ b/dist/olms.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ol/style/Circle.js"),require("ol/style/Fill.js"),require("ol/style/Icon.js"),require("ol/render/Feature.js"),require("ol/style/Stroke.js"),require("ol/style/Style.js"),require("ol/style/Text.js"),require("ol/functions.js"),require("ol/render/canvas.js"),require("ol/TileState.js"),require("ol"),require("ol/tileurlfunction.js"),require("ol/util.js"),require("ol/format/GeoJSON.js"),require("ol/layer/Image.js"),require("ol/layer/Layer.js"),require("ol/layer/Group.js"),require("ol/format/MVT.js"),require("ol/Map.js"),require("ol/source/Raster.js"),require("ol/source/Source.js"),require("ol/tilegrid/TileGrid.js"),require("ol/source/TileJSON.js"),require("ol/layer/Tile.js"),require("ol/layer/Vector.js"),require("ol/source/Vector.js"),require("ol/layer/VectorTile.js"),require("ol/source/VectorTile.js"),require("ol/View.js"),require("ol/proj/Units.js"),require("ol/loadingstrategy.js"),require("ol/tilegrid.js"),require("ol/proj.js"),require("ol/extent.js"),require("ol/events/Event.js"),require("ol/events/EventType.js")):"function"==typeof define&&define.amd?define(["exports","ol/style/Circle.js","ol/style/Fill.js","ol/style/Icon.js","ol/render/Feature.js","ol/style/Stroke.js","ol/style/Style.js","ol/style/Text.js","ol/functions.js","ol/render/canvas.js","ol/TileState.js","ol","ol/tileurlfunction.js","ol/util.js","ol/format/GeoJSON.js","ol/layer/Image.js","ol/layer/Layer.js","ol/layer/Group.js","ol/format/MVT.js","ol/Map.js","ol/source/Raster.js","ol/source/Source.js","ol/tilegrid/TileGrid.js","ol/source/TileJSON.js","ol/layer/Tile.js","ol/layer/Vector.js","ol/source/Vector.js","ol/layer/VectorTile.js","ol/source/VectorTile.js","ol/View.js","ol/proj/Units.js","ol/loadingstrategy.js","ol/tilegrid.js","ol/proj.js","ol/extent.js","ol/events/Event.js","ol/events/EventType.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).olms={},e.ol.style.Circle,e.ol.style.Fill,e.ol.style.Icon,e.ol.render.Feature,e.ol.style.Stroke,e.ol.style.Style,e.ol.style.Text,e.ol.functions,e.ol.render.canvas,e.ol.TileState,e.ol,e.ol.tileurlfunction,e.ol.util,e.ol.format.GeoJSON,e.ol.layer.Image,e.ol.layer.Layer,e.ol.layer.Group,e.ol.format.MVT,e.ol.Map,e.ol.source.Raster,e.ol.source.Source,e.ol.tilegrid.TileGrid,e.ol.source.TileJSON,e.ol.layer.Tile,e.ol.layer.Vector,e.ol.source.Vector,e.ol.layer.VectorTile,e.ol.source.VectorTile,e.ol.View,e.ol.proj.Units,e.ol.loadingstrategy,e.ol.tilegrid,e.ol.proj,e.ol.extent,e.ol.events.Event,e.ol.events.EventType)}(this,(function(e,t,r,n,o,i,a,s,l,u,p,c,f,d,m,y,h,g,v,b,x,w,k,z,M,j,S,q,T,E,$,_,C,A,I,F,P){"use strict";function L(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var O=L(t),D=L(r),R=L(n),N=L(o),U=L(i),V=L(a),G=L(s),J=L(p),W=L(m),Z=L(y),B=L(h),X=L(g),H=L(v),Y=L(b),K=L(x),Q=L(w),ee=L(k),te=L(z),re=L(M),ne=L(j),oe=L(S),ie=L(q),ae=L(T),se=L(E),le=L(F),ue=L(P);function pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ce,fe={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function de(e){return(e=Math.round(e))<0?0:e>255?255:e}function me(e){return e<0?0:e>1?1:e}function ye(e){return"%"===e[e.length-1]?de(parseFloat(e)/100*255):de(parseInt(e))}function he(e){return"%"===e[e.length-1]?me(parseFloat(e)/100):me(parseFloat(e))}function ge(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{ce={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in fe)return fe[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),o=r.indexOf(")");if(-1!==n&&o+1===r.length){var i=r.substr(0,n),a=r.substr(n+1,o-(n+1)).split(","),s=1;switch(i){case"rgba":if(4!==a.length)return null;s=he(a.pop());case"rgb":return 3!==a.length?null:[ye(a[0]),ye(a[1]),ye(a[2]),s];case"hsla":if(4!==a.length)return null;s=he(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=he(a[1]),p=he(a[2]),c=p<=.5?p*(u+1):p+u-p*u,f=2*p-c;return[de(255*ge(f,c,l+1/3)),de(255*ge(f,c,l)),de(255*ge(f,c,l-1/3)),s];default:return null}}return null}}catch(e){}class ve{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(e){if(!e)return;if(e instanceof ve)return e;if("string"!=typeof e)return;const t=ce(e);return t?new ve(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,r,n]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${n})`}toArray(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[e/n,t/n,r/n,n]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}}ve.black=new ve(0,0,0,1),ve.white=new ve(1,1,1,1),ve.transparent=new ve(0,0,0,0),ve.red=new ve(1,0,0,1),ve.blue=new ve(0,0,1,1);var be=ve;function xe(e){return"object"==typeof e?["literal",e]:e}function we(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,xe(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,i=n||!o;return r=r.map((e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],Te(e[1])]:[e[0],xe(e[1])])),n?function(e,t,r){const n={},o={},i=[];for(let t=0;t3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function qe(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function Te(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const i=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,i.length>0&&t.push(i),t.push(["get",o[1]])}if(1===t.length)return e;if(n`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Je=[Ae,Ie,Fe,Pe,Le,Ne,Oe,Ve(De),Ue];function We(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!We(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Je)if(!We(e,t))return null}return`Expected ${Ge(e)} but found ${Ge(t)} instead.`}function Ze(e,t){return t.some((t=>t.kind===e.kind))}function Be(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class Xe{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class He{constructor(e,t,r,n,o){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o}}class Ye{constructor(e){this.sections=e}static fromString(e){return new Ye([new He(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Ye?e:Ye.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class Ke{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ke({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Qe(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function et(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof be)return!0;if(e instanceof Xe)return!0;if(e instanceof Ye)return!0;if(e instanceof Ke)return!0;if(Array.isArray(e)){for(const t of e)if(!et(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!et(e[t]))return!1;return!0}return!1}function tt(e){if(null===e)return Ae;if("string"==typeof e)return Fe;if("boolean"==typeof e)return Pe;if("number"==typeof e)return Ie;if(e instanceof be)return Le;if(e instanceof Xe)return Re;if(e instanceof Ye)return Ne;if(e instanceof Ke)return Ue;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=tt(t);if(r){if(r===e)continue;r=De;break}r=e}return Ve(r||De,t)}return Oe}function rt(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof be||e instanceof Ye||e instanceof Ke?e.toString():JSON.stringify(e)}class nt{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!et(e[1]))return t.error("invalid value");const r=e[1];let n=tt(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new nt(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof be?["rgba"].concat(this.value.toArray()):this.value instanceof Ye?this.value.serialize():this.value}}var ot=nt;var it=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};const at={string:Fe,number:Ie,boolean:Pe,object:Oe};class st{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,i;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in at)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=at[r],n++}else o=De;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);i=e[2],n++}r=Ve(o,i)}else r=at[o];const i=[];for(;ne.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((e=>e.serialize())))}}var lt=st;class ut{constructor(e){this.type=Ne,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const i=e[r];if(o&&"object"==typeof i&&!Array.isArray(i)){o=!1;let e=null;if(i["font-scale"]&&(e=t.parse(i["font-scale"],1,Ie),!e))return null;let r=null;if(i["text-font"]&&(r=t.parse(i["text-font"],1,Ve(Fe)),!r))return null;let a=null;if(i["text-color"]&&(a=t.parse(i["text-color"],1,Le),!a))return null;const s=n[n.length-1];s.scale=e,s.font=r,s.textColor=a}else{const i=t.parse(e[r],1,De);if(!i)return null;const a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new ut(n)}evaluate(e){return new Ye(this.sections.map((t=>{const r=t.content.evaluate(e);return tt(r)===Ue?new He("",r,null,null,null):new He(rt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class pt{constructor(e){this.type=Ue,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Fe);return r?new pt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=Ke.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const ct={"to-boolean":Pe,"to-color":Le,"to-number":Ie,"to-string":Fe};class ft{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=ct[r],o=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Qe(t[0],t[1],t[2],t[3]),!r))return new be(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new it(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new it(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Ye.fromString(rt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Ke.fromString(rt(this.args[0].evaluate(e))):rt(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new ut([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new pt(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}var dt=ft;const mt=["Unknown","Point","LineString","Polygon"];var yt=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?mt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord,o=r*t-e[0],i=n*t-e[1];return this.featureDistanceData.bearing[0]*o+this.featureDistanceData.bearing[1]*i}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=be.parse(e)),t}};class ht{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],n=ht.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,i=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=i.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[n,i]of a){s=new Gt(t.registry,t.path,null,t.scope);const a=[];let l=!1;for(let t=1;t{return t=e,Array.isArray(t)?`(${t.map(Ge).join(", ")})`:`(${Ge(t.type)}...)`;var t})).join(" | "),n=[];for(let r=1;r=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function kt(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const i=Math.pow(2,t.z);return[Math.round(r*i*bt),Math.round(n*i*bt)]}function zt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],i=e[0]-r[0],a=e[1]-r[1];return n*a-i*o==0&&n*i<=0&&o*a<=0}function Mt(e,t){let r=!1;for(let a=0,s=t.length;an[1]!=i[1]>n[1]&&n[0]<(i[0]-o[0])*(n[1]-o[1])/(i[1]-o[1])+o[0]&&(r=!r)}}var n,o,i;return r}function jt(e,t){for(let r=0;r0&&c<0||p<0&&c>0}function qt(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],i=[n[0]-r[0],n[1]-r[1]];return 0!=(a=i)[0]*(s=o)[1]-a[1]*s[0]&&!(!St(e,t,r,n)||!St(r,n,e,t));var a,s}function Tt(e,t,r){for(const n of r)for(let r=0;rr[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}xt(t,e)}function It(e,t,r,n){const o=Math.pow(2,n.z)*bt,i=[n.x*bt,n.y*bt],a=[];if(!e)return a;for(const n of e)for(const e of n){const n=[e.x+i[0],e.y+i[1]];At(n,t,r,o),a.push(n)}return a}function Ft(e,t,r,n){const o=Math.pow(2,n.z)*bt,i=[n.x*bt,n.y*bt],a=[];if(!e)return a;for(const r of e){const e=[];for(const n of r){const r=[n.x+i[0],n.y+i[1]];xt(t,r),e.push(r)}a.push(e)}if(t[2]-t[0]<=o/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const n of e)At(n,t,r,o)}var s;return a}class Pt{constructor(e,t){this.type=Pe,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(et(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e{t&&!Ot(e)&&(t=!1)})),t}function Dt(e){if(e instanceof gt&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Dt(e)&&(t=!1)})),t}function Rt(e,t){if(e instanceof gt&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!Rt(e,t)&&(r=!1)})),r}class Nt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Nt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Ut=Nt;class Vt{constructor(e,t=[],r,n=new Ce,o=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=n,this.errors=o,this.expectedType=r}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new lt(t,[e]):"coerce"===r?new dt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof ot)&&"resolvedImage"!==n.type.kind&&Jt(n)){const e=new yt;try{n=new ot(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new Vt(this.registry,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new $e(r,e))}checkSubtype(e,t){const r=We(e,t);return r&&this.error(r),r}}var Gt=Vt;function Jt(e){if(e instanceof Ut)return Jt(e.boundExpression);if(e instanceof gt&&"error"===e.name)return!1;if(e instanceof vt)return!1;if(e instanceof Lt)return!1;const t=e instanceof dt||e instanceof lt;let r=!0;return e.eachChild((e=>{r=t?r&&Jt(e):r&&e instanceof ot})),!!r&&(Ot(e)&&Rt(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Wt(e,t){const r=e.length-1;let n,o,i=0,a=r,s=0;for(;i<=a;)if(s=Math.floor((i+a)/2),n=e[s],o=e[s+1],n<=t){if(s===r||tt))throw new it("Input is not a number.");a=s-1}return 0}class Zt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,Ie);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r=i)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(a,l,o);if(!u)return null;o=o||u.type,n.push([i,u])}return new Zt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[Wt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var Bt=Zt,Xt=Ht;function Ht(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}Ht.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},Ht.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},Ht.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},Ht.prototype.solveCurveX=function(e,t){var r,n,o,i,a;for(void 0===t&&(t=1e-6),o=e,a=0;a<8;a++){if(i=this.sampleCurveX(o)-e,Math.abs(i)(n=1))return n;for(;ri?r=o:n=o,o=.5*(n-r)+r}return o},Ht.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var Yt=pe(Xt);function Kt(e,t,r){return e*(1-r)+t*r}var Qt=Object.freeze({__proto__:null,number:Kt,color:function(e,t,r){return new be(Kt(e.r,t.r,r),Kt(e.g,t.g,r),Kt(e.b,t.b,r),Kt(e.a,t.a,r))},array:function(e,t,r){return e.map(((e,n)=>Kt(e,t[n],r)))}});const er=.95047,tr=1,rr=1.08883,nr=4/29,or=6/29,ir=3*or*or,ar=or*or*or,sr=Math.PI/180,lr=180/Math.PI;function ur(e){return e>ar?Math.pow(e,1/3):e/ir+nr}function pr(e){return e>or?e*e*e:ir*(e-nr)}function cr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function fr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dr(e){const t=fr(e.r),r=fr(e.g),n=fr(e.b),o=ur((.4124564*t+.3575761*r+.1804375*n)/er),i=ur((.2126729*t+.7151522*r+.072175*n)/tr);return{l:116*i-16,a:500*(o-i),b:200*(i-ur((.0193339*t+.119192*r+.9503041*n)/rr)),alpha:e.a}}function mr(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=tr*pr(t),r=er*pr(r),n=rr*pr(n),new be(cr(3.2404542*r-1.5371385*t-.4985314*n),cr(-.969266*r+1.8760108*t+.041556*n),cr(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function yr(e,t,r){const n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const hr={forward:dr,reverse:mr,interpolate:function(e,t,r){return{l:Kt(e.l,t.l,r),a:Kt(e.a,t.a,r),b:Kt(e.b,t.b,r),alpha:Kt(e.alpha,t.alpha,r)}}},gr={forward:function(e){const{l:t,a:r,b:n}=dr(e),o=Math.atan2(n,r)*lr;return{h:o<0?o+360:o,c:Math.sqrt(r*r+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*sr,r=e.c;return mr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:yr(e.h,t.h,r),c:Kt(e.c,t.c,r),l:Kt(e.l,t.l,r),alpha:Kt(e.alpha,t.alpha,r)}}};class vr{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=br(t,e.base,r,n);else if("linear"===e.name)o=br(t,1,r,n);else if("cubic-bezier"===e.name){const i=e.controlPoints;o=new Yt(i[0],i[1],i[2],i[3]).solve(br(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...i]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,Ie),!o)return null;const a=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=Le:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,a.push([r,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new vr(s,r,n,o,a):t.error(`Type ${Ge(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const i=Wt(t,n),a=t[i],s=t[i+1],l=vr.interpolationFactor(this.interpolation,n,a,s),u=r[i].evaluate(e),p=r[i+1].evaluate(e);return"interpolate"===this.operator?Qt[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?gr.reverse(gr.interpolate(gr.forward(u),gr.forward(p),l)):hr.reverse(hr.interpolate(hr.forward(u),hr.forward(p),l))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;eWe(n,e.type)));return new wr(i?De:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args){if(n++,r=o.evaluate(e),r&&r instanceof Ke&&!r.available&&(t||(t=r),r=null,n===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var kr=wr;class zr{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n=r.length)throw new it(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new it(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Sr=jr;class qr{constructor(e,t){this.type=Pe,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,De),n=t.parse(e[2],2,De);return r&&n?Ze(r.type,[Pe,Fe,Ie,Ae,De])?new qr(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!Be(t,["boolean","string","number","null"]))throw new it(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(tt(t))} instead.`);if(!Be(r,["string","array"]))throw new it(`Expected second argument to be of type array or string, but found ${Ge(tt(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Tr=qr;class Er{constructor(e,t,r){this.type=Ie,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,De),n=t.parse(e[2],2,De);if(!r||!n)return null;if(!Ze(r.type,[Pe,Fe,Ie,Ae,De]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Ie);return o?new Er(r,n,o):null}return new Er(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Be(t,["boolean","string","number","null"]))throw new it(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(tt(t))} instead.`);if(!Be(r,["string","array"]))throw new it(`Expected second argument to be of type array or string, but found ${Ge(tt(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var $r=Er;class _r{constructor(e,t,r,n,o,i){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=i}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},i=[];for(let a=2;aNumber.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,tt(e)))return null}else r=tt(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=i.length}const p=t.parse(l,a,n);if(!p)return null;n=n||p.type,i.push(p)}const a=t.parse(e[1],1,De);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(r,a.type)?null:new _r(r,n,a,o,i,s):null}evaluate(e){const t=this.input.evaluate(e);return(tt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const o=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of r)1===n.length?e.push(o(n[0])):e.push(n.map(o)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}var Cr=_r;class Ar{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;ot.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var Ir=Ar;class Fr{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,De),n=t.parse(e[2],2,Ie);if(!r||!n)return null;if(!Ze(r.type,[Ve(De),Fe,De]))return t.error(`Expected first argument to be of type array or string, but found ${Ge(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Ie);return o?new Fr(r.type,r,n,o):null}return new Fr(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Be(t,["string","array"]))throw new it(`Expected first argument to be of type array or string, but found ${Ge(tt(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Pr=Fr;function Lr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Or(e,t,r,n){return 0===n.compare(t,r)}function Dr(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=Pe,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let i=t.parse(e[1],1,De);if(!i)return null;if(!Lr(r,i.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${Ge(i.type)}'.`);let a=t.parse(e[2],2,De);if(!a)return null;if(!Lr(r,a.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${Ge(a.type)}'.`);if(i.type.kind!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${Ge(i.type)}' and '${Ge(a.type)}'.`);n&&("value"===i.type.kind&&"value"!==a.type.kind?i=new lt(a.type,[i]):"value"!==i.type.kind&&"value"===a.type.kind&&(a=new lt(i.type,[a])));let s=null;if(4===e.length){if("string"!==i.type.kind&&"string"!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,Re),!s)return null}return new o(i,a,s)}evaluate(o){const i=this.lhs.evaluate(o),a=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=tt(i),r=tt(a);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new it(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=tt(i),r=tt(a);if("string"!==e.kind||"string"!==r.kind)return t(o,i,a)}return this.collator?r(o,i,a,this.collator.evaluate(o)):t(o,i,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const Rr=Dr("==",(function(e,t,r){return t===r}),Or),Nr=Dr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Or(0,t,r,n)})),Ur=Dr("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Gr=Dr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Jr=Dr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Wr{constructor(e,t,r,n,o,i){this.type=Fe,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Ie);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,Fe),!o))return null;let i=null;if(n.currency&&(i=t.parse(n.currency,1,Fe),!i))return null;let a=null;if(n.unit&&(a=t.parse(n.unit,1,Fe),!a))return null;let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,Ie),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,Ie),!l)?null:new Wr(r,o,i,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Zr{constructor(e){this.type=Ie,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${Ge(r.type)} instead.`):new Zr(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new it(`Expected value to be of type string or array, but found ${Ge(tt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Br={"==":Rr,"!=":Nr,">":Vr,"<":Ur,">=":Jr,"<=":Gr,array:lt,at:Sr,boolean:lt,case:Ir,coalesce:kr,collator:vt,format:ut,image:pt,in:Tr,"index-of":$r,interpolate:xr,"interpolate-hcl":xr,"interpolate-lab":xr,length:Zr,let:Mr,literal:ot,match:Cr,number:lt,"number-format":Wr,object:lt,slice:Pr,step:Bt,string:lt,"to-boolean":dt,"to-color":dt,"to-number":dt,"to-string":dt,var:Ut,within:Lt};function Xr(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const i=o?o.evaluate(e):1,a=Qe(t,r,n,i);if(a)throw new it(a);return new be(t/255*i,r/255*i,n/255*i,i)}function Hr(e,t){return e in t}function Yr(e,t){const r=t[e];return void 0===r?null:r}function Kr(e){return{type:e}}gt.register(Br,{error:[{kind:"error"},[Fe],(e,[t])=>{throw new it(t.evaluate(e))}],typeof:[Fe,[De],(e,[t])=>Ge(tt(t.evaluate(e)))],"to-rgba":[Ve(Ie,4),[Le],(e,[t])=>t.evaluate(e).toArray()],rgb:[Le,[Ie,Ie,Ie],Xr],rgba:[Le,[Ie,Ie,Ie,Ie],Xr],has:{type:Pe,overloads:[[[Fe],(e,[t])=>Hr(t.evaluate(e),e.properties())],[[Fe,Oe],(e,[t,r])=>Hr(t.evaluate(e),r.evaluate(e))]]},get:{type:De,overloads:[[[Fe],(e,[t])=>Yr(t.evaluate(e),e.properties())],[[Fe,Oe],(e,[t,r])=>Yr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[De,[Fe],(e,[t])=>Yr(t.evaluate(e),e.featureState||{})],properties:[Oe,[],e=>e.properties()],"geometry-type":[Fe,[],e=>e.geometryType()],id:[De,[],e=>e.id()],zoom:[Ie,[],e=>e.globals.zoom],pitch:[Ie,[],e=>e.globals.pitch||0],"distance-from-center":[Ie,[],e=>e.distanceFromCenter()],"heatmap-density":[Ie,[],e=>e.globals.heatmapDensity||0],"line-progress":[Ie,[],e=>e.globals.lineProgress||0],"sky-radial-progress":[Ie,[],e=>e.globals.skyRadialProgress||0],accumulated:[De,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Ie,Kr(Ie),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[Ie,Kr(Ie),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:Ie,overloads:[[[Ie,Ie],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Ie],(e,[t])=>-t.evaluate(e)]]},"/":[Ie,[Ie,Ie],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Ie,[Ie,Ie],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Ie,[],()=>Math.LN2],pi:[Ie,[],()=>Math.PI],e:[Ie,[],()=>Math.E],"^":[Ie,[Ie,Ie],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Ie,[Ie],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Ie,[Ie],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Ie,[Ie],(e,[t])=>Math.log(t.evaluate(e))],log2:[Ie,[Ie],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Ie,[Ie],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Ie,[Ie],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Ie,[Ie],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Ie,[Ie],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Ie,[Ie],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Ie,[Ie],(e,[t])=>Math.atan(t.evaluate(e))],min:[Ie,Kr(Ie),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Ie,Kr(Ie),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Ie,[Ie],(e,[t])=>Math.abs(t.evaluate(e))],round:[Ie,[Ie],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ie,[Ie],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Ie,[Ie],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Pe,[Fe,De],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[Pe,[De],(e,[t])=>e.id()===t.value],"filter-type-==":[Pe,[Fe],(e,[t])=>e.geometryType()===t.value],"filter-<":[Pe,[Fe,De],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n{const r=e.id(),n=t.value;return typeof r==typeof n&&r":[Pe,[Fe,De],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[Pe,[De],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Pe,[Fe,De],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Pe,[De],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Pe,[Fe,De],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Pe,[De],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Pe,[De],(e,[t])=>t.value in e.properties()],"filter-has-id":[Pe,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Pe,[Ve(Fe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Pe,[Ve(De)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Pe,[Fe,Ve(De)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Pe,[Fe,Ve(De)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Pe,overloads:[[[Pe,Pe],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Kr(Pe),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:Pe,overloads:[[[Pe,Pe],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Kr(Pe),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[Pe,[Pe],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Pe,[Fe],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Fe,[Fe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Fe,[Fe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Fe,Kr(De),(e,t)=>t.map((t=>rt(t.evaluate(e)))).join("")],"resolved-locale":[Fe,[Re],(e,[t])=>t.evaluate(e).resolvedLocale()]});var Qr=Br;function en(e){return{result:"success",value:e}}function tn(e){return{result:"error",value:e}}function rn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}class nn{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new yt,this._defaultValue=t?function(e){return"color"===e.type&&(rn(e.default)||Array.isArray(e.default))?new be(0,0,0,0):"color"===e.type?be.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,o,i,a,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=i,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,i,a,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=i||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new it(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function on(e,t){const r=new Gt(Qr,[],t?function(e){const t={color:Le,string:Fe,number:Ie,enum:Fe,boolean:Pe,formatted:Ne,resolvedImage:Ue};if("array"===e.type)return Ve(t[e.value]||De,e.length);return t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?en(new nn(n,t)):tn(r.errors)}class an{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Dt(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,o,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,i)}evaluate(e,t,r,n,o,i){return this._styleExpression.evaluate(e,t,r,n,o,i)}}class sn{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Dt(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,o,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,i)}evaluate(e,t,r,n,o,i){return this._styleExpression.evaluate(e,t,r,n,o,i)}interpolationFactor(e,t,r){return this.interpolationType?xr.interpolationFactor(this.interpolationType,e,t,r):0}}function ln(e,t){if("error"===(e=on(e,t)).result)return e;const r=e.value.expression,n=Ot(r);if(!n&&!function(e){return"data-driven"===e["property-type"]}(t))return tn([new $e("","data expressions not supported")]);const o=Rt(r,["zoom","pitch","distance-from-center"]);if(!o&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return tn([new $e("","zoom expressions not supported")]);const i=un(r);if(!i&&!o)return tn([new $e("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(i instanceof $e)return tn([i]);if(i instanceof xr&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return tn([new $e("",'"interpolate" expressions cannot be used with this property')]);if(!i)return en(new an(n?"constant":"source",e.value));const a=i instanceof xr?i.interpolation:void 0;return en(new sn(n?"camera":"composite",e.value,i.labels,a))}function un(e){let t=null;if(e instanceof Mr)t=un(e.result);else if(e instanceof kr){for(const r of e.args)if(t=un(r),t)break}else(e instanceof Bt||e instanceof xr)&&e.input instanceof gt&&"zoom"===e.input.name&&(t=e);return t instanceof $e||e.eachChild((e=>{const r=un(e);r instanceof $e?t=r:!t&&r?t=new $e("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new $e("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function pn(e){if(Array.isArray(e))return e.map(pn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=pn(e[r]);return t}return function(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}(e)}var cn={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["source"]}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["fill-extrusion-edge-radius"]}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function fn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!fn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function dn(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};fn(e)||(e=xn(e));const r=e;let n=!0;try{n=function(e){if(!hn(e))return e;let t=pn(e);return yn(t),t=mn(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const o=cn[`filter_${t}`],i=on(n,o);let a=null;if("error"===i.result)throw new Error(i.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(e,t,r)=>i.value.evaluate(e,t,{},r);let s=null,l=null;if(n!==r){const e=on(r,o);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(t,r,n,o,i)=>e.value.evaluate(t,r,{},n,void 0,void 0,o,i),l=!Ot(e.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:bn(n),needFeature:!!l}}function mn(e){if(!Array.isArray(e))return e;const t=function(e){if(gn.has(e[0]))for(let t=1;tmn(e)))}function yn(e){let t=!1;const r=[];if("case"===e[0]){for(let n=1;n",">=","<","<=","to-boolean"]);function vn(e,t){return et?1:0}function bn(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?wn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(xn))):"all"===t?["all"].concat(e.slice(1).map(xn)):"none"===t?["all"].concat(e.slice(1).map(xn).map(Mn)):"in"===t?kn(e[1],e.slice(2)):"!in"===t?Mn(kn(e[1],e.slice(2))):"has"===t?zn(e[1]):"!has"===t?Mn(zn(e[1])):"within"!==t||e}function wn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function kn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(vn)]]:["filter-in-small",e,["literal",t]]}}function zn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Mn(e){return["!",e]}var jn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Sn(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return jn.forEach((e=>{e in t&&(r[e]=t[e])})),r}function qn(e){e=e.slice();const t=Object.create(null);for(let r=0;r1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){a=o?a:Tn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(a=f,o=!0);var y=c.join(En).replace("Klokantech Noto Sans","Noto Sans");-1!==y.indexOf(En)&&(y='"'+y+'"'),l.push(y)}n=_n[e]=[s,a,l]}return n[0]+En+n[1]+En+t+"px"+(r?"/"+r:"")+En+n[2]}));const An="https://api.mapbox.com";function In(e){const t="mapbox://";return 0!==e.indexOf(t)?"":e.slice(9)}function Fn(e,t){const r=In(e);if(!r)return decodeURI(new URL(e,location.href).href);const n="styles/";if(0!==r.indexOf(n))throw new Error(`unexpected style url: ${e}`);const o=r.slice(7);return`${An}/styles/v1/${o}?&access_token=${t}`}function Pn(e,t,r,n){const o=new URL(e,n),i=In(e);if(!i)return t?(o.searchParams.has(r)||o.searchParams.set(r,t),decodeURI(o.href)):decodeURI(o.href);if("mapbox.satellite"===i){return`https://api.mapbox.com/v4/${i}/{z}/{x}/{y}${window.devicePixelRatio>=1.5?"@2x":""}.webp?access_token=${t}`}return`https://{a-d}.tiles.mapbox.com/v4/${i}/{z}/{x}/{y}.vector.pbf?access_token=${t}`}const Ln={},On={};let Dn=0;function Rn(e){return e.id||(e.id=Dn++),e.id}function Nn(e,t){return Rn(e)+"."+d.getUid(t)}function Un(e){let t=Ln[e.id];return t||(t={},Ln[Rn(e)]=t),t}function Vn(e){let t=On[e.id];return t||(t={},On[Rn(e)]=t),t}function Gn(e){return e*Math.PI/180}const Jn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Wn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Zn(e,t){let r=0;const n=t.length;for(;ro)).then((e=>(e instanceof Request||(e=new Request(e)),e.headers.get("Accept")||e.headers.set("Accept","application/json"),n&&(n.request=e),fetch(e).then((function(e){return delete Xn[t],e.ok?e.json():Promise.reject(new Error("Error fetching source "+t))})).catch((function(e){return delete Xn[t],Promise.reject(new Error("Error fetching source "+t))})))));return Xn[t]=[o,i],i}function Yn(e,t){if("string"!=typeof e)return Promise.resolve(e);if(!e.trim().startsWith("{"))return Hn("Style",e=Fn(e,t.accessToken),t);try{const t=JSON.parse(e);return Promise.resolve(t)}catch(e){return Promise.reject(e)}}const Kn={};function Qn(e,t,r={}){const n=[t,JSON.stringify(e)].toString();let o=Kn[n];if(!o||r.transformRequest){let i;r.transformRequest&&(i=(e,t)=>{const n=r.transformRequest&&r.transformRequest(t,"Tiles")||t;if(e instanceof c.VectorTile)e.setLoader(((t,r,o)=>{l.toPromise((()=>n)).then((r=>{fetch(r).then((e=>e.arrayBuffer())).then((r=>{const n=e.getFormat().readFeatures(r,{extent:t,featureProjection:o});e.setFeatures(n)})).catch((t=>e.setState(J.default.ERROR)))}))}));else{const t=e.getImage();l.toPromise((()=>n)).then((r=>{r instanceof Request?fetch(r).then((e=>e.blob())).then((e=>{const r=URL.createObjectURL(e);t.addEventListener("load",(()=>URL.revokeObjectURL(r))),t.addEventListener("error",(()=>URL.revokeObjectURL(r))),t.src=r})).catch((t=>e.setState(J.default.ERROR))):t.src=r}))}});const a=e.url;if(a&&!e.tiles){const n=Pn(a,r.accessToken,r.accessTokenParam||"access_token",t||location.href);if(a.startsWith("mapbox://"))o=Promise.resolve({tileJson:Object.assign({},e,{url:void 0,tiles:f.expandUrl(n)}),tileLoadFunction:i});else{const e={};o=Hn("Source",n,r,e).then((function(t){return t.tiles=t.tiles.map((function(n){return"tms"===t.scheme&&(n=n.replace("{y}","{-y}")),Pn(n,r.accessToken,r.accessTokenParam||"access_token",e.request.url)})),Promise.resolve({tileJson:t,tileLoadFunction:i})}))}}else e=Object.assign({},e,{tiles:e.tiles.map((function(n){return"tms"===e.scheme&&(n=n.replace("{y}","{-y}")),Pn(n,r.accessToken,r.accessTokenParam||"access_token",t||location.href)}))}),o=Promise.resolve({tileJson:Object.assign({},e),tileLoadFunction:i});Kn[n]=o}return o}function eo(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],i=Wn(o[0],o[1]),a=i.getContext("2d");a.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=a.getImageData(0,0,o[0],o[1]);a.globalCompositeOperation="destination-over",a.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e0&&a.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return a.fill(),i}function to(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function ro(e,t,r){const n=Wn(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const i=o.getImageData(0,0,t.width,t.height),a=i.data;for(let e=0,t=i.width;e0?(a[o+0]=Math.round(255*r.r*l),a[o+1]=Math.round(255*r.g*l),a[o+2]=Math.round(255*r.b*l),a[o+3]=Math.round(255*l)):a[o+3]=0}return o.putImageData(i,0,0),n}const no=Array(256).join(" ");function oo(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=no.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let io;function ao(){return io||(io=Wn(1,1).getContext("2d")),io}function so(e,t){return ao().measureText(e).width+(e.length-1)*t}const lo={};function uo(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),i=[];for(let e=0,a=o.length;e1){const e=ao();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=a.length;e1;++e){const r=l[e];if(so(r,n)<.35*o){const o=e>0?so(l[e-1],n):1/0,i=e.7*o&&so(i,n)<.6*o){const a=r.split(" "),s=a.pop();so(s,n)<.2*o&&(l[e]=a.join(" "),l[e+1]=s+" "+i),t-=1}}i=l.join("\n")}else i=e;i=oo(i,n),lo[o]=i}return i}const po=/font-family: ?([^;]*);/,co=/("|')/g;let fo;function mo(e){if(!fo){fo={};const e=document.styleSheets;for(let t=0,r=e.length;t`${e.key}: ${e.message}`)).join(", "));return r.value},bo={},xo={zoom:0};let wo,ko;function zo(e,t,r,n,o,i,a){const s=e.id;i||(i={},console.warn("No functionCache provided to getValue()")),i[s]||(i[s]={});const l=i[s];if(!l[r]){let n=(e[t]||bo)[r];const o=cn[`${t}_${e.type}`][r];void 0===n&&(n=o.default);let i=(u=n,Array.isArray(u)&&u.length>0&&"string"==typeof u[0]&&u[0]in Qr);if(!i&&rn(n)&&(n=we(n,o),i=!0),i){const e=vo(n,o);l[r]=e.evaluate.bind(e)}else"color"==o.type&&(n=be.parse(n)),l[r]=function(){return n}}var u;return xo.zoom=n,l[r](xo,o,a)}function Mo(e,t,r,n,o){if(!zo(e,"layout",`${n}-allow-overlap`,t,r,o))return"declutter";return zo(e,"layout",`${n}-ignore-placement`,t,r,o)?"none":"obstacle"}function jo(e,t,r,n,o){return o||console.warn("No filterCache provided to evaluateFilter()"),e in o||(o[e]=dn(t).filter),xo.zoom=n,o[e](xo,r)}let So=!1;function qo(e,t){if(e){if(!So&&(0===e.a||0===t))return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const To=/\{[^{}}]*\}/g;function Eo(e,t){return e.replace(To,(function(e){return t[e.slice(1,-1)]||""}))}let $o=!1;const _o={};function Co(e,t,r,n=Jn,o=void 0,i=void 0,a=void 0,s=void 0){if("string"==typeof t&&(t=JSON.parse(t)),8!=t.version)throw new Error("glStyle version 8 required.");let u,p,c;if(_o[Nn(t,e)]=Array.from(arguments),i)if("undefined"!=typeof Image){const t=new Image;let r;l.toPromise((()=>i)).then((e=>{e instanceof Request?fetch(e).then((e=>e.blob())).then((e=>{r=URL.createObjectURL(e),t.src=r})).catch((()=>{})):(t.crossOrigin="anonymous",t.src=e,r&&URL.revokeObjectURL(r))})),t.onload=function(){u=t,p=[t.width,t.height],e.changed(),t.onload=null}}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const e=self;e.postMessage({action:"loadImage",src:i}),e.addEventListener("message",(function(e){"imageLoaded"===e.data.action&&e.data.src===i&&(u=e.data.image,p=[u.width,u.height])}))}const f=qn(t.layers),d={},m=[],y={},h={},g=Un(t),v=Vn(t);let b;for(let e=0,n=f.length;e=T.maxzoom)continue;const C=T.filter;if(!C||jo(E,C,M,b,v)){let n,l,m,v,E,C;S=T;const A=d.index;if(3==z&&("fill"==T.type||"fill-extrusion"==T.type))if(l=zo(T,"paint",T.type+"-opacity",b,M,g,j),T.type+"-pattern"in _){const e=zo(T,"paint",T.type+"-pattern",b,M,g,j);if(e){const t="string"==typeof e?Eo(e,f):e.toString();if(u&&o&&o[t]){++q,C=k[q],C&&C.getFill()&&!C.getStroke()&&!C.getText()||(C=new V.default({fill:new D.default}),k[q]=C),m=C.getFill(),C.setZIndex(A);const e=t+"."+l;let r=h[e];if(!r){const n=o[t],i=Wn(n.width,n.height),a=i.getContext("2d");a.globalAlpha=l,a.drawImage(u,n.x,n.y,n.width,n.height,0,0,n.width,n.height),r=a.createPattern(i,"repeat"),h[e]=r}m.setColor(r)}}}else n=qo(zo(T,"paint",T.type+"-color",b,M,g,j),l),T.type+"-outline-color"in _&&(E=qo(zo(T,"paint",T.type+"-outline-color",b,M,g,j),l)),E||(E=n),(n||E)&&(++q,C=k[q],(!C||n&&!C.getFill()||!n&&C.getFill()||E&&!C.getStroke()||!E&&C.getStroke()||C.getText())&&(C=new V.default({fill:n?new D.default:void 0,stroke:E?new U.default:void 0}),k[q]=C),n&&(m=C.getFill(),m.setColor(n)),E&&(v=C.getStroke(),v.setColor(E),v.setWidth(.5)),C.setZIndex(A));if(1!=z&&"line"==T.type){n="line-pattern"in _?void 0:qo(zo(T,"paint","line-color",b,M,g,j),zo(T,"paint","line-opacity",b,M,g,j));const e=zo(T,"paint","line-width",b,M,g,j);n&&e>0&&(++q,C=k[q],C&&C.getStroke()&&!C.getFill()&&!C.getText()||(C=new V.default({stroke:new U.default}),k[q]=C),v=C.getStroke(),v.setLineCap(zo(T,"layout","line-cap",b,M,g,j)),v.setLineJoin(zo(T,"layout","line-join",b,M,g,j)),v.setMiterLimit(zo(T,"layout","line-miter-limit",b,M,g,j)),v.setColor(n),v.setWidth(e),v.setLineDash(_["line-dasharray"]?zo(T,"paint","line-dasharray",b,M,g,j).map((function(t){return t*e})):null),C.setZIndex(A))}let I,F,P,L,J,W,Z,B,X,H=!1,Y=null,K=0;if((1==z||2==z)&&"icon-image"in $){const t=zo(T,"layout","icon-image",b,M,g,j);if(t){let n;I="string"==typeof t?Eo(t,f):t.toString();const a=s?s(e,I):void 0;if(u&&o&&o[I]||a){const e=zo(T,"layout","icon-rotation-alignment",b,M,g,j);if(2==z){const t=r.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const r=t.getExtent();if(Math.sqrt(Math.max(Math.pow((r[2]-r[0])/i,2),Math.pow((r[3]-r[1])/i,2)))>150){const r="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();ko||(wo=[NaN,NaN],ko=new N.default("Point",wo,[],2,{},void 0)),n=ko,wo[0]=r[0],wo[1]=r[1];if("line"===zo(T,"layout","symbol-placement",b,M,g,j)&&"map"===e){const e=t.getStride(),n=t.getFlatCoordinates();for(let t=0,o=n.length-e;t=l&&r[0]<=p&&r[1]>=u&&r[1]<=c){K=Math.atan2(i-s,a-o);break}}}}}}if(2!==z||n){const t=zo(T,"layout","icon-size",b,M,g,j),r=void 0!==_["icon-color"]?zo(T,"paint","icon-color",b,M,g,j):null;if(!r||0!==r.a){const n=zo(T,"paint","icon-halo-color",b,M,g,j),i=zo(T,"paint","icon-halo-width",b,M,g,j);let s=`${I}.${t}.${i}.${n}`;if(null!==r&&(s+=`.${r}`),F=y[s],!F){const l=Mo(T,b,M,"icon",g);let f;"icon-offset"in $&&(f=zo(T,"layout","icon-offset",b,M,g,j).slice(0),f[0]*=t,f[1]*=-t);let d=r?[255*r.r,255*r.g,255*r.b,r.a]:void 0;if(a){const r={color:d,rotateWithView:"map"===e,displacement:f,declutterMode:l,scale:t};"string"==typeof a?r.src=a:(r.img=a,r.imgSize=[a.width,a.height]),F=new R.default(r)}else{const a=o[I];let s,m,y;i?a.sdf?(s=eo(ro(u,a,r||[0,0,0,1]),{x:0,y:0,width:a.width,height:a.height,pixelRatio:a.pixelRatio},i,n),d=void 0):s=eo(u,a,i,n):(a.sdf?(c||(c=ro(u,{x:0,y:0,width:p[0],height:p[1]},{r:1,g:1,b:1,a:1})),s=c):s=u,m=[a.width,a.height],y=[a.x,a.y]),F=new R.default({color:d,img:s,imgSize:p,size:m,offset:y,rotateWithView:"map"===e,scale:t/a.pixelRatio,displacement:f,declutterMode:l})}y[s]=F}}F&&(++q,C=k[q],C&&C.getImage()&&!C.getFill()&&!C.getStroke()||(C=new V.default,k[q]=C),C.setGeometry(n),F.setRotation(K+Gn(zo(T,"layout","icon-rotate",b,M,g,j))),F.setOpacity(zo(T,"paint","icon-opacity",b,M,g,j)),F.setAnchor(go[zo(T,"layout","icon-anchor",b,M,g,j)]),C.setImage(F),Y=C.getText(),C.setText(void 0),C.setZIndex(A),H=!0,P=!1)}else P=!0}}}if(1==z&&"circle"===T.type){++q,C=k[q],C&&C.getImage()&&!C.getFill()&&!C.getStroke()||(C=new V.default,k[q]=C);const e="circle-radius"in _?zo(T,"paint","circle-radius",b,M,g,j):5,t=qo(zo(T,"paint","circle-stroke-color",b,M,g,j),zo(T,"paint","circle-stroke-opacity",b,M,g,j)),r=zo(T,"paint","circle-translate",b,M,g,j),n=qo(zo(T,"paint","circle-color",b,M,g,j),zo(T,"paint","circle-opacity",b,M,g,j)),o=zo(T,"paint","circle-stroke-width",b,M,g,j),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];F=y[i],F||(F=new O.default({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new U.default({width:o,color:t}):void 0,fill:n?new D.default({color:n}):void 0,declutterMode:"none"}),y[i]=F),C.setImage(F),Y=C.getText(),C.setText(void 0),C.setGeometry(void 0),C.setZIndex(A),H=!0}if("text-field"in $){Z=Math.round(zo(T,"layout","text-size",b,M,g,j));const e=zo(T,"layout","text-font",b,M,g,j);W=zo(T,"layout","text-line-height",b,M,g,j),J=Cn(a?a(e,t.metadata?t.metadata["ol:webfonts"]:void 0):e,Z,W),J.includes("sans-serif")||(J+=",sans-serif"),B=zo(T,"layout","text-letter-spacing",b,M,g,j),X=zo(T,"layout","text-max-width",b,M,g,j);const r=zo(T,"layout","text-field",b,M,g,j);L="object"==typeof r&&r.sections?1===r.sections.length?r.toString():r.sections.reduce(((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,i=Cn(a?a(o):o,Z*(r.scale||1),W);let s=r.text;if("\n"===s)return t.push("\n",""),t;if(2!=z){s=uo(s,i,X,B).split("\n");for(let e=0,r=s.length;e0&&t.push("\n",""),t.push(s[e],i);return t}t.push(oo(s,B),i)}),[]):Eo(r,f).trim(),l=zo(T,"paint","text-opacity",b,M,g,j)}if(L&&l&&!P){H||(++q,C=k[q],C&&C.getText()&&!C.getFill()&&!C.getStroke()||(C=new V.default,k[q]=C),C.setImage(void 0),C.setGeometry(void 0));const e=Mo(T,b,M,"text",g);C.getText()||C.setText(Y),Y=C.getText(),(!Y||"getDeclutterMode"in Y&&Y.getDeclutterMode()!==e)&&(Y=new G.default({padding:[2,2,2,2],declutterMode:e}),C.setText(Y));const t=zo(T,"layout","text-transform",b,M,g,j);"uppercase"==t?L=Array.isArray(L)?L.map(((e,t)=>t%2?e:e.toUpperCase())):L.toUpperCase():"lowercase"==t&&(L=Array.isArray(L)?L.map(((e,t)=>t%2?e:e.toLowerCase())):L.toLowerCase());const r=Array.isArray(L)?L:2==z?oo(L,B):uo(L,J,X,B);Y.setText(r),Y.setFont(J),Y.setRotation(Gn(zo(T,"layout","text-rotate",b,M,g,j)));const n=zo(T,"layout","text-anchor",b,M,g,j),o=H||1==z?"point":zo(T,"layout","symbol-placement",b,M,g,j);let i;if("line-center"===o?(Y.setPlacement("line"),i="center"):Y.setPlacement(o),"line"===o&&"function"==typeof Y.setRepeat){const e=zo(T,"layout","symbol-spacing",b,M,g,j);Y.setRepeat(2*e)}Y.setOverflow("point"===o);let a=zo(T,"paint","text-halo-width",b,M,g,j);const s=zo(T,"layout","text-offset",b,M,g,j),u=zo(T,"paint","text-translate",b,M,g,j);let p=0,c=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",c=a):-1!==n.indexOf("right")&&(i="right",c=-a);const e=zo(T,"layout","text-rotation-alignment",b,M,g,j);Y.setRotateWithView("map"==e)}else Y.setMaxAngle(Gn(zo(T,"layout","text-max-angle",b,M,g,j))*L.length/r.length),Y.setRotateWithView(!1);Y.setTextAlign(i);let f="middle";0==n.indexOf("bottom")?(f="bottom",p=-a-.5*(W-1)*Z):0==n.indexOf("top")&&(f="top",p=a+.5*(W-1)*Z),Y.setTextBaseline(f);const d=zo(T,"layout","text-justify",b,M,g,j);Y.setJustify("auto"===d?void 0:d),Y.setOffsetX(s[0]*Z+c+u[0]),Y.setOffsetY(s[1]*Z+p+u[1]),w.setColor(qo(zo(T,"paint","text-color",b,M,g,j),l)),Y.setFill(w);const m=qo(zo(T,"paint","text-halo-color",b,M,g,j),l);if(m&&a>0){x.setColor(m),a*=2;const e=.5*Z;x.setWidth(a<=e?a:e),Y.setStroke(x)}else Y.setStroke(void 0);const y=zo(T,"layout","text-padding",b,M,g,j),h=Y.getPadding();y!==h[0]&&(h[0]=y,h[1]=y,h[2]=y,h[3]=y),C.setZIndex(A)}}}return q>-1?(k.length=q+1,$o&&("set"in r?r.set("mapbox-layer",S):r.getProperties()["mapbox-layer"]=S),k):void 0};return e.setStyle(z),e.set("mapbox-source",b),e.set("mapbox-layers",m),e.set("mapbox-featurestate",e.get("mapbox-featurestate")||{}),z}function Ao(e,t){const r=e[0],n=r.width,o=r.height,i=r.data,a=new Uint8ClampedArray(i.length),s=2*t.resolution,l=n-1,u=o-1,p=[0,0,0,0],c=2*Math.PI,f=Math.PI/2,d=Math.PI*t.sunEl/180,m=Math.PI*t.sunAz/180,y=Math.cos(d),h=Math.sin(d),g=t.highlightColor,v=t.shadowColor,b=t.accentColor,x=t.encoding;let w,k,z,M,j,S,q,T,E,$,_,C,A,I,F,P,L,O,D,R,N,U;function V(e,t="mapbox"){return"mapbox"===t?.1*(256*e[0]*256+256*e[1]+e[2])-1e4:"terrarium"===t?256*e[0]+e[1]+e[2]/256-32768:void 0}for(k=0;k<=u;++k)for(j=0===k?0:k-1,S=k===u?u:k+1,w=0;w<=l;++w)z=0===w?0:w-1,M=w===l?l:w+1,q=4*(k*n+z),p[0]=i[q],p[1]=i[q+1],p[2]=i[q+2],p[3]=i[q+3],T=t.vert*V(p,x),q=4*(k*n+M),p[0]=i[q],p[1]=i[q+1],p[2]=i[q+2],p[3]=i[q+3],E=t.vert*V(p,x),$=(E-T)/s,q=4*(j*n+w),p[0]=i[q],p[1]=i[q+1],p[2]=i[q+2],p[3]=i[q+3],T=t.vert*V(p,x),q=4*(S*n+w),p[0]=i[q],p[1]=i[q+1],p[2]=i[q+2],p[3]=i[q+3],E=t.vert*V(p,x),_=(E-T)/s,A=Math.atan2(_,-$),A=A<0?f-A:A>f?c-A+f:f-A,C=Math.atan(Math.sqrt($*$+_*_)),U=h*Math.cos(C)+y*Math.sin(C)*Math.cos(m-A),I=Math.cos(C),F=255*U,D=Math.min(Math.max(2*t.sunEl,0),1),R=1.875-1.75*t.opacity,N=.5!==t.opacity?f*((Math.pow(R,C)-1)/(Math.pow(R,f)-1)):C,L={r:(1-I)*b.r*D*255,g:(1-I)*b.g*D*255,b:(1-I)*b.b*D*255,a:(1-I)*b.a*D*255},P=Math.abs(((A+m)/Math.PI+.5)%2-1),O={r:(g.r*(1-P)+v.r*P)*F,g:(g.g*(1-P)+v.g*P)*F,b:(g.b*(1-P)+v.b*P)*F,a:(g.a*(1-P)+v.a*P)*F},q=4*(k*n+w),a[q]=L.r*(1-P)+O.r,a[q+1]=L.g*(1-P)+O.g,a[q+2]=L.b*(1-P)+O.b,a[q+3]=i[q+3]*t.opacity*D*Math.sin(N);return new ImageData(a,n,o)}function Io(e,t=512){return e.getExtent()?C.createXYZ({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():Jn}function Fo(e,t){if(!t.accessToken){t=Object.assign({},t);new URL(e).searchParams.forEach(((e,r)=>{t.accessToken=e,t.accessTokenParam=r}))}return t}function Po(e,t,r="",n={},o=void 0){let i,a,s,l,p=!0;return"string"==typeof r||Array.isArray(r)?l=r:(s=r,l=s.source||s.layers,n=s),"string"==typeof n?(i=n,s={}):(i=n.styleUrl,s=n),!1===s.updateSource&&(p=!1),o||(o=s.resolutions),i||"string"!=typeof t||t.trim().startsWith("{")||(i=t),i&&(i=i.startsWith("data:")?location.href:Fn(i,s.accessToken),s=Fo(i,s)),new Promise((function(r,n){Yn(t,s).then((function(t){if(8!=t.version)return n(new Error("glStyle version 8 required."));if(!(e instanceof ne.default||e instanceof ie.default))return n(new Error("Can only apply to VectorLayer or VectorTileLayer"));const c=e instanceof ie.default?"vector":"geojson";if(l?a=Array.isArray(l)?t.layers.find((function(e){return e.id===l[0]})).source:l:(a=Object.keys(t.sources).find((function(e){return t.sources[e].type===c})),l=a),!a)return n(new Error(`No ${c} source found in the glStyle.`));function f(){if(!p)return Promise.resolve();if(e instanceof ie.default)return Vo(t.sources[a],i,s).then((function(t){const r=e.getSource();r?t!==r&&(r.setTileUrlFunction(t.getTileUrlFunction()),"function"==typeof r.setUrls&&"function"==typeof t.getUrls&&r.setUrls(t.getUrls()),r.format_||(r.format_=t.format_),r.getAttributions()||r.setAttributions(t.getAttributions()),r.getTileLoadFunction()===T.defaultLoadFunction&&r.setTileLoadFunction(t.getTileLoadFunction()),A.equivalent(r.getProjection(),t.getProjection())&&(r.tileGrid=t.getTileGrid())):e.setSource(t);const n=e.getSource().getTileGrid();!isFinite(e.getMaxResolution())&&!isFinite(e.getMinZoom())&&n.getMinZoom()>0&&e.setMaxResolution(Bn(Math.max(0,n.getMinZoom()-1e-12),n.getResolutions()))}));const r=t.sources[a];let n=e.getSource();n&&n.get("mapbox-source")===r||(n=Zo(r,i,s));const o=e.getSource();return o?n!==o&&(o.getAttributions()||o.setAttributions(n.getAttributions()),o.format_||(o.format_=n.getFormat()),o.url_=n.getUrl()):e.setSource(n),Promise.resolve()}let d,m,y,h;function g(){if(h||t.sprite&&!m)h?(e.setStyle(h),f().then(r).catch(n)):n(new Error("Something went wrong trying to apply style."));else{if(s.projection&&!o){const e=A.get(s.projection).getUnits();"m"!==e&&(o=Jn.map((t=>t/$.METERS_PER_UNIT[e])))}h=Co(e,t,l,o,m,y,((e,t=s.webfonts)=>function(e,t="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){const r=e.toString();if(r in yo)return yo[r];const n=[];for(let t=0,r=e.length;t=1.5?.5:1;const r=.5==d?"@2x":"";let o=e.origin+e.pathname+r+".json"+e.search;new Promise((function(t,r){Hn("Sprite",o,s).then(t).catch((function(n){o=e.origin+e.pathname+".json"+e.search,Hn("Sprite",o,s).then(t).catch(r)}))})).then((function(t){if(void 0===t&&n(new Error("No sprites found.")),m=t,y=e.origin+e.pathname+r+".png"+e.search,s.transformRequest){const e=s.transformRequest(y,"SpriteImage")||y;(e instanceof Request||e instanceof Promise)&&(y=e)}g()})).catch((function(e){n(new Error(`Sprites cannot be loaded: ${o}: ${e.message}`))}))}else g()})).catch(n)}))}const Lo={};function Oo(e,t,r={}){return Yn(t,r).then((function(t){!function(e,t,r){t.layers.some((function(t){if("background"===t.type){if(e instanceof B.default)return e.setBackground((function(e){return No(t,e,r,{})})),!0;if(e instanceof Y.default||e instanceof X.default)return e.getLayers().insertAt(0,Uo(t,r,{})),!0}}))}(e,t,r)}))}function Do(e,t){let r;return e.some((function(e){if(e.id==t)return r=e.source,!0})),r}function Ro(e,t,r){const n=new te.default({tileJSON:t,tileSize:e.tileSize||t.tileSize||512}),o=n.getTileJSON(),i=n.getTileGrid(),a=A.get(r.projection||"EPSG:3857"),s=function(e,t){const r=e.bounds;if(r){const e=A.fromLonLat([r[0],r[1]],t),n=A.fromLonLat([r[2],r[3]],t);return[e[0],e[1],n[0],n[1]]}return A.get(t).getExtent()}(o,a),l=a.getExtent(),u=o.minzoom||0,p=o.maxzoom||22,c={attributions:n.getAttributions(),projection:a,tileGrid:new ee.default({origin:l?I.getTopLeft(l):i.getOrigin(0),extent:s||i.getExtent(),minZoom:u,resolutions:Io(a,t.tileSize).slice(0,p+1),tileSize:i.getTileSize(0)})};return Array.isArray(o.tiles)?c.urls=o.tiles:c.url=o.tiles,c}function No(e,t,r,n){const o={id:e.id,type:e.type},i=e.layout||{},a=e.paint||{};o.paint=a;const s=Zn(t,r.resolutions||Jn);let l;const u=zo(o,"paint","background-color",s,Lo,n);return void 0!==a["background-opacity"]&&(l=zo(o,"paint","background-opacity",s,Lo,n)),"none"==i.visibility?void 0:qo(u,l)}function Uo(e,t,r){const n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new B.default({source:new Q.default({}),render(o){const i=No(e,o.viewState.resolution,t,r);return n.style.backgroundColor=i,n}})}function Vo(e,t,r){return new Promise((function(n,o){Qn(e,t,r).then((function({tileJson:t,tileLoadFunction:o}){const i=Ro(e,t,r);i.tileLoadFunction=o,i.format=new H.default,n(new ae.default(i))})).catch(o)}))}function Go(e){return`{bbox-${(e?e.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Jo(e,t,r){return new Promise((function(n,o){Qn(e,t,r).then((function({tileJson:t,tileLoadFunction:o}){const i=new te.default({interpolate:void 0===r.interpolate||r.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:t});i.tileGrid=Ro(e,t,r).tileGrid,r.projection&&(i.projection=A.get(r.projection));const a=i.getTileUrlFunction();o&&i.setTileLoadFunction(o),i.setTileUrlFunction((function(e,t,r){const n=Go(r);let o=a(e,t,r);if(-1!=o.indexOf(n)){const t=i.getTileGrid().getTileCoordExtent(e);o=o.replace(n,t.toString())}return o})),i.set("mapbox-source",e),n(i)})).catch((function(e){o(e)}))}))}function Wo(e,t,r){const n=new re.default;return Jo(e,t,r).then((function(e){n.setSource(e)})).catch((function(){n.setSource(void 0)})),n}function Zo(e,t,r){const n=r.projection?new W.default({dataProjection:r.projection}):new W.default,o=e.data,i={};if("string"==typeof o){const i=Pn(o,r.accessToken,r.accessTokenParam||"access_token",t||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(i)){const t=(e,t,r)=>{const n=Go(r);return i.replace(n,`${e.join(",")}`)},o=new oe.default({attributions:e.attribution,format:n,loader:(e,n,i,a,s)=>{Hn("GeoJSON","function"==typeof t?t(e,n,i):t,r).then((e=>{const t=o.getFormat().readFeatures(e,{featureProjection:i});o.addFeatures(t),a(t)})).catch((t=>{o.removeLoadedExtent(e),s()}))},strategy:_.bbox});return o.set("mapbox-source",e),o}const a=new oe.default({attributions:e.attribution,format:n,url:i,loader:(e,t,n,o,s)=>{Hn("GeoJSON",i,r).then((e=>{const t=a.getFormat().readFeatures(e,{featureProjection:n});a.addFeatures(t),o(t)})).catch((t=>{a.removeLoadedExtent(e),s()}))}});return a}i.features=n.readFeatures(o,{featureProjection:A.getUserProjection()||"EPSG:3857"});const a=new oe.default(Object.assign({attributions:e.attribution,format:n},i));return a.set("mapbox-source",e),a}function Bo(e,t,r){let n=null;return function(o){e.paint&&"raster-opacity"in e.paint&&o.frameState.viewState.zoom!==n&&(n=o.frameState.viewState.zoom,delete r[e.id],function(e,t,r,n){const o=zo(e,"paint","raster-opacity",r,Lo,n);t.setOpacity(o)}(e,t,n,r))}}function Xo(e,t,r,n){const o=Un(e),i=e.layers,a=r.type,s=r.source||Do(i,r.ref),l=e.sources[s];let u;if("background"==a)u=Uo(r,n,o);else if("vector"==l.type)u=function(e,t,r){const n=new ie.default({declutter:!0,visible:!1});return Vo(e,t,r).then((function(t){t.set("mapbox-source",e),n.setSource(t)})).catch((function(e){n.setSource(void 0)})),n}(l,t,n);else if("raster"==l.type)u=Wo(l,t,n),u.setVisible(!r.layout||"none"!==r.layout.visibility),u.on("prerender",Bo(r,u,o));else if("geojson"==l.type)u=function(e,t,r){return new ne.default({declutter:!0,source:Zo(e,t,r),visible:!1})}(l,t,n);else if("raster-dem"==l.type&&"hillshade"==r.type){const e=function(e,t,r){const n=Wo(e,t,r);return new Z.default({source:new K.default({operationType:"image",operation:Ao,sources:[n]})})}(l,t,n);u=e,e.getSource().on("beforeoperations",(function(e){const t=e.data;t.resolution=A.getPointResolution(n.projection||"EPSG:3857",e.resolution,I.getCenter(e.extent),"m");const i=Zn(e.resolution,n.resolutions||Jn);t.encoding=l.encoding,t.vert=5*zo(r,"paint","hillshade-exaggeration",i,Lo,o),t.sunAz=zo(r,"paint","hillshade-illumination-direction",i,Lo,o),t.sunEl=35,t.opacity=.3,t.highlightColor=zo(r,"paint","hillshade-highlight-color",i,Lo,o),t.shadowColor=zo(r,"paint","hillshade-shadow-color",i,Lo,o),t.accentColor=zo(r,"paint","hillshade-accent-color",i,Lo,o)})),u.setVisible(!r.layout||"none"!==r.layout.visibility)}const p=s;return u&&u.set("mapbox-source",p),u}function Ho(e,t,r,n){const o=[];let i=null;if(t instanceof Y.default){if(i=t.getView(),!i.isDef()&&!i.getRotation()&&!i.getResolutions()){const e=n.projection?A.get(n.projection):i.getProjection();i=new se.default(Object.assign(i.getProperties(),{maxResolution:Jn[0]/$.METERS_PER_UNIT[e.getUnits()],projection:n.projection||i.getProjection()})),t.setView(i)}"center"in e&&!i.getCenter()&&i.setCenter(A.fromLonLat(e.center,i.getProjection())),"zoom"in e&&void 0===i.getZoom()&&i.setResolution(Jn[0]/$.METERS_PER_UNIT[i.getProjection().getUnits()]/Math.pow(2,e.zoom)),i.getCenter()&&void 0!==i.getZoom()||i.fit(i.getProjection().getExtent(),{nearest:!0,size:t.getSize()})}t.set("mapbox-style",e),t.set("mapbox-metadata",{styleUrl:r,options:n});const a=e.layers;let s,l,u,p=[];for(let i=0,c=a.length;i0||r>0)&&e.setMaxResolution(Math.min(Bn(Math.max(0,a-1e-12),Jn),Bn(Math.max(0,r-1e-12),t.getResolutions()))),s<24&&e.setMinResolution(Bn(s,Jn))}}else a>0&&e.setMaxResolution(Bn(Math.max(0,a-1e-12),Jn));p instanceof oe.default||p instanceof ae.default?Po(e,r,t,Object.assign({styleUrl:n},i)).then((function(){!function(e,t){function r(){const r=t.get("mapbox-style");if(!r)return;const n=qn(r.layers),o=e.get("mapbox-layers"),i=n.filter((function(e){return o.includes(e.id)})).some((function(e){return!e.layout||!e.layout.visibility||"visible"===e.layout.visibility}));e.get("visible")!==i&&e.setVisible(i)}e.on("change",r),r()}(e,o),l()})).catch(u):l()}else u(new Error("Error accessing data for source "+e.get("mapbox-source")))};e.set("mapbox-layers",t);const c=o.getLayers();-1===c.getArray().indexOf(e)&&c.push(e),e.getSource()?p():e.once("change:source",p)}))}function Qo(e,t){return e.get("mapbox-style").layers.find((function(e){return e.id===t}))}function ei(e,t){const r=e.getLayers().getArray();for(let e=0,n=r.length;e{r.setState("ready")})).catch((e=>{this.dispatchEvent(new ni(e));this.getSource().setState("error")}))}}e.MapboxVectorLayer=oi,e.addMapboxLayer=function(e,t,r){const n=e.get("mapbox-style"),o=n.layers;let i,a,s=-1;if(void 0!==r){const t=Qo(e,r);if(void 0===t)throw new Error(`Layer with id "${r}" not found.`);i=o.indexOf(t)}else i=o.length;if(i>0&&o[i-1].source===t.source?(s=i-1,a=-1):ie.id===t.id)))throw new Error(`Layer with id "${t.id}" already exists.`);const l=o[s].id,u=_o[Nn(e.get("mapbox-style"),ei(e,l))];if(o.splice(i,0,t),u){const[e,r,n,o,i,s,p,c]=u;if(Array.isArray(n)){const e=n.indexOf(l)+a;n.splice(e,0,t.id)}Co(e,r,n,o,i,s,p,c)}else ei(e,o[s].id).changed();return Promise.resolve()},e.apply=Yo,e.applyBackground=Oo,e.applyStyle=Po,e.default=Yo,e.getFeatureState=function(e,t){const r="getLayers"in e?ti(e,t.source):[e];for(let e=0,n=r.length;ee.id===r)),1);const s=_o[Nn(i,n)];if(s){const[e,t,n,o,i,a,l,u]=s;Array.isArray(n)&&n.splice(n.findIndex((e=>e===r)),1),Co(e,t,n,o,i,a,l,u)}else ei(e,r).changed()},e.renderTransparent=function(e){e!==So&&(!function(){for(const e in Ln)delete Ln[e]}(),So=e)},e.setFeatureState=function(e,t,r){const n="getLayers"in e?ti(e,t.source):[e];for(let e=0,o=n.length;e, 2012.\n//\n// https://github.com/deanm/css-color-parser-js\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n// http://www.w3.org/TR/css3-color/\nvar kCSSColorTable = {\n \"transparent\": [0,0,0,0], \"aliceblue\": [240,248,255,1],\n \"antiquewhite\": [250,235,215,1], \"aqua\": [0,255,255,1],\n \"aquamarine\": [127,255,212,1], \"azure\": [240,255,255,1],\n \"beige\": [245,245,220,1], \"bisque\": [255,228,196,1],\n \"black\": [0,0,0,1], \"blanchedalmond\": [255,235,205,1],\n \"blue\": [0,0,255,1], \"blueviolet\": [138,43,226,1],\n \"brown\": [165,42,42,1], \"burlywood\": [222,184,135,1],\n \"cadetblue\": [95,158,160,1], \"chartreuse\": [127,255,0,1],\n \"chocolate\": [210,105,30,1], \"coral\": [255,127,80,1],\n \"cornflowerblue\": [100,149,237,1], \"cornsilk\": [255,248,220,1],\n \"crimson\": [220,20,60,1], \"cyan\": [0,255,255,1],\n \"darkblue\": [0,0,139,1], \"darkcyan\": [0,139,139,1],\n \"darkgoldenrod\": [184,134,11,1], \"darkgray\": [169,169,169,1],\n \"darkgreen\": [0,100,0,1], \"darkgrey\": [169,169,169,1],\n \"darkkhaki\": [189,183,107,1], \"darkmagenta\": [139,0,139,1],\n \"darkolivegreen\": [85,107,47,1], \"darkorange\": [255,140,0,1],\n \"darkorchid\": [153,50,204,1], \"darkred\": [139,0,0,1],\n \"darksalmon\": [233,150,122,1], \"darkseagreen\": [143,188,143,1],\n \"darkslateblue\": [72,61,139,1], \"darkslategray\": [47,79,79,1],\n \"darkslategrey\": [47,79,79,1], \"darkturquoise\": [0,206,209,1],\n \"darkviolet\": [148,0,211,1], \"deeppink\": [255,20,147,1],\n \"deepskyblue\": [0,191,255,1], \"dimgray\": [105,105,105,1],\n \"dimgrey\": [105,105,105,1], \"dodgerblue\": [30,144,255,1],\n \"firebrick\": [178,34,34,1], \"floralwhite\": [255,250,240,1],\n \"forestgreen\": [34,139,34,1], \"fuchsia\": [255,0,255,1],\n \"gainsboro\": [220,220,220,1], \"ghostwhite\": [248,248,255,1],\n \"gold\": [255,215,0,1], \"goldenrod\": [218,165,32,1],\n \"gray\": [128,128,128,1], \"green\": [0,128,0,1],\n \"greenyellow\": [173,255,47,1], \"grey\": [128,128,128,1],\n \"honeydew\": [240,255,240,1], \"hotpink\": [255,105,180,1],\n \"indianred\": [205,92,92,1], \"indigo\": [75,0,130,1],\n \"ivory\": [255,255,240,1], \"khaki\": [240,230,140,1],\n \"lavender\": [230,230,250,1], \"lavenderblush\": [255,240,245,1],\n \"lawngreen\": [124,252,0,1], \"lemonchiffon\": [255,250,205,1],\n \"lightblue\": [173,216,230,1], \"lightcoral\": [240,128,128,1],\n \"lightcyan\": [224,255,255,1], \"lightgoldenrodyellow\": [250,250,210,1],\n \"lightgray\": [211,211,211,1], \"lightgreen\": [144,238,144,1],\n \"lightgrey\": [211,211,211,1], \"lightpink\": [255,182,193,1],\n \"lightsalmon\": [255,160,122,1], \"lightseagreen\": [32,178,170,1],\n \"lightskyblue\": [135,206,250,1], \"lightslategray\": [119,136,153,1],\n \"lightslategrey\": [119,136,153,1], \"lightsteelblue\": [176,196,222,1],\n \"lightyellow\": [255,255,224,1], \"lime\": [0,255,0,1],\n \"limegreen\": [50,205,50,1], \"linen\": [250,240,230,1],\n \"magenta\": [255,0,255,1], \"maroon\": [128,0,0,1],\n \"mediumaquamarine\": [102,205,170,1], \"mediumblue\": [0,0,205,1],\n \"mediumorchid\": [186,85,211,1], \"mediumpurple\": [147,112,219,1],\n \"mediumseagreen\": [60,179,113,1], \"mediumslateblue\": [123,104,238,1],\n \"mediumspringgreen\": [0,250,154,1], \"mediumturquoise\": [72,209,204,1],\n \"mediumvioletred\": [199,21,133,1], \"midnightblue\": [25,25,112,1],\n \"mintcream\": [245,255,250,1], \"mistyrose\": [255,228,225,1],\n \"moccasin\": [255,228,181,1], \"navajowhite\": [255,222,173,1],\n \"navy\": [0,0,128,1], \"oldlace\": [253,245,230,1],\n \"olive\": [128,128,0,1], \"olivedrab\": [107,142,35,1],\n \"orange\": [255,165,0,1], \"orangered\": [255,69,0,1],\n \"orchid\": [218,112,214,1], \"palegoldenrod\": [238,232,170,1],\n \"palegreen\": [152,251,152,1], \"paleturquoise\": [175,238,238,1],\n \"palevioletred\": [219,112,147,1], \"papayawhip\": [255,239,213,1],\n \"peachpuff\": [255,218,185,1], \"peru\": [205,133,63,1],\n \"pink\": [255,192,203,1], \"plum\": [221,160,221,1],\n \"powderblue\": [176,224,230,1], \"purple\": [128,0,128,1],\n \"rebeccapurple\": [102,51,153,1],\n \"red\": [255,0,0,1], \"rosybrown\": [188,143,143,1],\n \"royalblue\": [65,105,225,1], \"saddlebrown\": [139,69,19,1],\n \"salmon\": [250,128,114,1], \"sandybrown\": [244,164,96,1],\n \"seagreen\": [46,139,87,1], \"seashell\": [255,245,238,1],\n \"sienna\": [160,82,45,1], \"silver\": [192,192,192,1],\n \"skyblue\": [135,206,235,1], \"slateblue\": [106,90,205,1],\n \"slategray\": [112,128,144,1], \"slategrey\": [112,128,144,1],\n \"snow\": [255,250,250,1], \"springgreen\": [0,255,127,1],\n \"steelblue\": [70,130,180,1], \"tan\": [210,180,140,1],\n \"teal\": [0,128,128,1], \"thistle\": [216,191,216,1],\n \"tomato\": [255,99,71,1], \"turquoise\": [64,224,208,1],\n \"violet\": [238,130,238,1], \"wheat\": [245,222,179,1],\n \"white\": [255,255,255,1], \"whitesmoke\": [245,245,245,1],\n \"yellow\": [255,255,0,1], \"yellowgreen\": [154,205,50,1]}\n\nfunction clamp_css_byte(i) { // Clamp to integer 0 .. 255.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clamp_css_float(f) { // Clamp to float 0.0 .. 1.0.\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parse_css_int(str) { // int or percentage.\n if (str[str.length - 1] === '%')\n return clamp_css_byte(parseFloat(str) / 100 * 255);\n return clamp_css_byte(parseInt(str));\n}\n\nfunction parse_css_float(str) { // float or percentage.\n if (str[str.length - 1] === '%')\n return clamp_css_float(parseFloat(str) / 100);\n return clamp_css_float(parseFloat(str));\n}\n\nfunction css_hue_to_rgb(m1, m2, h) {\n if (h < 0) h += 1;\n else if (h > 1) h -= 1;\n\n if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;\n if (h * 2 < 1) return m2;\n if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;\n return m1;\n}\n\nfunction parseCSSColor(css_str) {\n // Remove all whitespace, not compliant, but should just be more accepting.\n var str = css_str.replace(/ /g, '').toLowerCase();\n\n // Color keywords (and transparent) lookup.\n if (str in kCSSColorTable) return kCSSColorTable[str].slice(); // dup.\n\n // #abc and #abc123 syntax.\n if (str[0] === '#') {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xfff)) return null; // Covers NaN.\n return [((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n (iv & 0xf0) | ((iv & 0xf0) >> 4),\n (iv & 0xf) | ((iv & 0xf) << 4),\n 1];\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffff)) return null; // Covers NaN.\n return [(iv & 0xff0000) >> 16,\n (iv & 0xff00) >> 8,\n iv & 0xff,\n 1];\n }\n\n return null;\n }\n\n var op = str.indexOf('('), ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op+1, ep-(op+1)).split(',');\n var alpha = 1; // To allow case fallthrough.\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) return null;\n alpha = parse_css_float(params.pop());\n // Fall through.\n case 'rgb':\n if (params.length !== 3) return null;\n return [parse_css_int(params[0]),\n parse_css_int(params[1]),\n parse_css_int(params[2]),\n alpha];\n case 'hsla':\n if (params.length !== 4) return null;\n alpha = parse_css_float(params.pop());\n // Fall through.\n case 'hsl':\n if (params.length !== 3) return null;\n var h = (((parseFloat(params[0]) % 360) + 360) % 360) / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n var s = parse_css_float(params[1]);\n var l = parse_css_float(params[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n return [clamp_css_byte(css_hue_to_rgb(m1, m2, h+1/3) * 255),\n clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),\n clamp_css_byte(css_hue_to_rgb(m1, m2, h-1/3) * 255),\n alpha];\n default:\n return null;\n }\n }\n\n return null;\n}\n\ntry { exports.parseCSSColor = parseCSSColor } catch(e) { }\n","// @flow\n\nimport {parseCSSColor} from 'csscolorparser';\n\n/**\n * An RGBA color value. Create instances from color strings using the static\n * method `Color.parse`. The constructor accepts RGB channel values in the range\n * `[0, 1]`, premultiplied by A.\n *\n * @param {number} r The red channel.\n * @param {number} g The green channel.\n * @param {number} b The blue channel.\n * @param {number} a The alpha channel.\n * @private\n */\nclass Color {\n r: number;\n g: number;\n b: number;\n a: number;\n\n constructor(r: number, g: number, b: number, a: number = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }\n\n static black: Color;\n static white: Color;\n static transparent: Color;\n static red: Color;\n static blue: Color;\n\n /**\n * Parses valid CSS color strings and returns a `Color` instance.\n * @returns A `Color` instance, or `undefined` if the input is not a valid color string.\n */\n static parse(input?: string | Color | null): Color | void {\n if (!input) {\n return undefined;\n }\n\n if (input instanceof Color) {\n return input;\n }\n\n if (typeof input !== 'string') {\n return undefined;\n }\n\n const rgba = parseCSSColor(input);\n if (!rgba) {\n return undefined;\n }\n\n return new Color(\n rgba[0] / 255 * rgba[3],\n rgba[1] / 255 * rgba[3],\n rgba[2] / 255 * rgba[3],\n rgba[3]\n );\n }\n\n /**\n * Returns an RGBA string representing the color value.\n *\n * @returns An RGBA string.\n * @example\n * var purple = new Color.parse('purple');\n * purple.toString; // = \"rgba(128,0,128,1)\"\n * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');\n * translucentGreen.toString(); // = \"rgba(26,207,26,0.73)\"\n */\n toString(): string {\n const [r, g, b, a] = this.toArray();\n return `rgba(${Math.round(r)},${Math.round(g)},${Math.round(b)},${a})`;\n }\n\n /**\n * Returns an RGBA array of values representing the color, unpremultiplied by A.\n *\n * @returns An array of RGBA color values in the range [0, 255].\n */\n toArray(): [number, number, number, number] {\n const {r, g, b, a} = this;\n return a === 0 ? [0, 0, 0, 0] : [\n r * 255 / a,\n g * 255 / a,\n b * 255 / a,\n a\n ];\n }\n\n /**\n * Returns a RGBA array of float values representing the color, unpremultiplied by A.\n *\n * @returns An array of RGBA color values in the range [0, 1].\n */\n toArray01(): [number, number, number, number] {\n const {r, g, b, a} = this;\n return a === 0 ? [0, 0, 0, 0] : [\n r / a,\n g / a,\n b / a,\n a\n ];\n }\n\n /**\n * Returns an RGBA array of values representing the color, premultiplied by A.\n *\n * @returns An array of RGBA color values in the range [0, 1].\n */\n toArray01PremultipliedAlpha(): [number, number, number, number] {\n const {r, g, b, a} = this;\n return [\n r,\n g,\n b,\n a\n ];\n }\n}\n\nColor.black = new Color(0, 0, 0, 1);\nColor.white = new Color(1, 1, 1, 1);\nColor.transparent = new Color(0, 0, 0, 0);\nColor.red = new Color(1, 0, 0, 1);\nColor.blue = new Color(0, 0, 1, 1);\n\nexport default Color;\n","// @flow\n\nimport assert from 'assert';\n\nimport type {StylePropertySpecification} from '../style-spec.js';\nimport type {ExpressionSpecification} from '../types.js';\n\nfunction convertLiteral(value) {\n return typeof value === 'object' ? ['literal', value] : value;\n}\n\nexport default function convertFunction(parameters: any, propertySpec: StylePropertySpecification): ExpressionSpecification {\n let stops = parameters.stops;\n if (!stops) {\n // identity function\n return convertIdentityFunction(parameters, propertySpec);\n }\n\n const zoomAndFeatureDependent = stops && typeof stops[0][0] === 'object';\n const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n\n stops = stops.map((stop) => {\n if (!featureDependent && propertySpec.tokens && typeof stop[1] === 'string') {\n return [stop[0], convertTokenString(stop[1])];\n }\n return [stop[0], convertLiteral(stop[1])];\n });\n\n if (zoomAndFeatureDependent) {\n return convertZoomAndPropertyFunction(parameters, propertySpec, stops);\n } else if (zoomDependent) {\n return convertZoomFunction(parameters, propertySpec, stops);\n } else {\n return convertPropertyFunction(parameters, propertySpec, stops);\n }\n}\n\nfunction convertIdentityFunction(parameters, propertySpec): Array {\n const get = ['get', parameters.property];\n\n if (parameters.default === undefined) {\n // By default, expressions for string-valued properties get coerced. To preserve\n // legacy function semantics, insert an explicit assertion instead.\n return propertySpec.type === 'string' ? ['string', get] : get;\n } else if (propertySpec.type === 'enum') {\n return [\n 'match',\n get,\n Object.keys(propertySpec.values),\n get,\n parameters.default\n ];\n } else {\n const expression = [propertySpec.type === 'color' ? 'to-color' : propertySpec.type, get, convertLiteral(parameters.default)];\n if (propertySpec.type === 'array') {\n expression.splice(1, 0, propertySpec.value, propertySpec.length || null);\n }\n return expression;\n }\n}\n\nfunction getInterpolateOperator(parameters) {\n switch (parameters.colorSpace) {\n case 'hcl': return 'interpolate-hcl';\n case 'lab': return 'interpolate-lab';\n default: return 'interpolate';\n }\n}\n\nfunction convertZoomAndPropertyFunction(parameters, propertySpec, stops) {\n const featureFunctionParameters = {};\n const featureFunctionStops = {};\n const zoomStops = [];\n for (let s = 0; s < stops.length; s++) {\n const stop = stops[s];\n const zoom = stop[0].zoom;\n if (featureFunctionParameters[zoom] === undefined) {\n featureFunctionParameters[zoom] = {\n zoom,\n type: parameters.type,\n property: parameters.property,\n default: parameters.default,\n };\n featureFunctionStops[zoom] = [];\n zoomStops.push(zoom);\n }\n featureFunctionStops[zoom].push([stop[0].value, stop[1]]);\n }\n\n // the interpolation type for the zoom dimension of a zoom-and-property\n // function is determined directly from the style property specification\n // for which it's being used: linear for interpolatable properties, step\n // otherwise.\n const functionType = getFunctionType({}, propertySpec);\n if (functionType === 'exponential') {\n const expression = [getInterpolateOperator(parameters), ['linear'], ['zoom']];\n\n for (const z of zoomStops) {\n const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n appendStopPair(expression, z, output, false);\n }\n\n return expression;\n } else {\n const expression = ['step', ['zoom']];\n\n for (const z of zoomStops) {\n const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n appendStopPair(expression, z, output, true);\n }\n\n fixupDegenerateStepCurve(expression);\n\n return expression;\n }\n}\n\nfunction coalesce(a, b) {\n if (a !== undefined) return a;\n if (b !== undefined) return b;\n}\n\nfunction getFallback(parameters, propertySpec) {\n const defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default));\n\n /*\n * Some fields with type: resolvedImage have an undefined default.\n * Because undefined is an invalid value for resolvedImage, set fallback to\n * an empty string instead of undefined to ensure output\n * passes validation.\n */\n if (defaultValue === undefined && propertySpec.type === 'resolvedImage') {\n return '';\n }\n return defaultValue;\n}\n\nfunction convertPropertyFunction(parameters, propertySpec, stops) {\n const type = getFunctionType(parameters, propertySpec);\n const get = ['get', parameters.property];\n if (type === 'categorical' && typeof stops[0][0] === 'boolean') {\n assert(parameters.stops.length > 0 && parameters.stops.length <= 2);\n const expression = ['case'];\n for (const stop of stops) {\n expression.push(['==', get, stop[0]], stop[1]);\n }\n\n expression.push(getFallback(parameters, propertySpec));\n return expression;\n } else if (type === 'categorical') {\n const expression = ['match', get];\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], false);\n }\n expression.push(getFallback(parameters, propertySpec));\n return expression;\n } else if (type === 'interval') {\n const expression = ['step', ['number', get]];\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], true);\n }\n fixupDegenerateStepCurve(expression);\n return parameters.default === undefined ? expression : [\n 'case',\n ['==', ['typeof', get], 'number'],\n expression,\n convertLiteral(parameters.default)\n ];\n } else if (type === 'exponential') {\n const base = parameters.base !== undefined ? parameters.base : 1;\n const expression = [\n getInterpolateOperator(parameters),\n base === 1 ? [\"linear\"] : [\"exponential\", base],\n [\"number\", get]\n ];\n\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], false);\n }\n return parameters.default === undefined ? expression : [\n 'case',\n ['==', ['typeof', get], 'number'],\n expression,\n convertLiteral(parameters.default)\n ];\n } else {\n throw new Error(`Unknown property function type ${type}`);\n }\n}\n\nfunction convertZoomFunction(parameters, propertySpec, stops, input = ['zoom']) {\n const type = getFunctionType(parameters, propertySpec);\n let expression;\n let isStep = false;\n if (type === 'interval') {\n expression = ['step', input];\n isStep = true;\n } else if (type === 'exponential') {\n const base = parameters.base !== undefined ? parameters.base : 1;\n expression = [getInterpolateOperator(parameters), base === 1 ? [\"linear\"] : [\"exponential\", base], input];\n\n } else {\n throw new Error(`Unknown zoom function type \"${type}\"`);\n }\n\n for (const stop of stops) {\n appendStopPair(expression, stop[0], stop[1], isStep);\n }\n\n fixupDegenerateStepCurve(expression);\n\n return expression;\n}\n\nfunction fixupDegenerateStepCurve(expression) {\n // degenerate step curve (i.e. a constant function): add a noop stop\n if (expression[0] === 'step' && expression.length === 3) {\n expression.push(0);\n expression.push(expression[3]);\n }\n}\n\nfunction appendStopPair(curve, input, output, isStep) {\n // Skip duplicate stop values. They were not validated for functions, but they are for expressions.\n // https://github.com/mapbox/mapbox-gl-js/issues/4107\n if (curve.length > 3 && input === curve[curve.length - 2]) {\n return;\n }\n // step curves don't get the first input value, as it is redundant.\n if (!(isStep && curve.length === 2)) {\n curve.push(input);\n }\n curve.push(output);\n}\n\nfunction getFunctionType(parameters, propertySpec) {\n if (parameters.type) {\n return parameters.type;\n } else {\n assert(propertySpec.expression);\n return (propertySpec.expression: any).interpolated ? 'exponential' : 'interval';\n }\n}\n\n// \"String with {name} token\" => [\"concat\", \"String with \", [\"get\", \"name\"], \" token\"]\nexport function convertTokenString(s: string): string | ExpressionSpecification {\n const result = ['concat'];\n const re = /{([^{}]+)}/g;\n let pos = 0;\n for (let match = re.exec(s); match !== null; match = re.exec(s)) {\n const literal = s.slice(pos, re.lastIndex - match[0].length);\n pos = re.lastIndex;\n if (literal.length > 0) result.push(literal);\n result.push(['get', match[1]]);\n }\n\n if (result.length === 1) {\n return s;\n }\n\n if (pos < s.length) {\n result.push(s.slice(pos));\n } else if (result.length === 2) {\n return ['to-string', result[1]];\n }\n\n return result;\n}\n\n","// @flow\n\nclass ParsingError extends Error {\n key: string;\n message: string;\n constructor(key: string, message: string) {\n super(message);\n this.message = message;\n this.key = key;\n }\n}\n\nexport default ParsingError;\n","// @flow\n\nimport type {Expression} from './expression.js';\n\n/**\n * Tracks `let` bindings during expression parsing.\n * @private\n */\nclass Scope {\n parent: ?Scope;\n bindings: {[_: string]: Expression};\n constructor(parent?: Scope, bindings: Array<[string, Expression]> = []) {\n this.parent = parent;\n this.bindings = {};\n for (const [name, expression] of bindings) {\n this.bindings[name] = expression;\n }\n }\n\n concat(bindings: Array<[string, Expression]>): Scope {\n return new Scope(this, bindings);\n }\n\n get(name: string): Expression {\n if (this.bindings[name]) { return this.bindings[name]; }\n if (this.parent) { return this.parent.get(name); }\n throw new Error(`${name} not found in scope.`);\n }\n\n has(name: string): boolean {\n if (this.bindings[name]) return true;\n return this.parent ? this.parent.has(name) : false;\n }\n}\n\nexport default Scope;\n","// @flow\n\nexport type NullTypeT = { kind: 'null' };\nexport type NumberTypeT = { kind: 'number' };\nexport type StringTypeT = { kind: 'string' };\nexport type BooleanTypeT = { kind: 'boolean' };\nexport type ColorTypeT = { kind: 'color' };\nexport type ObjectTypeT = { kind: 'object' };\nexport type ValueTypeT = { kind: 'value' };\nexport type ErrorTypeT = { kind: 'error' };\nexport type CollatorTypeT = { kind: 'collator' };\nexport type FormattedTypeT = { kind: 'formatted' };\nexport type ResolvedImageTypeT = { kind: 'resolvedImage' };\n\nexport type EvaluationKind = 'constant' | 'source' | 'camera' | 'composite';\n\nexport type Type =\n NullTypeT |\n NumberTypeT |\n StringTypeT |\n BooleanTypeT |\n ColorTypeT |\n ObjectTypeT |\n ValueTypeT |\n ArrayType | // eslint-disable-line no-use-before-define\n ErrorTypeT |\n CollatorTypeT |\n FormattedTypeT |\n ResolvedImageTypeT\n\nexport type ArrayType = {\n kind: 'array',\n itemType: Type,\n N: ?number\n}\n\nexport type NativeType = 'number' | 'string' | 'boolean' | 'null' | 'array' | 'object'\n\nexport const NullType = {kind: 'null'};\nexport const NumberType = {kind: 'number'};\nexport const StringType = {kind: 'string'};\nexport const BooleanType = {kind: 'boolean'};\nexport const ColorType = {kind: 'color'};\nexport const ObjectType = {kind: 'object'};\nexport const ValueType = {kind: 'value'};\nexport const ErrorType = {kind: 'error'};\nexport const CollatorType = {kind: 'collator'};\nexport const FormattedType = {kind: 'formatted'};\nexport const ResolvedImageType = {kind: 'resolvedImage'};\n\nexport function array(itemType: Type, N: ?number): ArrayType {\n return {\n kind: 'array',\n itemType,\n N\n };\n}\n\nexport function toString(type: Type): string {\n if (type.kind === 'array') {\n const itemType = toString(type.itemType);\n return typeof type.N === 'number' ?\n `array<${itemType}, ${type.N}>` :\n type.itemType.kind === 'value' ? 'array' : `array<${itemType}>`;\n } else {\n return type.kind;\n }\n}\n\nconst valueMemberTypes = [\n NullType,\n NumberType,\n StringType,\n BooleanType,\n ColorType,\n FormattedType,\n ObjectType,\n array(ValueType),\n ResolvedImageType\n];\n\n/**\n * Returns null if `t` is a subtype of `expected`; otherwise returns an\n * error message.\n * @private\n */\nexport function checkSubtype(expected: Type, t: Type): ?string {\n if (t.kind === 'error') {\n // Error is a subtype of every type\n return null;\n } else if (expected.kind === 'array') {\n if (t.kind === 'array' &&\n ((t.N === 0 && t.itemType.kind === 'value') || !checkSubtype(expected.itemType, t.itemType)) &&\n (typeof expected.N !== 'number' || expected.N === t.N)) {\n return null;\n }\n } else if (expected.kind === t.kind) {\n return null;\n } else if (expected.kind === 'value') {\n for (const memberType of valueMemberTypes) {\n if (!checkSubtype(memberType, t)) {\n return null;\n }\n }\n }\n\n return `Expected ${toString(expected)} but found ${toString(t)} instead.`;\n}\n\nexport function isValidType(provided: Type, allowedTypes: Array): boolean {\n return allowedTypes.some(t => t.kind === provided.kind);\n}\n\nexport function isValidNativeType(provided: any, allowedTypes: Array): boolean {\n return allowedTypes.some(t => {\n if (t === 'null') {\n return provided === null;\n } else if (t === 'array') {\n return Array.isArray(provided);\n } else if (t === 'object') {\n return provided && !Array.isArray(provided) && typeof provided === 'object';\n } else {\n return t === typeof provided;\n }\n });\n}\n","// @flow\n\n// Flow type declarations for Intl cribbed from\n// https://github.com/facebook/flow/issues/1270\n\ndeclare var Intl: {\n Collator: Class\n};\n\ndeclare class Intl$Collator {\n constructor (\n locales?: string | string[],\n options?: CollatorOptions\n ): Intl$Collator;\n\n static (\n locales?: string | string[],\n options?: CollatorOptions\n ): Intl$Collator;\n\n compare (a: string, b: string): number;\n\n resolvedOptions(): any;\n}\n\ntype CollatorOptions = {\n localeMatcher?: 'lookup' | 'best fit',\n usage?: 'sort' | 'search',\n sensitivity?: 'base' | 'accent' | 'case' | 'variant',\n ignorePunctuation?: boolean,\n numeric?: boolean,\n caseFirst?: 'upper' | 'lower' | 'false'\n}\n\nexport default class Collator {\n locale: string | null;\n sensitivity: 'base' | 'accent' | 'case' | 'variant';\n collator: Intl$Collator;\n\n constructor(caseSensitive: boolean, diacriticSensitive: boolean, locale: string | null) {\n if (caseSensitive)\n this.sensitivity = diacriticSensitive ? 'variant' : 'case';\n else\n this.sensitivity = diacriticSensitive ? 'accent' : 'base';\n\n this.locale = locale;\n this.collator = new Intl.Collator(this.locale ? this.locale : [],\n {sensitivity: this.sensitivity, usage: 'search'});\n }\n\n compare(lhs: string, rhs: string): number {\n return this.collator.compare(lhs, rhs);\n }\n\n resolvedLocale(): string {\n // We create a Collator without \"usage: search\" because we don't want\n // the search options encoded in our result (e.g. \"en-u-co-search\")\n return new Intl.Collator(this.locale ? this.locale : [])\n .resolvedOptions().locale;\n }\n}\n","// @flow\nimport type Color from '../../util/color.js';\nimport type ResolvedImage from '../types/resolved_image.js';\n\nexport class FormattedSection {\n text: string;\n image: ResolvedImage | null;\n scale: number | null;\n fontStack: string | null;\n textColor: Color | null;\n\n constructor(text: string, image: ResolvedImage | null, scale: number | null, fontStack: string | null, textColor: Color | null) {\n // combine characters so that diacritic marks are not separate code points\n this.text = text.normalize ? text.normalize() : text;\n this.image = image;\n this.scale = scale;\n this.fontStack = fontStack;\n this.textColor = textColor;\n }\n}\n\nexport default class Formatted {\n sections: Array;\n\n constructor(sections: Array) {\n this.sections = sections;\n }\n\n static fromString(unformatted: string): Formatted {\n return new Formatted([new FormattedSection(unformatted, null, null, null, null)]);\n }\n\n isEmpty(): boolean {\n if (this.sections.length === 0) return true;\n return !this.sections.some(section => section.text.length !== 0 ||\n (section.image && section.image.name.length !== 0));\n }\n\n static factory(text: Formatted | string): Formatted {\n if (text instanceof Formatted) {\n return text;\n } else {\n return Formatted.fromString(text);\n }\n }\n\n toString(): string {\n if (this.sections.length === 0) return '';\n return this.sections.map(section => section.text).join('');\n }\n\n serialize(): Array {\n const serialized: Array = [\"format\"];\n for (const section of this.sections) {\n if (section.image) {\n serialized.push([\"image\", section.image.name]);\n continue;\n }\n serialized.push(section.text);\n const options: { [key: string]: mixed } = {};\n if (section.fontStack) {\n options[\"text-font\"] = [\"literal\", section.fontStack.split(',')];\n }\n if (section.scale) {\n options[\"font-scale\"] = section.scale;\n }\n if (section.textColor) {\n options[\"text-color\"] = ([\"rgba\"]: Array).concat(section.textColor.toArray());\n }\n serialized.push(options);\n }\n return serialized;\n }\n}\n","// @flow\n\nexport type ResolvedImageOptions = {\n name: string,\n available: boolean\n};\n\nexport default class ResolvedImage {\n name: string;\n available: boolean;\n\n constructor(options: ResolvedImageOptions) {\n this.name = options.name;\n this.available = options.available;\n }\n\n toString(): string {\n return this.name;\n }\n\n static fromString(name: string): ResolvedImage | null {\n if (!name) return null; // treat empty values as no image\n return new ResolvedImage({name, available: false});\n }\n\n serialize(): Array {\n return [\"image\", this.name];\n }\n}\n","// @flow\n\nimport assert from 'assert';\n\nimport Color from '../util/color.js';\nimport Collator from './types/collator.js';\nimport Formatted from './types/formatted.js';\nimport ResolvedImage from './types/resolved_image.js';\nimport {NullType, NumberType, StringType, BooleanType, ColorType, ObjectType, ValueType, CollatorType, FormattedType, ResolvedImageType, array} from './types.js';\n\nimport type {Type} from './types.js';\n\nexport function validateRGBA(r: mixed, g: mixed, b: mixed, a?: mixed): string | null {\n if (!(\n typeof r === 'number' && r >= 0 && r <= 255 &&\n typeof g === 'number' && g >= 0 && g <= 255 &&\n typeof b === 'number' && b >= 0 && b <= 255\n )) {\n const value = typeof a === 'number' ? [r, g, b, a] : [r, g, b];\n return `Invalid rgba value [${value.join(', ')}]: 'r', 'g', and 'b' must be between 0 and 255.`;\n }\n\n if (!(\n typeof a === 'undefined' || (typeof a === 'number' && a >= 0 && a <= 1)\n )) {\n return `Invalid rgba value [${[r, g, b, a].join(', ')}]: 'a' must be between 0 and 1.`;\n }\n\n return null;\n}\n\nexport type Value = null | string | boolean | number | Color | Collator | Formatted | ResolvedImage | $ReadOnlyArray | { +[string]: Value }\n\nexport function isValue(mixed: mixed): boolean {\n if (mixed === null) {\n return true;\n } else if (typeof mixed === 'string') {\n return true;\n } else if (typeof mixed === 'boolean') {\n return true;\n } else if (typeof mixed === 'number') {\n return true;\n } else if (mixed instanceof Color) {\n return true;\n } else if (mixed instanceof Collator) {\n return true;\n } else if (mixed instanceof Formatted) {\n return true;\n } else if (mixed instanceof ResolvedImage) {\n return true;\n } else if (Array.isArray(mixed)) {\n for (const item of mixed) {\n if (!isValue(item)) {\n return false;\n }\n }\n return true;\n } else if (typeof mixed === 'object') {\n for (const key in mixed) {\n if (!isValue(mixed[key])) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n}\n\nexport function typeOf(value: Value): Type {\n if (value === null) {\n return NullType;\n } else if (typeof value === 'string') {\n return StringType;\n } else if (typeof value === 'boolean') {\n return BooleanType;\n } else if (typeof value === 'number') {\n return NumberType;\n } else if (value instanceof Color) {\n return ColorType;\n } else if (value instanceof Collator) {\n return CollatorType;\n } else if (value instanceof Formatted) {\n return FormattedType;\n } else if (value instanceof ResolvedImage) {\n return ResolvedImageType;\n } else if (Array.isArray(value)) {\n const length = value.length;\n let itemType: Type | typeof undefined;\n\n for (const item of value) {\n const t = typeOf(item);\n if (!itemType) {\n itemType = t;\n } else if (itemType === t) {\n continue;\n } else {\n itemType = ValueType;\n break;\n }\n }\n\n return array(itemType || ValueType, length);\n } else {\n assert(typeof value === 'object');\n return ObjectType;\n }\n}\n\nexport function toString(value: Value): string {\n const type = typeof value;\n if (value === null) {\n return '';\n } else if (type === 'string' || type === 'number' || type === 'boolean') {\n return String(value);\n } else if (value instanceof Color || value instanceof Formatted || value instanceof ResolvedImage) {\n return value.toString();\n } else {\n return JSON.stringify(value);\n }\n}\n\nexport {Color, Collator};\n","// @flow\n\nimport assert from 'assert';\nimport {isValue, typeOf, Color} from '../values.js';\nimport Formatted from '../types/formatted.js';\n\nimport type {Type} from '../types.js';\nimport type {Value} from '../values.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\n\nclass Literal implements Expression {\n type: Type;\n value: Value;\n\n constructor(type: Type, value: Value) {\n this.type = type;\n this.value = value;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): void | Literal {\n if (args.length !== 2)\n return context.error(`'literal' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n\n if (!isValue(args[1]))\n return context.error(`invalid value`);\n\n const value = (args[1]: any);\n let type = typeOf(value);\n\n // special case: infer the item type if possible for zero-length arrays\n const expected = context.expectedType;\n if (\n type.kind === 'array' &&\n type.N === 0 &&\n expected &&\n expected.kind === 'array' &&\n (typeof expected.N !== 'number' || expected.N === 0)\n ) {\n type = expected;\n }\n\n return new Literal(type, value);\n }\n\n evaluate(): Value {\n return this.value;\n }\n\n eachChild() {}\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n if (this.type.kind === 'array' || this.type.kind === 'object') {\n return [\"literal\", this.value];\n } else if (this.value instanceof Color) {\n // Constant-folding can generate Literal expressions that you\n // couldn't actually generate with a \"literal\" expression,\n // so we have to implement an equivalent serialization here\n return [\"rgba\"].concat(this.value.toArray());\n } else if (this.value instanceof Formatted) {\n // Same as Color\n return this.value.serialize();\n } else {\n assert(this.value === null ||\n typeof this.value === 'string' ||\n typeof this.value === 'number' ||\n typeof this.value === 'boolean');\n return (this.value: any);\n }\n }\n}\n\nexport default Literal;\n","// @flow\n\nclass RuntimeError {\n name: string;\n message: string;\n\n constructor(message: string) {\n this.name = 'ExpressionEvaluationError';\n this.message = message;\n }\n\n toJSON(): string {\n return this.message;\n }\n}\n\nexport default RuntimeError;\n","// @flow\n\nimport assert from 'assert';\n\nimport {\n ObjectType,\n ValueType,\n StringType,\n NumberType,\n BooleanType,\n checkSubtype,\n toString,\n array\n} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nconst types = {\n string: StringType,\n number: NumberType,\n boolean: BooleanType,\n object: ObjectType\n};\n\nclass Assertion implements Expression {\n type: Type;\n args: Array;\n\n constructor(type: Type, args: Array) {\n this.type = type;\n this.args = args;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length < 2)\n return context.error(`Expected at least one argument.`);\n\n let i = 1;\n let type;\n\n const name: string = (args[0]: any);\n if (name === 'array') {\n let itemType;\n if (args.length > 2) {\n const type = args[1];\n if (typeof type !== 'string' || !(type in types) || type === 'object')\n return context.error('The item type argument of \"array\" must be one of string, number, boolean', 1);\n itemType = types[type];\n i++;\n } else {\n itemType = ValueType;\n }\n\n let N;\n if (args.length > 3) {\n if (args[2] !== null &&\n (typeof args[2] !== 'number' ||\n args[2] < 0 ||\n args[2] !== Math.floor(args[2]))\n ) {\n return context.error('The length argument to \"array\" must be a positive integer literal', 2);\n }\n N = args[2];\n i++;\n }\n\n type = array(itemType, N);\n } else {\n assert(types[name], name);\n type = types[name];\n }\n\n const parsed = [];\n for (; i < args.length; i++) {\n const input = context.parse(args[i], i, ValueType);\n if (!input) return null;\n parsed.push(input);\n }\n\n return new Assertion(type, parsed);\n }\n\n evaluate(ctx: EvaluationContext): any | null {\n for (let i = 0; i < this.args.length; i++) {\n const value = this.args[i].evaluate(ctx);\n const error = checkSubtype(this.type, typeOf(value));\n if (!error) {\n return value;\n } else if (i === this.args.length - 1) {\n throw new RuntimeError(`Expected value to be of type ${toString(this.type)}, but found ${toString(typeOf(value))} instead.`);\n }\n }\n\n assert(false);\n return null;\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return this.args.every(arg => arg.outputDefined());\n }\n\n serialize(): SerializedExpression {\n const type = this.type;\n const serialized = [type.kind];\n if (type.kind === 'array') {\n const itemType = type.itemType;\n if (itemType.kind === 'string' ||\n itemType.kind === 'number' ||\n itemType.kind === 'boolean') {\n serialized.push(itemType.kind);\n const N = type.N;\n if (typeof N === 'number' || this.args.length > 1) {\n serialized.push(N);\n }\n }\n }\n return serialized.concat(this.args.map(arg => arg.serialize()));\n }\n}\n\nexport default Assertion;\n","// @flow\n\nimport {NumberType, ValueType, FormattedType, array, StringType, ColorType, ResolvedImageType} from '../types.js';\nimport Formatted, {FormattedSection} from '../types/formatted.js';\nimport {toString, typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\ntype FormattedSectionExpression = {\n // Content of a section may be Image expression or other\n // type of expression that is coercable to 'string'.\n content: Expression,\n scale: Expression | null;\n font: Expression | null;\n textColor: Expression | null;\n}\n\nexport default class FormatExpression implements Expression {\n type: Type;\n sections: Array;\n\n constructor(sections: Array) {\n this.type = FormattedType;\n this.sections = sections;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length < 2) {\n return context.error(`Expected at least one argument.`);\n }\n\n const firstArg = args[1];\n if (!Array.isArray(firstArg) && typeof firstArg === 'object') {\n return context.error(`First argument must be an image or text section.`);\n }\n\n const sections: Array = [];\n let nextTokenMayBeObject = false;\n for (let i = 1; i <= args.length - 1; ++i) {\n const arg = (args[i]: any);\n\n if (nextTokenMayBeObject && typeof arg === \"object\" && !Array.isArray(arg)) {\n nextTokenMayBeObject = false;\n\n let scale = null;\n if (arg['font-scale']) {\n scale = context.parse(arg['font-scale'], 1, NumberType);\n if (!scale) return null;\n }\n\n let font = null;\n if (arg['text-font']) {\n font = context.parse(arg['text-font'], 1, array(StringType));\n if (!font) return null;\n }\n\n let textColor = null;\n if (arg['text-color']) {\n textColor = context.parse(arg['text-color'], 1, ColorType);\n if (!textColor) return null;\n }\n\n const lastExpression = sections[sections.length - 1];\n lastExpression.scale = scale;\n lastExpression.font = font;\n lastExpression.textColor = textColor;\n } else {\n const content = context.parse(args[i], 1, ValueType);\n if (!content) return null;\n\n const kind = content.type.kind;\n if (kind !== 'string' && kind !== 'value' && kind !== 'null' && kind !== 'resolvedImage')\n return context.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);\n\n nextTokenMayBeObject = true;\n sections.push({content, scale: null, font: null, textColor: null});\n }\n }\n\n return new FormatExpression(sections);\n }\n\n evaluate(ctx: EvaluationContext): Formatted {\n const evaluateSection = section => {\n const evaluatedContent = section.content.evaluate(ctx);\n if (typeOf(evaluatedContent) === ResolvedImageType) {\n return new FormattedSection('', evaluatedContent, null, null, null);\n }\n\n return new FormattedSection(\n toString(evaluatedContent),\n null,\n section.scale ? section.scale.evaluate(ctx) : null,\n section.font ? section.font.evaluate(ctx).join(',') : null,\n section.textColor ? section.textColor.evaluate(ctx) : null\n );\n };\n\n return new Formatted(this.sections.map(evaluateSection));\n }\n\n eachChild(fn: (_: Expression) => void) {\n for (const section of this.sections) {\n fn(section.content);\n if (section.scale) {\n fn(section.scale);\n }\n if (section.font) {\n fn(section.font);\n }\n if (section.textColor) {\n fn(section.textColor);\n }\n }\n }\n\n outputDefined(): boolean {\n // Technically the combinatoric set of all children\n // Usually, this.text will be undefined anyway\n return false;\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"format\"];\n for (const section of this.sections) {\n serialized.push(section.content.serialize());\n const options = {};\n if (section.scale) {\n options['font-scale'] = section.scale.serialize();\n }\n if (section.font) {\n options['text-font'] = section.font.serialize();\n }\n if (section.textColor) {\n options['text-color'] = section.textColor.serialize();\n }\n serialized.push(options);\n }\n return serialized;\n }\n}\n","// @flow\n\nimport {ResolvedImageType, StringType} from '../types.js';\nimport ResolvedImage from '../types/resolved_image.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\nexport default class ImageExpression implements Expression {\n type: Type;\n input: Expression;\n\n constructor(input: Expression) {\n this.type = ResolvedImageType;\n this.input = input;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 2) {\n return context.error(`Expected two arguments.`);\n }\n\n const name = context.parse(args[1], 1, StringType);\n if (!name) return context.error(`No image name provided.`);\n\n return new ImageExpression(name);\n }\n\n evaluate(ctx: EvaluationContext): null | ResolvedImage {\n const evaluatedImageName = this.input.evaluate(ctx);\n\n const value = ResolvedImage.fromString(evaluatedImageName);\n if (value && ctx.availableImages) value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1;\n\n return value;\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n }\n\n outputDefined(): boolean {\n // The output of image is determined by the list of available images in the evaluation context\n return false;\n }\n\n serialize(): SerializedExpression {\n return [\"image\", this.input.serialize()];\n }\n}\n","// @flow\n\nimport assert from 'assert';\n\nimport {BooleanType, ColorType, NumberType, StringType, ValueType} from '../types.js';\nimport {Color, toString as valueToString, validateRGBA} from '../values.js';\nimport RuntimeError from '../runtime_error.js';\nimport Formatted from '../types/formatted.js';\nimport FormatExpression from '../definitions/format.js';\nimport ImageExpression from '../definitions/image.js';\nimport ResolvedImage from '../types/resolved_image.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nconst types = {\n 'to-boolean': BooleanType,\n 'to-color': ColorType,\n 'to-number': NumberType,\n 'to-string': StringType\n};\n\n/**\n * Special form for error-coalescing coercion expressions \"to-number\",\n * \"to-color\". Since these coercions can fail at runtime, they accept multiple\n * arguments, only evaluating one at a time until one succeeds.\n *\n * @private\n */\nclass Coercion implements Expression {\n type: Type;\n args: Array;\n\n constructor(type: Type, args: Array) {\n this.type = type;\n this.args = args;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length < 2)\n return context.error(`Expected at least one argument.`);\n\n const name: string = (args[0]: any);\n assert(types[name], name);\n\n if ((name === 'to-boolean' || name === 'to-string') && args.length !== 2)\n return context.error(`Expected one argument.`);\n\n const type = types[name];\n\n const parsed = [];\n for (let i = 1; i < args.length; i++) {\n const input = context.parse(args[i], i, ValueType);\n if (!input) return null;\n parsed.push(input);\n }\n\n return new Coercion(type, parsed);\n }\n\n evaluate(ctx: EvaluationContext): null | boolean | number | string | Color | Formatted | ResolvedImage {\n if (this.type.kind === 'boolean') {\n return Boolean(this.args[0].evaluate(ctx));\n } else if (this.type.kind === 'color') {\n let input;\n let error;\n for (const arg of this.args) {\n input = arg.evaluate(ctx);\n error = null;\n if (input instanceof Color) {\n return input;\n } else if (typeof input === 'string') {\n const c = ctx.parseColor(input);\n if (c) return c;\n } else if (Array.isArray(input)) {\n if (input.length < 3 || input.length > 4) {\n error = `Invalid rbga value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;\n } else {\n error = validateRGBA(input[0], input[1], input[2], input[3]);\n }\n if (!error) {\n return new Color((input[0]: any) / 255, (input[1]: any) / 255, (input[2]: any) / 255, (input[3]: any));\n }\n }\n }\n throw new RuntimeError(error || `Could not parse color from value '${typeof input === 'string' ? input : String(JSON.stringify(input))}'`);\n } else if (this.type.kind === 'number') {\n let value = null;\n for (const arg of this.args) {\n value = arg.evaluate(ctx);\n if (value === null) return 0;\n const num = Number(value);\n if (isNaN(num)) continue;\n return num;\n }\n throw new RuntimeError(`Could not convert ${JSON.stringify(value)} to number.`);\n } else if (this.type.kind === 'formatted') {\n // There is no explicit 'to-formatted' but this coercion can be implicitly\n // created by properties that expect the 'formatted' type.\n return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));\n } else if (this.type.kind === 'resolvedImage') {\n return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));\n } else {\n return valueToString(this.args[0].evaluate(ctx));\n }\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return this.args.every(arg => arg.outputDefined());\n }\n\n serialize(): SerializedExpression {\n if (this.type.kind === 'formatted') {\n return new FormatExpression([{content: this.args[0], scale: null, font: null, textColor: null}]).serialize();\n }\n\n if (this.type.kind === 'resolvedImage') {\n return new ImageExpression(this.args[0]).serialize();\n }\n\n const serialized = [`to-${this.type.kind}`];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Coercion;\n","// @flow\n\nimport {Color} from './values.js';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {FormattedSection} from './types/formatted.js';\nimport type {GlobalProperties, Feature, FeatureState} from './index.js';\nimport type {CanonicalTileID} from '../../source/tile_id.js';\nimport type {FeatureDistanceData} from '../feature_filter/index.js';\n\nconst geometryTypes = ['Unknown', 'Point', 'LineString', 'Polygon'];\n\nclass EvaluationContext {\n globals: GlobalProperties;\n feature: ?Feature;\n featureState: ?FeatureState;\n formattedSection: ?FormattedSection;\n availableImages: ?Array;\n canonical: null | CanonicalTileID;\n featureTileCoord: ?Point;\n featureDistanceData: ?FeatureDistanceData;\n\n _parseColorCache: {[_: string]: ?Color};\n\n constructor() {\n this.globals = (null: any);\n this.feature = null;\n this.featureState = null;\n this.formattedSection = null;\n this._parseColorCache = {};\n this.availableImages = null;\n this.canonical = null;\n this.featureTileCoord = null;\n this.featureDistanceData = null;\n }\n\n id(): number | null {\n return this.feature && this.feature.id !== undefined ? this.feature.id : null;\n }\n\n geometryType(): null | string {\n return this.feature ? typeof this.feature.type === 'number' ? geometryTypes[this.feature.type] : this.feature.type : null;\n }\n\n geometry(): ?Array> {\n return this.feature && 'geometry' in this.feature ? this.feature.geometry : null;\n }\n\n canonicalID(): null | CanonicalTileID {\n return this.canonical;\n }\n\n properties(): {[string]: any} {\n return (this.feature && this.feature.properties) || {};\n }\n\n distanceFromCenter(): number {\n if (this.featureTileCoord && this.featureDistanceData) {\n\n const c = this.featureDistanceData.center;\n const scale = this.featureDistanceData.scale;\n const {x, y} = this.featureTileCoord;\n\n // Calculate the distance vector `d` (left handed)\n const dX = x * scale - c[0];\n const dY = y * scale - c[1];\n\n // The bearing vector `b` (left handed)\n const bX = this.featureDistanceData.bearing[0];\n const bY = this.featureDistanceData.bearing[1];\n\n // Distance is calculated as `dot(d, v)`\n const dist = (bX * dX + bY * dY);\n return dist;\n }\n\n return 0;\n }\n\n parseColor(input: string): ?Color {\n let cached = this._parseColorCache[input];\n if (!cached) {\n cached = this._parseColorCache[input] = Color.parse(input);\n }\n return cached;\n }\n}\n\nexport default EvaluationContext;\n","// @flow\n\nimport {toString} from './types.js';\n\nimport ParsingContext from './parsing_context.js';\nimport EvaluationContext from './evaluation_context.js';\nimport assert from 'assert';\n\nimport type {Expression, ExpressionRegistry} from './expression.js';\nimport type {Type} from './types.js';\nimport type {Value} from './values.js';\n\nexport type Varargs = {| type: Type |};\ntype Signature = Array | Varargs;\ntype Evaluate = (EvaluationContext, Array) => Value;\ntype Definition = [Type, Signature, Evaluate] |\n {|type: Type, overloads: Array<[Signature, Evaluate]>|};\n\nclass CompoundExpression implements Expression {\n name: string;\n type: Type;\n _evaluate: Evaluate;\n args: Array;\n\n static definitions: {[_: string]: Definition };\n\n constructor(name: string, type: Type, evaluate: Evaluate, args: Array) {\n this.name = name;\n this.type = type;\n this._evaluate = evaluate;\n this.args = args;\n }\n\n evaluate(ctx: EvaluationContext): Value {\n return this._evaluate(ctx, this.args);\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): Array {\n return [this.name].concat(this.args.map(arg => arg.serialize()));\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n const op: string = (args[0]: any);\n const definition = CompoundExpression.definitions[op];\n if (!definition) {\n return context.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n }\n\n // Now check argument types against each signature\n const type = Array.isArray(definition) ?\n definition[0] : definition.type;\n\n const availableOverloads = Array.isArray(definition) ?\n [[definition[1], definition[2]]] :\n definition.overloads;\n\n const overloads = availableOverloads.filter(([signature]) => (\n !Array.isArray(signature) || // varags\n signature.length === args.length - 1 // correct param count\n ));\n\n let signatureContext: ParsingContext = (null: any);\n\n for (const [params, evaluate] of overloads) {\n // Use a fresh context for each attempted signature so that, if\n // we eventually succeed, we haven't polluted `context.errors`.\n signatureContext = new ParsingContext(context.registry, context.path, null, context.scope);\n\n // First parse all the args, potentially coercing to the\n // types expected by this overload.\n const parsedArgs: Array = [];\n let argParseFailed = false;\n for (let i = 1; i < args.length; i++) {\n const arg = args[i];\n const expectedType = Array.isArray(params) ?\n params[i - 1] :\n params.type;\n\n const parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType);\n if (!parsed) {\n argParseFailed = true;\n break;\n }\n parsedArgs.push(parsed);\n }\n if (argParseFailed) {\n // Couldn't coerce args of this overload to expected type, move\n // on to next one.\n continue;\n }\n\n if (Array.isArray(params)) {\n if (params.length !== parsedArgs.length) {\n signatureContext.error(`Expected ${params.length} arguments, but found ${parsedArgs.length} instead.`);\n continue;\n }\n }\n\n for (let i = 0; i < parsedArgs.length; i++) {\n const expected = Array.isArray(params) ? params[i] : params.type;\n const arg = parsedArgs[i];\n signatureContext.concat(i + 1).checkSubtype(expected, arg.type);\n }\n\n if (signatureContext.errors.length === 0) {\n return new CompoundExpression(op, type, evaluate, parsedArgs);\n }\n }\n\n assert(!signatureContext || signatureContext.errors.length > 0);\n\n if (overloads.length === 1) {\n context.errors.push(...signatureContext.errors);\n } else {\n const expected = overloads.length ? overloads : availableOverloads;\n const signatures = expected\n .map(([params]) => stringifySignature(params))\n .join(' | ');\n\n const actualTypes = [];\n // For error message, re-parse arguments without trying to\n // apply any coercions\n for (let i = 1; i < args.length; i++) {\n const parsed = context.parse(args[i], 1 + actualTypes.length);\n if (!parsed) return null;\n actualTypes.push(toString(parsed.type));\n }\n context.error(`Expected arguments of type ${signatures}, but found (${actualTypes.join(', ')}) instead.`);\n }\n\n return null;\n }\n\n static register(\n registry: ExpressionRegistry,\n definitions: {[_: string]: Definition }\n ) {\n assert(!CompoundExpression.definitions);\n CompoundExpression.definitions = definitions;\n for (const name in definitions) {\n registry[name] = CompoundExpression;\n }\n }\n}\n\nfunction stringifySignature(signature: Signature): string {\n if (Array.isArray(signature)) {\n return `(${signature.map(toString).join(', ')})`;\n } else {\n return `(${toString(signature.type)}...)`;\n }\n}\n\nexport default CompoundExpression;\n","// @flow\n\nimport {StringType, BooleanType, CollatorType} from '../types.js';\nimport Collator from '../types/collator.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\nexport default class CollatorExpression implements Expression {\n type: Type;\n caseSensitive: Expression;\n diacriticSensitive: Expression;\n locale: Expression | null;\n\n constructor(caseSensitive: Expression, diacriticSensitive: Expression, locale: Expression | null) {\n this.type = CollatorType;\n this.locale = locale;\n this.caseSensitive = caseSensitive;\n this.diacriticSensitive = diacriticSensitive;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 2)\n return context.error(`Expected one argument.`);\n\n const options = (args[1]: any);\n if (typeof options !== \"object\" || Array.isArray(options))\n return context.error(`Collator options argument must be an object.`);\n\n const caseSensitive = context.parse(\n options['case-sensitive'] === undefined ? false : options['case-sensitive'], 1, BooleanType);\n if (!caseSensitive) return null;\n\n const diacriticSensitive = context.parse(\n options['diacritic-sensitive'] === undefined ? false : options['diacritic-sensitive'], 1, BooleanType);\n if (!diacriticSensitive) return null;\n\n let locale = null;\n if (options['locale']) {\n locale = context.parse(options['locale'], 1, StringType);\n if (!locale) return null;\n }\n\n return new CollatorExpression(caseSensitive, diacriticSensitive, locale);\n }\n\n evaluate(ctx: EvaluationContext): Collator {\n return new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.caseSensitive);\n fn(this.diacriticSensitive);\n if (this.locale) {\n fn(this.locale);\n }\n }\n\n outputDefined(): boolean {\n // Technically the set of possible outputs is the combinatoric set of Collators produced\n // by all possible outputs of locale/caseSensitive/diacriticSensitive\n // But for the primary use of Collators in comparison operators, we ignore the Collator's\n // possible outputs anyway, so we can get away with leaving this false for now.\n return false;\n }\n\n serialize(): SerializedExpression {\n const options = {};\n options['case-sensitive'] = this.caseSensitive.serialize();\n options['diacritic-sensitive'] = this.diacriticSensitive.serialize();\n if (this.locale) {\n options['locale'] = this.locale.serialize();\n }\n return [\"collator\", options];\n }\n}\n","// @flow\n\nimport {isValue} from '../values.js';\nimport type {Type} from '../types.js';\nimport {BooleanType} from '../types.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {GeoJSON, GeoJSONPolygon, GeoJSONMultiPolygon} from '@mapbox/geojson-types';\nimport type {CanonicalTileID} from '../../../source/tile_id.js';\n\ntype GeoJSONPolygons =| GeoJSONPolygon | GeoJSONMultiPolygon;\n\n// minX, minY, maxX, maxY\ntype BBox = [number, number, number, number];\nconst EXTENT = 8192;\n\nfunction updateBBox(bbox: BBox, coord: [number, number]) {\n bbox[0] = Math.min(bbox[0], coord[0]);\n bbox[1] = Math.min(bbox[1], coord[1]);\n bbox[2] = Math.max(bbox[2], coord[0]);\n bbox[3] = Math.max(bbox[3], coord[1]);\n}\n\nfunction mercatorXfromLng(lng: number) {\n return (180 + lng) / 360;\n}\n\nfunction mercatorYfromLat(lat: number) {\n return (180 - (180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360)))) / 360;\n}\n\nfunction boxWithinBox(bbox1: BBox, bbox2: BBox) {\n if (bbox1[0] <= bbox2[0]) return false;\n if (bbox1[2] >= bbox2[2]) return false;\n if (bbox1[1] <= bbox2[1]) return false;\n if (bbox1[3] >= bbox2[3]) return false;\n return true;\n}\n\nfunction getTileCoordinates(p, canonical: CanonicalTileID) {\n const x = mercatorXfromLng(p[0]);\n const y = mercatorYfromLat(p[1]);\n const tilesAtZoom = Math.pow(2, canonical.z);\n return [Math.round(x * tilesAtZoom * EXTENT), Math.round(y * tilesAtZoom * EXTENT)];\n}\n\nfunction onBoundary(p, p1, p2) {\n const x1 = p[0] - p1[0];\n const y1 = p[1] - p1[1];\n const x2 = p[0] - p2[0];\n const y2 = p[1] - p2[1];\n return (x1 * y2 - x2 * y1 === 0) && (x1 * x2 <= 0) && (y1 * y2 <= 0);\n}\n\nfunction rayIntersect(p, p1, p2) {\n return ((p1[1] > p[1]) !== (p2[1] > p[1])) && (p[0] < (p2[0] - p1[0]) * (p[1] - p1[1]) / (p2[1] - p1[1]) + p1[0]);\n}\n\n// ray casting algorithm for detecting if point is in polygon\nfunction pointWithinPolygon(point, rings) {\n let inside = false;\n for (let i = 0, len = rings.length; i < len; i++) {\n const ring = rings[i];\n for (let j = 0, len2 = ring.length; j < len2 - 1; j++) {\n if (onBoundary(point, ring[j], ring[j + 1])) return false;\n if (rayIntersect(point, ring[j], ring[j + 1])) inside = !inside;\n }\n }\n return inside;\n}\n\nfunction pointWithinPolygons(point, polygons) {\n for (let i = 0; i < polygons.length; i++) {\n if (pointWithinPolygon(point, polygons[i])) return true;\n }\n return false;\n}\n\nfunction perp(v1, v2) {\n return (v1[0] * v2[1] - v1[1] * v2[0]);\n}\n\n// check if p1 and p2 are in different sides of line segment q1->q2\nfunction twoSided(p1, p2, q1, q2) {\n // q1->p1 (x1, y1), q1->p2 (x2, y2), q1->q2 (x3, y3)\n const x1 = p1[0] - q1[0];\n const y1 = p1[1] - q1[1];\n const x2 = p2[0] - q1[0];\n const y2 = p2[1] - q1[1];\n const x3 = q2[0] - q1[0];\n const y3 = q2[1] - q1[1];\n const det1 = (x1 * y3 - x3 * y1);\n const det2 = (x2 * y3 - x3 * y2);\n if ((det1 > 0 && det2 < 0) || (det1 < 0 && det2 > 0)) return true;\n return false;\n}\n// a, b are end points for line segment1, c and d are end points for line segment2\nfunction lineIntersectLine(a, b, c, d) {\n // check if two segments are parallel or not\n // precondition is end point a, b is inside polygon, if line a->b is\n // parallel to polygon edge c->d, then a->b won't intersect with c->d\n const vectorP = [b[0] - a[0], b[1] - a[1]];\n const vectorQ = [d[0] - c[0], d[1] - c[1]];\n if (perp(vectorQ, vectorP) === 0) return false;\n\n // If lines are intersecting with each other, the relative location should be:\n // a and b lie in different sides of segment c->d\n // c and d lie in different sides of segment a->b\n if (twoSided(a, b, c, d) && twoSided(c, d, a, b)) return true;\n return false;\n}\n\nfunction lineIntersectPolygon(p1, p2, polygon) {\n for (const ring of polygon) {\n // loop through every edge of the ring\n for (let j = 0; j < ring.length - 1; ++j) {\n if (lineIntersectLine(p1, p2, ring[j], ring[j + 1])) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction lineStringWithinPolygon(line, polygon) {\n // First, check if geometry points of line segments are all inside polygon\n for (let i = 0; i < line.length; ++i) {\n if (!pointWithinPolygon(line[i], polygon)) {\n return false;\n }\n }\n\n // Second, check if there is line segment intersecting polygon edge\n for (let i = 0; i < line.length - 1; ++i) {\n if (lineIntersectPolygon(line[i], line[i + 1], polygon)) {\n return false;\n }\n }\n return true;\n}\n\nfunction lineStringWithinPolygons(line, polygons) {\n for (let i = 0; i < polygons.length; i++) {\n if (lineStringWithinPolygon(line, polygons[i])) return true;\n }\n return false;\n}\n\nfunction getTilePolygon(coordinates, bbox: BBox, canonical: CanonicalTileID) {\n const polygon = [];\n for (let i = 0; i < coordinates.length; i++) {\n const ring = [];\n for (let j = 0; j < coordinates[i].length; j++) {\n const coord = getTileCoordinates(coordinates[i][j], canonical);\n updateBBox(bbox, coord);\n ring.push(coord);\n }\n polygon.push(ring);\n }\n return polygon;\n}\n\nfunction getTilePolygons(coordinates, bbox, canonical: CanonicalTileID) {\n const polygons = [];\n for (let i = 0; i < coordinates.length; i++) {\n const polygon = getTilePolygon(coordinates[i], bbox, canonical);\n polygons.push(polygon);\n }\n return polygons;\n}\n\nfunction updatePoint(p, bbox, polyBBox, worldSize) {\n if (p[0] < polyBBox[0] || p[0] > polyBBox[2]) {\n const halfWorldSize = worldSize * 0.5;\n let shift = (p[0] - polyBBox[0] > halfWorldSize) ? -worldSize : (polyBBox[0] - p[0] > halfWorldSize) ? worldSize : 0;\n if (shift === 0) {\n shift = (p[0] - polyBBox[2] > halfWorldSize) ? -worldSize : (polyBBox[2] - p[0] > halfWorldSize) ? worldSize : 0;\n }\n p[0] += shift;\n }\n updateBBox(bbox, p);\n}\n\nfunction resetBBox(bbox) {\n bbox[0] = bbox[1] = Infinity;\n bbox[2] = bbox[3] = -Infinity;\n}\n\nfunction getTilePoints(geometry, pointBBox, polyBBox, canonical: CanonicalTileID) {\n const worldSize = Math.pow(2, canonical.z) * EXTENT;\n const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n const tilePoints = [];\n if (!geometry) return tilePoints;\n for (const points of geometry) {\n for (const point of points) {\n const p = [point.x + shifts[0], point.y + shifts[1]];\n updatePoint(p, pointBBox, polyBBox, worldSize);\n tilePoints.push(p);\n }\n }\n return tilePoints;\n}\n\nfunction getTileLines(geometry, lineBBox, polyBBox, canonical: CanonicalTileID) {\n const worldSize = Math.pow(2, canonical.z) * EXTENT;\n const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n const tileLines = [];\n if (!geometry) return tileLines;\n for (const line of geometry) {\n const tileLine = [];\n for (const point of line) {\n const p = [point.x + shifts[0], point.y + shifts[1]];\n updateBBox(lineBBox, p);\n tileLine.push(p);\n }\n tileLines.push(tileLine);\n }\n if (lineBBox[2] - lineBBox[0] <= worldSize / 2) {\n resetBBox(lineBBox);\n for (const line of tileLines) {\n for (const p of line) {\n updatePoint(p, lineBBox, polyBBox, worldSize);\n }\n }\n }\n return tileLines;\n}\n\nfunction pointsWithinPolygons(ctx: EvaluationContext, polygonGeometry: GeoJSONPolygons) {\n const pointBBox = [Infinity, Infinity, -Infinity, -Infinity];\n const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n\n const canonical = ctx.canonicalID();\n if (!canonical) {\n return false;\n }\n\n if (polygonGeometry.type === 'Polygon') {\n const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n if (!boxWithinBox(pointBBox, polyBBox)) return false;\n\n for (const point of tilePoints) {\n if (!pointWithinPolygon(point, tilePolygon)) return false;\n }\n }\n if (polygonGeometry.type === 'MultiPolygon') {\n const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n if (!boxWithinBox(pointBBox, polyBBox)) return false;\n\n for (const point of tilePoints) {\n if (!pointWithinPolygons(point, tilePolygons)) return false;\n }\n }\n\n return true;\n}\n\nfunction linesWithinPolygons(ctx: EvaluationContext, polygonGeometry: GeoJSONPolygons) {\n const lineBBox = [Infinity, Infinity, -Infinity, -Infinity];\n const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n\n const canonical = ctx.canonicalID();\n if (!canonical) {\n return false;\n }\n\n if (polygonGeometry.type === 'Polygon') {\n const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n if (!boxWithinBox(lineBBox, polyBBox)) return false;\n\n for (const line of tileLines) {\n if (!lineStringWithinPolygon(line, tilePolygon)) return false;\n }\n }\n if (polygonGeometry.type === 'MultiPolygon') {\n const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n if (!boxWithinBox(lineBBox, polyBBox)) return false;\n\n for (const line of tileLines) {\n if (!lineStringWithinPolygons(line, tilePolygons)) return false;\n }\n }\n return true;\n}\n\nclass Within implements Expression {\n type: Type;\n geojson: GeoJSON\n geometries: GeoJSONPolygons;\n\n constructor(geojson: GeoJSON, geometries: GeoJSONPolygons) {\n this.type = BooleanType;\n this.geojson = geojson;\n this.geometries = geometries;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Within {\n if (args.length !== 2)\n return context.error(`'within' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n if (isValue(args[1])) {\n const geojson = (args[1]: Object);\n if (geojson.type === 'FeatureCollection') {\n for (let i = 0; i < geojson.features.length; ++i) {\n const type = geojson.features[i].geometry.type;\n if (type === 'Polygon' || type === 'MultiPolygon') {\n return new Within(geojson, geojson.features[i].geometry);\n }\n }\n } else if (geojson.type === 'Feature') {\n const type = geojson.geometry.type;\n if (type === 'Polygon' || type === 'MultiPolygon') {\n return new Within(geojson, geojson.geometry);\n }\n } else if (geojson.type === 'Polygon' || geojson.type === 'MultiPolygon') {\n return new Within(geojson, geojson);\n }\n }\n return context.error(`'within' expression requires valid geojson object that contains polygon geometry type.`);\n }\n\n evaluate(ctx: EvaluationContext): boolean {\n if (ctx.geometry() != null && ctx.canonicalID() != null) {\n if (ctx.geometryType() === 'Point') {\n return pointsWithinPolygons(ctx, this.geometries);\n } else if (ctx.geometryType() === 'LineString') {\n return linesWithinPolygons(ctx, this.geometries);\n }\n }\n return false;\n }\n\n eachChild() {}\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n return [\"within\", this.geojson];\n }\n\n}\n\nexport default Within;\n","// @flow\n\nimport CompoundExpression from './compound_expression.js';\nimport Within from './definitions/within.js';\nimport type {Expression} from './expression.js';\n\nfunction isFeatureConstant(e: Expression): boolean {\n if (e instanceof CompoundExpression) {\n if (e.name === 'get' && e.args.length === 1) {\n return false;\n } else if (e.name === 'feature-state') {\n return false;\n } else if (e.name === 'has' && e.args.length === 1) {\n return false;\n } else if (\n e.name === 'properties' ||\n e.name === 'geometry-type' ||\n e.name === 'id'\n ) {\n return false;\n } else if (/^filter-/.test(e.name)) {\n return false;\n }\n }\n\n if (e instanceof Within) {\n return false;\n }\n\n let result = true;\n e.eachChild(arg => {\n if (result && !isFeatureConstant(arg)) { result = false; }\n });\n return result;\n}\n\nfunction isStateConstant(e: Expression): boolean {\n if (e instanceof CompoundExpression) {\n if (e.name === 'feature-state') {\n return false;\n }\n }\n let result = true;\n e.eachChild(arg => {\n if (result && !isStateConstant(arg)) { result = false; }\n });\n return result;\n}\n\nfunction isGlobalPropertyConstant(e: Expression, properties: Array): boolean {\n if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) { return false; }\n let result = true;\n e.eachChild((arg) => {\n if (result && !isGlobalPropertyConstant(arg, properties)) { result = false; }\n });\n return result;\n}\n\nexport {isFeatureConstant, isGlobalPropertyConstant, isStateConstant};\n","// @flow\n\nimport type {Type} from '../types.js';\nimport type {Expression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\n\nclass Var implements Expression {\n type: Type;\n name: string;\n boundExpression: Expression;\n\n constructor(name: string, boundExpression: Expression) {\n this.type = boundExpression.type;\n this.name = name;\n this.boundExpression = boundExpression;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): void | Var {\n if (args.length !== 2 || typeof args[1] !== 'string')\n return context.error(`'var' expression requires exactly one string literal argument.`);\n\n const name = args[1];\n if (!context.scope.has(name)) {\n return context.error(`Unknown variable \"${name}\". Make sure \"${name}\" has been bound in an enclosing \"let\" expression before using it.`, 1);\n }\n\n return new Var(name, context.scope.get(name));\n }\n\n evaluate(ctx: EvaluationContext): any {\n return this.boundExpression.evaluate(ctx);\n }\n\n eachChild() {}\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): Array {\n return [\"var\", this.name];\n }\n}\n\nexport default Var;\n","// @flow\n\nimport Scope from './scope.js';\nimport {checkSubtype} from './types.js';\nimport ParsingError from './parsing_error.js';\nimport Literal from './definitions/literal.js';\nimport Assertion from './definitions/assertion.js';\nimport Coercion from './definitions/coercion.js';\nimport EvaluationContext from './evaluation_context.js';\nimport CompoundExpression from './compound_expression.js';\nimport CollatorExpression from './definitions/collator.js';\nimport Within from './definitions/within.js';\nimport {isGlobalPropertyConstant, isFeatureConstant} from './is_constant.js';\nimport Var from './definitions/var.js';\n\nimport type {Expression, ExpressionRegistry} from './expression.js';\nimport type {Type} from './types.js';\n\n/**\n * State associated parsing at a given point in an expression tree.\n * @private\n */\nclass ParsingContext {\n registry: ExpressionRegistry;\n path: Array;\n key: string;\n scope: Scope;\n errors: Array;\n\n // The expected type of this expression. Provided only to allow Expression\n // implementations to infer argument types: Expression#parse() need not\n // check that the output type of the parsed expression matches\n // `expectedType`.\n expectedType: ?Type;\n\n constructor(\n registry: ExpressionRegistry,\n path: Array = [],\n expectedType: ?Type,\n scope: Scope = new Scope(),\n errors: Array = []\n ) {\n this.registry = registry;\n this.path = path;\n this.key = path.map(part => `[${part}]`).join('');\n this.scope = scope;\n this.errors = errors;\n this.expectedType = expectedType;\n }\n\n /**\n * @param expr the JSON expression to parse\n * @param index the optional argument index if this expression is an argument of a parent expression that's being parsed\n * @param options\n * @param options.omitTypeAnnotations set true to omit inferred type annotations. Caller beware: with this option set, the parsed expression's type will NOT satisfy `expectedType` if it would normally be wrapped in an inferred annotation.\n * @private\n */\n parse(\n expr: mixed,\n index?: number,\n expectedType?: ?Type,\n bindings?: Array<[string, Expression]>,\n options: {typeAnnotation?: 'assert' | 'coerce' | 'omit'} = {}\n ): ?Expression {\n if (index) {\n return this.concat(index, expectedType, bindings)._parse(expr, options);\n }\n return this._parse(expr, options);\n }\n\n _parse(expr: mixed, options: {typeAnnotation?: 'assert' | 'coerce' | 'omit'}): ?Expression {\n if (expr === null || typeof expr === 'string' || typeof expr === 'boolean' || typeof expr === 'number') {\n expr = ['literal', expr];\n }\n\n function annotate(parsed, type, typeAnnotation: 'assert' | 'coerce' | 'omit') {\n if (typeAnnotation === 'assert') {\n return new Assertion(type, [parsed]);\n } else if (typeAnnotation === 'coerce') {\n return new Coercion(type, [parsed]);\n } else {\n return parsed;\n }\n }\n\n if (Array.isArray(expr)) {\n if (expr.length === 0) {\n return this.error(`Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].`);\n }\n\n const op = expr[0];\n if (typeof op !== 'string') {\n this.error(`Expression name must be a string, but found ${typeof op} instead. If you wanted a literal array, use [\"literal\", [...]].`, 0);\n return null;\n }\n\n const Expr = this.registry[op];\n if (Expr) {\n let parsed = Expr.parse(expr, this);\n if (!parsed) return null;\n\n if (this.expectedType) {\n const expected = this.expectedType;\n const actual = parsed.type;\n\n // When we expect a number, string, boolean, or array but have a value, wrap it in an assertion.\n // When we expect a color or formatted string, but have a string or value, wrap it in a coercion.\n // Otherwise, we do static type-checking.\n //\n // These behaviors are overridable for:\n // * The \"coalesce\" operator, which needs to omit type annotations.\n // * String-valued properties (e.g. `text-field`), where coercion is more convenient than assertion.\n //\n if ((expected.kind === 'string' || expected.kind === 'number' || expected.kind === 'boolean' || expected.kind === 'object' || expected.kind === 'array') && actual.kind === 'value') {\n parsed = annotate(parsed, expected, options.typeAnnotation || 'assert');\n } else if ((expected.kind === 'color' || expected.kind === 'formatted' || expected.kind === 'resolvedImage') && (actual.kind === 'value' || actual.kind === 'string')) {\n parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');\n } else if (this.checkSubtype(expected, actual)) {\n return null;\n }\n }\n\n // If an expression's arguments are all literals, we can evaluate\n // it immediately and replace it with a literal value in the\n // parsed/compiled result. Expressions that expect an image should\n // not be resolved here so we can later get the available images.\n if (!(parsed instanceof Literal) && (parsed.type.kind !== 'resolvedImage') && isConstant(parsed)) {\n const ec = new EvaluationContext();\n try {\n parsed = new Literal(parsed.type, parsed.evaluate(ec));\n } catch (e) {\n this.error(e.message);\n return null;\n }\n }\n\n return parsed;\n }\n\n return this.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n } else if (typeof expr === 'undefined') {\n return this.error(`'undefined' value invalid. Use null instead.`);\n } else if (typeof expr === 'object') {\n return this.error(`Bare objects invalid. Use [\"literal\", {...}] instead.`);\n } else {\n return this.error(`Expected an array, but found ${typeof expr} instead.`);\n }\n }\n\n /**\n * Returns a copy of this context suitable for parsing the subexpression at\n * index `index`, optionally appending to 'let' binding map.\n *\n * Note that `errors` property, intended for collecting errors while\n * parsing, is copied by reference rather than cloned.\n * @private\n */\n concat(index: number, expectedType?: ?Type, bindings?: Array<[string, Expression]>): ParsingContext {\n const path = typeof index === 'number' ? this.path.concat(index) : this.path;\n const scope = bindings ? this.scope.concat(bindings) : this.scope;\n return new ParsingContext(\n this.registry,\n path,\n expectedType || null,\n scope,\n this.errors\n );\n }\n\n /**\n * Push a parsing (or type checking) error into the `this.errors`\n * @param error The message\n * @param keys Optionally specify the source of the error at a child\n * of the current expression at `this.key`.\n * @private\n */\n error(error: string, ...keys: Array) {\n const key = `${this.key}${keys.map(k => `[${k}]`).join('')}`;\n this.errors.push(new ParsingError(key, error));\n }\n\n /**\n * Returns null if `t` is a subtype of `expected`; otherwise returns an\n * error message and also pushes it to `this.errors`.\n */\n checkSubtype(expected: Type, t: Type): ?string {\n const error = checkSubtype(expected, t);\n if (error) this.error(error);\n return error;\n }\n}\n\nexport default ParsingContext;\n\nfunction isConstant(expression: Expression) {\n if (expression instanceof Var) {\n return isConstant(expression.boundExpression);\n } else if (expression instanceof CompoundExpression && expression.name === 'error') {\n return false;\n } else if (expression instanceof CollatorExpression) {\n // Although the results of a Collator expression with fixed arguments\n // generally shouldn't change between executions, we can't serialize them\n // as constant expressions because results change based on environment.\n return false;\n } else if (expression instanceof Within) {\n return false;\n }\n\n const isTypeAnnotation = expression instanceof Coercion ||\n expression instanceof Assertion;\n\n let childrenConstant = true;\n expression.eachChild(child => {\n // We can _almost_ assume that if `expressions` children are constant,\n // they would already have been evaluated to Literal values when they\n // were parsed. Type annotations are the exception, because they might\n // have been inferred and added after a child was parsed.\n\n // So we recurse into isConstant() for the children of type annotations,\n // but otherwise simply check whether they are Literals.\n if (isTypeAnnotation) {\n childrenConstant = childrenConstant && isConstant(child);\n } else {\n childrenConstant = childrenConstant && child instanceof Literal;\n }\n });\n if (!childrenConstant) {\n return false;\n }\n\n return isFeatureConstant(expression) &&\n isGlobalPropertyConstant(expression, ['zoom', 'heatmap-density', 'line-progress', 'sky-radial-progress', 'accumulated', 'is-supported-script', 'pitch', 'distance-from-center']);\n}\n","// @flow\n\nimport RuntimeError from './runtime_error.js';\n\nimport type {Expression} from './expression.js';\n\nexport type Stops = Array<[number, Expression]>;\n\n/**\n * Returns the index of the last stop <= input, or 0 if it doesn't exist.\n * @private\n */\nexport function findStopLessThanOrEqualTo(stops: Array, input: number): number {\n const lastIndex = stops.length - 1;\n let lowerIndex = 0;\n let upperIndex = lastIndex;\n let currentIndex = 0;\n let currentValue, nextValue;\n\n while (lowerIndex <= upperIndex) {\n currentIndex = Math.floor((lowerIndex + upperIndex) / 2);\n currentValue = stops[currentIndex];\n nextValue = stops[currentIndex + 1];\n\n if (currentValue <= input) {\n if (currentIndex === lastIndex || input < nextValue) { // Search complete\n return currentIndex;\n }\n\n lowerIndex = currentIndex + 1;\n } else if (currentValue > input) {\n upperIndex = currentIndex - 1;\n } else {\n throw new RuntimeError('Input is not a number.');\n }\n }\n\n return 0;\n}\n","// @flow\n\nimport {NumberType} from '../types.js';\n\nimport {findStopLessThanOrEqualTo} from '../stops.js';\n\nimport type {Stops} from '../stops.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Step implements Expression {\n type: Type;\n\n input: Expression;\n labels: Array;\n outputs: Array;\n\n constructor(type: Type, input: Expression, stops: Stops) {\n this.type = type;\n this.input = input;\n\n this.labels = [];\n this.outputs = [];\n for (const [label, expression] of stops) {\n this.labels.push(label);\n this.outputs.push(expression);\n }\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Step {\n if (args.length - 1 < 4) {\n return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n }\n\n if ((args.length - 1) % 2 !== 0) {\n return context.error(`Expected an even number of arguments.`);\n }\n\n const input = context.parse(args[1], 1, NumberType);\n if (!input) return null;\n\n const stops: Stops = [];\n\n let outputType: Type = (null: any);\n if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n\n for (let i = 1; i < args.length; i += 2) {\n const label = i === 1 ? -Infinity : args[i];\n const value = args[i + 1];\n\n const labelKey = i;\n const valueKey = i + 1;\n\n if (typeof label !== 'number') {\n return context.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n }\n\n if (stops.length && stops[stops.length - 1][0] >= label) {\n return context.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n }\n\n const parsed = context.parse(value, valueKey, outputType);\n if (!parsed) return null;\n outputType = outputType || parsed.type;\n stops.push([label, parsed]);\n }\n\n return new Step(outputType, input, stops);\n }\n\n evaluate(ctx: EvaluationContext): any {\n const labels = this.labels;\n const outputs = this.outputs;\n\n if (labels.length === 1) {\n return outputs[0].evaluate(ctx);\n }\n\n const value = ((this.input.evaluate(ctx): any): number);\n if (value <= labels[0]) {\n return outputs[0].evaluate(ctx);\n }\n\n const stopCount = labels.length;\n if (value >= labels[stopCount - 1]) {\n return outputs[stopCount - 1].evaluate(ctx);\n }\n\n const index = findStopLessThanOrEqualTo(labels, value);\n return outputs[index].evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n for (const expression of this.outputs) {\n fn(expression);\n }\n }\n\n outputDefined(): boolean {\n return this.outputs.every(out => out.outputDefined());\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"step\", this.input.serialize()];\n for (let i = 0; i < this.labels.length; i++) {\n if (i > 0) {\n serialized.push(this.labels[i]);\n }\n serialized.push(this.outputs[i].serialize());\n }\n return serialized;\n }\n}\n\nexport default Step;\n","/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * Ported from Webkit\n * http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/platform/graphics/UnitBezier.h\n */\n\nmodule.exports = UnitBezier;\n\nfunction UnitBezier(p1x, p1y, p2x, p2y) {\n // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n this.cx = 3.0 * p1x;\n this.bx = 3.0 * (p2x - p1x) - this.cx;\n this.ax = 1.0 - this.cx - this.bx;\n\n this.cy = 3.0 * p1y;\n this.by = 3.0 * (p2y - p1y) - this.cy;\n this.ay = 1.0 - this.cy - this.by;\n\n this.p1x = p1x;\n this.p1y = p2y;\n this.p2x = p2x;\n this.p2y = p2y;\n}\n\nUnitBezier.prototype.sampleCurveX = function(t) {\n // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n return ((this.ax * t + this.bx) * t + this.cx) * t;\n};\n\nUnitBezier.prototype.sampleCurveY = function(t) {\n return ((this.ay * t + this.by) * t + this.cy) * t;\n};\n\nUnitBezier.prototype.sampleCurveDerivativeX = function(t) {\n return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n};\n\nUnitBezier.prototype.solveCurveX = function(x, epsilon) {\n if (typeof epsilon === 'undefined') epsilon = 1e-6;\n\n var t0, t1, t2, x2, i;\n\n // First try a few iterations of Newton's method -- normally very fast.\n for (t2 = x, i = 0; i < 8; i++) {\n\n x2 = this.sampleCurveX(t2) - x;\n if (Math.abs(x2) < epsilon) return t2;\n\n var d2 = this.sampleCurveDerivativeX(t2);\n if (Math.abs(d2) < 1e-6) break;\n\n t2 = t2 - x2 / d2;\n }\n\n // Fall back to the bisection method for reliability.\n t0 = 0.0;\n t1 = 1.0;\n t2 = x;\n\n if (t2 < t0) return t0;\n if (t2 > t1) return t1;\n\n while (t0 < t1) {\n\n x2 = this.sampleCurveX(t2);\n if (Math.abs(x2 - x) < epsilon) return t2;\n\n if (x > x2) {\n t0 = t2;\n } else {\n t1 = t2;\n }\n\n t2 = (t1 - t0) * 0.5 + t0;\n }\n\n // Failure.\n return t2;\n};\n\nUnitBezier.prototype.solve = function(x, epsilon) {\n return this.sampleCurveY(this.solveCurveX(x, epsilon));\n};\n","// @flow\n\nimport Color from './color.js';\n\nexport function number(a: number, b: number, t: number): number {\n return (a * (1 - t)) + (b * t);\n}\n\nexport function color(from: Color, to: Color, t: number): Color {\n return new Color(\n number(from.r, to.r, t),\n number(from.g, to.g, t),\n number(from.b, to.b, t),\n number(from.a, to.a, t)\n );\n}\n\nexport function array(from: Array, to: Array, t: number): Array {\n return from.map((d, i) => {\n return number(d, to[i], t);\n });\n}\n","// @flow\n\nimport Color from './color.js';\n\nimport {number as interpolateNumber} from './interpolate.js';\n\ntype LABColor = {\n l: number,\n a: number,\n b: number,\n alpha: number\n};\n\ntype HCLColor = {\n h: number,\n c: number,\n l: number,\n alpha: number\n};\n\n// Constants\nconst Xn = 0.950470, // D65 standard referent\n Yn = 1,\n Zn = 1.088830,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1,\n deg2rad = Math.PI / 180,\n rad2deg = 180 / Math.PI;\n\n// Utilities\nfunction xyz2lab(t: number) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t: number) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction xyz2rgb(x: number) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2xyz(x: number) {\n x /= 255;\n return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\n// LAB\nfunction rgbToLab(rgbColor: Color): LABColor {\n const b = rgb2xyz(rgbColor.r),\n a = rgb2xyz(rgbColor.g),\n l = rgb2xyz(rgbColor.b),\n x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn),\n y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.0721750 * l) / Yn),\n z = xyz2lab((0.0193339 * b + 0.1191920 * a + 0.9503041 * l) / Zn);\n\n return {\n l: 116 * y - 16,\n a: 500 * (x - y),\n b: 200 * (y - z),\n alpha: rgbColor.a\n };\n}\n\nfunction labToRgb(labColor: LABColor): Color {\n let y = (labColor.l + 16) / 116,\n x = isNaN(labColor.a) ? y : y + labColor.a / 500,\n z = isNaN(labColor.b) ? y : y - labColor.b / 200;\n y = Yn * lab2xyz(y);\n x = Xn * lab2xyz(x);\n z = Zn * lab2xyz(z);\n return new Color(\n xyz2rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB\n xyz2rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),\n xyz2rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z),\n labColor.alpha\n );\n}\n\nfunction interpolateLab(from: LABColor, to: LABColor, t: number): LABColor {\n return {\n l: interpolateNumber(from.l, to.l, t),\n a: interpolateNumber(from.a, to.a, t),\n b: interpolateNumber(from.b, to.b, t),\n alpha: interpolateNumber(from.alpha, to.alpha, t)\n };\n}\n\n// HCL\nfunction rgbToHcl(rgbColor: Color): HCLColor {\n const {l, a, b} = rgbToLab(rgbColor);\n const h = Math.atan2(b, a) * rad2deg;\n return {\n h: h < 0 ? h + 360 : h,\n c: Math.sqrt(a * a + b * b),\n l,\n alpha: rgbColor.a\n };\n}\n\nfunction hclToRgb(hclColor: HCLColor): Color {\n const h = hclColor.h * deg2rad,\n c = hclColor.c,\n l = hclColor.l;\n return labToRgb({\n l,\n a: Math.cos(h) * c,\n b: Math.sin(h) * c,\n alpha: hclColor.alpha\n });\n}\n\nfunction interpolateHue(a: number, b: number, t: number) {\n const d = b - a;\n return a + t * (d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d);\n}\n\nfunction interpolateHcl(from: HCLColor, to: HCLColor, t: number): HCLColor {\n return {\n h: interpolateHue(from.h, to.h, t),\n c: interpolateNumber(from.c, to.c, t),\n l: interpolateNumber(from.l, to.l, t),\n alpha: interpolateNumber(from.alpha, to.alpha, t)\n };\n}\n\nexport const lab = {\n forward: rgbToLab,\n reverse: labToRgb,\n interpolate: interpolateLab\n};\n\nexport const hcl = {\n forward: rgbToHcl,\n reverse: hclToRgb,\n interpolate: interpolateHcl\n};\n","// @flow\n\nimport UnitBezier from '@mapbox/unitbezier';\n\nimport * as interpolate from '../../util/interpolate.js';\nimport {toString, NumberType, ColorType} from '../types.js';\nimport {findStopLessThanOrEqualTo} from '../stops.js';\nimport {hcl, lab} from '../../util/color_spaces.js';\nimport Color from '../../util/color.js';\n\nimport type {Stops} from '../stops.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nexport type InterpolationType =\n { name: 'linear' } |\n { name: 'exponential', base: number } |\n { name: 'cubic-bezier', controlPoints: [number, number, number, number] };\n\nclass Interpolate implements Expression {\n type: Type;\n\n operator: 'interpolate' | 'interpolate-hcl' | 'interpolate-lab';\n interpolation: InterpolationType;\n input: Expression;\n labels: Array;\n outputs: Array;\n\n constructor(type: Type, operator: 'interpolate' | 'interpolate-hcl' | 'interpolate-lab', interpolation: InterpolationType, input: Expression, stops: Stops) {\n this.type = type;\n this.operator = operator;\n this.interpolation = interpolation;\n this.input = input;\n\n this.labels = [];\n this.outputs = [];\n for (const [label, expression] of stops) {\n this.labels.push(label);\n this.outputs.push(expression);\n }\n }\n\n static interpolationFactor(interpolation: InterpolationType, input: number, lower: number, upper: number): number {\n let t = 0;\n if (interpolation.name === 'exponential') {\n t = exponentialInterpolation(input, interpolation.base, lower, upper);\n } else if (interpolation.name === 'linear') {\n t = exponentialInterpolation(input, 1, lower, upper);\n } else if (interpolation.name === 'cubic-bezier') {\n const c = interpolation.controlPoints;\n const ub = new UnitBezier(c[0], c[1], c[2], c[3]);\n t = ub.solve(exponentialInterpolation(input, 1, lower, upper));\n }\n return t;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Interpolate {\n let [operator, interpolation, input, ...rest] = args;\n\n if (!Array.isArray(interpolation) || interpolation.length === 0) {\n return context.error(`Expected an interpolation type expression.`, 1);\n }\n\n if (interpolation[0] === 'linear') {\n interpolation = {name: 'linear'};\n } else if (interpolation[0] === 'exponential') {\n const base = interpolation[1];\n if (typeof base !== 'number')\n return context.error(`Exponential interpolation requires a numeric base.`, 1, 1);\n interpolation = {\n name: 'exponential',\n base\n };\n } else if (interpolation[0] === 'cubic-bezier') {\n const controlPoints = interpolation.slice(1);\n if (\n controlPoints.length !== 4 ||\n controlPoints.some(t => typeof t !== 'number' || t < 0 || t > 1)\n ) {\n return context.error('Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.', 1);\n }\n\n interpolation = {\n name: 'cubic-bezier',\n controlPoints: (controlPoints: any)\n };\n } else {\n return context.error(`Unknown interpolation type ${String(interpolation[0])}`, 1, 0);\n }\n\n if (args.length - 1 < 4) {\n return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n }\n\n if ((args.length - 1) % 2 !== 0) {\n return context.error(`Expected an even number of arguments.`);\n }\n\n input = context.parse(input, 2, NumberType);\n if (!input) return null;\n\n const stops: Stops = [];\n\n let outputType: Type = (null: any);\n if (operator === 'interpolate-hcl' || operator === 'interpolate-lab') {\n outputType = ColorType;\n } else if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n\n for (let i = 0; i < rest.length; i += 2) {\n const label = rest[i];\n const value = rest[i + 1];\n\n const labelKey = i + 3;\n const valueKey = i + 4;\n\n if (typeof label !== 'number') {\n return context.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n }\n\n if (stops.length && stops[stops.length - 1][0] >= label) {\n return context.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n }\n\n const parsed = context.parse(value, valueKey, outputType);\n if (!parsed) return null;\n outputType = outputType || parsed.type;\n stops.push([label, parsed]);\n }\n\n if (outputType.kind !== 'number' &&\n outputType.kind !== 'color' &&\n !(\n outputType.kind === 'array' &&\n outputType.itemType.kind === 'number' &&\n typeof outputType.N === 'number'\n )\n ) {\n return context.error(`Type ${toString(outputType)} is not interpolatable.`);\n }\n\n return new Interpolate(outputType, (operator: any), interpolation, input, stops);\n }\n\n evaluate(ctx: EvaluationContext): Color {\n const labels = this.labels;\n const outputs = this.outputs;\n\n if (labels.length === 1) {\n return outputs[0].evaluate(ctx);\n }\n\n const value = ((this.input.evaluate(ctx): any): number);\n if (value <= labels[0]) {\n return outputs[0].evaluate(ctx);\n }\n\n const stopCount = labels.length;\n if (value >= labels[stopCount - 1]) {\n return outputs[stopCount - 1].evaluate(ctx);\n }\n\n const index = findStopLessThanOrEqualTo(labels, value);\n const lower = labels[index];\n const upper = labels[index + 1];\n const t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper);\n\n const outputLower = outputs[index].evaluate(ctx);\n const outputUpper = outputs[index + 1].evaluate(ctx);\n\n if (this.operator === 'interpolate') {\n return (interpolate[this.type.kind.toLowerCase()]: any)(outputLower, outputUpper, t); // eslint-disable-line import/namespace\n } else if (this.operator === 'interpolate-hcl') {\n return hcl.reverse(hcl.interpolate(hcl.forward(outputLower), hcl.forward(outputUpper), t));\n } else {\n return lab.reverse(lab.interpolate(lab.forward(outputLower), lab.forward(outputUpper), t));\n }\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n for (const expression of this.outputs) {\n fn(expression);\n }\n }\n\n outputDefined(): boolean {\n return this.outputs.every(out => out.outputDefined());\n }\n\n serialize(): SerializedExpression {\n let interpolation;\n if (this.interpolation.name === 'linear') {\n interpolation = [\"linear\"];\n } else if (this.interpolation.name === 'exponential') {\n if (this.interpolation.base === 1) {\n interpolation = [\"linear\"];\n } else {\n interpolation = [\"exponential\", this.interpolation.base];\n }\n } else {\n interpolation = [\"cubic-bezier\" ].concat(this.interpolation.controlPoints);\n }\n\n const serialized = [this.operator, interpolation, this.input.serialize()];\n\n for (let i = 0; i < this.labels.length; i++) {\n serialized.push(\n this.labels[i],\n this.outputs[i].serialize()\n );\n }\n return serialized;\n }\n}\n\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n * How it works: Two consecutive stop values define a (scaled and shifted) exponential function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n * = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`. In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n*/\nfunction exponentialInterpolation(input, base, lowerValue, upperValue) {\n const difference = upperValue - lowerValue;\n const progress = input - lowerValue;\n\n if (difference === 0) {\n return 0;\n } else if (base === 1) {\n return progress / difference;\n } else {\n return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n }\n}\n\nexport default Interpolate;\n","// @flow\n\nimport assert from 'assert';\n\nimport {checkSubtype, ValueType} from '../types.js';\nimport ResolvedImage from '../types/resolved_image.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Coalesce implements Expression {\n type: Type;\n args: Array;\n\n constructor(type: Type, args: Array) {\n this.type = type;\n this.args = args;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Coalesce {\n if (args.length < 2) {\n return context.error(\"Expectected at least one argument.\");\n }\n let outputType: Type = (null: any);\n const expectedType = context.expectedType;\n if (expectedType && expectedType.kind !== 'value') {\n outputType = expectedType;\n }\n const parsedArgs = [];\n\n for (const arg of args.slice(1)) {\n const parsed = context.parse(arg, 1 + parsedArgs.length, outputType, undefined, {typeAnnotation: 'omit'});\n if (!parsed) return null;\n outputType = outputType || parsed.type;\n parsedArgs.push(parsed);\n }\n assert(outputType);\n\n // Above, we parse arguments without inferred type annotation so that\n // they don't produce a runtime error for `null` input, which would\n // preempt the desired null-coalescing behavior.\n // Thus, if any of our arguments would have needed an annotation, we\n // need to wrap the enclosing coalesce expression with it instead.\n const needsAnnotation = expectedType &&\n parsedArgs.some(arg => checkSubtype(expectedType, arg.type));\n\n return needsAnnotation ?\n new Coalesce(ValueType, parsedArgs) :\n new Coalesce((outputType: any), parsedArgs);\n }\n\n evaluate(ctx: EvaluationContext): any | null {\n let result = null;\n let argCount = 0;\n let firstImage;\n for (const arg of this.args) {\n argCount++;\n result = arg.evaluate(ctx);\n // we need to keep track of the first requested image in a coalesce statement\n // if coalesce can't find a valid image, we return the first image so styleimagemissing can fire\n if (result && result instanceof ResolvedImage && !result.available) {\n // set to first image\n if (!firstImage) {\n firstImage = result;\n }\n result = null;\n // if we reach the end, return the first image\n if (argCount === this.args.length) {\n return firstImage;\n }\n }\n\n if (result !== null) break;\n }\n return result;\n }\n\n eachChild(fn: (_: Expression) => void) {\n this.args.forEach(fn);\n }\n\n outputDefined(): boolean {\n return this.args.every(arg => arg.outputDefined());\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"coalesce\"];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Coalesce;\n","// @flow\n\nimport type {Type} from '../types.js';\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\n\nclass Let implements Expression {\n type: Type;\n bindings: Array<[string, Expression]>;\n result: Expression;\n\n constructor(bindings: Array<[string, Expression]>, result: Expression) {\n this.type = result.type;\n this.bindings = [].concat(bindings);\n this.result = result;\n }\n\n evaluate(ctx: EvaluationContext): any {\n return this.result.evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n for (const binding of this.bindings) {\n fn(binding[1]);\n }\n fn(this.result);\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Let {\n if (args.length < 4)\n return context.error(`Expected at least 3 arguments, but found ${args.length - 1} instead.`);\n\n const bindings: Array<[string, Expression]> = [];\n for (let i = 1; i < args.length - 1; i += 2) {\n const name = args[i];\n\n if (typeof name !== 'string') {\n return context.error(`Expected string, but found ${typeof name} instead.`, i);\n }\n\n if (/[^a-zA-Z0-9_]/.test(name)) {\n return context.error(`Variable names must contain only alphanumeric characters or '_'.`, i);\n }\n\n const value = context.parse(args[i + 1], i + 1);\n if (!value) return null;\n\n bindings.push([name, value]);\n }\n\n const result = context.parse(args[args.length - 1], args.length - 1, context.expectedType, bindings);\n if (!result) return null;\n\n return new Let(bindings, result);\n }\n\n outputDefined(): boolean {\n return this.result.outputDefined();\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"let\"];\n for (const [name, expr] of this.bindings) {\n serialized.push(name, expr.serialize());\n }\n serialized.push(this.result.serialize());\n return serialized;\n }\n}\n\nexport default Let;\n","// @flow\n\nimport {array, ValueType, NumberType} from '../types.js';\n\nimport RuntimeError from '../runtime_error.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type, ArrayType} from '../types.js';\nimport type {Value} from '../values.js';\n\nclass At implements Expression {\n type: Type;\n index: Expression;\n input: Expression;\n\n constructor(type: Type, index: Expression, input: Expression) {\n this.type = type;\n this.index = index;\n this.input = input;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?At {\n if (args.length !== 3)\n return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n\n const index = context.parse(args[1], 1, NumberType);\n const input = context.parse(args[2], 2, array(context.expectedType || ValueType));\n\n if (!index || !input) return null;\n\n const t: ArrayType = (input.type: any);\n return new At(t.itemType, index, input);\n }\n\n evaluate(ctx: EvaluationContext): Value {\n const index = ((this.index.evaluate(ctx): any): number);\n const array = ((this.input.evaluate(ctx): any): Array);\n\n if (index < 0) {\n throw new RuntimeError(`Array index out of bounds: ${index} < 0.`);\n }\n\n if (index >= array.length) {\n throw new RuntimeError(`Array index out of bounds: ${index} > ${array.length - 1}.`);\n }\n\n if (index !== Math.floor(index)) {\n throw new RuntimeError(`Array index must be an integer, but found ${index} instead.`);\n }\n\n return array[index];\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.index);\n fn(this.input);\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n return [\"at\", this.index.serialize(), this.input.serialize()];\n }\n}\n\nexport default At;\n","// @flow\n\nimport {BooleanType, StringType, ValueType, NullType, toString, NumberType, isValidType, isValidNativeType} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass In implements Expression {\n type: Type;\n needle: Expression;\n haystack: Expression;\n\n constructor(needle: Expression, haystack: Expression) {\n this.type = BooleanType;\n this.needle = needle;\n this.haystack = haystack;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?In {\n if (args.length !== 3) {\n return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n }\n\n const needle = context.parse(args[1], 1, ValueType);\n\n const haystack = context.parse(args[2], 2, ValueType);\n\n if (!needle || !haystack) return null;\n\n if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString(needle.type)} instead`);\n }\n\n return new In(needle, haystack);\n }\n\n evaluate(ctx: EvaluationContext): boolean {\n const needle = (this.needle.evaluate(ctx): any);\n const haystack = (this.haystack.evaluate(ctx): any);\n\n if (haystack == null) return false;\n\n if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString(typeOf(needle))} instead.`);\n }\n\n if (!isValidNativeType(haystack, ['string', 'array'])) {\n throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString(typeOf(haystack))} instead.`);\n }\n\n return haystack.indexOf(needle) >= 0;\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.needle);\n fn(this.haystack);\n }\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n return [\"in\", this.needle.serialize(), this.haystack.serialize()];\n }\n}\n\nexport default In;\n","// @flow\n\nimport {BooleanType, StringType, ValueType, NullType, toString, NumberType, isValidType, isValidNativeType} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass IndexOf implements Expression {\n type: Type;\n needle: Expression;\n haystack: Expression;\n fromIndex: ?Expression;\n\n constructor(needle: Expression, haystack: Expression, fromIndex?: Expression) {\n this.type = NumberType;\n this.needle = needle;\n this.haystack = haystack;\n this.fromIndex = fromIndex;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?IndexOf {\n if (args.length <= 2 || args.length >= 5) {\n return context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);\n }\n\n const needle = context.parse(args[1], 1, ValueType);\n\n const haystack = context.parse(args[2], 2, ValueType);\n\n if (!needle || !haystack) return null;\n if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString(needle.type)} instead`);\n }\n\n if (args.length === 4) {\n const fromIndex = context.parse(args[3], 3, NumberType);\n if (!fromIndex) return null;\n return new IndexOf(needle, haystack, fromIndex);\n } else {\n return new IndexOf(needle, haystack);\n }\n }\n\n evaluate(ctx: EvaluationContext): any {\n const needle = (this.needle.evaluate(ctx): any);\n const haystack = (this.haystack.evaluate(ctx): any);\n\n if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString(typeOf(needle))} instead.`);\n }\n\n if (!isValidNativeType(haystack, ['string', 'array'])) {\n throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString(typeOf(haystack))} instead.`);\n }\n\n if (this.fromIndex) {\n const fromIndex = (this.fromIndex.evaluate(ctx): number);\n return haystack.indexOf(needle, fromIndex);\n }\n\n return haystack.indexOf(needle);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.needle);\n fn(this.haystack);\n if (this.fromIndex) {\n fn(this.fromIndex);\n }\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n if (this.fromIndex != null && this.fromIndex !== undefined) {\n const fromIndex = this.fromIndex.serialize();\n return [\"index-of\", this.needle.serialize(), this.haystack.serialize(), fromIndex];\n }\n return [\"index-of\", this.needle.serialize(), this.haystack.serialize()];\n }\n}\n\nexport default IndexOf;\n","// @flow\n\nimport assert from 'assert';\n\nimport {typeOf} from '../values.js';\nimport {ValueType, type Type} from '../types.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\n\n// Map input label values to output expression index\ntype Cases = {[number | string]: number};\n\nclass Match implements Expression {\n type: Type;\n inputType: Type;\n\n input: Expression;\n cases: Cases;\n outputs: Array;\n otherwise: Expression;\n\n constructor(inputType: Type, outputType: Type, input: Expression, cases: Cases, outputs: Array, otherwise: Expression) {\n this.inputType = inputType;\n this.type = outputType;\n this.input = input;\n this.cases = cases;\n this.outputs = outputs;\n this.otherwise = otherwise;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Match {\n if (args.length < 5)\n return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n if (args.length % 2 !== 1)\n return context.error(`Expected an even number of arguments.`);\n\n let inputType;\n let outputType;\n if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n const cases = {};\n const outputs = [];\n for (let i = 2; i < args.length - 1; i += 2) {\n let labels = args[i];\n const value = args[i + 1];\n\n if (!Array.isArray(labels)) {\n labels = [labels];\n }\n\n const labelContext = context.concat(i);\n if (labels.length === 0) {\n return labelContext.error('Expected at least one branch label.');\n }\n\n for (const label of labels) {\n if (typeof label !== 'number' && typeof label !== 'string') {\n return labelContext.error(`Branch labels must be numbers or strings.`);\n } else if (typeof label === 'number' && Math.abs(label) > Number.MAX_SAFE_INTEGER) {\n return labelContext.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);\n\n } else if (typeof label === 'number' && Math.floor(label) !== label) {\n return labelContext.error(`Numeric branch labels must be integer values.`);\n\n } else if (!inputType) {\n inputType = typeOf(label);\n } else if (labelContext.checkSubtype(inputType, typeOf(label))) {\n return null;\n }\n\n if (typeof cases[String(label)] !== 'undefined') {\n return labelContext.error('Branch labels must be unique.');\n }\n\n cases[String(label)] = outputs.length;\n }\n\n const result = context.parse(value, i, outputType);\n if (!result) return null;\n outputType = outputType || result.type;\n outputs.push(result);\n }\n\n const input = context.parse(args[1], 1, ValueType);\n if (!input) return null;\n\n const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n if (!otherwise) return null;\n\n assert(inputType && outputType);\n\n if (input.type.kind !== 'value' && context.concat(1).checkSubtype((inputType: any), input.type)) {\n return null;\n }\n\n return new Match((inputType: any), (outputType: any), input, cases, outputs, otherwise);\n }\n\n evaluate(ctx: EvaluationContext): any {\n const input = (this.input.evaluate(ctx): any);\n const output = (typeOf(input) === this.inputType && this.outputs[this.cases[input]]) || this.otherwise;\n return output.evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n this.outputs.forEach(fn);\n fn(this.otherwise);\n }\n\n outputDefined(): boolean {\n return this.outputs.every(out => out.outputDefined()) && this.otherwise.outputDefined();\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"match\", this.input.serialize()];\n\n // Sort so serialization has an arbitrary defined order, even though\n // branch order doesn't affect evaluation\n const sortedLabels = Object.keys(this.cases).sort();\n\n // Group branches by unique match expression to support condensed\n // serializations of the form [case1, case2, ...] -> matchExpression\n const groupedByOutput: Array<[number, Array]> = [];\n const outputLookup: {[index: number]: number} = {}; // lookup index into groupedByOutput for a given output expression\n for (const label of sortedLabels) {\n const outputIndex = outputLookup[this.cases[label]];\n if (outputIndex === undefined) {\n // First time seeing this output, add it to the end of the grouped list\n outputLookup[this.cases[label]] = groupedByOutput.length;\n groupedByOutput.push([this.cases[label], [label]]);\n } else {\n // We've seen this expression before, add the label to that output's group\n groupedByOutput[outputIndex][1].push(label);\n }\n }\n\n const coerceLabel = (label) => this.inputType.kind === 'number' ? Number(label) : label;\n\n for (const [outputIndex, labels] of groupedByOutput) {\n if (labels.length === 1) {\n // Only a single label matches this output expression\n serialized.push(coerceLabel(labels[0]));\n } else {\n // Array of literal labels pointing to this output expression\n serialized.push(labels.map(coerceLabel));\n }\n serialized.push(this.outputs[outputIndex].serialize());\n }\n serialized.push(this.otherwise.serialize());\n return serialized;\n }\n}\n\nexport default Match;\n","// @flow\n\nimport assert from 'assert';\n\nimport {BooleanType} from '../types.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\ntype Branches = Array<[Expression, Expression]>;\n\nclass Case implements Expression {\n type: Type;\n\n branches: Branches;\n otherwise: Expression;\n\n constructor(type: Type, branches: Branches, otherwise: Expression) {\n this.type = type;\n this.branches = branches;\n this.otherwise = otherwise;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Case {\n if (args.length < 4)\n return context.error(`Expected at least 3 arguments, but found only ${args.length - 1}.`);\n if (args.length % 2 !== 0)\n return context.error(`Expected an odd number of arguments.`);\n\n let outputType: ?Type;\n if (context.expectedType && context.expectedType.kind !== 'value') {\n outputType = context.expectedType;\n }\n\n const branches = [];\n for (let i = 1; i < args.length - 1; i += 2) {\n const test = context.parse(args[i], i, BooleanType);\n if (!test) return null;\n\n const result = context.parse(args[i + 1], i + 1, outputType);\n if (!result) return null;\n\n branches.push([test, result]);\n\n outputType = outputType || result.type;\n }\n\n const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n if (!otherwise) return null;\n\n assert(outputType);\n return new Case((outputType: any), branches, otherwise);\n }\n\n evaluate(ctx: EvaluationContext): any {\n for (const [test, expression] of this.branches) {\n if (test.evaluate(ctx)) {\n return expression.evaluate(ctx);\n }\n }\n return this.otherwise.evaluate(ctx);\n }\n\n eachChild(fn: (_: Expression) => void) {\n for (const [test, expression] of this.branches) {\n fn(test);\n fn(expression);\n }\n fn(this.otherwise);\n }\n\n outputDefined(): boolean {\n return this.branches.every(([_, out]) => out.outputDefined()) && this.otherwise.outputDefined();\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"case\"];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Case;\n","// @flow\n\nimport {ValueType, NumberType, StringType, array, toString, isValidType, isValidNativeType} from '../types.js';\nimport RuntimeError from '../runtime_error.js';\nimport {typeOf} from '../values.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Slice implements Expression {\n type: Type;\n input: Expression;\n beginIndex: Expression;\n endIndex: ?Expression;\n\n constructor(type: Type, input: Expression, beginIndex: Expression, endIndex?: Expression) {\n this.type = type;\n this.input = input;\n this.beginIndex = beginIndex;\n this.endIndex = endIndex;\n\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Slice {\n if (args.length <= 2 || args.length >= 5) {\n return context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);\n }\n\n const input = context.parse(args[1], 1, ValueType);\n const beginIndex = context.parse(args[2], 2, NumberType);\n\n if (!input || !beginIndex) return null;\n\n if (!isValidType(input.type, [array(ValueType), StringType, ValueType])) {\n return context.error(`Expected first argument to be of type array or string, but found ${toString(input.type)} instead`);\n }\n\n if (args.length === 4) {\n const endIndex = context.parse(args[3], 3, NumberType);\n if (!endIndex) return null;\n return new Slice(input.type, input, beginIndex, endIndex);\n } else {\n return new Slice(input.type, input, beginIndex);\n }\n }\n\n evaluate(ctx: EvaluationContext): any {\n const input = (this.input.evaluate(ctx): any);\n const beginIndex = (this.beginIndex.evaluate(ctx): number);\n\n if (!isValidNativeType(input, ['string', 'array'])) {\n throw new RuntimeError(`Expected first argument to be of type array or string, but found ${toString(typeOf(input))} instead.`);\n }\n\n if (this.endIndex) {\n const endIndex = (this.endIndex.evaluate(ctx): number);\n return input.slice(beginIndex, endIndex);\n }\n\n return input.slice(beginIndex);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n fn(this.beginIndex);\n if (this.endIndex) {\n fn(this.endIndex);\n }\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n if (this.endIndex != null && this.endIndex !== undefined) {\n const endIndex = this.endIndex.serialize();\n return [\"slice\", this.input.serialize(), this.beginIndex.serialize(), endIndex];\n }\n return [\"slice\", this.input.serialize(), this.beginIndex.serialize()];\n }\n}\n\nexport default Slice;\n","// @flow\n\nimport {toString, ValueType, BooleanType, CollatorType} from '../types.js';\nimport Assertion from './assertion.js';\nimport {typeOf} from '../values.js';\nimport RuntimeError from '../runtime_error.js';\n\nimport type {Expression, SerializedExpression, ExpressionRegistration} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\ntype ComparisonOperator = '==' | '!=' | '<' | '>' | '<=' | '>=' ;\n\nfunction isComparableType(op: ComparisonOperator, type: Type) {\n if (op === '==' || op === '!=') {\n // equality operator\n return type.kind === 'boolean' ||\n type.kind === 'string' ||\n type.kind === 'number' ||\n type.kind === 'null' ||\n type.kind === 'value';\n } else {\n // ordering operator\n return type.kind === 'string' ||\n type.kind === 'number' ||\n type.kind === 'value';\n }\n}\n\nfunction eq(ctx: EvaluationContext, a: any, b: any): boolean { return a === b; }\nfunction neq(ctx: EvaluationContext, a: any, b: any): boolean { return a !== b; }\nfunction lt(ctx: EvaluationContext, a: any, b: any): boolean { return a < b; }\nfunction gt(ctx: EvaluationContext, a: any, b: any): boolean { return a > b; }\nfunction lteq(ctx: EvaluationContext, a: any, b: any): boolean { return a <= b; }\nfunction gteq(ctx: EvaluationContext, a: any, b: any): boolean { return a >= b; }\n\nfunction eqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) === 0; }\nfunction neqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return !eqCollate(ctx, a, b, c); }\nfunction ltCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) < 0; }\nfunction gtCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) > 0; }\nfunction lteqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) <= 0; }\nfunction gteqCollate(ctx: EvaluationContext, a: any, b: any, c: any): boolean { return c.compare(a, b) >= 0; }\n\n/**\n * Special form for comparison operators, implementing the signatures:\n * - (T, T, ?Collator) => boolean\n * - (T, value, ?Collator) => boolean\n * - (value, T, ?Collator) => boolean\n *\n * For inequalities, T must be either value, string, or number. For ==/!=, it\n * can also be boolean or null.\n *\n * Equality semantics are equivalent to Javascript's strict equality (===/!==)\n * -- i.e., when the arguments' types don't match, == evaluates to false, != to\n * true.\n *\n * When types don't match in an ordering comparison, a runtime error is thrown.\n *\n * @private\n */\nfunction makeComparison(op: ComparisonOperator, compareBasic: (EvaluationContext, any, any) => boolean, compareWithCollator: (EvaluationContext, any, any, any) => boolean): ExpressionRegistration {\n const isOrderComparison = op !== '==' && op !== '!=';\n\n return class Comparison implements Expression {\n type: Type;\n lhs: Expression;\n rhs: Expression;\n collator: ?Expression;\n hasUntypedArgument: boolean;\n\n constructor(lhs: Expression, rhs: Expression, collator: ?Expression) {\n this.type = BooleanType;\n this.lhs = lhs;\n this.rhs = rhs;\n this.collator = collator;\n this.hasUntypedArgument = lhs.type.kind === 'value' || rhs.type.kind === 'value';\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 3 && args.length !== 4)\n return context.error(`Expected two or three arguments.`);\n\n const op: ComparisonOperator = (args[0]: any);\n\n let lhs = context.parse(args[1], 1, ValueType);\n if (!lhs) return null;\n if (!isComparableType(op, lhs.type)) {\n return context.concat(1).error(`\"${op}\" comparisons are not supported for type '${toString(lhs.type)}'.`);\n }\n let rhs = context.parse(args[2], 2, ValueType);\n if (!rhs) return null;\n if (!isComparableType(op, rhs.type)) {\n return context.concat(2).error(`\"${op}\" comparisons are not supported for type '${toString(rhs.type)}'.`);\n }\n\n if (\n lhs.type.kind !== rhs.type.kind &&\n lhs.type.kind !== 'value' &&\n rhs.type.kind !== 'value'\n ) {\n return context.error(`Cannot compare types '${toString(lhs.type)}' and '${toString(rhs.type)}'.`);\n }\n\n if (isOrderComparison) {\n // typing rules specific to less/greater than operators\n if (lhs.type.kind === 'value' && rhs.type.kind !== 'value') {\n // (value, T)\n lhs = new Assertion(rhs.type, [lhs]);\n } else if (lhs.type.kind !== 'value' && rhs.type.kind === 'value') {\n // (T, value)\n rhs = new Assertion(lhs.type, [rhs]);\n }\n }\n\n let collator = null;\n if (args.length === 4) {\n if (\n lhs.type.kind !== 'string' &&\n rhs.type.kind !== 'string' &&\n lhs.type.kind !== 'value' &&\n rhs.type.kind !== 'value'\n ) {\n return context.error(`Cannot use collator to compare non-string types.`);\n }\n collator = context.parse(args[3], 3, CollatorType);\n if (!collator) return null;\n }\n\n return new Comparison(lhs, rhs, collator);\n }\n\n evaluate(ctx: EvaluationContext): boolean {\n const lhs = this.lhs.evaluate(ctx);\n const rhs = this.rhs.evaluate(ctx);\n\n if (isOrderComparison && this.hasUntypedArgument) {\n const lt = typeOf(lhs);\n const rt = typeOf(rhs);\n // check that type is string or number, and equal\n if (lt.kind !== rt.kind || !(lt.kind === 'string' || lt.kind === 'number')) {\n throw new RuntimeError(`Expected arguments for \"${op}\" to be (string, string) or (number, number), but found (${lt.kind}, ${rt.kind}) instead.`);\n }\n }\n\n if (this.collator && !isOrderComparison && this.hasUntypedArgument) {\n const lt = typeOf(lhs);\n const rt = typeOf(rhs);\n if (lt.kind !== 'string' || rt.kind !== 'string') {\n return compareBasic(ctx, lhs, rhs);\n }\n }\n\n return this.collator ?\n compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx)) :\n compareBasic(ctx, lhs, rhs);\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.lhs);\n fn(this.rhs);\n if (this.collator) {\n fn(this.collator);\n }\n }\n\n outputDefined(): boolean {\n return true;\n }\n\n serialize(): SerializedExpression {\n const serialized = [op];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n };\n}\n\nexport const Equals: $Call = makeComparison('==', eq, eqCollate);\nexport const NotEquals: $Call = makeComparison('<', lt, ltCollate);\nexport const GreaterThan: $Call', typeof gt, typeof gtCollate> = makeComparison('>', gt, gtCollate);\nexport const LessThanOrEqual: $Call=', typeof gteq, typeof gteqCollate> = makeComparison('>=', gteq, gteqCollate);\n","// @flow\n\nimport {StringType, NumberType} from '../types.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type {Type} from '../types.js';\n\ndeclare var Intl: {\n NumberFormat: Class\n};\n\ndeclare class Intl$NumberFormat {\n constructor (\n locales?: string | string[],\n options?: NumberFormatOptions\n ): Intl$NumberFormat;\n\n static (\n locales?: string | string[],\n options?: NumberFormatOptions\n ): Intl$NumberFormat;\n\n format(a: number): string;\n\n resolvedOptions(): any;\n}\n\ntype NumberFormatOptions = {\n style?: 'decimal' | 'currency' | 'percent' | 'unit';\n currency?: null | string;\n unit?: null | string;\n minimumFractionDigits?: null | string;\n maximumFractionDigits?: null | string;\n};\n\nexport default class NumberFormat implements Expression {\n type: Type;\n number: Expression;\n locale: Expression | null; // BCP 47 language tag\n currency: Expression | null; // ISO 4217 currency code, required if style=currency\n unit: Expression | null; // Simple units sanctioned for use in ECMAScript, required if style=unit. https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\n minFractionDigits: Expression | null; // Default 0\n maxFractionDigits: Expression | null; // Default 3\n\n constructor(number: Expression,\n locale: Expression | null,\n currency: Expression | null,\n unit: Expression | null,\n minFractionDigits: Expression | null,\n maxFractionDigits: Expression | null) {\n this.type = StringType;\n this.number = number;\n this.locale = locale;\n this.currency = currency;\n this.unit = unit;\n this.minFractionDigits = minFractionDigits;\n this.maxFractionDigits = maxFractionDigits;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Expression {\n if (args.length !== 3)\n return context.error(`Expected two arguments.`);\n\n const number = context.parse(args[1], 1, NumberType);\n if (!number) return null;\n\n const options = (args[2]: any);\n if (typeof options !== \"object\" || Array.isArray(options))\n return context.error(`NumberFormat options argument must be an object.`);\n\n let locale = null;\n if (options['locale']) {\n locale = context.parse(options['locale'], 1, StringType);\n if (!locale) return null;\n }\n\n let currency = null;\n if (options['currency']) {\n currency = context.parse(options['currency'], 1, StringType);\n if (!currency) return null;\n }\n\n let unit = null;\n if (options['unit']) {\n unit = context.parse(options['unit'], 1, StringType);\n if (!unit) return null;\n }\n\n let minFractionDigits = null;\n if (options['min-fraction-digits']) {\n minFractionDigits = context.parse(options['min-fraction-digits'], 1, NumberType);\n if (!minFractionDigits) return null;\n }\n\n let maxFractionDigits = null;\n if (options['max-fraction-digits']) {\n maxFractionDigits = context.parse(options['max-fraction-digits'], 1, NumberType);\n if (!maxFractionDigits) return null;\n }\n\n return new NumberFormat(number, locale, currency, unit, minFractionDigits, maxFractionDigits);\n }\n\n evaluate(ctx: EvaluationContext): string {\n return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [],\n {\n style:\n (this.currency && \"currency\") ||\n (this.unit && \"unit\") ||\n \"decimal\",\n currency: this.currency ? this.currency.evaluate(ctx) : undefined,\n unit: this.unit ? this.unit.evaluate(ctx) : undefined,\n minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : undefined,\n maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : undefined,\n }).format(this.number.evaluate(ctx));\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.number);\n if (this.locale) {\n fn(this.locale);\n }\n if (this.currency) {\n fn(this.currency);\n }\n if (this.unit) {\n fn(this.unit);\n }\n if (this.minFractionDigits) {\n fn(this.minFractionDigits);\n }\n if (this.maxFractionDigits) {\n fn(this.maxFractionDigits);\n }\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n const options = {};\n if (this.locale) {\n options['locale'] = this.locale.serialize();\n }\n if (this.currency) {\n options['currency'] = this.currency.serialize();\n }\n if (this.unit) {\n options['unit'] = this.unit.serialize();\n }\n if (this.minFractionDigits) {\n options['min-fraction-digits'] = this.minFractionDigits.serialize();\n }\n if (this.maxFractionDigits) {\n options['max-fraction-digits'] = this.maxFractionDigits.serialize();\n }\n return [\"number-format\", this.number.serialize(), options];\n }\n}\n","// @flow\n\nimport {NumberType, toString} from '../types.js';\n\nimport {typeOf} from '../values.js';\nimport RuntimeError from '../runtime_error.js';\n\nimport type {Expression, SerializedExpression} from '../expression.js';\nimport type ParsingContext from '../parsing_context.js';\nimport type EvaluationContext from '../evaluation_context.js';\nimport type {Type} from '../types.js';\n\nclass Length implements Expression {\n type: Type;\n input: Expression;\n\n constructor(input: Expression) {\n this.type = NumberType;\n this.input = input;\n }\n\n static parse(args: $ReadOnlyArray, context: ParsingContext): ?Length {\n if (args.length !== 2)\n return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n\n const input = context.parse(args[1], 1);\n if (!input) return null;\n\n if (input.type.kind !== 'array' && input.type.kind !== 'string' && input.type.kind !== 'value')\n return context.error(`Expected argument of type string or array, but found ${toString(input.type)} instead.`);\n\n return new Length(input);\n }\n\n evaluate(ctx: EvaluationContext): any | number {\n const input = this.input.evaluate(ctx);\n if (typeof input === 'string') {\n return input.length;\n } else if (Array.isArray(input)) {\n return input.length;\n } else {\n throw new RuntimeError(`Expected value to be of type string or array, but found ${toString(typeOf(input))} instead.`);\n }\n }\n\n eachChild(fn: (_: Expression) => void) {\n fn(this.input);\n }\n\n outputDefined(): boolean {\n return false;\n }\n\n serialize(): SerializedExpression {\n const serialized = [\"length\"];\n this.eachChild(child => { serialized.push(child.serialize()); });\n return serialized;\n }\n}\n\nexport default Length;\n","// @flow\n\nimport {\n type Type,\n NumberType,\n StringType,\n BooleanType,\n ColorType,\n ObjectType,\n ValueType,\n ErrorType,\n CollatorType,\n array,\n toString as typeToString\n} from '../types.js';\n\nimport {typeOf, Color, validateRGBA, toString as valueToString} from '../values.js';\nimport CompoundExpression from '../compound_expression.js';\nimport RuntimeError from '../runtime_error.js';\nimport Let from './let.js';\nimport Var from './var.js';\nimport Literal from './literal.js';\nimport Assertion from './assertion.js';\nimport Coercion from './coercion.js';\nimport At from './at.js';\nimport In from './in.js';\nimport IndexOf from './index_of.js';\nimport Match from './match.js';\nimport Case from './case.js';\nimport Slice from './slice.js';\nimport Step from './step.js';\nimport Interpolate from './interpolate.js';\nimport Coalesce from './coalesce.js';\nimport {\n Equals,\n NotEquals,\n LessThan,\n GreaterThan,\n LessThanOrEqual,\n GreaterThanOrEqual\n} from './comparison.js';\nimport CollatorExpression from './collator.js';\nimport NumberFormat from './number_format.js';\nimport FormatExpression from './format.js';\nimport ImageExpression from './image.js';\nimport Length from './length.js';\nimport Within from './within.js';\n\nimport type {Varargs} from '../compound_expression.js';\nimport type {ExpressionRegistry} from '../expression.js';\n\nconst expressions: ExpressionRegistry = {\n // special forms\n '==': Equals,\n '!=': NotEquals,\n '>': GreaterThan,\n '<': LessThan,\n '>=': GreaterThanOrEqual,\n '<=': LessThanOrEqual,\n 'array': Assertion,\n 'at': At,\n 'boolean': Assertion,\n 'case': Case,\n 'coalesce': Coalesce,\n 'collator': CollatorExpression,\n 'format': FormatExpression,\n 'image': ImageExpression,\n 'in': In,\n 'index-of': IndexOf,\n 'interpolate': Interpolate,\n 'interpolate-hcl': Interpolate,\n 'interpolate-lab': Interpolate,\n 'length': Length,\n 'let': Let,\n 'literal': Literal,\n 'match': Match,\n 'number': Assertion,\n 'number-format': NumberFormat,\n 'object': Assertion,\n 'slice': Slice,\n 'step': Step,\n 'string': Assertion,\n 'to-boolean': Coercion,\n 'to-color': Coercion,\n 'to-number': Coercion,\n 'to-string': Coercion,\n 'var': Var,\n 'within': Within\n};\n\nfunction rgba(ctx, [r, g, b, a]) {\n r = r.evaluate(ctx);\n g = g.evaluate(ctx);\n b = b.evaluate(ctx);\n const alpha = a ? a.evaluate(ctx) : 1;\n const error = validateRGBA(r, g, b, alpha);\n if (error) throw new RuntimeError(error);\n return new Color(r / 255 * alpha, g / 255 * alpha, b / 255 * alpha, alpha);\n}\n\nfunction has(key, obj) {\n return key in obj;\n}\n\nfunction get(key, obj) {\n const v = obj[key];\n return typeof v === 'undefined' ? null : v;\n}\n\nfunction binarySearch(v, a, i, j) {\n while (i <= j) {\n const m = (i + j) >> 1;\n if (a[m] === v)\n return true;\n if (a[m] > v)\n j = m - 1;\n else\n i = m + 1;\n }\n return false;\n}\n\nfunction varargs(type: Type): Varargs {\n return {type};\n}\n\nCompoundExpression.register(expressions, {\n 'error': [\n ErrorType,\n [StringType],\n (ctx, [v]) => { throw new RuntimeError(v.evaluate(ctx)); }\n ],\n 'typeof': [\n StringType,\n [ValueType],\n (ctx, [v]) => typeToString(typeOf(v.evaluate(ctx)))\n ],\n 'to-rgba': [\n array(NumberType, 4),\n [ColorType],\n (ctx, [v]) => {\n return v.evaluate(ctx).toArray();\n }\n ],\n 'rgb': [\n ColorType,\n [NumberType, NumberType, NumberType],\n rgba\n ],\n 'rgba': [\n ColorType,\n [NumberType, NumberType, NumberType, NumberType],\n rgba\n ],\n 'has': {\n type: BooleanType,\n overloads: [\n [\n [StringType],\n (ctx, [key]) => has(key.evaluate(ctx), ctx.properties())\n ], [\n [StringType, ObjectType],\n (ctx, [key, obj]) => has(key.evaluate(ctx), obj.evaluate(ctx))\n ]\n ]\n },\n 'get': {\n type: ValueType,\n overloads: [\n [\n [StringType],\n (ctx, [key]) => get(key.evaluate(ctx), ctx.properties())\n ], [\n [StringType, ObjectType],\n (ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))\n ]\n ]\n },\n 'feature-state': [\n ValueType,\n [StringType],\n (ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})\n ],\n 'properties': [\n ObjectType,\n [],\n (ctx) => ctx.properties()\n ],\n 'geometry-type': [\n StringType,\n [],\n (ctx) => ctx.geometryType()\n ],\n 'id': [\n ValueType,\n [],\n (ctx) => ctx.id()\n ],\n 'zoom': [\n NumberType,\n [],\n (ctx) => ctx.globals.zoom\n ],\n 'pitch': [\n NumberType,\n [],\n (ctx) => ctx.globals.pitch || 0\n ],\n 'distance-from-center': [\n NumberType,\n [],\n (ctx) => ctx.distanceFromCenter()\n ],\n 'heatmap-density': [\n NumberType,\n [],\n (ctx) => ctx.globals.heatmapDensity || 0\n ],\n 'line-progress': [\n NumberType,\n [],\n (ctx) => ctx.globals.lineProgress || 0\n ],\n 'sky-radial-progress': [\n NumberType,\n [],\n (ctx) => ctx.globals.skyRadialProgress || 0\n ],\n 'accumulated': [\n ValueType,\n [],\n (ctx) => ctx.globals.accumulated === undefined ? null : ctx.globals.accumulated\n ],\n '+': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => {\n let result = 0;\n for (const arg of args) {\n result += arg.evaluate(ctx);\n }\n return result;\n }\n ],\n '*': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => {\n let result = 1;\n for (const arg of args) {\n result *= arg.evaluate(ctx);\n }\n return result;\n }\n ],\n '-': {\n type: NumberType,\n overloads: [\n [\n [NumberType, NumberType],\n (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx)\n ], [\n [NumberType],\n (ctx, [a]) => -a.evaluate(ctx)\n ]\n ]\n },\n '/': [\n NumberType,\n [NumberType, NumberType],\n (ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx)\n ],\n '%': [\n NumberType,\n [NumberType, NumberType],\n (ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx)\n ],\n 'ln2': [\n NumberType,\n [],\n () => Math.LN2\n ],\n 'pi': [\n NumberType,\n [],\n () => Math.PI\n ],\n 'e': [\n NumberType,\n [],\n () => Math.E\n ],\n '^': [\n NumberType,\n [NumberType, NumberType],\n (ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx))\n ],\n 'sqrt': [\n NumberType,\n [NumberType],\n (ctx, [x]) => Math.sqrt(x.evaluate(ctx))\n ],\n 'log10': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10\n ],\n 'ln': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.log(n.evaluate(ctx))\n ],\n 'log2': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2\n ],\n 'sin': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.sin(n.evaluate(ctx))\n ],\n 'cos': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.cos(n.evaluate(ctx))\n ],\n 'tan': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.tan(n.evaluate(ctx))\n ],\n 'asin': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.asin(n.evaluate(ctx))\n ],\n 'acos': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.acos(n.evaluate(ctx))\n ],\n 'atan': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.atan(n.evaluate(ctx))\n ],\n 'min': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))\n ],\n 'max': [\n NumberType,\n varargs(NumberType),\n (ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))\n ],\n 'abs': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.abs(n.evaluate(ctx))\n ],\n 'round': [\n NumberType,\n [NumberType],\n (ctx, [n]) => {\n const v = n.evaluate(ctx);\n // Javascript's Math.round() rounds towards +Infinity for halfway\n // values, even when they're negative. It's more common to round\n // away from 0 (e.g., this is what python and C++ do)\n return v < 0 ? -Math.round(-v) : Math.round(v);\n }\n ],\n 'floor': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.floor(n.evaluate(ctx))\n ],\n 'ceil': [\n NumberType,\n [NumberType],\n (ctx, [n]) => Math.ceil(n.evaluate(ctx))\n ],\n 'filter-==': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => ctx.properties()[(k: any).value] === (v: any).value\n ],\n 'filter-id-==': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => ctx.id() === (v: any).value\n ],\n 'filter-type-==': [\n BooleanType,\n [StringType],\n (ctx, [v]) => ctx.geometryType() === (v: any).value\n ],\n 'filter-<': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a < b;\n }\n ],\n 'filter-id-<': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a < b;\n }\n ],\n 'filter->': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a > b;\n }\n ],\n 'filter-id->': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a > b;\n }\n ],\n 'filter-<=': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a <= b;\n }\n ],\n 'filter-id-<=': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a <= b;\n }\n ],\n 'filter->=': [\n BooleanType,\n [StringType, ValueType],\n (ctx, [k, v]) => {\n const a = ctx.properties()[(k: any).value];\n const b = (v: any).value;\n return typeof a === typeof b && a >= b;\n }\n ],\n 'filter-id->=': [\n BooleanType,\n [ValueType],\n (ctx, [v]) => {\n const a = ctx.id();\n const b = (v: any).value;\n return typeof a === typeof b && a >= b;\n }\n ],\n 'filter-has': [\n BooleanType,\n [ValueType],\n (ctx, [k]) => (k: any).value in ctx.properties()\n ],\n 'filter-has-id': [\n BooleanType,\n [],\n (ctx) => (ctx.id() !== null && ctx.id() !== undefined)\n ],\n 'filter-type-in': [\n BooleanType,\n [array(StringType)],\n (ctx, [v]) => (v: any).value.indexOf(ctx.geometryType()) >= 0\n ],\n 'filter-id-in': [\n BooleanType,\n [array(ValueType)],\n (ctx, [v]) => (v: any).value.indexOf(ctx.id()) >= 0\n ],\n 'filter-in-small': [\n BooleanType,\n [StringType, array(ValueType)],\n // assumes v is an array literal\n (ctx, [k, v]) => (v: any).value.indexOf(ctx.properties()[(k: any).value]) >= 0\n ],\n 'filter-in-large': [\n BooleanType,\n [StringType, array(ValueType)],\n // assumes v is a array literal with values sorted in ascending order and of a single type\n (ctx, [k, v]) => binarySearch(ctx.properties()[(k: any).value], (v: any).value, 0, (v: any).value.length - 1)\n ],\n 'all': {\n type: BooleanType,\n overloads: [\n [\n [BooleanType, BooleanType],\n (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)\n ],\n [\n varargs(BooleanType),\n (ctx, args) => {\n for (const arg of args) {\n if (!arg.evaluate(ctx))\n return false;\n }\n return true;\n }\n ]\n ]\n },\n 'any': {\n type: BooleanType,\n overloads: [\n [\n [BooleanType, BooleanType],\n (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)\n ],\n [\n varargs(BooleanType),\n (ctx, args) => {\n for (const arg of args) {\n if (arg.evaluate(ctx))\n return true;\n }\n return false;\n }\n ]\n ]\n },\n '!': [\n BooleanType,\n [BooleanType],\n (ctx, [b]) => !b.evaluate(ctx)\n ],\n 'is-supported-script': [\n BooleanType,\n [StringType],\n // At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant\n (ctx, [s]) => {\n const isSupportedScript = ctx.globals && ctx.globals.isSupportedScript;\n if (isSupportedScript) {\n return isSupportedScript(s.evaluate(ctx));\n }\n return true;\n }\n ],\n 'upcase': [\n StringType,\n [StringType],\n (ctx, [s]) => s.evaluate(ctx).toUpperCase()\n ],\n 'downcase': [\n StringType,\n [StringType],\n (ctx, [s]) => s.evaluate(ctx).toLowerCase()\n ],\n 'concat': [\n StringType,\n varargs(ValueType),\n (ctx, args) => args.map(arg => valueToString(arg.evaluate(ctx))).join('')\n ],\n 'resolved-locale': [\n StringType,\n [CollatorType],\n (ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()\n ]\n});\n\nexport default expressions;\n","// @flow\n\n/**\n * A type used for returning and propagating errors. The first element of the union\n * represents success and contains a value, and the second represents an error and\n * contains an error value.\n * @private\n */\nexport type Result =\n | {| result: 'success', value: T |}\n | {| result: 'error', value: E |};\n\nexport function success(value: T): Result {\n return {result: 'success', value};\n}\n\nexport function error(value: E): Result {\n return {result: 'error', value};\n}\n","\nimport * as colorSpaces from '../util/color_spaces.js';\nimport Color from '../util/color.js';\nimport extend from '../util/extend.js';\nimport getType from '../util/get_type.js';\nimport * as interpolate from '../util/interpolate.js';\nimport Interpolate from '../expression/definitions/interpolate.js';\nimport Formatted from '../expression/types/formatted.js';\nimport ResolvedImage from '../expression/types/resolved_image.js';\nimport {supportsInterpolation} from '../util/properties.js';\nimport {findStopLessThanOrEqualTo} from '../expression/stops.js';\n\nexport function isFunction(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction identityFunction(x) {\n return x;\n}\n\nexport function createFunction(parameters, propertySpec) {\n const isColor = propertySpec.type === 'color';\n const zoomAndFeatureDependent = parameters.stops && typeof parameters.stops[0][0] === 'object';\n const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n const type = parameters.type || (supportsInterpolation(propertySpec) ? 'exponential' : 'interval');\n\n if (isColor) {\n parameters = extend({}, parameters);\n\n if (parameters.stops) {\n parameters.stops = parameters.stops.map((stop) => {\n return [stop[0], Color.parse(stop[1])];\n });\n }\n\n if (parameters.default) {\n parameters.default = Color.parse(parameters.default);\n } else {\n parameters.default = Color.parse(propertySpec.default);\n }\n }\n\n if (parameters.colorSpace && parameters.colorSpace !== 'rgb' && !colorSpaces[parameters.colorSpace]) { // eslint-disable-line import/namespace\n throw new Error(`Unknown color space: ${parameters.colorSpace}`);\n }\n\n let innerFun;\n let hashedStops;\n let categoricalKeyType;\n if (type === 'exponential') {\n innerFun = evaluateExponentialFunction;\n } else if (type === 'interval') {\n innerFun = evaluateIntervalFunction;\n } else if (type === 'categorical') {\n innerFun = evaluateCategoricalFunction;\n\n // For categorical functions, generate an Object as a hashmap of the stops for fast searching\n hashedStops = Object.create(null);\n for (const stop of parameters.stops) {\n hashedStops[stop[0]] = stop[1];\n }\n\n // Infer key type based on first stop key-- used to encforce strict type checking later\n categoricalKeyType = typeof parameters.stops[0][0];\n\n } else if (type === 'identity') {\n innerFun = evaluateIdentityFunction;\n } else {\n throw new Error(`Unknown function type \"${type}\"`);\n }\n\n if (zoomAndFeatureDependent) {\n const featureFunctions = {};\n const zoomStops = [];\n for (let s = 0; s < parameters.stops.length; s++) {\n const stop = parameters.stops[s];\n const zoom = stop[0].zoom;\n if (featureFunctions[zoom] === undefined) {\n featureFunctions[zoom] = {\n zoom,\n type: parameters.type,\n property: parameters.property,\n default: parameters.default,\n stops: []\n };\n zoomStops.push(zoom);\n }\n featureFunctions[zoom].stops.push([stop[0].value, stop[1]]);\n }\n\n const featureFunctionStops = [];\n for (const z of zoomStops) {\n featureFunctionStops.push([featureFunctions[z].zoom, createFunction(featureFunctions[z], propertySpec)]);\n }\n\n const interpolationType = {name: 'linear'};\n return {\n kind: 'composite',\n interpolationType,\n interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n zoomStops: featureFunctionStops.map(s => s[0]),\n evaluate({zoom}, properties) {\n return evaluateExponentialFunction({\n stops: featureFunctionStops,\n base: parameters.base\n }, propertySpec, zoom).evaluate(zoom, properties);\n }\n };\n } else if (zoomDependent) {\n const interpolationType = type === 'exponential' ?\n {name: 'exponential', base: parameters.base !== undefined ? parameters.base : 1} : null;\n return {\n kind: 'camera',\n interpolationType,\n interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n zoomStops: parameters.stops.map(s => s[0]),\n evaluate: ({zoom}) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)\n };\n } else {\n return {\n kind: 'source',\n evaluate(_, feature) {\n const value = feature && feature.properties ? feature.properties[parameters.property] : undefined;\n if (value === undefined) {\n return coalesce(parameters.default, propertySpec.default);\n }\n return innerFun(parameters, propertySpec, value, hashedStops, categoricalKeyType);\n }\n };\n }\n}\n\nfunction coalesce(a, b, c) {\n if (a !== undefined) return a;\n if (b !== undefined) return b;\n if (c !== undefined) return c;\n}\n\nfunction evaluateCategoricalFunction(parameters, propertySpec, input, hashedStops, keyType) {\n const evaluated = typeof input === keyType ? hashedStops[input] : undefined; // Enforce strict typing on input\n return coalesce(evaluated, parameters.default, propertySpec.default);\n}\n\nfunction evaluateIntervalFunction(parameters, propertySpec, input) {\n // Edge cases\n if (getType(input) !== 'number') return coalesce(parameters.default, propertySpec.default);\n const n = parameters.stops.length;\n if (n === 1) return parameters.stops[0][1];\n if (input <= parameters.stops[0][0]) return parameters.stops[0][1];\n if (input >= parameters.stops[n - 1][0]) return parameters.stops[n - 1][1];\n\n const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n\n return parameters.stops[index][1];\n}\n\nfunction evaluateExponentialFunction(parameters, propertySpec, input) {\n const base = parameters.base !== undefined ? parameters.base : 1;\n\n // Edge cases\n if (getType(input) !== 'number') return coalesce(parameters.default, propertySpec.default);\n const n = parameters.stops.length;\n if (n === 1) return parameters.stops[0][1];\n if (input <= parameters.stops[0][0]) return parameters.stops[0][1];\n if (input >= parameters.stops[n - 1][0]) return parameters.stops[n - 1][1];\n\n const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n const t = interpolationFactor(\n input, base,\n parameters.stops[index][0],\n parameters.stops[index + 1][0]);\n\n const outputLower = parameters.stops[index][1];\n const outputUpper = parameters.stops[index + 1][1];\n let interp = interpolate[propertySpec.type] || identityFunction; // eslint-disable-line import/namespace\n\n if (parameters.colorSpace && parameters.colorSpace !== 'rgb') {\n const colorspace = colorSpaces[parameters.colorSpace]; // eslint-disable-line import/namespace\n interp = (a, b) => colorspace.reverse(colorspace.interpolate(colorspace.forward(a), colorspace.forward(b), t));\n }\n\n if (typeof outputLower.evaluate === 'function') {\n return {\n evaluate(...args) {\n const evaluatedLower = outputLower.evaluate.apply(undefined, args);\n const evaluatedUpper = outputUpper.evaluate.apply(undefined, args);\n // Special case for fill-outline-color, which has no spec default.\n if (evaluatedLower === undefined || evaluatedUpper === undefined) {\n return undefined;\n }\n return interp(evaluatedLower, evaluatedUpper, t);\n }\n };\n }\n\n return interp(outputLower, outputUpper, t);\n}\n\nfunction evaluateIdentityFunction(parameters, propertySpec, input) {\n if (propertySpec.type === 'color') {\n input = Color.parse(input);\n } else if (propertySpec.type === 'formatted') {\n input = Formatted.fromString(input.toString());\n } else if (propertySpec.type === 'resolvedImage') {\n input = ResolvedImage.fromString(input.toString());\n } else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {\n input = undefined;\n }\n return coalesce(input, parameters.default, propertySpec.default);\n}\n\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n *\n * How it works:\n * Two consecutive stop values define a (scaled and shifted) exponential\n * function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n * = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`. In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n */\nfunction interpolationFactor(input, base, lowerValue, upperValue) {\n const difference = upperValue - lowerValue;\n const progress = input - lowerValue;\n\n if (difference === 0) {\n return 0;\n } else if (base === 1) {\n return progress / difference;\n } else {\n return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n }\n}\n","// @flow\n\nimport assert from 'assert';\n\nimport extend from '../util/extend.js';\nimport ParsingError from './parsing_error.js';\nimport ParsingContext from './parsing_context.js';\nimport EvaluationContext from './evaluation_context.js';\nimport CompoundExpression from './compound_expression.js';\nimport Step from './definitions/step.js';\nimport Interpolate from './definitions/interpolate.js';\nimport Coalesce from './definitions/coalesce.js';\nimport Let from './definitions/let.js';\nimport definitions from './definitions/index.js';\nimport * as isConstant from './is_constant.js';\nimport RuntimeError from './runtime_error.js';\nimport {success, error} from '../util/result.js';\nimport {supportsPropertyExpression, supportsZoomExpression, supportsInterpolation} from '../util/properties.js';\n\nimport type {Type, EvaluationKind} from './types.js';\nimport type {Value} from './values.js';\nimport type {Expression} from './expression.js';\nimport type {StylePropertySpecification} from '../style-spec.js';\nimport type {Result} from '../util/result.js';\nimport type {InterpolationType} from './definitions/interpolate.js';\nimport type {PropertyValueSpecification} from '../types.js';\nimport type {FormattedSection} from './types/formatted.js';\nimport type Point from '@mapbox/point-geometry';\nimport type {CanonicalTileID} from '../../source/tile_id.js';\nimport type {FeatureDistanceData} from '../feature_filter/index.js';\n\nexport type Feature = {\n +type: 1 | 2 | 3 | 'Unknown' | 'Point' | 'LineString' | 'Polygon',\n +id?: number | null,\n +properties: {[_: string]: any},\n +patterns?: {[_: string]: string},\n +geometry?: Array>\n};\n\nexport type FeatureState = {[_: string]: any};\n\nexport type GlobalProperties = $ReadOnly<{\n zoom: number,\n pitch?: number,\n heatmapDensity?: number,\n lineProgress?: number,\n skyRadialProgress?: number,\n isSupportedScript?: (_: string) => boolean,\n accumulated?: Value\n}>;\n\nexport class StyleExpression {\n expression: Expression;\n\n _evaluator: EvaluationContext;\n _defaultValue: Value;\n _warningHistory: {[key: string]: boolean};\n _enumValues: ?{[_: string]: any};\n\n constructor(expression: Expression, propertySpec: ?StylePropertySpecification) {\n this.expression = expression;\n this._warningHistory = {};\n this._evaluator = new EvaluationContext();\n this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;\n this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;\n }\n\n evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any {\n this._evaluator.globals = globals;\n this._evaluator.feature = feature;\n this._evaluator.featureState = featureState;\n this._evaluator.canonical = canonical || null;\n this._evaluator.availableImages = availableImages || null;\n this._evaluator.formattedSection = formattedSection;\n this._evaluator.featureTileCoord = featureTileCoord || null;\n this._evaluator.featureDistanceData = featureDistanceData || null;\n\n return this.expression.evaluate(this._evaluator);\n }\n\n evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any {\n this._evaluator.globals = globals;\n this._evaluator.feature = feature || null;\n this._evaluator.featureState = featureState || null;\n this._evaluator.canonical = canonical || null;\n this._evaluator.availableImages = availableImages || null;\n this._evaluator.formattedSection = formattedSection || null;\n this._evaluator.featureTileCoord = featureTileCoord || null;\n this._evaluator.featureDistanceData = featureDistanceData || null;\n\n try {\n const val = this.expression.evaluate(this._evaluator);\n // eslint-disable-next-line no-self-compare\n if (val === null || val === undefined || (typeof val === 'number' && val !== val)) {\n return this._defaultValue;\n }\n if (this._enumValues && !(val in this._enumValues)) {\n throw new RuntimeError(`Expected value to be one of ${Object.keys(this._enumValues).map(v => JSON.stringify(v)).join(', ')}, but found ${JSON.stringify(val)} instead.`);\n }\n return val;\n } catch (e) {\n if (!this._warningHistory[e.message]) {\n this._warningHistory[e.message] = true;\n if (typeof console !== 'undefined') {\n console.warn(e.message);\n }\n }\n return this._defaultValue;\n }\n }\n}\n\nexport function isExpression(expression: mixed): boolean {\n return Array.isArray(expression) && expression.length > 0 &&\n typeof expression[0] === 'string' && expression[0] in definitions;\n}\n\n/**\n * Parse and typecheck the given style spec JSON expression. If\n * options.defaultValue is provided, then the resulting StyleExpression's\n * `evaluate()` method will handle errors by logging a warning (once per\n * message) and returning the default value. Otherwise, it will throw\n * evaluation errors.\n *\n * @private\n */\nexport function createExpression(expression: mixed, propertySpec: ?StylePropertySpecification): Result> {\n const parser = new ParsingContext(definitions, [], propertySpec ? getExpectedType(propertySpec) : undefined);\n\n // For string-valued properties, coerce to string at the top level rather than asserting.\n const parsed = parser.parse(expression, undefined, undefined, undefined,\n propertySpec && propertySpec.type === 'string' ? {typeAnnotation: 'coerce'} : undefined);\n\n if (!parsed) {\n assert(parser.errors.length > 0);\n return error(parser.errors);\n }\n\n return success(new StyleExpression(parsed, propertySpec));\n}\n\nexport class ZoomConstantExpression {\n kind: Kind;\n isStateDependent: boolean;\n _styleExpression: StyleExpression;\n\n constructor(kind: Kind, expression: StyleExpression) {\n this.kind = kind;\n this._styleExpression = expression;\n this.isStateDependent = kind !== ('constant': EvaluationKind) && !isConstant.isStateConstant(expression.expression);\n }\n\n evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n\n evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n}\n\nexport class ZoomDependentExpression {\n kind: Kind;\n zoomStops: Array;\n isStateDependent: boolean;\n\n _styleExpression: StyleExpression;\n interpolationType: ?InterpolationType;\n\n constructor(kind: Kind, expression: StyleExpression, zoomStops: Array, interpolationType?: InterpolationType) {\n this.kind = kind;\n this.zoomStops = zoomStops;\n this._styleExpression = expression;\n this.isStateDependent = kind !== ('camera': EvaluationKind) && !isConstant.isStateConstant(expression.expression);\n this.interpolationType = interpolationType;\n }\n\n evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n\n evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection): any {\n return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n }\n\n interpolationFactor(input: number, lower: number, upper: number): number {\n if (this.interpolationType) {\n return Interpolate.interpolationFactor(this.interpolationType, input, lower, upper);\n } else {\n return 0;\n }\n }\n}\n\nexport type ConstantExpression = {\n kind: 'constant',\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array) => any,\n}\n\nexport type SourceExpression = {\n kind: 'source',\n isStateDependent: boolean,\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection) => any,\n};\n\nexport type CameraExpression = {\n kind: 'camera',\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array) => any,\n +interpolationFactor: (input: number, lower: number, upper: number) => number,\n zoomStops: Array,\n interpolationType: ?InterpolationType\n};\n\nexport type CompositeExpression = {\n kind: 'composite',\n isStateDependent: boolean,\n +evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array, formattedSection?: FormattedSection) => any,\n +interpolationFactor: (input: number, lower: number, upper: number) => number,\n zoomStops: Array,\n interpolationType: ?InterpolationType\n};\n\nexport type StylePropertyExpression =\n | ConstantExpression\n | SourceExpression\n | CameraExpression\n | CompositeExpression;\n\nexport function createPropertyExpression(expression: mixed, propertySpec: StylePropertySpecification): Result> {\n expression = createExpression(expression, propertySpec);\n if (expression.result === 'error') {\n return expression;\n }\n\n const parsed = expression.value.expression;\n\n const isFeatureConstant = isConstant.isFeatureConstant(parsed);\n if (!isFeatureConstant && !supportsPropertyExpression(propertySpec)) {\n return error([new ParsingError('', 'data expressions not supported')]);\n }\n\n const isZoomConstant = isConstant.isGlobalPropertyConstant(parsed, ['zoom', 'pitch', 'distance-from-center']);\n if (!isZoomConstant && !supportsZoomExpression(propertySpec)) {\n return error([new ParsingError('', 'zoom expressions not supported')]);\n }\n\n const zoomCurve = findZoomCurve(parsed);\n if (!zoomCurve && !isZoomConstant) {\n return error([new ParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);\n } else if (zoomCurve instanceof ParsingError) {\n return error([zoomCurve]);\n } else if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) {\n return error([new ParsingError('', '\"interpolate\" expressions cannot be used with this property')]);\n }\n\n if (!zoomCurve) {\n return success(isFeatureConstant ?\n (new ZoomConstantExpression('constant', expression.value): ConstantExpression) :\n (new ZoomConstantExpression('source', expression.value): SourceExpression));\n }\n\n const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : undefined;\n\n return success(isFeatureConstant ?\n (new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType): CameraExpression) :\n (new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType): CompositeExpression));\n}\n\nimport {isFunction, createFunction} from '../function/index.js';\nimport {Color} from './values.js';\n\n// serialization wrapper for old-style stop functions normalized to the\n// expression interface\nexport class StylePropertyFunction {\n _parameters: PropertyValueSpecification;\n _specification: StylePropertySpecification;\n\n kind: EvaluationKind;\n evaluate: (globals: GlobalProperties, feature?: Feature) => any;\n interpolationFactor: ?(input: number, lower: number, upper: number) => number;\n zoomStops: ?Array;\n\n constructor(parameters: PropertyValueSpecification, specification: StylePropertySpecification) {\n this._parameters = parameters;\n this._specification = specification;\n extend(this, createFunction(this._parameters, this._specification));\n }\n\n static deserialize(serialized: {_parameters: PropertyValueSpecification, _specification: StylePropertySpecification}): StylePropertyFunction {\n return new StylePropertyFunction(serialized._parameters, serialized._specification);\n }\n\n static serialize(input: StylePropertyFunction): {_parameters: PropertyValueSpecification, _specification: StylePropertySpecification} {\n return {\n _parameters: input._parameters,\n _specification: input._specification\n };\n }\n}\n\nexport function normalizePropertyExpression(value: PropertyValueSpecification, specification: StylePropertySpecification): StylePropertyExpression {\n if (isFunction(value)) {\n return (new StylePropertyFunction(value, specification): any);\n\n } else if (isExpression(value)) {\n const expression = createPropertyExpression(value, specification);\n if (expression.result === 'error') {\n // this should have been caught in validation\n throw new Error(expression.value.map(err => `${err.key}: ${err.message}`).join(', '));\n }\n return expression.value;\n\n } else {\n let constant: any = value;\n if (typeof value === 'string' && specification.type === 'color') {\n constant = Color.parse(value);\n }\n return {\n kind: 'constant',\n evaluate: () => constant\n };\n }\n}\n\n// Zoom-dependent expressions may only use [\"zoom\"] as the input to a top-level \"step\" or \"interpolate\"\n// expression (collectively referred to as a \"curve\"). The curve may be wrapped in one or more \"let\" or\n// \"coalesce\" expressions.\nfunction findZoomCurve(expression: Expression): Step | Interpolate | ParsingError | null {\n let result = null;\n if (expression instanceof Let) {\n result = findZoomCurve(expression.result);\n\n } else if (expression instanceof Coalesce) {\n for (const arg of expression.args) {\n result = findZoomCurve(arg);\n if (result) {\n break;\n }\n }\n\n } else if ((expression instanceof Step || expression instanceof Interpolate) &&\n expression.input instanceof CompoundExpression &&\n expression.input.name === 'zoom') {\n\n result = expression;\n }\n\n if (result instanceof ParsingError) {\n return result;\n }\n\n expression.eachChild((child) => {\n const childResult = findZoomCurve(child);\n if (childResult instanceof ParsingError) {\n result = childResult;\n } else if (!result && childResult) {\n result = new ParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.');\n } else if (result && childResult && result !== childResult) {\n result = new ParsingError('', 'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.');\n }\n });\n\n return result;\n}\n\nimport {ColorType, StringType, NumberType, BooleanType, ValueType, FormattedType, ResolvedImageType, array} from './types.js';\n\nfunction getExpectedType(spec: StylePropertySpecification): Type {\n const types = {\n color: ColorType,\n string: StringType,\n number: NumberType,\n enum: StringType,\n boolean: BooleanType,\n formatted: FormattedType,\n resolvedImage: ResolvedImageType\n };\n\n if (spec.type === 'array') {\n return array(types[spec.value] || ValueType, spec.length);\n }\n\n return types[spec.type];\n}\n\nfunction getDefaultValue(spec: StylePropertySpecification): Value {\n if (spec.type === 'color' && (isFunction(spec.default) || Array.isArray(spec.default))) {\n // Special case for heatmap-color: it uses the 'default:' to define a\n // default color ramp, but createExpression expects a simple value to fall\n // back to in case of runtime errors\n return new Color(0, 0, 0, 0);\n } else if (spec.type === 'color') {\n return Color.parse(spec.default) || null;\n } else if (spec.default === undefined) {\n return null;\n } else {\n return spec.default;\n }\n}\n","// @flow\n\nimport type {StylePropertySpecification} from '../style-spec.js';\n\nexport function supportsPropertyExpression(spec: StylePropertySpecification): boolean {\n return spec['property-type'] === 'data-driven';\n}\n\nexport function supportsZoomExpression(spec: StylePropertySpecification): boolean {\n return !!spec.expression && spec.expression.parameters.indexOf('zoom') > -1;\n}\n\nexport function supportsInterpolation(spec: StylePropertySpecification): boolean {\n return !!spec.expression && spec.expression.interpolated;\n}\n","// @flow\n\n// Turn jsonlint-lines-primitives objects into primitive objects\nexport function unbundle(value: mixed): mixed {\n if (value instanceof Number || value instanceof String || value instanceof Boolean) {\n return value.valueOf();\n } else {\n return value;\n }\n}\n\nexport function deepUnbundle(value: mixed): mixed {\n if (Array.isArray(value)) {\n return value.map(deepUnbundle);\n } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {\n const unbundledValue: { [key: string]: mixed } = {};\n for (const key in value) {\n unbundledValue[key] = deepUnbundle(value[key]);\n }\n return unbundledValue;\n }\n\n return unbundle(value);\n}\n","{\n \"$version\": 8,\n \"$root\": {\n \"version\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": [\n 8\n ],\n \"doc\": \"Style specification version number. Must be 8.\",\n \"example\": 8\n },\n \"name\": {\n \"type\": \"string\",\n \"doc\": \"A human-readable name for the style.\",\n \"example\": \"Bright\"\n },\n \"metadata\": {\n \"type\": \"*\",\n \"doc\": \"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\"\n },\n \"center\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"doc\": \"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": [\n -73.9749,\n 40.7736\n ]\n },\n \"zoom\": {\n \"type\": \"number\",\n \"doc\": \"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": 12.5\n },\n \"bearing\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"units\": \"degrees\",\n \"doc\": \"Default bearing, in degrees. The bearing is the compass direction that is \\\"up\\\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": 29\n },\n \"pitch\": {\n \"type\": \"number\",\n \"default\": 0,\n \"units\": \"degrees\",\n \"doc\": \"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\n \"example\": 50\n },\n \"light\": {\n \"type\": \"light\",\n \"doc\": \"The global light source.\",\n \"example\": {\n \"anchor\": \"viewport\",\n \"color\": \"white\",\n \"intensity\": 0.4\n }\n },\n \"terrain\": {\n \"type\": \"terrain\",\n \"doc\": \"A global modifier that elevates layers and markers based on a DEM data source.\"\n },\n \"fog\": {\n \"type\": \"fog\",\n \"doc\": \"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0.\"\n },\n \"sources\": {\n \"required\": true,\n \"type\": \"sources\",\n \"doc\": \"Data source specifications.\",\n \"example\": {\n \"mapbox-streets\": {\n \"type\": \"vector\",\n \"url\": \"mapbox://mapbox.mapbox-streets-v6\"\n }\n }\n },\n \"sprite\": {\n \"type\": \"string\",\n \"doc\": \"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).\",\n \"example\": \"mapbox://sprites/mapbox/bright-v8\"\n },\n \"glyphs\": {\n \"type\": \"string\",\n \"doc\": \"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).\",\n \"example\": \"mapbox://fonts/mapbox/{fontstack}/{range}.pbf\"\n },\n \"transition\": {\n \"type\": \"transition\",\n \"doc\": \"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.\",\n \"example\": {\n \"duration\": 300,\n \"delay\": 0\n }\n },\n \"projection\": {\n \"type\": \"projection\",\n \"doc\": \"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.\",\n \"example\": {\n \"name\": \"albers\",\n \"center\": [-154, 50],\n \"parallels\": [55, 65]\n }\n },\n \"layers\": {\n \"required\": true,\n \"type\": \"array\",\n \"value\": \"layer\",\n \"doc\": \"Layers will be drawn in the order of this array.\",\n \"example\": [\n {\n \"id\": \"water\",\n \"source\": \"mapbox-streets\",\n \"source-layer\": \"water\",\n \"type\": \"fill\",\n \"paint\": {\n \"fill-color\": \"#00ffff\"\n }\n }\n ]\n }\n },\n \"sources\": {\n \"*\": {\n \"type\": \"source\",\n \"doc\": \"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided.\"\n }\n },\n \"source\": [\n \"source_vector\",\n \"source_raster\",\n \"source_raster_dem\",\n \"source_geojson\",\n \"source_video\",\n \"source_image\"\n ],\n \"source_vector\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"vector\": {\n \"doc\": \"A vector tile source.\"\n }\n },\n \"doc\": \"The type of the source.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"doc\": \"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`.\"\n },\n \"tiles\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"An array of one or more tile source URLs, as in the TileJSON spec.\"\n },\n \"bounds\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n -180,\n -85.051129,\n 180,\n 85.051129\n ],\n \"doc\": \"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\"\n },\n \"scheme\": {\n \"type\": \"enum\",\n \"values\": {\n \"xyz\": {\n \"doc\": \"Slippy map tilenames scheme.\"\n },\n \"tms\": {\n \"doc\": \"OSGeo spec scheme.\"\n }\n },\n \"default\": \"xyz\",\n \"doc\": \"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 22,\n \"doc\": \"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"promoteId\": {\n \"type\": \"promoteId\",\n \"doc\": \"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id\"\n },\n \"volatile\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"A setting to determine whether a source's tiles are cached locally.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.3.0\",\n \"ios\": \"5.10.0\"\n }\n }\n },\n \"*\": {\n \"type\": \"*\",\n \"doc\": \"Other keys to configure the data source.\"\n }\n },\n \"source_raster\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"raster\": {\n \"doc\": \"A raster tile source.\"\n }\n },\n \"doc\": \"The type of the source.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"doc\": \"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`.\"\n },\n \"tiles\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"An array of one or more tile source URLs, as in the TileJSON spec.\"\n },\n \"bounds\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n -180,\n -85.051129,\n 180,\n 85.051129\n ],\n \"doc\": \"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 22,\n \"doc\": \"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"\n },\n \"tileSize\": {\n \"type\": \"number\",\n \"default\": 512,\n \"units\": \"pixels\",\n \"doc\": \"The minimum visual size to display tiles for this layer. Only configurable for raster layers.\"\n },\n \"scheme\": {\n \"type\": \"enum\",\n \"values\": {\n \"xyz\": {\n \"doc\": \"Slippy map tilenames scheme.\"\n },\n \"tms\": {\n \"doc\": \"OSGeo spec scheme.\"\n }\n },\n \"default\": \"xyz\",\n \"doc\": \"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"volatile\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"A setting to determine whether a source's tiles are cached locally.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.3.0\",\n \"ios\": \"5.10.0\"\n }\n }\n },\n \"*\": {\n \"type\": \"*\",\n \"doc\": \"Other keys to configure the data source.\"\n }\n },\n \"source_raster_dem\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"raster-dem\": {\n \"doc\": \"A RGB-encoded raster DEM source\"\n }\n },\n \"doc\": \"The type of the source.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"doc\": \"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`.\"\n },\n \"tiles\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"An array of one or more tile source URLs, as in the TileJSON spec.\"\n },\n \"bounds\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n -180,\n -85.051129,\n 180,\n 85.051129\n ],\n \"doc\": \"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 22,\n \"doc\": \"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"\n },\n \"tileSize\": {\n \"type\": \"number\",\n \"default\": 512,\n \"units\": \"pixels\",\n \"doc\": \"The minimum visual size to display tiles for this layer. Only configurable for raster layers.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"encoding\": {\n \"type\": \"enum\",\n \"values\": {\n \"terrarium\": {\n \"doc\": \"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info.\"\n },\n \"mapbox\": {\n \"doc\": \"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info.\"\n }\n },\n \"default\": \"mapbox\",\n \"doc\": \"The encoding used by this source. Mapbox Terrain RGB is used by default\"\n },\n \"volatile\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"A setting to determine whether a source's tiles are cached locally.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.3.0\",\n \"ios\": \"5.10.0\"\n }\n }\n },\n \"*\": {\n \"type\": \"*\",\n \"doc\": \"Other keys to configure the data source.\"\n }\n },\n \"source_geojson\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"geojson\": {\n \"doc\": \"A GeoJSON data source.\"\n }\n },\n \"doc\": \"The data type of the GeoJSON source.\"\n },\n \"data\": {\n \"type\": \"*\",\n \"doc\": \"A URL to a GeoJSON file, or inline GeoJSON.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"default\": 18,\n \"doc\": \"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"doc\": \"Contains an attribution to be displayed when the map is shown to a user.\"\n },\n \"buffer\": {\n \"type\": \"number\",\n \"default\": 128,\n \"maximum\": 512,\n \"minimum\": 0,\n \"doc\": \"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.\"\n },\n \"filter\": {\n \"type\": \"*\",\n \"doc\": \"An expression for filtering features prior to processing them for rendering.\"\n },\n \"tolerance\": {\n \"type\": \"number\",\n \"default\": 0.375,\n \"doc\": \"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).\"\n },\n \"cluster\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count\"\n },\n \"clusterRadius\": {\n \"type\": \"number\",\n \"default\": 50,\n \"minimum\": 0,\n \"doc\": \"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.\"\n },\n \"clusterMaxZoom\": {\n \"type\": \"number\",\n \"doc\": \"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.\"\n },\n \"clusterMinPoints\": {\n \"type\": \"number\",\n \"doc\": \"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`.\"\n },\n \"clusterProperties\": {\n \"type\": \"*\",\n \"doc\": \"An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{\\\"property_name\\\": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `\\\"+\\\"` or `\\\"max\\\"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{\\\"sum\\\": [\\\"+\\\", [\\\"get\\\", \\\"scalerank\\\"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `[\\\"accumulated\\\"]` value, e.g.:\\n`{\\\"sum\\\": [[\\\"+\\\", [\\\"accumulated\\\"], [\\\"get\\\", \\\"sum\\\"]], [\\\"get\\\", \\\"scalerank\\\"]]}`\"\n },\n \"lineMetrics\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values.\"\n },\n \"generateId\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values.\"\n },\n \"promoteId\": {\n \"type\": \"promoteId\",\n \"doc\": \"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`.\"\n }\n },\n \"source_video\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"video\": {\n \"doc\": \"A video data source.\"\n }\n },\n \"doc\": \"The data type of the video source.\"\n },\n \"urls\": {\n \"required\": true,\n \"type\": \"array\",\n \"value\": \"string\",\n \"doc\": \"URLs to video content in order of preferred format.\"\n },\n \"coordinates\": {\n \"required\": true,\n \"doc\": \"Corners of video specified in longitude, latitude pairs.\",\n \"type\": \"array\",\n \"length\": 4,\n \"value\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"doc\": \"A single longitude, latitude pair.\"\n }\n }\n },\n \"source_image\": {\n \"type\": {\n \"required\": true,\n \"type\": \"enum\",\n \"values\": {\n \"image\": {\n \"doc\": \"An image data source.\"\n }\n },\n \"doc\": \"The data type of the image source.\"\n },\n \"url\": {\n \"required\": true,\n \"type\": \"string\",\n \"doc\": \"URL that points to an image.\"\n },\n \"coordinates\": {\n \"required\": true,\n \"doc\": \"Corners of image specified in longitude, latitude pairs.\",\n \"type\": \"array\",\n \"length\": 4,\n \"value\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"doc\": \"A single longitude, latitude pair.\"\n }\n }\n },\n \"layer\": {\n \"id\": {\n \"type\": \"string\",\n \"doc\": \"Unique layer name.\",\n \"required\": true\n },\n \"type\": {\n \"type\": \"enum\",\n \"values\": {\n \"fill\": {\n \"doc\": \"A filled polygon with an optional stroked border.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"line\": {\n \"doc\": \"A stroked line.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"symbol\": {\n \"doc\": \"An icon or a text label.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"circle\": {\n \"doc\": \"A filled circle.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"heatmap\": {\n \"doc\": \"A heatmap.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"fill-extrusion\": {\n \"doc\": \"An extruded (3D) polygon.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"raster\": {\n \"doc\": \"Raster map textures such as satellite imagery.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"hillshade\": {\n \"doc\": \"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"background\": {\n \"doc\": \"The background color or pattern of the map.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n }\n },\n \"sky\": {\n \"doc\": \"A spherical dome around the map that is always rendered behind all other layers.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n }\n },\n \"doc\": \"Rendering type of this layer.\",\n \"required\": true\n },\n \"metadata\": {\n \"type\": \"*\",\n \"doc\": \"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\"\n },\n \"source\": {\n \"type\": \"string\",\n \"doc\": \"Name of a source description to be used for this layer. Required for all layer types except `background`.\"\n },\n \"source-layer\": {\n \"type\": \"string\",\n \"doc\": \"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.\"\n },\n \"minzoom\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 24,\n \"doc\": \"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.\"\n },\n \"maxzoom\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 24,\n \"doc\": \"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.\"\n },\n \"filter\": {\n \"type\": \"filter\",\n \"doc\": \"An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\\\"feature-state\\\", ...]` expression is not supported in filter expressions. The `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions are supported only for filter expressions on the symbol layer.\"\n },\n \"layout\": {\n \"type\": \"layout\",\n \"doc\": \"Layout properties for the layer.\"\n },\n \"paint\": {\n \"type\": \"paint\",\n \"doc\": \"Default paint properties for this layer.\"\n }\n },\n \"layout\": [\n \"layout_fill\",\n \"layout_line\",\n \"layout_circle\",\n \"layout_heatmap\",\n \"layout_fill-extrusion\",\n \"layout_symbol\",\n \"layout_raster\",\n \"layout_hillshade\",\n \"layout_background\",\n \"layout_sky\"\n ],\n \"layout_background\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_sky\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_fill\": {\n \"fill-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n },\n \"data-driven styling\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_circle\": {\n \"circle-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.2.0\",\n \"ios\": \"5.9.0\",\n \"macos\": \"0.16.0\"\n },\n \"data-driven styling\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.2.0\",\n \"ios\": \"5.9.0\",\n \"macos\": \"0.16.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_heatmap\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_fill-extrusion\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"property-type\": \"constant\"\n },\n \"fill-extrusion-edge-radius\": {\n \"type\": \"number\",\n \"private\": true,\n \"default\": 0,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"v2.10.0\",\n \"android\": \"10.7.0\",\n \"ios\": \"10.7.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_line\": {\n \"line-cap\": {\n \"type\": \"enum\",\n \"values\": {\n \"butt\": {\n \"doc\": \"A cap with a squared-off end which is drawn to the exact endpoint of the line.\"\n },\n \"round\": {\n \"doc\": \"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.\"\n },\n \"square\": {\n \"doc\": \"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.\"\n }\n },\n \"default\": \"butt\",\n \"doc\": \"The display of line endings.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"2.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-join\": {\n \"type\": \"enum\",\n \"values\": {\n \"bevel\": {\n \"doc\": \"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.\"\n },\n \"round\": {\n \"doc\": \"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.\"\n },\n \"miter\": {\n \"doc\": \"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.\"\n }\n },\n \"default\": \"miter\",\n \"doc\": \"The display of lines when joining.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-miter-limit\": {\n \"type\": \"number\",\n \"default\": 2,\n \"doc\": \"Used to automatically convert miter joins to bevel joins for sharp angles.\",\n \"requires\": [\n {\n \"line-join\": \"miter\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-round-limit\": {\n \"type\": \"number\",\n \"default\": 1.05,\n \"doc\": \"Used to automatically convert round joins to miter joins for shallow angles.\",\n \"requires\": [\n {\n \"line-join\": \"round\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n },\n \"data-driven styling\": {\n \"js\": \"1.2.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_symbol\": {\n \"symbol-placement\": {\n \"type\": \"enum\",\n \"values\": {\n \"point\": {\n \"doc\": \"The label is placed at the point where the geometry is located.\"\n },\n \"line\": {\n \"doc\": \"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.\"\n },\n \"line-center\": {\n \"doc\": \"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries.\"\n }\n },\n \"default\": \"point\",\n \"doc\": \"Label placement relative to its geometry.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"`line-center` value\": {\n \"js\": \"0.47.0\",\n \"android\": \"6.4.0\",\n \"ios\": \"4.3.0\",\n \"macos\": \"0.10.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"symbol-spacing\": {\n \"type\": \"number\",\n \"default\": 250,\n \"minimum\": 1,\n \"units\": \"pixels\",\n \"doc\": \"Distance between two symbol anchors.\",\n \"requires\": [\n {\n \"symbol-placement\": \"line\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"symbol-avoid-edges\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"symbol-sort-key\": {\n \"type\": \"number\",\n \"doc\": \"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.53.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.11.0\",\n \"macos\": \"0.14.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.53.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.11.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"symbol-z-order\": {\n \"type\": \"enum\",\n \"values\": {\n \"auto\": {\n \"doc\": \"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.\"\n },\n \"viewport-y\": {\n \"doc\": \"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.\"\n },\n \"source\": {\n \"doc\": \"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.6.0\",\n \"ios\": \"4.5.0\",\n \"macos\": \"0.12.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-allow-overlap\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the icon will be visible even if it collides with other previously drawn symbols.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-ignore-placement\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, other symbols can be visible even if they collide with the icon.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-optional\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.\",\n \"requires\": [\n \"icon-image\",\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-rotation-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line.\"\n },\n \"viewport\": {\n \"doc\": \"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.\"\n },\n \"auto\": {\n \"doc\": \"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"In combination with `symbol-placement`, determines the rotation behavior of icons.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"`auto` value\": {\n \"js\": \"0.25.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-size\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"units\": \"factor of the original icon size\",\n \"doc\": \"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-text-fit\": {\n \"type\": \"enum\",\n \"values\": {\n \"none\": {\n \"doc\": \"The icon is displayed at its intrinsic aspect ratio.\"\n },\n \"width\": {\n \"doc\": \"The icon is scaled in the x-dimension to fit the width of the text.\"\n },\n \"height\": {\n \"doc\": \"The icon is scaled in the y-dimension to fit the height of the text.\"\n },\n \"both\": {\n \"doc\": \"The icon is scaled in both x- and y-dimensions.\"\n }\n },\n \"default\": \"none\",\n \"doc\": \"Scales the icon to fit around the associated text.\",\n \"requires\": [\n \"icon-image\",\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n },\n \"stretchable icons\": {\n \"js\": \"1.6.0\",\n \"android\": \"9.2.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-text-fit-padding\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 4,\n \"default\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"units\": \"pixels\",\n \"doc\": \"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.\",\n \"requires\": [\n \"icon-image\",\n \"text-field\",\n {\n \"icon-text-fit\": [\n \"both\",\n \"width\",\n \"height\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-image\": {\n \"type\": \"resolvedImage\",\n \"doc\": \"Name of image in sprite to use for drawing an image background.\",\n \"tokens\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-rotate\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"units\": \"degrees\",\n \"doc\": \"Rotates the icon clockwise.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.21.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-padding\": {\n \"type\": \"number\",\n \"default\": 2,\n \"minimum\": 0,\n \"units\": \"pixels\",\n \"doc\": \"Size of the additional area around the icon bounding box used for detecting symbol collisions.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-keep-upright\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the icon may be flipped to prevent it from being rendered upside-down.\",\n \"requires\": [\n \"icon-image\",\n {\n \"icon-rotation-alignment\": \"map\"\n },\n {\n \"symbol-placement\": [\n \"line\",\n \"line-center\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-offset\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"doc\": \"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"center\": {\n \"doc\": \"The center of the icon is placed closest to the anchor.\"\n },\n \"left\": {\n \"doc\": \"The left side of the icon is placed closest to the anchor.\"\n },\n \"right\": {\n \"doc\": \"The right side of the icon is placed closest to the anchor.\"\n },\n \"top\": {\n \"doc\": \"The top of the icon is placed closest to the anchor.\"\n },\n \"bottom\": {\n \"doc\": \"The bottom of the icon is placed closest to the anchor.\"\n },\n \"top-left\": {\n \"doc\": \"The top left corner of the icon is placed closest to the anchor.\"\n },\n \"top-right\": {\n \"doc\": \"The top right corner of the icon is placed closest to the anchor.\"\n },\n \"bottom-left\": {\n \"doc\": \"The bottom left corner of the icon is placed closest to the anchor.\"\n },\n \"bottom-right\": {\n \"doc\": \"The bottom right corner of the icon is placed closest to the anchor.\"\n }\n },\n \"default\": \"center\",\n \"doc\": \"Part of the icon placed closest to the anchor.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-pitch-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The icon is aligned to the plane of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The icon is aligned to the plane of the viewport.\"\n },\n \"auto\": {\n \"doc\": \"Automatically matches the value of `icon-rotation-alignment`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"Orientation of icon when map is pitched.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-pitch-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The text is aligned to the plane of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The text is aligned to the plane of the viewport.\"\n },\n \"auto\": {\n \"doc\": \"Automatically matches the value of `text-rotation-alignment`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"Orientation of text when map is pitched.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n },\n \"`auto` value\": {\n \"js\": \"0.25.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-rotation-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line.\"\n },\n \"viewport\": {\n \"doc\": \"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.\"\n },\n \"auto\": {\n \"doc\": \"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.\"\n }\n },\n \"default\": \"auto\",\n \"doc\": \"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"`auto` value\": {\n \"js\": \"0.25.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-field\": {\n \"type\": \"formatted\",\n \"default\": \"\",\n \"tokens\": true,\n \"doc\": \"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-font\": {\n \"type\": \"array\",\n \"value\": \"string\",\n \"default\": [\n \"Open Sans Regular\",\n \"Arial Unicode MS Regular\"\n ],\n \"doc\": \"Font stack to use for displaying text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-size\": {\n \"type\": \"number\",\n \"default\": 16,\n \"minimum\": 0,\n \"units\": \"pixels\",\n \"doc\": \"Font size.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-max-width\": {\n \"type\": \"number\",\n \"default\": 10,\n \"minimum\": 0,\n \"units\": \"ems\",\n \"doc\": \"The maximum line width for text wrapping.\",\n \"requires\": [\n \"text-field\",\n {\n \"symbol-placement\": [\n \"point\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-line-height\": {\n \"type\": \"number\",\n \"default\": 1.2,\n \"units\": \"ems\",\n \"doc\": \"Text leading value for multi-line text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-letter-spacing\": {\n \"type\": \"number\",\n \"default\": 0,\n \"units\": \"ems\",\n \"doc\": \"Text tracking amount.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.40.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-justify\": {\n \"type\": \"enum\",\n \"values\": {\n \"auto\": {\n \"doc\": \"The text is aligned towards the anchor position.\"\n },\n \"left\": {\n \"doc\": \"The text is aligned to the left.\"\n },\n \"center\": {\n \"doc\": \"The text is centered.\"\n },\n \"right\": {\n \"doc\": \"The text is aligned to the right.\"\n }\n },\n \"default\": \"center\",\n \"doc\": \"Text justification options.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n },\n \"auto\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-radial-offset\": {\n \"type\": \"number\",\n \"units\": \"ems\",\n \"default\": 0,\n \"doc\": \"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"requires\": [\n \"text-field\"\n ],\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n }\n },\n \"text-variable-anchor\": {\n \"type\": \"array\",\n \"value\": \"enum\",\n \"values\": {\n \"center\": {\n \"doc\": \"The center of the text is placed closest to the anchor.\"\n },\n \"left\": {\n \"doc\": \"The left side of the text is placed closest to the anchor.\"\n },\n \"right\": {\n \"doc\": \"The right side of the text is placed closest to the anchor.\"\n },\n \"top\": {\n \"doc\": \"The top of the text is placed closest to the anchor.\"\n },\n \"bottom\": {\n \"doc\": \"The bottom of the text is placed closest to the anchor.\"\n },\n \"top-left\": {\n \"doc\": \"The top left corner of the text is placed closest to the anchor.\"\n },\n \"top-right\": {\n \"doc\": \"The top right corner of the text is placed closest to the anchor.\"\n },\n \"bottom-left\": {\n \"doc\": \"The bottom left corner of the text is placed closest to the anchor.\"\n },\n \"bottom-right\": {\n \"doc\": \"The bottom right corner of the text is placed closest to the anchor.\"\n }\n },\n \"requires\": [\n \"text-field\",\n {\n \"symbol-placement\": [\n \"point\"\n ]\n }\n ],\n \"doc\": \"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.54.0\",\n \"android\": \"7.4.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"center\": {\n \"doc\": \"The center of the text is placed closest to the anchor.\"\n },\n \"left\": {\n \"doc\": \"The left side of the text is placed closest to the anchor.\"\n },\n \"right\": {\n \"doc\": \"The right side of the text is placed closest to the anchor.\"\n },\n \"top\": {\n \"doc\": \"The top of the text is placed closest to the anchor.\"\n },\n \"bottom\": {\n \"doc\": \"The bottom of the text is placed closest to the anchor.\"\n },\n \"top-left\": {\n \"doc\": \"The top left corner of the text is placed closest to the anchor.\"\n },\n \"top-right\": {\n \"doc\": \"The top right corner of the text is placed closest to the anchor.\"\n },\n \"bottom-left\": {\n \"doc\": \"The bottom left corner of the text is placed closest to the anchor.\"\n },\n \"bottom-right\": {\n \"doc\": \"The bottom right corner of the text is placed closest to the anchor.\"\n }\n },\n \"default\": \"center\",\n \"doc\": \"Part of the text placed closest to the anchor.\",\n \"requires\": [\n \"text-field\",\n {\n \"!\": \"text-variable-anchor\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-max-angle\": {\n \"type\": \"number\",\n \"default\": 45,\n \"units\": \"degrees\",\n \"doc\": \"Maximum angle change between adjacent characters.\",\n \"requires\": [\n \"text-field\",\n {\n \"symbol-placement\": [\n \"line\",\n \"line-center\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-writing-mode\": {\n \"type\": \"array\",\n \"value\": \"enum\",\n \"values\": {\n \"horizontal\": {\n \"doc\": \"If a text's language supports horizontal writing mode, symbols would be laid out horizontally.\"\n },\n \"vertical\": {\n \"doc\": \"If a text's language supports vertical writing mode, symbols would be laid out vertically.\"\n }\n },\n \"doc\": \"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.3.0\",\n \"android\": \"8.3.0\",\n \"ios\": \"5.3.0\",\n \"macos\": \"0.15.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-rotate\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"units\": \"degrees\",\n \"doc\": \"Rotates the text clockwise.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-padding\": {\n \"type\": \"number\",\n \"default\": 2,\n \"minimum\": 0,\n \"units\": \"pixels\",\n \"doc\": \"Size of the additional area around the text bounding box used for detecting symbol collisions.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-keep-upright\": {\n \"type\": \"boolean\",\n \"default\": true,\n \"doc\": \"If true, the text may be flipped vertically to prevent it from being rendered upside-down.\",\n \"requires\": [\n \"text-field\",\n {\n \"text-rotation-alignment\": \"map\"\n },\n {\n \"symbol-placement\": [\n \"line\",\n \"line-center\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-transform\": {\n \"type\": \"enum\",\n \"values\": {\n \"none\": {\n \"doc\": \"The text is not altered.\"\n },\n \"uppercase\": {\n \"doc\": \"Forces all letters to be displayed in uppercase.\"\n },\n \"lowercase\": {\n \"doc\": \"Forces all letters to be displayed in lowercase.\"\n }\n },\n \"default\": \"none\",\n \"doc\": \"Specifies how to capitalize text, similar to the CSS `text-transform` property.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-offset\": {\n \"type\": \"array\",\n \"doc\": \"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.\",\n \"value\": \"number\",\n \"units\": \"ems\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"requires\": [\n \"text-field\",\n {\n \"!\": \"text-radial-offset\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.35.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-allow-overlap\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, the text will be visible even if it collides with other previously drawn symbols.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-ignore-placement\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, other symbols can be visible even if they collide with the text.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-optional\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"doc\": \"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.\",\n \"requires\": [\n \"text-field\",\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_raster\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"layout_hillshade\": {\n \"visibility\": {\n \"type\": \"enum\",\n \"values\": {\n \"visible\": {\n \"doc\": \"The layer is shown.\"\n },\n \"none\": {\n \"doc\": \"The layer is not shown.\"\n }\n },\n \"default\": \"visible\",\n \"doc\": \"Whether this layer is displayed.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"filter\": {\n \"type\": \"array\",\n \"value\": \"*\",\n \"doc\": \"A filter selects specific features from a layer.\"\n },\n \"filter_symbol\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\", \"pitch\", \"distance-from-center\"]\n }\n },\n \"filter_fill\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_line\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_circle\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_fill-extrusion\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_heatmap\": {\n \"type\": \"boolean\",\n \"doc\": \"Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\\"pitch\\\"]` and `[\\\"distance-from-center\\\"]` expressions to reference the current state of the view.\",\n \"default\": false,\n \"transition\": false,\n \"property-type\": \"data-driven\",\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\"zoom\", \"feature\"]\n }\n },\n \"filter_operator\": {\n \"type\": \"enum\",\n \"values\": {\n \"==\": {\n \"doc\": \"`[\\\"==\\\", key, value]` equality: `feature[key] = value`\"\n },\n \"!=\": {\n \"doc\": \"`[\\\"!=\\\", key, value]` inequality: `feature[key] ≠ value`\"\n },\n \">\": {\n \"doc\": \"`[\\\">\\\", key, value]` greater than: `feature[key] > value`\"\n },\n \">=\": {\n \"doc\": \"`[\\\">=\\\", key, value]` greater than or equal: `feature[key] ≥ value`\"\n },\n \"<\": {\n \"doc\": \"`[\\\"<\\\", key, value]` less than: `feature[key] < value`\"\n },\n \"<=\": {\n \"doc\": \"`[\\\"<=\\\", key, value]` less than or equal: `feature[key] ≤ value`\"\n },\n \"in\": {\n \"doc\": \"`[\\\"in\\\", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`\"\n },\n \"!in\": {\n \"doc\": \"`[\\\"!in\\\", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`\"\n },\n \"all\": {\n \"doc\": \"`[\\\"all\\\", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`\"\n },\n \"any\": {\n \"doc\": \"`[\\\"any\\\", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`\"\n },\n \"none\": {\n \"doc\": \"`[\\\"none\\\", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`\"\n },\n \"has\": {\n \"doc\": \"`[\\\"has\\\", key]` `feature[key]` exists\"\n },\n \"!has\": {\n \"doc\": \"`[\\\"!has\\\", key]` `feature[key]` does not exist\"\n },\n \"within\": {\n \"doc\": \"`[\\\"within\\\", object]` feature geometry is within object geometry\"\n }\n },\n \"doc\": \"The filter operator.\"\n },\n \"geometry_type\": {\n \"type\": \"enum\",\n \"values\": {\n \"Point\": {\n \"doc\": \"Filter to point geometries.\"\n },\n \"LineString\": {\n \"doc\": \"Filter to line geometries.\"\n },\n \"Polygon\": {\n \"doc\": \"Filter to polygon geometries.\"\n }\n },\n \"doc\": \"The geometry type for the filter to select.\"\n },\n \"function\": {\n \"expression\": {\n \"type\": \"expression\",\n \"doc\": \"An expression.\"\n },\n \"stops\": {\n \"type\": \"array\",\n \"doc\": \"An array of stops.\",\n \"value\": \"function_stop\"\n },\n \"base\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"doc\": \"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly.\"\n },\n \"property\": {\n \"type\": \"string\",\n \"doc\": \"The name of a feature property to use as the function input.\",\n \"default\": \"$zoom\"\n },\n \"type\": {\n \"type\": \"enum\",\n \"values\": {\n \"identity\": {\n \"doc\": \"Return the input value as the output value.\"\n },\n \"exponential\": {\n \"doc\": \"Generate an output by interpolating between stops just less than and just greater than the function input.\"\n },\n \"interval\": {\n \"doc\": \"Return the output value of the stop just less than the function input.\"\n },\n \"categorical\": {\n \"doc\": \"Return the output value of the stop equal to the function input.\"\n }\n },\n \"doc\": \"The interpolation strategy to use in function evaluation.\",\n \"default\": \"exponential\"\n },\n \"colorSpace\": {\n \"type\": \"enum\",\n \"values\": {\n \"rgb\": {\n \"doc\": \"Use the RGB color space to interpolate color values\"\n },\n \"lab\": {\n \"doc\": \"Use the LAB color space to interpolate color values.\"\n },\n \"hcl\": {\n \"doc\": \"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually.\"\n }\n },\n \"doc\": \"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.\",\n \"default\": \"rgb\"\n },\n \"default\": {\n \"type\": \"*\",\n \"required\": false,\n \"doc\": \"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property's default is used in these circumstances.\"\n }\n },\n \"function_stop\": {\n \"type\": \"array\",\n \"minimum\": 0,\n \"maximum\": 24,\n \"value\": [\n \"number\",\n \"color\"\n ],\n \"length\": 2,\n \"doc\": \"Zoom level and value pair.\"\n },\n \"expression\": {\n \"type\": \"array\",\n \"value\": \"*\",\n \"minimum\": 1,\n \"doc\": \"An expression defines a function that can be used for data-driven style properties or feature filters.\"\n },\n \"expression_name\": {\n \"doc\": \"\",\n \"type\": \"enum\",\n \"values\": {\n \"let\": {\n \"doc\": \"Binds expressions to named variables, which can then be referenced in the result expression using [\\\"var\\\", \\\"variable_name\\\"].\",\n \"group\": \"Variable binding\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"var\": {\n \"doc\": \"References variable bound using \\\"let\\\".\",\n \"group\": \"Variable binding\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"literal\": {\n \"doc\": \"Provides a literal array or object value.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"array\": {\n \"doc\": \"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"at\": {\n \"doc\": \"Retrieves an item from an array.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"in\": {\n \"doc\": \"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.6.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"index-of\": {\n \"doc\": \"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.10.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n }\n },\n \"slice\": {\n \"doc\": \"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.10.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n }\n },\n \"case\": {\n \"doc\": \"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"match\": {\n \"doc\": \"Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\\\"get\\\", \\\"building_type\\\"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\\\"c\\\", \\\"b\\\"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `\\\"in\\\"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"coalesce\": {\n \"doc\": \"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"step\": {\n \"doc\": \"Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\\\"stops\\\"). The `input` may be any numeric expression (e.g., `[\\\"get\\\", \\\"population\\\"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.42.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"interpolate\": {\n \"doc\": \"Produces continuous, smooth results by interpolating between pairs of input and output values (\\\"stops\\\"). The `input` may be any numeric expression (e.g., `[\\\"get\\\", \\\"population\\\"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\\n\\nInterpolation types:\\n- `[\\\"linear\\\"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `[\\\"exponential\\\", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `[\\\"cubic-bezier\\\", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.42.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"interpolate-hcl\": {\n \"doc\": \"Produces continuous, smooth results by interpolating between pairs of input and output values (\\\"stops\\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.49.0\"\n }\n }\n },\n \"interpolate-lab\": {\n \"doc\": \"Produces continuous, smooth results by interpolating between pairs of input and output values (\\\"stops\\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.\",\n \"group\": \"Ramps, scales, curves\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.49.0\"\n }\n }\n },\n \"ln2\": {\n \"doc\": \"Returns mathematical constant ln(2).\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"pi\": {\n \"doc\": \"Returns the mathematical constant pi.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"e\": {\n \"doc\": \"Returns the mathematical constant e.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"typeof\": {\n \"doc\": \"Returns a string describing the type of the given value.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"string\": {\n \"doc\": \"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"number\": {\n \"doc\": \"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"boolean\": {\n \"doc\": \"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"object\": {\n \"doc\": \"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"collator\": {\n \"doc\": \"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"format\": {\n \"doc\": \"Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`'image'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `\\\"text-font\\\"`: Overrides the font stack specified by the root layout property.\\n- `\\\"text-color\\\"`: Overrides the color specified by the root paint property.\\n- `\\\"font-scale\\\"`: Applies a scaling factor on `text-size` as specified by the root layout property.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.48.0\",\n \"android\": \"6.7.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n },\n \"text-font\": {\n \"js\": \"0.48.0\",\n \"android\": \"6.7.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n },\n \"font-scale\": {\n \"js\": \"0.48.0\",\n \"android\": \"6.7.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n },\n \"text-color\": {\n \"js\": \"1.3.0\",\n \"android\": \"7.3.0\",\n \"ios\": \"4.10.0\",\n \"macos\": \"0.14.0\"\n },\n \"image\": {\n \"js\": \"1.6.0\",\n \"android\": \"8.6.0\",\n \"ios\": \"5.7.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"image\": {\n \"doc\": \"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.4.0\",\n \"android\": \"8.6.0\",\n \"ios\": \"5.7.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"number-format\": {\n \"doc\": \"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.54.0\",\n \"android\" : \"8.4.0\",\n \"ios\": \"5.4.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"to-string\": {\n \"doc\": \"Converts the input value to a string. If the input is `null`, the result is `\\\"\\\"`. If the input is a [`boolean`](#types-boolean), the result is `\\\"true\\\"` or `\\\"false\\\"`. If the input is a number, it is converted to a string as specified by the [\\\"NumberToString\\\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `\\\"rgba(r,g,b,a)\\\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`'image'`](#types-image) expression, `'to-string'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-number\": {\n \"doc\": \"Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the [\\\"ToNumber Applied to the String Type\\\" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-boolean\": {\n \"doc\": \"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-rgba\": {\n \"doc\": \"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.\",\n \"group\": \"Color\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"to-color\": {\n \"doc\": \"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\",\n \"group\": \"Types\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"rgb\": {\n \"doc\": \"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.\",\n \"group\": \"Color\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"rgba\": {\n \"doc\": \"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.\",\n \"group\": \"Color\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"get\": {\n \"doc\": \"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"has\": {\n \"doc\": \"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"length\": {\n \"doc\": \"Returns the length of an array or string.\",\n \"group\": \"Lookup\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"properties\": {\n \"doc\": \"Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\\\"get\\\", \\\"property_name\\\"]` directly.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"feature-state\": {\n \"doc\": \"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\\"feature-state\\\"] can only be used with paint properties that support data-driven styling.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.46.0\",\n \"android\": \"10.0.0\",\n \"ios\": \"10.0.0\"\n }\n }\n },\n \"geometry-type\": {\n \"doc\": \"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"id\": {\n \"doc\": \"Returns the feature's id, if it has one.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"zoom\": {\n \"doc\": \"Returns the current zoom level. Note that in style layout and paint properties, [\\\"zoom\\\"] may only appear as the input to a top-level \\\"step\\\" or \\\"interpolate\\\" expression.\",\n \"group\": \"Camera\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"pitch\": {\n \"doc\": \"Returns the current pitch in degrees. `[\\\"pitch\\\"]` may only be used in the `filter` expression for a `symbol` layer.\",\n \"group\": \"Camera\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\",\n \"android\": \"10.9.0\",\n \"ios\": \"10.9.0\"\n }\n }\n },\n \"distance-from-center\": {\n \"doc\": \"Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `[\\\"distance-from-center\\\"]` may only be used in the `filter` expression for a `symbol` layer.\",\n \"group\": \"Camera\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\",\n \"android\": \"10.9.0\",\n \"ios\": \"10.9.0\"\n }\n }\n },\n \"heatmap-density\": {\n \"doc\": \"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.\",\n \"group\": \"Heatmap\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"line-progress\": {\n \"doc\": \"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.6.0\",\n \"macos\": \"0.12.0\"\n }\n }\n },\n \"sky-radial-progress\": {\n \"doc\": \"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.\",\n \"group\": \"sky\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n },\n \"accumulated\": {\n \"doc\": \"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.\",\n \"group\": \"Feature data\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.53.0\",\n \"android\": \"8.4.0\",\n \"ios\": \"5.5.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"+\": {\n \"doc\": \"Returns the sum of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"*\": {\n \"doc\": \"Returns the product of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"-\": {\n \"doc\": \"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"/\": {\n \"doc\": \"Returns the result of floating point division of the first input by the second.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"%\": {\n \"doc\": \"Returns the remainder after integer division of the first input by the second.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"^\": {\n \"doc\": \"Returns the result of raising the first input to the power specified by the second.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"sqrt\": {\n \"doc\": \"Returns the square root of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.42.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"log10\": {\n \"doc\": \"Returns the base-ten logarithm of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"ln\": {\n \"doc\": \"Returns the natural logarithm of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"log2\": {\n \"doc\": \"Returns the base-two logarithm of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"sin\": {\n \"doc\": \"Returns the sine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"cos\": {\n \"doc\": \"Returns the cosine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"tan\": {\n \"doc\": \"Returns the tangent of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"asin\": {\n \"doc\": \"Returns the arcsine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"acos\": {\n \"doc\": \"Returns the arccosine of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"atan\": {\n \"doc\": \"Returns the arctangent of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"min\": {\n \"doc\": \"Returns the minimum value of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"max\": {\n \"doc\": \"Returns the maximum value of the inputs.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"round\": {\n \"doc\": \"Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `[\\\"round\\\", -1.5]` evaluates to -2.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"abs\": {\n \"doc\": \"Returns the absolute value of the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"ceil\": {\n \"doc\": \"Returns the smallest integer that is greater than or equal to the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"floor\": {\n \"doc\": \"Returns the largest integer that is less than or equal to the input.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"distance\": {\n \"doc\": \"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.\",\n \"group\": \"Math\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"android\": \"9.2.0\",\n \"ios\": \"5.9.0\",\n \"macos\": \"0.16.0\"\n }\n }\n },\n \"==\": {\n \"doc\": \"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"!=\": {\n \"doc\": \"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \">\": {\n \"doc\": \"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"<\": {\n \"doc\": \"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \">=\": {\n \"doc\": \"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"<=\": {\n \"doc\": \"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"collator\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n },\n \"all\": {\n \"doc\": \"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"any\": {\n \"doc\": \"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"!\": {\n \"doc\": \"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"within\": {\n \"doc\": \"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.\",\n \"group\": \"Decision\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"1.9.0\",\n \"android\": \"9.1.0\",\n \"ios\": \"5.8.0\",\n \"macos\": \"0.15.0\"\n }\n }\n },\n \"is-supported-script\": {\n \"doc\": \"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.6.0\",\n \"ios\": \"4.1.0\",\n \"macos\": \"0.8.0\"\n }\n }\n },\n \"upcase\": {\n \"doc\": \"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"downcase\": {\n \"doc\": \"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"concat\": {\n \"doc\": \"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n }\n },\n \"resolved-locale\": {\n \"doc\": \"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.\",\n \"group\": \"String\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n }\n }\n }\n },\n \"fog\": {\n \"range\": {\n \"type\": \"array\",\n \"default\": [\n 0.5,\n 10\n ],\n \"minimum\": -20,\n \"maximum\": 20,\n \"length\": 2,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"transition\": true,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"doc\": \"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.\",\n \"example\": [\n 0.5,\n 10\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n \"default\": \"#ffffff\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"high-color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n \"default\": \"#245cdf\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"space-color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n\n \"default\":\n [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"zoom\"\n ],\n 4,\n \"#010b19\",\n 7,\n \"#367ab9\"\n ],\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"horizon-blend\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\":\n [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"zoom\"\n ],\n 4,\n 0.2,\n 7,\n 0.1\n ],\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.3.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n },\n \"star-intensity\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\":\n [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"zoom\"\n ],\n 5,\n 0.35,\n 6,\n 0\n ],\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.6.0\",\n \"ios\": \"10.6.0\"\n }\n }\n }\n },\n \"light\": {\n \"anchor\": {\n \"type\": \"enum\",\n \"default\": \"viewport\",\n \"values\": {\n \"map\": {\n \"doc\": \"The position of the light source is aligned to the rotation of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The position of the light source is aligned to the rotation of the viewport.\"\n }\n },\n \"property-type\": \"data-constant\",\n \"transition\": false,\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"doc\": \"Whether extruded geometries are lit relative to the map or viewport.\",\n \"example\": \"map\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"position\": {\n \"type\": \"array\",\n \"default\": [\n 1.15,\n 210,\n 30\n ],\n \"length\": 3,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"transition\": true,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"doc\": \"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).\",\n \"example\": [\n 1.5,\n 90,\n 80\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"color\": {\n \"type\": \"color\",\n \"property-type\": \"data-constant\",\n \"default\": \"#ffffff\",\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Color tint for lighting extruded geometries.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n },\n \"intensity\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\": 0.5,\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n }\n }\n },\n \"projection\": {\n \"name\": {\n \"type\": \"enum\",\n \"values\": {\n \"albers\": {\n \"doc\": \"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region.\"\n },\n \"equalEarth\": {\n \"doc\": \"An Equal Earth projection.\"\n },\n \"equirectangular\": {\n \"doc\": \"An Equirectangular projection. This projection is very similar to the Plate Carrée projection.\"\n },\n \"lambertConformalConic\": {\n \"doc\": \"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region.\"\n },\n \"mercator\": {\n \"doc\": \"The Mercator projection is the default projection.\"\n },\n \"naturalEarth\": {\n \"doc\": \"A Natural Earth projection.\"\n },\n \"winkelTripel\": {\n \"doc\": \"A Winkel Tripel projection.\"\n },\n \"globe\": {\n \"doc\": \"A globe projection.\"\n }\n },\n \"default\": \"mercator\",\n \"doc\": \"The name of the projection to be used for rendering the map.\",\n \"required\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\"\n }\n }\n },\n \"center\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"minimum\": [-180, -90],\n \"maximum\": [180, 90],\n \"transition\": false,\n \"doc\": \"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].\",\n \"example\": [\n -96,\n 37.5\n ],\n \"requires\": [\n {\n \"name\": [\n \"albers\",\n \"lambertConformalConic\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\"\n }\n }\n },\n \"parallels\": {\n \"type\": \"array\",\n \"length\": 2,\n \"value\": \"number\",\n \"property-type\": \"data-constant\",\n \"minimum\": [-90, -90],\n \"maximum\": [90, 90],\n \"transition\": false,\n \"doc\": \"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).\",\n \"example\": [\n 29.5,\n 45.5\n ],\n \"requires\": [\n {\n \"name\": [\n \"albers\",\n \"lambertConformalConic\"\n ]\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.6.0\"\n }\n }\n }\n },\n \"terrain\" : {\n \"source\": {\n \"type\": \"string\",\n \"doc\": \"Name of a source of `raster_dem` type to be used for terrain elevation.\",\n \"required\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n },\n \"exaggeration\": {\n \"type\": \"number\",\n \"property-type\": \"data-constant\",\n \"default\": 1.0,\n \"minimum\": 0,\n \"maximum\": 1000,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.\",\n \"requires\": [\n \"source\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n }\n }\n },\n \"paint\": [\n \"paint_fill\",\n \"paint_line\",\n \"paint_circle\",\n \"paint_heatmap\",\n \"paint_fill-extrusion\",\n \"paint_symbol\",\n \"paint_raster\",\n \"paint_hillshade\",\n \"paint_background\",\n \"paint_sky\"\n ],\n \"paint_fill\": {\n \"fill-antialias\": {\n \"type\": \"boolean\",\n \"default\": true,\n \"doc\": \"Whether or not the fill should be antialiased.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.21.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"fill-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.19.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-outline-color\": {\n \"type\": \"color\",\n \"doc\": \"The outline color of the fill. Matches the value of `fill-color` if unspecified.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"fill-pattern\"\n },\n {\n \"fill-antialias\": true\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.19.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The fill is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The fill is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `fill-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"fill-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.5.0\",\n \"macos\": \"0.11.0\",\n \"ios\": \"4.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n }\n },\n \"paint_fill-extrusion\": {\n \"fill-extrusion-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"fill-extrusion-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The fill extrusion is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The fill extrusion is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `fill-extrusion-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"fill-extrusion-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.5.0\",\n \"macos\": \"0.11.0\",\n \"ios\": \"4.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-height\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"units\": \"meters\",\n \"doc\": \"The height with which to extrude this layer.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-base\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"units\": \"meters\",\n \"doc\": \"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.\",\n \"transition\": true,\n \"requires\": [\n \"fill-extrusion-height\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.27.0\",\n \"android\": \"5.1.0\",\n \"ios\": \"3.6.0\",\n \"macos\": \"0.5.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"fill-extrusion-vertical-gradient\": {\n \"type\": \"boolean\",\n \"default\": true,\n \"doc\": \"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.\",\n \"transition\": false,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.50.0\",\n \"android\": \"7.0.0\",\n \"ios\": \"4.7.0\",\n \"macos\": \"0.13.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"fill-extrusion-ambient-occlusion-intensity\": {\n \"property-type\": \"data-constant\",\n \"type\": \"number\",\n \"private\": true,\n \"default\": 0.0,\n \"minimum\": 0,\n \"maximum\": 1,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.10.0\",\n \"android\": \"10.7.0\",\n \"ios\": \"10.7.0\"\n }\n }\n },\n \"fill-extrusion-ambient-occlusion-radius\": {\n \"property-type\": \"data-constant\",\n \"type\": \"number\",\n \"private\": true,\n \"default\": 3.0,\n \"minimum\": 0,\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"transition\": true,\n \"doc\": \"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.\",\n \"requires\": [\n \"fill-extrusion-edge-radius\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.10.0\",\n \"android\": \"10.7.0\",\n \"ios\": \"10.7.0\"\n }\n }\n }\n },\n \"paint_line\": {\n \"line-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the line will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-color\": {\n \"type\": \"color\",\n \"doc\": \"The color with which the line will be drawn.\",\n \"default\": \"#000000\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"line-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.23.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The line is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The line is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `line-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"line-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"line-width\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Stroke thickness.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-gap-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"doc\": \"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.\",\n \"transition\": true,\n \"units\": \"pixels\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-offset\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.\",\n \"transition\": true,\n \"units\": \"pixels\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.12.1\",\n \"android\": \"3.0.0\",\n \"ios\": \"3.1.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Blur applied to the line, in pixels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-dasharray\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"doc\": \"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"minimum\": 0,\n \"transition\": false,\n \"units\": \"line widths\",\n \"requires\": [\n {\n \"!\": \"line-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"2.3.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.49.0\",\n \"android\": \"6.5.0\",\n \"macos\": \"0.11.0\",\n \"ios\": \"4.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\",\n \"feature\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"line-gradient\": {\n \"type\": \"color\",\n \"doc\": \"Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `\\\"lineMetrics\\\": true`.\",\n \"transition\": false,\n \"requires\": [\n {\n \"!\": \"line-pattern\"\n },\n {\n \"source\": \"geojson\",\n \"has\": {\n \"lineMetrics\": true\n }\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.45.0\",\n \"android\": \"6.5.0\",\n \"ios\": \"4.4.0\",\n \"macos\": \"0.11.0\"\n },\n \"data-driven styling\": {}\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"line-progress\"\n ]\n },\n \"property-type\": \"color-ramp\"\n },\n \"line-trim-offset\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"doc\": \"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].\",\n \"length\": 2,\n \"default\": [0.0, 0.0],\n \"minimum\": [0.0, 0.0],\n \"maximum\": [1.0, 1.0],\n \"transition\": false,\n \"requires\": [\n {\n \"source\": \"geojson\",\n \"has\": {\n \"lineMetrics\": true\n }\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.9.0\",\n \"android\": \"10.5.0\",\n \"ios\": \"10.5.0\",\n \"macos\": \"10.5.0\"\n }\n },\n \"property-type\": \"constant\"\n }\n },\n \"paint_circle\": {\n \"circle-radius\": {\n \"type\": \"number\",\n \"default\": 5,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Circle radius.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.18.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The fill color of the circle.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.18.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"doc\": \"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.20.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the circle will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.20.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The circle is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The circle is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `circle-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"circle-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-pitch-scale\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"Circles are scaled according to their apparent distance to the camera.\"\n },\n \"viewport\": {\n \"doc\": \"Circles are not scaled.\"\n }\n },\n \"default\": \"map\",\n \"doc\": \"Controls the scaling behavior of the circle when the map is pitched.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.21.0\",\n \"android\": \"4.2.0\",\n \"ios\": \"3.4.0\",\n \"macos\": \"0.2.1\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-pitch-alignment\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The circle is aligned to the plane of the map.\"\n },\n \"viewport\": {\n \"doc\": \"The circle is aligned to the plane of the viewport.\"\n }\n },\n \"default\": \"viewport\",\n \"doc\": \"Orientation of circle when map is pitched.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.39.0\",\n \"android\": \"5.2.0\",\n \"ios\": \"3.7.0\",\n \"macos\": \"0.6.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"circle-stroke-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-stroke-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The stroke color of the circle.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"circle-stroke-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity of the circle's stroke.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.29.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n }\n },\n \"paint_heatmap\": {\n \"heatmap-radius\": {\n \"type\": \"number\",\n \"default\": 30,\n \"minimum\": 1,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"heatmap-weight\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"transition\": false,\n \"doc\": \"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"heatmap-intensity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"transition\": true,\n \"doc\": \"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"heatmap-color\": {\n \"type\": \"color\",\n \"default\": [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"heatmap-density\"\n ],\n 0,\n \"rgba(0, 0, 255, 0)\",\n 0.1,\n \"royalblue\",\n 0.3,\n \"cyan\",\n 0.5,\n \"lime\",\n 0.7,\n \"yellow\",\n 1,\n \"red\"\n ],\n \"doc\": \"Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\\\"heatmap-density\\\"]` as input.\",\n \"transition\": false,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n },\n \"data-driven styling\": {}\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"heatmap-density\"\n ]\n },\n \"property-type\": \"color-ramp\"\n },\n \"heatmap-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The global opacity at which the heatmap layer will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.41.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_symbol\": {\n \"icon-opacity\": {\n \"doc\": \"The opacity at which the icon will be drawn.\",\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"transition\": true,\n \"doc\": \"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-halo-color\": {\n \"type\": \"color\",\n \"default\": \"rgba(0, 0, 0, 0)\",\n \"transition\": true,\n \"doc\": \"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-halo-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance of halo to the icon outline.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-halo-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Fade out the halo towards the outside.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"icon-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.\",\n \"requires\": [\n \"icon-image\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"icon-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"Icons are translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"Icons are translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `icon-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"icon-image\",\n \"icon-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the text will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-color\": {\n \"type\": \"color\",\n \"doc\": \"The color with which the text will be drawn.\",\n \"default\": \"#000000\",\n \"transition\": true,\n \"overridable\": true,\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-halo-color\": {\n \"type\": \"color\",\n \"default\": \"rgba(0, 0, 0, 0)\",\n \"transition\": true,\n \"doc\": \"The color of the text's halo, which helps it stand out from backgrounds.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-halo-width\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-halo-blur\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"The halo's fadeout distance towards the outside.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n },\n \"data-driven styling\": {\n \"js\": \"0.33.0\",\n \"android\": \"5.0.0\",\n \"ios\": \"3.5.0\",\n \"macos\": \"0.4.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\",\n \"feature\",\n \"feature-state\"\n ]\n },\n \"property-type\": \"data-driven\"\n },\n \"text-translate\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"default\": [\n 0,\n 0\n ],\n \"transition\": true,\n \"units\": \"pixels\",\n \"doc\": \"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.\",\n \"requires\": [\n \"text-field\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"text-translate-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The text is translated relative to the map.\"\n },\n \"viewport\": {\n \"doc\": \"The text is translated relative to the viewport.\"\n }\n },\n \"doc\": \"Controls the frame of reference for `text-translate`.\",\n \"default\": \"map\",\n \"requires\": [\n \"text-field\",\n \"text-translate\"\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_raster\": {\n \"raster-opacity\": {\n \"type\": \"number\",\n \"doc\": \"The opacity at which the image will be drawn.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-hue-rotate\": {\n \"type\": \"number\",\n \"default\": 0,\n \"period\": 360,\n \"transition\": true,\n \"units\": \"degrees\",\n \"doc\": \"Rotates hues around the color wheel.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-brightness-min\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the brightness of the image. The value is the minimum brightness.\",\n \"default\": 0,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-brightness-max\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the brightness of the image. The value is the maximum brightness.\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-saturation\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the saturation of the image.\",\n \"default\": 0,\n \"minimum\": -1,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-contrast\": {\n \"type\": \"number\",\n \"doc\": \"Increase or reduce the contrast of the image.\",\n \"default\": 0,\n \"minimum\": -1,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-resampling\": {\n \"type\": \"enum\",\n \"doc\": \"The resampling/interpolation method to use for overscaling, also known as texture magnification filter\",\n \"values\": {\n \"linear\": {\n \"doc\": \"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled\"\n },\n \"nearest\": {\n \"doc\": \"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled\"\n }\n },\n \"default\": \"linear\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.47.0\",\n \"android\": \"6.3.0\",\n \"ios\": \"4.2.0\",\n \"macos\": \"0.9.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"raster-fade-duration\": {\n \"type\": \"number\",\n \"default\": 300,\n \"minimum\": 0,\n \"transition\": false,\n \"units\": \"milliseconds\",\n \"doc\": \"Fade duration when a new tile is added.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_hillshade\": {\n \"hillshade-illumination-direction\": {\n \"type\": \"number\",\n \"default\": 335,\n \"minimum\": 0,\n \"maximum\": 359,\n \"doc\": \"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.\",\n \"transition\": false,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-illumination-anchor\": {\n \"type\": \"enum\",\n \"values\": {\n \"map\": {\n \"doc\": \"The hillshade illumination is relative to the north direction.\"\n },\n \"viewport\": {\n \"doc\": \"The hillshade illumination is relative to the top of the viewport.\"\n }\n },\n \"default\": \"viewport\",\n \"doc\": \"Direction of light source when map is rotated.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-exaggeration\": {\n \"type\": \"number\",\n \"doc\": \"Intensity of the hillshade\",\n \"default\": 0.5,\n \"minimum\": 0,\n \"maximum\": 1,\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-shadow-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The shading color of areas that face away from the light source.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-highlight-color\": {\n \"type\": \"color\",\n \"default\": \"#FFFFFF\",\n \"doc\": \"The shading color of areas that faces towards the light source.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"hillshade-accent-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.43.0\",\n \"android\": \"6.0.0\",\n \"ios\": \"4.0.0\",\n \"macos\": \"0.7.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_background\": {\n \"background-color\": {\n \"type\": \"color\",\n \"default\": \"#000000\",\n \"doc\": \"The color with which the background will be drawn.\",\n \"transition\": true,\n \"requires\": [\n {\n \"!\": \"background-pattern\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"background-pattern\": {\n \"type\": \"resolvedImage\",\n \"transition\": false,\n \"doc\": \"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"background-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity at which the background will be drawn.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"0.10.0\",\n \"android\": \"2.0.1\",\n \"ios\": \"2.0.0\",\n \"macos\": \"0.1.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"paint_sky\": {\n \"sky-type\": {\n \"type\": \"enum\",\n \"values\": {\n \"gradient\": {\n \"doc\": \"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`.\"\n },\n \"atmosphere\": {\n \"doc\": \"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`.\"\n }\n },\n \"default\": \"atmosphere\",\n \"doc\": \"The type of the sky\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-atmosphere-sun\": {\n \"type\": \"array\",\n \"value\": \"number\",\n \"length\": 2,\n \"units\": \"degrees\",\n \"minimum\": [0, 0],\n \"maximum\": [360, 180],\n \"transition\": false,\n \"doc\": \"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-atmosphere-sun-intensity\": {\n \"type\": \"number\",\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"default\": 10,\n \"minimum\": 0,\n \"maximum\": 100,\n \"transition\": false,\n \"doc\": \"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-gradient-center\": {\n \"type\": \"array\",\n \"requires\": [\n {\n \"sky-type\": \"gradient\"\n }\n ],\n \"value\": \"number\",\n \"default\": [\n 0,\n 0\n ],\n \"length\": 2,\n \"units\": \"degrees\",\n \"minimum\": [0, 0],\n \"maximum\": [360, 180],\n \"transition\": false,\n \"doc\": \"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-gradient-radius\": {\n \"type\": \"number\",\n \"requires\": [\n {\n \"sky-type\": \"gradient\"\n }\n ],\n \"default\": 90,\n \"minimum\": 0,\n \"maximum\": 180,\n \"transition\": false,\n \"doc\": \"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.\",\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": false,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-gradient\": {\n \"type\": \"color\",\n \"default\": [\n \"interpolate\",\n [\n \"linear\"\n ],\n [\n \"sky-radial-progress\"\n ],\n 0.8,\n \"#87ceeb\",\n 1,\n \"white\"\n ],\n \"doc\": \"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.\",\n \"transition\": false,\n \"requires\": [\n {\n \"sky-type\": \"gradient\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n },\n \"data-driven styling\": {}\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"sky-radial-progress\"\n ]\n },\n \"property-type\": \"color-ramp\"\n },\n \"sky-atmosphere-halo-color\": {\n \"type\": \"color\",\n \"default\": \"white\",\n \"doc\": \"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.\",\n \"transition\": false,\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-atmosphere-color\": {\n \"type\": \"color\",\n \"default\": \"white\",\n \"doc\": \"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.\",\n \"transition\": false,\n \"requires\": [\n {\n \"sky-type\": \"atmosphere\"\n }\n ],\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"property-type\": \"data-constant\"\n },\n \"sky-opacity\": {\n \"type\": \"number\",\n \"default\": 1,\n \"minimum\": 0,\n \"maximum\": 1,\n \"doc\": \"The opacity of the entire sky layer.\",\n \"transition\": true,\n \"sdk-support\": {\n \"basic functionality\": {\n \"js\": \"2.0.0\",\n \"ios\": \"10.0.0\",\n \"android\": \"10.0.0\"\n }\n },\n \"expression\": {\n \"interpolated\": true,\n \"parameters\": [\n \"zoom\"\n ]\n },\n \"property-type\": \"data-constant\"\n }\n },\n \"transition\": {\n \"duration\": {\n \"type\": \"number\",\n \"default\": 300,\n \"minimum\": 0,\n \"units\": \"milliseconds\",\n \"doc\": \"Time allotted for transitions to complete.\"\n },\n \"delay\": {\n \"type\": \"number\",\n \"default\": 0,\n \"minimum\": 0,\n \"units\": \"milliseconds\",\n \"doc\": \"Length of time before a transition begins.\"\n }\n },\n \"property-type\": {\n \"data-driven\": {\n \"type\": \"property-type\",\n \"doc\": \"Property is interpolable and can be represented using a property expression.\"\n },\n \"color-ramp\": {\n \"type\": \"property-type\",\n \"doc\": \"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation.\"\n },\n \"data-constant\": {\n \"type\": \"property-type\",\n \"doc\": \"Property is interpolable but cannot be represented using a property expression.\"\n },\n \"constant\": {\n \"type\": \"property-type\",\n \"doc\": \"Property is constant across all zoom levels and property values.\"\n }\n },\n \"promoteId\": {\n \"*\": {\n \"type\": \"string\",\n \"doc\": \"A name of a feature property to use as ID for feature state.\"\n }\n }\n}\n","// @flow\n\nimport {createExpression} from '../expression/index.js';\nimport {isFeatureConstant} from '../expression/is_constant.js';\nimport {deepUnbundle} from '../util/unbundle_jsonlint.js';\nimport latest from '../reference/latest.js';\nimport type {GlobalProperties, Feature} from '../expression/index.js';\nimport type {CanonicalTileID} from '../../source/tile_id.js';\nimport type Point from '@mapbox/point-geometry';\n\nexport type FeatureDistanceData = {bearing: [number, number], center: [number, number], scale: number};\nexport type FilterExpression = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData) => boolean;\nexport type FeatureFilter = {filter: FilterExpression, dynamicFilter?: FilterExpression, needGeometry: boolean, needFeature: boolean};\n\nexport default createFilter;\nexport {isExpressionFilter, isDynamicFilter, extractStaticFilter};\n\nfunction isExpressionFilter(filter: any): boolean {\n if (filter === true || filter === false) {\n return true;\n }\n\n if (!Array.isArray(filter) || filter.length === 0) {\n return false;\n }\n switch (filter[0]) {\n case 'has':\n return filter.length >= 2 && filter[1] !== '$id' && filter[1] !== '$type';\n\n case 'in':\n return filter.length >= 3 && (typeof filter[1] !== 'string' || Array.isArray(filter[2]));\n\n case '!in':\n case '!has':\n case 'none':\n return false;\n\n case '==':\n case '!=':\n case '>':\n case '>=':\n case '<':\n case '<=':\n return filter.length !== 3 || (Array.isArray(filter[1]) || Array.isArray(filter[2]));\n\n case 'any':\n case 'all':\n for (const f of filter.slice(1)) {\n if (!isExpressionFilter(f) && typeof f !== 'boolean') {\n return false;\n }\n }\n return true;\n\n default:\n return true;\n }\n}\n\n/**\n * Given a filter expressed as nested arrays, return a new function\n * that evaluates whether a given feature (with a .properties or .tags property)\n * passes its test.\n *\n * @private\n * @param {Array} filter mapbox gl filter\n * @param {string} layerType the type of the layer this filter will be applied to.\n * @returns {Function} filter-evaluating function\n */\nfunction createFilter(filter: any, layerType?: string = 'fill'): FeatureFilter {\n if (filter === null || filter === undefined) {\n return {filter: () => true, needGeometry: false, needFeature: false};\n }\n\n if (!isExpressionFilter(filter)) {\n filter = convertFilter(filter);\n }\n const filterExp = ((filter: any): string[] | string | boolean);\n\n let staticFilter = true;\n try {\n staticFilter = extractStaticFilter(filterExp);\n } catch (e) {\n console.warn(\n`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(filterExp, null, 2)}\n `);\n }\n\n // Compile the static component of the filter\n const filterSpec = latest[`filter_${layerType}`];\n const compiledStaticFilter = createExpression(staticFilter, filterSpec);\n\n let filterFunc = null;\n if (compiledStaticFilter.result === 'error') {\n throw new Error(compiledStaticFilter.value.map(err => `${err.key}: ${err.message}`).join(', '));\n } else {\n filterFunc = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);\n }\n\n // If the static component is not equal to the entire filter then we have a dynamic component\n // Compile the dynamic component separately\n let dynamicFilterFunc = null;\n let needFeature = null;\n if (staticFilter !== filterExp) {\n const compiledDynamicFilter = createExpression(filterExp, filterSpec);\n\n if (compiledDynamicFilter.result === 'error') {\n throw new Error(compiledDynamicFilter.value.map(err => `${err.key}: ${err.message}`).join(', '));\n } else {\n dynamicFilterFunc = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData) => compiledDynamicFilter.value.evaluate(globalProperties, feature, {}, canonical, undefined, undefined, featureTileCoord, featureDistanceData);\n needFeature = !isFeatureConstant(compiledDynamicFilter.value.expression);\n }\n }\n\n filterFunc = ((filterFunc: any): FilterExpression);\n const needGeometry = geometryNeeded(staticFilter);\n\n return {\n filter: filterFunc,\n dynamicFilter: dynamicFilterFunc ? dynamicFilterFunc : undefined,\n needGeometry,\n needFeature: !!needFeature\n };\n}\n\nfunction extractStaticFilter(filter: any): any {\n if (!isDynamicFilter(filter)) {\n return filter;\n }\n\n // Shallow copy so we can replace expressions in-place\n let result = deepUnbundle(filter);\n\n // 1. Union branches\n unionDynamicBranches(result);\n\n // 2. Collapse dynamic conditions to `true`\n result = collapseDynamicBooleanExpressions(result);\n\n return result;\n}\n\nfunction collapseDynamicBooleanExpressions(expression: any): any {\n if (!Array.isArray(expression)) {\n return expression;\n }\n\n const collapsed = collapsedExpression(expression);\n if (collapsed === true) {\n return collapsed;\n } else {\n return collapsed.map((subExpression) => collapseDynamicBooleanExpressions(subExpression));\n }\n}\n\n/**\n * Traverses the expression and replaces all instances of branching on a\n * `dynamic` conditional (such as `['pitch']` or `['distance-from-center']`)\n * into an `any` expression.\n * This ensures that all possible outcomes of a `dynamic` branch are considered\n * when evaluating the expression upfront during filtering.\n *\n * @param {Array} filter the filter expression mutated in-place.\n */\nfunction unionDynamicBranches(filter: any) {\n let isBranchingDynamically = false;\n const branches = [];\n\n if (filter[0] === 'case') {\n for (let i = 1; i < filter.length - 1; i += 2) {\n isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[i]);\n branches.push(filter[i + 1]);\n }\n\n branches.push(filter[filter.length - 1]);\n } else if (filter[0] === 'match') {\n isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[1]);\n\n for (let i = 2; i < filter.length - 1; i += 2) {\n branches.push(filter[i + 1]);\n }\n branches.push(filter[filter.length - 1]);\n } else if (filter[0] === 'step') {\n isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter[1]);\n\n for (let i = 1; i < filter.length - 1; i += 2) {\n branches.push(filter[i + 1]);\n }\n }\n\n if (isBranchingDynamically) {\n filter.length = 0;\n filter.push('any', ...branches);\n }\n\n // traverse and recurse into children\n for (let i = 1; i < filter.length; i++) {\n unionDynamicBranches(filter[i]);\n }\n}\n\nfunction isDynamicFilter(filter: any): boolean {\n // Base Cases\n if (!Array.isArray(filter)) {\n return false;\n }\n if (isRootExpressionDynamic(filter[0])) {\n return true;\n }\n\n for (let i = 1; i < filter.length; i++) {\n const child = filter[i];\n if (isDynamicFilter(child)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isRootExpressionDynamic(expression: string): boolean {\n return expression === 'pitch' ||\n expression === 'distance-from-center';\n}\n\nconst dynamicConditionExpressions = new Set([\n 'in',\n '==',\n '!=',\n '>',\n '>=',\n '<',\n '<=',\n 'to-boolean'\n]);\n\nfunction collapsedExpression(expression: any): any {\n if (dynamicConditionExpressions.has(expression[0])) {\n\n for (let i = 1; i < expression.length; i++) {\n const param = expression[i];\n if (isDynamicFilter(param)) {\n return true;\n }\n }\n }\n return expression;\n}\n\n// Comparison function to sort numbers and strings\nfunction compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nfunction geometryNeeded(filter) {\n if (!Array.isArray(filter)) return false;\n if (filter[0] === 'within') return true;\n for (let index = 1; index < filter.length; index++) {\n if (geometryNeeded(filter[index])) return true;\n }\n return false;\n}\n\nfunction convertFilter(filter: ?Array): mixed {\n if (!filter) return true;\n const op = filter[0];\n if (filter.length <= 1) return (op !== 'any');\n const converted =\n op === '==' ? convertComparisonOp(filter[1], filter[2], '==') :\n op === '!=' ? convertNegation(convertComparisonOp(filter[1], filter[2], '==')) :\n op === '<' ||\n op === '>' ||\n op === '<=' ||\n op === '>=' ? convertComparisonOp(filter[1], filter[2], op) :\n op === 'any' ? convertDisjunctionOp(filter.slice(1)) :\n op === 'all' ? ['all'].concat(filter.slice(1).map(convertFilter)) :\n op === 'none' ? ['all'].concat(filter.slice(1).map(convertFilter).map(convertNegation)) :\n op === 'in' ? convertInOp(filter[1], filter.slice(2)) :\n op === '!in' ? convertNegation(convertInOp(filter[1], filter.slice(2))) :\n op === 'has' ? convertHasOp(filter[1]) :\n op === '!has' ? convertNegation(convertHasOp(filter[1])) :\n op === 'within' ? filter :\n true;\n return converted;\n}\n\nfunction convertComparisonOp(property: string, value: any, op: string) {\n switch (property) {\n case '$type':\n return [`filter-type-${op}`, value];\n case '$id':\n return [`filter-id-${op}`, value];\n default:\n return [`filter-${op}`, property, value];\n }\n}\n\nfunction convertDisjunctionOp(filters: Array>) {\n return ['any'].concat(filters.map(convertFilter));\n}\n\nfunction convertInOp(property: string, values: Array) {\n if (values.length === 0) { return false; }\n switch (property) {\n case '$type':\n return [`filter-type-in`, ['literal', values]];\n case '$id':\n return [`filter-id-in`, ['literal', values]];\n default:\n if (values.length > 200 && !values.some(v => typeof v !== typeof values[0])) {\n return ['filter-in-large', property, ['literal', values.sort(compare)]];\n } else {\n return ['filter-in-small', property, ['literal', values]];\n }\n }\n}\n\nfunction convertHasOp(property: string) {\n switch (property) {\n case '$type':\n return true;\n case '$id':\n return [`filter-has-id`];\n default:\n return [`filter-has`, property];\n }\n}\n\nfunction convertNegation(filter: mixed) {\n return ['!', filter];\n}\n","// @flow\nexport default ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n","// @flow\n\nimport refProperties from './util/ref_properties.js';\n\nimport type {LayerSpecification} from './types.js';\n\nfunction deref(layer: LayerSpecification, parent: LayerSpecification): LayerSpecification {\n const result = {};\n\n for (const k in layer) {\n if (k !== 'ref') {\n result[k] = layer[k];\n }\n }\n\n refProperties.forEach((k) => {\n if (k in parent) {\n result[k] = (parent: any)[k];\n }\n });\n\n return ((result: any): LayerSpecification);\n}\n\n/**\n * Given an array of layers, some of which may contain `ref` properties\n * whose value is the `id` of another property, return a new array where\n * such layers have been augmented with the 'type', 'source', etc. properties\n * from the parent layer, and the `ref` property has been removed.\n *\n * The input is not modified. The output may contain references to portions\n * of the input.\n *\n * @private\n * @param {Array} layers\n * @returns {Array}\n */\nexport default function derefLayers(layers: Array): Array {\n layers = layers.slice();\n\n const map = Object.create(null);\n for (let i = 0; i < layers.length; i++) {\n map[layers[i].id] = layers[i];\n }\n\n for (let i = 0; i < layers.length; i++) {\n if ('ref' in layers[i]) {\n layers[i] = deref(layers[i], map[(layers[i]: any).ref]);\n }\n }\n\n return layers;\n}\n","var fontWeights = {\n thin: 100,\n hairline: 100,\n 'ultra-light': 200,\n 'extra-light': 200,\n light: 300,\n book: 300,\n regular: 400,\n normal: 400,\n plain: 400,\n roman: 400,\n standard: 400,\n medium: 500,\n 'semi-bold': 600,\n 'demi-bold': 600,\n bold: 700,\n 'extra-bold': 800,\n 'ultra-bold': 800,\n heavy: 900,\n black: 900,\n 'heavy-black': 900,\n fat: 900,\n poster: 900,\n 'ultra-black': 950,\n 'extra-black': 950\n};\nvar sp = ' ';\nvar italicRE = /(italic|oblique)$/i;\n\nvar fontCache = {};\n\nmodule.exports = function(fonts, size, lineHeight) {\n var cssData = fontCache[fonts];\n if (!cssData) {\n if (!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n var weight = 400;\n var style = 'normal';\n var fontFamilies = [];\n var haveWeight, haveStyle;\n for (var i = 0, ii = fonts.length; i < ii; ++i) {\n var font = fonts[i];\n var parts = font.split(' ');\n var maybeWeight = parts[parts.length - 1].toLowerCase();\n if (maybeWeight == 'normal' || maybeWeight == 'italic' || maybeWeight == 'oblique') {\n style = haveStyle ? style : maybeWeight;\n haveStyle = true;\n parts.pop();\n maybeWeight = parts[parts.length - 1].toLowerCase();\n } else if (italicRE.test(maybeWeight)) {\n maybeWeight = maybeWeight.replace(italicRE, '');\n style = haveStyle ? style : parts[parts.length - 1].replace(maybeWeight, '');\n haveStyle = true;\n }\n for (var w in fontWeights) {\n var previousPart = parts.length > 1 ? parts[parts.length - 2].toLowerCase() : '';\n if (maybeWeight == w || maybeWeight == w.replace('-', '') || previousPart + '-' + maybeWeight == w) {\n weight = haveWeight ? weight : fontWeights[w];\n parts.pop();\n if (previousPart && w.startsWith(previousPart)) {\n parts.pop();\n }\n break;\n }\n }\n if (!haveWeight && typeof maybeWeight == 'number') {\n weight = maybeWeight;\n haveWeight = true;\n }\n var fontFamily = parts.join(sp)\n .replace('Klokantech Noto Sans', 'Noto Sans');\n if (fontFamily.indexOf(sp) !== -1) {\n fontFamily = '\"' + fontFamily + '\"';\n }\n fontFamilies.push(fontFamily);\n }\n // CSS font property: font-style font-weight font-size/line-height font-family\n cssData = fontCache[fonts] = [style, weight, fontFamilies];\n }\n return cssData[0] + sp + cssData[1] + sp + size + 'px' + (lineHeight ? '/' + lineHeight : '') + sp + cssData[2];\n};\n","const mapboxBaseUrl = 'https://api.mapbox.com';\n\n/**\n * Gets the path from a mapbox:// URL.\n * @param {string} url The Mapbox URL.\n * @return {string} The path.\n * @private\n */\nexport function getMapboxPath(url) {\n const startsWith = 'mapbox://';\n if (url.indexOf(startsWith) !== 0) {\n return '';\n }\n return url.slice(startsWith.length);\n}\n\n/**\n * Turns mapbox:// sprite URLs into resolvable URLs.\n * @param {string} url The sprite URL.\n * @param {string} token The access token.\n * @param {string} styleUrl The style URL.\n * @return {string} A resolvable URL.\n * @private\n */\nexport function normalizeSpriteUrl(url, token, styleUrl) {\n const mapboxPath = getMapboxPath(url);\n if (!mapboxPath) {\n return decodeURI(new URL(url, styleUrl).href);\n }\n const startsWith = 'sprites/';\n if (mapboxPath.indexOf(startsWith) !== 0) {\n throw new Error(`unexpected sprites url: ${url}`);\n }\n const sprite = mapboxPath.slice(startsWith.length);\n\n return `${mapboxBaseUrl}/styles/v1/${sprite}/sprite?access_token=${token}`;\n}\n\n/**\n * Turns mapbox:// style URLs into resolvable URLs.\n * @param {string} url The style URL.\n * @param {string} token The access token.\n * @return {string} A resolvable URL.\n * @private\n */\nexport function normalizeStyleUrl(url, token) {\n const mapboxPath = getMapboxPath(url);\n if (!mapboxPath) {\n return decodeURI(new URL(url, location.href).href);\n }\n const startsWith = 'styles/';\n if (mapboxPath.indexOf(startsWith) !== 0) {\n throw new Error(`unexpected style url: ${url}`);\n }\n const style = mapboxPath.slice(startsWith.length);\n\n return `${mapboxBaseUrl}/styles/v1/${style}?&access_token=${token}`;\n}\n\n/**\n * Turns mapbox:// source URLs into vector tile URL templates.\n * @param {string} url The source URL.\n * @param {string} token The access token.\n * @param {string} tokenParam The access token key.\n * @param {string} styleUrl The style URL.\n * @return {string} A vector tile template.\n * @private\n */\nexport function normalizeSourceUrl(url, token, tokenParam, styleUrl) {\n const urlObject = new URL(url, styleUrl);\n const mapboxPath = getMapboxPath(url);\n if (!mapboxPath) {\n if (!token) {\n return decodeURI(urlObject.href);\n }\n if (!urlObject.searchParams.has(tokenParam)) {\n urlObject.searchParams.set(tokenParam, token);\n }\n return decodeURI(urlObject.href);\n }\n\n if (mapboxPath === 'mapbox.satellite') {\n const sizeFactor = window.devicePixelRatio >= 1.5 ? '@2x' : '';\n return `https://api.mapbox.com/v4/${mapboxPath}/{z}/{x}/{y}${sizeFactor}.webp?access_token=${token}`;\n }\n return `https://{a-d}.tiles.mapbox.com/v4/${mapboxPath}/{z}/{x}/{y}.vector.pbf?access_token=${token}`;\n}\n","import TileState from 'ol/TileState.js';\nimport {VectorTile} from 'ol';\nimport {expandUrl} from 'ol/tileurlfunction.js';\nimport {getUid} from 'ol/util.js';\nimport {normalizeSourceUrl, normalizeStyleUrl} from './mapbox.js';\nimport {toPromise} from 'ol/functions.js';\n\n/** @typedef {'Style'|'Source'|'Sprite'|'SpriteImage'|'Tiles'|'GeoJSON'} ResourceType */\n\n/** @typedef {import(\"ol\").Map} Map */\n/** @typedef {import(\"ol/layer\").Layer} Layer */\n/** @typedef {import(\"ol/layer\").Group} LayerGroup */\n/** @typedef {import(\"ol/layer\").Vector} VectorLayer */\n/** @typedef {import(\"ol/layer\").VectorTile} VectorTileLayer */\n/** @typedef {import(\"ol/source\").Source} Source */\n\nconst functionCacheByStyleId = {};\nconst filterCacheByStyleId = {};\n\nlet styleId = 0;\nexport function getStyleId(glStyle) {\n if (!glStyle.id) {\n glStyle.id = styleId++;\n }\n return glStyle.id;\n}\n\nexport function getStyleFunctionKey(glStyle, olLayer) {\n return getStyleId(glStyle) + '.' + getUid(olLayer);\n}\n\n/**\n * @param {Object} glStyle Mapboox style object.\n * @return {Object} Function cache.\n */\nexport function getFunctionCache(glStyle) {\n let functionCache = functionCacheByStyleId[glStyle.id];\n if (!functionCache) {\n functionCache = {};\n functionCacheByStyleId[getStyleId(glStyle)] = functionCache;\n }\n return functionCache;\n}\n\nexport function clearFunctionCache() {\n for (const key in functionCacheByStyleId) {\n delete functionCacheByStyleId[key];\n }\n}\n\n/**\n * @param {Object} glStyle Mapboox style object.\n * @return {Object} Filter cache.\n */\nexport function getFilterCache(glStyle) {\n let filterCache = filterCacheByStyleId[glStyle.id];\n if (!filterCache) {\n filterCache = {};\n filterCacheByStyleId[getStyleId(glStyle)] = filterCache;\n }\n return filterCache;\n}\n\nexport function deg2rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n\nexport const defaultResolutions = (function () {\n const resolutions = [];\n for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) {\n resolutions.push(res);\n }\n return resolutions;\n})();\n\n/**\n * @param {number} width Width of the canvas.\n * @param {number} height Height of the canvas.\n * @return {HTMLCanvasElement} Canvas.\n */\nexport function createCanvas(width, height) {\n if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && typeof OffscreenCanvas !== 'undefined') { // eslint-disable-line\n return /** @type {?} */ (new OffscreenCanvas(width, height));\n }\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n return canvas;\n}\n\nexport function getZoomForResolution(resolution, resolutions) {\n let i = 0;\n const ii = resolutions.length;\n for (; i < ii; ++i) {\n const candidate = resolutions[i];\n if (candidate < resolution && i + 1 < ii) {\n const zoomFactor = resolutions[i] / resolutions[i + 1];\n return i + Math.log(resolutions[i] / resolution) / Math.log(zoomFactor);\n }\n }\n return ii - 1;\n}\n\nexport function getResolutionForZoom(zoom, resolutions) {\n const base = Math.floor(zoom);\n const factor = Math.pow(2, zoom - base);\n return resolutions[base] / factor;\n}\n\nconst pendingRequests = {};\n/**\n * @param {ResourceType} resourceType Type of resource to load.\n * @param {string} url Url of the resource.\n * @param {Options} [options={}] Options.\n * @param {{request?: Request}} [metadata] Object to be filled with the request.\n * @return {Promise} Promise that resolves with the loaded resource\n * or rejects with the Response object.\n * @private\n */\nexport function fetchResource(resourceType, url, options = {}, metadata) {\n if (url in pendingRequests) {\n if (metadata) {\n metadata.request = pendingRequests[url][0];\n }\n return pendingRequests[url][1];\n }\n const transformedRequest = options.transformRequest\n ? options.transformRequest(url, resourceType) || url\n : url;\n const pendingRequest = toPromise(() => transformedRequest).then(\n (transformedRequest) => {\n if (!(transformedRequest instanceof Request)) {\n transformedRequest = new Request(transformedRequest);\n }\n if (!transformedRequest.headers.get('Accept')) {\n transformedRequest.headers.set('Accept', 'application/json');\n }\n if (metadata) {\n metadata.request = transformedRequest;\n }\n return fetch(transformedRequest)\n .then(function (response) {\n delete pendingRequests[url];\n return response.ok\n ? response.json()\n : Promise.reject(new Error('Error fetching source ' + url));\n })\n .catch(function (error) {\n delete pendingRequests[url];\n return Promise.reject(new Error('Error fetching source ' + url));\n });\n },\n );\n pendingRequests[url] = [transformedRequest, pendingRequest];\n return pendingRequest;\n}\n\nexport function getGlStyle(glStyleOrUrl, options) {\n if (typeof glStyleOrUrl === 'string') {\n if (glStyleOrUrl.trim().startsWith('{')) {\n try {\n const glStyle = JSON.parse(glStyleOrUrl);\n return Promise.resolve(glStyle);\n } catch (error) {\n return Promise.reject(error);\n }\n } else {\n glStyleOrUrl = normalizeStyleUrl(glStyleOrUrl, options.accessToken);\n return fetchResource('Style', glStyleOrUrl, options);\n }\n } else {\n return Promise.resolve(glStyleOrUrl);\n }\n}\n\nconst tilejsonCache = {};\n/**\n * @param {Object} glSource glStyle source object.\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {Promise<{tileJson: Object, tileLoadFunction: import('ol/Tile.js').LoadFunction}?>} TileJson and load function\n */\nexport function getTileJson(glSource, styleUrl, options = {}) {\n const cacheKey = [styleUrl, JSON.stringify(glSource)].toString();\n let promise = tilejsonCache[cacheKey];\n if (!promise || options.transformRequest) {\n let tileLoadFunction;\n if (options.transformRequest) {\n tileLoadFunction = (tile, src) => {\n const transformedRequest = options.transformRequest\n ? options.transformRequest(src, 'Tiles') || src\n : src;\n if (tile instanceof VectorTile) {\n tile.setLoader((extent, resolution, projection) => {\n toPromise(() => transformedRequest).then((transformedRequest) => {\n fetch(transformedRequest)\n .then((response) => response.arrayBuffer())\n .then((data) => {\n const format = tile.getFormat();\n const features = format.readFeatures(data, {\n extent: extent,\n featureProjection: projection,\n });\n // @ts-ignore\n tile.setFeatures(features);\n })\n .catch((e) => tile.setState(TileState.ERROR));\n });\n });\n } else {\n const img = tile.getImage();\n toPromise(() => transformedRequest).then((transformedRequest) => {\n if (transformedRequest instanceof Request) {\n fetch(transformedRequest)\n .then((response) => response.blob())\n .then((blob) => {\n const url = URL.createObjectURL(blob);\n img.addEventListener('load', () => URL.revokeObjectURL(url));\n img.addEventListener('error', () => URL.revokeObjectURL(url));\n img.src = url;\n })\n .catch((e) => tile.setState(TileState.ERROR));\n } else {\n img.src = transformedRequest;\n }\n });\n }\n };\n }\n const url = glSource.url;\n if (url && !glSource.tiles) {\n const normalizedSourceUrl = normalizeSourceUrl(\n url,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n styleUrl || location.href,\n );\n if (url.startsWith('mapbox://')) {\n promise = Promise.resolve({\n tileJson: Object.assign({}, glSource, {\n url: undefined,\n tiles: expandUrl(normalizedSourceUrl),\n }),\n tileLoadFunction,\n });\n } else {\n const metadata = {};\n promise = fetchResource(\n 'Source',\n normalizedSourceUrl,\n options,\n metadata,\n ).then(function (tileJson) {\n tileJson.tiles = tileJson.tiles.map(function (tileUrl) {\n if (tileJson.scheme === 'tms') {\n tileUrl = tileUrl.replace('{y}', '{-y}');\n }\n return normalizeSourceUrl(\n tileUrl,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n metadata.request.url,\n );\n });\n return Promise.resolve({tileJson, tileLoadFunction});\n });\n }\n } else {\n glSource = Object.assign({}, glSource, {\n tiles: glSource.tiles.map(function (tileUrl) {\n if (glSource.scheme === 'tms') {\n tileUrl = tileUrl.replace('{y}', '{-y}');\n }\n return normalizeSourceUrl(\n tileUrl,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n styleUrl || location.href,\n );\n }),\n });\n promise = Promise.resolve({\n tileJson: Object.assign({}, glSource),\n tileLoadFunction,\n });\n }\n tilejsonCache[cacheKey] = promise;\n }\n return promise;\n}\n\n/**\n * @param {HTMLImageElement|HTMLCanvasElement} spriteImage Sprite image id.\n * @param {{x: number, y: number, width: number, height: number, pixelRatio: number}} spriteImageData Sprite image data.\n * @param {number} haloWidth Halo width.\n * @param {{r: number, g: number, b: number, a: number}} haloColor Halo color.\n * @return {HTMLCanvasElement} Canvas element with the halo.\n */\nexport function drawIconHalo(\n spriteImage,\n spriteImageData,\n haloWidth,\n haloColor,\n) {\n const imgSize = [\n 2 * haloWidth * spriteImageData.pixelRatio + spriteImageData.width,\n 2 * haloWidth * spriteImageData.pixelRatio + spriteImageData.height,\n ];\n const imageCanvas = createCanvas(imgSize[0], imgSize[1]);\n const imageContext = imageCanvas.getContext('2d');\n imageContext.drawImage(\n spriteImage,\n spriteImageData.x,\n spriteImageData.y,\n spriteImageData.width,\n spriteImageData.height,\n haloWidth * spriteImageData.pixelRatio,\n haloWidth * spriteImageData.pixelRatio,\n spriteImageData.width,\n spriteImageData.height,\n );\n const imageData = imageContext.getImageData(0, 0, imgSize[0], imgSize[1]);\n imageContext.globalCompositeOperation = 'destination-over';\n imageContext.fillStyle = `rgba(${haloColor.r * 255},${haloColor.g * 255},${\n haloColor.b * 255\n },${haloColor.a})`;\n const data = imageData.data;\n for (let i = 0, ii = imageData.width; i < ii; ++i) {\n for (let j = 0, jj = imageData.height; j < jj; ++j) {\n const index = (j * ii + i) * 4;\n const alpha = data[index + 3];\n if (alpha > 0) {\n imageContext.arc(\n i,\n j,\n haloWidth * spriteImageData.pixelRatio,\n 0,\n 2 * Math.PI,\n );\n }\n }\n }\n imageContext.fill();\n return imageCanvas;\n}\n\nfunction smoothstep(min, max, value) {\n const x = Math.max(0, Math.min(1, (value - min) / (max - min)));\n return x * x * (3 - 2 * x);\n}\n\n/**\n * @param {HTMLImageElement} image SDF image\n * @param {{x: number, y: number, width: number, height: number}} area Area to unSDF\n * @param {{r: number, g: number, b: number, a: number}} color Color to use\n * @return {HTMLCanvasElement} Regular image\n */\nexport function drawSDF(image, area, color) {\n const imageCanvas = createCanvas(area.width, area.height);\n const imageContext = imageCanvas.getContext('2d');\n imageContext.drawImage(\n image,\n area.x,\n area.y,\n area.width,\n area.height,\n 0,\n 0,\n area.width,\n area.height,\n );\n const imageData = imageContext.getImageData(0, 0, area.width, area.height);\n const data = imageData.data;\n for (let i = 0, ii = imageData.width; i < ii; ++i) {\n for (let j = 0, jj = imageData.height; j < jj; ++j) {\n const index = (j * ii + i) * 4;\n const dist = data[index + 3] / 255;\n\n const buffer = 0.75;\n const gamma = 0.1;\n\n const alpha = smoothstep(buffer - gamma, buffer + gamma, dist);\n if (alpha > 0) {\n data[index + 0] = Math.round(255 * color.r * alpha);\n data[index + 1] = Math.round(255 * color.g * alpha);\n data[index + 2] = Math.round(255 * color.b * alpha);\n data[index + 3] = Math.round(255 * alpha);\n } else {\n data[index + 3] = 0;\n }\n }\n }\n imageContext.putImageData(imageData, 0, 0);\n return imageCanvas;\n}\n\n/**\n * @typedef {import(\"./apply.js\").Options} Options\n * @private\n */\n","import mb2css from 'mapbox-to-css-font';\nimport {checkedFonts, registerFont} from 'ol/render/canvas.js';\nimport {createCanvas} from './util.js';\n\nconst hairSpacePool = Array(256).join('\\u200A');\nexport function applyLetterSpacing(text, letterSpacing) {\n if (letterSpacing >= 0.05) {\n let textWithLetterSpacing = '';\n const lines = text.split('\\n');\n const joinSpaceString = hairSpacePool.slice(\n 0,\n Math.round(letterSpacing / 0.1),\n );\n for (let l = 0, ll = lines.length; l < ll; ++l) {\n if (l > 0) {\n textWithLetterSpacing += '\\n';\n }\n textWithLetterSpacing += lines[l].split('').join(joinSpaceString);\n }\n return textWithLetterSpacing;\n }\n return text;\n}\n\nlet measureContext;\nfunction getMeasureContext() {\n if (!measureContext) {\n measureContext = createCanvas(1, 1).getContext('2d');\n }\n return measureContext;\n}\n\nfunction measureText(text, letterSpacing) {\n return (\n getMeasureContext().measureText(text).width +\n (text.length - 1) * letterSpacing\n );\n}\n\nconst measureCache = {};\nexport function wrapText(text, font, em, letterSpacing) {\n if (text.indexOf('\\n') !== -1) {\n const hardLines = text.split('\\n');\n const lines = [];\n for (let i = 0, ii = hardLines.length; i < ii; ++i) {\n lines.push(wrapText(hardLines[i], font, em, letterSpacing));\n }\n return lines.join('\\n');\n }\n const key = em + ',' + font + ',' + text + ',' + letterSpacing;\n let wrappedText = measureCache[key];\n if (!wrappedText) {\n const words = text.split(' ');\n if (words.length > 1) {\n const ctx = getMeasureContext();\n ctx.font = font;\n const oneEm = ctx.measureText('M').width;\n const maxWidth = oneEm * em;\n let line = '';\n const lines = [];\n // Pass 1 - wrap lines to not exceed maxWidth\n for (let i = 0, ii = words.length; i < ii; ++i) {\n const word = words[i];\n const testLine = line + (line ? ' ' : '') + word;\n if (measureText(testLine, letterSpacing) <= maxWidth) {\n line = testLine;\n } else {\n if (line) {\n lines.push(line);\n }\n line = word;\n }\n }\n if (line) {\n lines.push(line);\n }\n // Pass 2 - add lines with a width of less than 30% of maxWidth to the previous or next line\n for (let i = 0, ii = lines.length; i < ii && ii > 1; ++i) {\n const line = lines[i];\n if (measureText(line, letterSpacing) < maxWidth * 0.35) {\n const prevWidth =\n i > 0 ? measureText(lines[i - 1], letterSpacing) : Infinity;\n const nextWidth =\n i < ii - 1 ? measureText(lines[i + 1], letterSpacing) : Infinity;\n lines.splice(i, 1);\n ii -= 1;\n if (prevWidth < nextWidth) {\n lines[i - 1] += ' ' + line;\n i -= 1;\n } else {\n lines[i] = line + ' ' + lines[i];\n }\n }\n }\n // Pass 3 - try to fill 80% of maxWidth for each line\n for (let i = 0, ii = lines.length - 1; i < ii; ++i) {\n const line = lines[i];\n const next = lines[i + 1];\n if (\n measureText(line, letterSpacing) > maxWidth * 0.7 &&\n measureText(next, letterSpacing) < maxWidth * 0.6\n ) {\n const lineWords = line.split(' ');\n const lastWord = lineWords.pop();\n if (measureText(lastWord, letterSpacing) < maxWidth * 0.2) {\n lines[i] = lineWords.join(' ');\n lines[i + 1] = lastWord + ' ' + next;\n }\n ii -= 1;\n }\n }\n wrappedText = lines.join('\\n');\n } else {\n wrappedText = text;\n }\n wrappedText = applyLetterSpacing(wrappedText, letterSpacing);\n measureCache[key] = wrappedText;\n }\n return wrappedText;\n}\n\nconst fontFamilyRegEx = /font-family: ?([^;]*);/;\nconst stripQuotesRegEx = /(\"|')/g;\nlet loadedFontFamilies;\nfunction hasFontFamily(family) {\n if (!loadedFontFamilies) {\n loadedFontFamilies = {};\n const styleSheets = document.styleSheets;\n for (let i = 0, ii = styleSheets.length; i < ii; ++i) {\n const styleSheet = /** @type {CSSStyleSheet} */ (styleSheets[i]);\n try {\n const cssRules = styleSheet.rules || styleSheet.cssRules;\n if (cssRules) {\n for (let j = 0, jj = cssRules.length; j < jj; ++j) {\n const cssRule = cssRules[j];\n if (cssRule.type == 5) {\n const match = cssRule.cssText.match(fontFamilyRegEx);\n loadedFontFamilies[match[1].replace(stripQuotesRegEx, '')] = true;\n }\n }\n }\n } catch (e) {\n // empty catch block\n }\n }\n }\n return family in loadedFontFamilies;\n}\n\nconst processedFontFamilies = {};\n\n/**\n * @param {Array} fonts Fonts.\n * @param {string} [templateUrl] Template URL.\n * @return {Array} Processed fonts.\n * @private\n */\nexport function getFonts(\n fonts,\n templateUrl = 'https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css',\n) {\n const fontsKey = fonts.toString();\n if (fontsKey in processedFontFamilies) {\n return processedFontFamilies[fontsKey];\n }\n const fontDescriptions = [];\n for (let i = 0, ii = fonts.length; i < ii; ++i) {\n fonts[i] = fonts[i].replace('Arial Unicode MS', 'Arial');\n const font = fonts[i];\n const cssFont = mb2css(font, 1);\n registerFont(cssFont);\n const parts = cssFont.split(' ');\n fontDescriptions.push([\n parts.slice(3).join(' ').replace(/\"/g, ''),\n parts[1],\n parts[0],\n ]);\n }\n for (let i = 0, ii = fontDescriptions.length; i < ii; ++i) {\n const fontDescription = fontDescriptions[i];\n const family = fontDescription[0];\n if (!hasFontFamily(family)) {\n if (\n checkedFonts.get(\n `${fontDescription[2]}\\n${fontDescription[1]} \\n${family}`,\n ) !== 100\n ) {\n const fontUrl = templateUrl\n .replace('{font-family}', family.replace(/ /g, '-').toLowerCase())\n .replace('{Font+Family}', family.replace(/ /g, '+'))\n .replace('{fontweight}', fontDescription[1])\n .replace(\n '{-fontstyle}',\n fontDescription[2].replace('normal', '').replace(/(.+)/, '-$1'),\n )\n .replace('{fontstyle}', fontDescription[2]);\n if (!document.querySelector('link[href=\"' + fontUrl + '\"]')) {\n const markup = document.createElement('link');\n markup.href = fontUrl;\n markup.rel = 'stylesheet';\n document.head.appendChild(markup);\n }\n }\n }\n }\n processedFontFamilies[fontsKey] = fonts;\n return fonts;\n}\n","/*\nol-mapbox-style - Use Mapbox Style objects with OpenLayers\nCopyright 2016-present ol-mapbox-style contributors\nLicense: https://raw.githubusercontent.com/openlayers/ol-mapbox-style/master/LICENSE\n*/\n\nimport Circle from 'ol/style/Circle.js';\nimport Fill from 'ol/style/Fill.js';\nimport Icon from 'ol/style/Icon.js';\nimport RenderFeature from 'ol/render/Feature.js';\nimport Stroke from 'ol/style/Stroke.js';\nimport Style from 'ol/style/Style.js';\nimport Text from 'ol/style/Text.js';\nimport {toPromise} from 'ol/functions.js';\n\nimport Color from '@mapbox/mapbox-gl-style-spec/util/color.js';\nimport convertFunction from '@mapbox/mapbox-gl-style-spec/function/convert.js';\nimport createFilter from '@mapbox/mapbox-gl-style-spec/feature_filter/index.js';\nimport derefLayers from '@mapbox/mapbox-gl-style-spec/deref.js';\nimport mb2css from 'mapbox-to-css-font';\nimport spec from '@mapbox/mapbox-gl-style-spec/reference/v8.json';\nimport {applyLetterSpacing, wrapText} from './text.js';\nimport {\n clearFunctionCache,\n createCanvas,\n defaultResolutions,\n deg2rad,\n drawIconHalo,\n drawSDF,\n getFilterCache,\n getFunctionCache,\n getStyleFunctionKey,\n getZoomForResolution,\n} from './util.js';\nimport {\n createPropertyExpression,\n isExpression,\n} from '@mapbox/mapbox-gl-style-spec/expression/index.js';\nimport {isFunction} from '@mapbox/mapbox-gl-style-spec/function/index.js';\n\n/**\n * @typedef {import(\"ol/layer/Vector\").default} VectorLayer\n * @typedef {import(\"ol/layer/VectorTile\").default} VectorTileLayer\n * @typedef {import(\"ol/style/Style\").StyleFunction} StyleFunction\n * @typedef {import('./util.js').ResourceType} ResourceType\n */\n\nconst types = {\n 'Point': 1,\n 'MultiPoint': 1,\n 'LineString': 2,\n 'MultiLineString': 2,\n 'Polygon': 3,\n 'MultiPolygon': 3,\n};\nconst anchor = {\n 'center': [0.5, 0.5],\n 'left': [0, 0.5],\n 'right': [1, 0.5],\n 'top': [0.5, 0],\n 'bottom': [0.5, 1],\n 'top-left': [0, 0],\n 'top-right': [1, 0],\n 'bottom-left': [0, 1],\n 'bottom-right': [1, 1],\n};\n\nconst expressionData = function (rawExpression, propertySpec) {\n const compiledExpression = createPropertyExpression(\n rawExpression,\n propertySpec,\n );\n if (compiledExpression.result === 'error') {\n throw new Error(\n compiledExpression.value\n .map((err) => `${err.key}: ${err.message}`)\n .join(', '),\n );\n }\n return compiledExpression.value;\n};\n\nconst emptyObj = {};\nconst zoomObj = {zoom: 0};\nlet renderFeatureCoordinates, renderFeature;\n\n/**\n * @private\n * @param {Object} layer Gl object layer.\n * @param {string} layoutOrPaint 'layout' or 'paint'.\n * @param {string} property Feature property.\n * @param {number} zoom Zoom.\n * @param {Object} feature Gl feature.\n * @param {Object} [functionCache] Function cache.\n * @param {Object} [featureState] Feature state.\n * @return {?} Value.\n */\nexport function getValue(\n layer,\n layoutOrPaint,\n property,\n zoom,\n feature,\n functionCache,\n featureState,\n) {\n const layerId = layer.id;\n if (!functionCache) {\n functionCache = {};\n console.warn('No functionCache provided to getValue()'); //eslint-disable-line no-console\n }\n if (!functionCache[layerId]) {\n functionCache[layerId] = {};\n }\n const functions = functionCache[layerId];\n if (!functions[property]) {\n let value = (layer[layoutOrPaint] || emptyObj)[property];\n const propertySpec = spec[`${layoutOrPaint}_${layer.type}`][property];\n if (value === undefined) {\n value = propertySpec.default;\n }\n let isExpr = isExpression(value);\n if (!isExpr && isFunction(value)) {\n value = convertFunction(value, propertySpec);\n isExpr = true;\n }\n if (isExpr) {\n const compiledExpression = expressionData(value, propertySpec);\n functions[property] =\n compiledExpression.evaluate.bind(compiledExpression);\n } else {\n if (propertySpec.type == 'color') {\n value = Color.parse(value);\n }\n functions[property] = function () {\n return value;\n };\n }\n }\n zoomObj.zoom = zoom;\n return functions[property](zoomObj, feature, featureState);\n}\n\n/**\n * @private\n * @param {Object} layer Gl object layer.\n * @param {number} zoom Zoom.\n * @param {Object} feature Gl feature.\n * @param {\"icon\"|\"text\"} prefix Style property prefix.\n * @param {Object} [functionCache] Function cache.\n * @return {\"declutter\"|\"obstacle\"|\"none\"} Value.\n */\nfunction getDeclutterMode(layer, zoom, feature, prefix, functionCache) {\n const allowOverlap = getValue(\n layer,\n 'layout',\n `${prefix}-allow-overlap`,\n zoom,\n feature,\n functionCache,\n );\n if (!allowOverlap) {\n return 'declutter';\n }\n const ignorePlacement = getValue(\n layer,\n 'layout',\n `${prefix}-ignore-placement`,\n zoom,\n feature,\n functionCache,\n );\n if (!ignorePlacement) {\n return 'obstacle';\n }\n return 'none';\n}\n\n/**\n * @private\n * @param {string} layerId Layer id.\n * @param {?} filter Filter.\n * @param {Object} feature Feature.\n * @param {number} zoom Zoom.\n * @param {Object} [filterCache] Filter cache.\n * @return {boolean} Filter result.\n */\nfunction evaluateFilter(layerId, filter, feature, zoom, filterCache) {\n if (!filterCache) {\n console.warn('No filterCache provided to evaluateFilter()'); //eslint-disable-line no-console\n }\n if (!(layerId in filterCache)) {\n filterCache[layerId] = createFilter(filter).filter;\n }\n zoomObj.zoom = zoom;\n return filterCache[layerId](zoomObj, feature);\n}\n\nlet renderTransparentEnabled = false;\n\n/**\n * Configure whether features with a transparent style should be rendered. When\n * set to `true`, it will be possible to hit detect content that is not visible,\n * like transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or\n * `ol/Map#getFeaturesAtPixel()`\n * @param {boolean} enabled Rendering of transparent elements is enabled.\n * Default is `false`.\n */\nexport function renderTransparent(enabled) {\n if (enabled !== renderTransparentEnabled) {\n clearFunctionCache();\n renderTransparentEnabled = enabled;\n }\n}\n\n/**\n * @private\n * @param {?} color Color.\n * @param {number} [opacity] Opacity.\n * @return {string} Color.\n */\nfunction colorWithOpacity(color, opacity) {\n if (color) {\n if (!renderTransparentEnabled && (color.a === 0 || opacity === 0)) {\n return undefined;\n }\n const a = color.a;\n opacity = opacity === undefined ? 1 : opacity;\n return a === 0\n ? 'transparent'\n : 'rgba(' +\n Math.round((color.r * 255) / a) +\n ',' +\n Math.round((color.g * 255) / a) +\n ',' +\n Math.round((color.b * 255) / a) +\n ',' +\n a * opacity +\n ')';\n }\n return color;\n}\n\nconst templateRegEx = /\\{[^{}}]*\\}/g;\n\n/**\n * @private\n * @param {string} text Text.\n * @param {Object} properties Properties.\n * @return {string} Text.\n */\nfunction fromTemplate(text, properties) {\n return text.replace(templateRegEx, function (match) {\n return properties[match.slice(1, -1)] || '';\n });\n}\n\nlet recordLayer = false;\n\n/**\n * Turns recording of the Mapbox Style's `layer` on and off. When turned on,\n * the layer that a rendered feature belongs to will be set as the feature's\n * `mapbox-layer` property.\n * @param {boolean} record Recording of the style layer is on.\n */\nexport function recordStyleLayer(record = false) {\n recordLayer = record;\n}\n\nexport const styleFunctionArgs = {};\n\n/**\n * Creates a style function from the `glStyle` object for all layers that use\n * the specified `source`, which needs to be a `\"type\": \"vector\"` or\n * `\"type\": \"geojson\"` source and applies it to the specified OpenLayers layer.\n *\n * Two additional properties will be set on the provided layer:\n *\n * * `mapbox-source`: The `id` of the Mapbox Style document's source that the\n * OpenLayers layer was created from. Usually `apply()` creates one\n * OpenLayers layer per Mapbox Style source, unless the layer stack has\n * layers from different sources in between.\n * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are\n * included in the OpenLayers layer.\n *\n * This function also works in a web worker. In worker mode, the main thread needs\n * to listen to messages from the worker and respond with another message to make\n * sure that sprite image loading works:\n *\n * ```js\n * worker.addEventListener('message', event => {\n * if (event.data.action === 'loadImage') {\n * const image = new Image();\n * image.crossOrigin = 'anonymous';\n * image.addEventListener('load', function() {\n * createImageBitmap(image, 0, 0, image.width, image.height).then(imageBitmap => {\n * worker.postMessage({\n * action: 'imageLoaded',\n * image: imageBitmap,\n * src: event.data.src\n * }, [imageBitmap]);\n * });\n * });\n * image.src = event.data.src;\n * }\n * });\n * ```\n *\n * @param {VectorLayer|VectorTileLayer} olLayer OpenLayers layer to\n * apply the style to. In addition to the style, the layer will get two\n * properties: `mapbox-source` will be the `id` of the `glStyle`'s source used\n * for the layer, and `mapbox-layers` will be an array of the `id`s of the\n * `glStyle`'s layers.\n * @param {string|Object} glStyle Mapbox Style object.\n * @param {string|Array} sourceOrLayers `source` key or an array of layer `id`s\n * from the Mapbox Style object. When a `source` key is provided, all layers for\n * the specified source will be included in the style function. When layer `id`s\n * are provided, they must be from layers that use the same source.\n * @param {Array} resolutions\n * Resolutions for mapping resolution to zoom level.\n * @param {Object} spriteData Sprite data from the url specified in\n * the Mapbox Style object's `sprite` property. Only required if a `sprite`\n * property is specified in the Mapbox Style object.\n * @param {string|Request|Promise} spriteImageUrl Sprite image url for the sprite\n * specified in the Mapbox Style object's `sprite` property. Only required if a\n * `sprite` property is specified in the Mapbox Style object.\n * @param {function(Array, string=):Array} getFonts Function that\n * receives a font stack and the url template from the GL style's `metadata['ol:webfonts']`\n * property (if set) as arguments, and returns a (modified) font stack that\n * is available. Font names are the names used in the Mapbox Style object. If\n * not provided, the font stack will be used as-is. This function can also be\n * used for loading web fonts.\n * @param {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined]\n * Function that returns an image or a URL for an image name. If the result is an HTMLImageElement, it must already be\n * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished.\n * This function can be used for icons not in the sprite or to override sprite icons.\n * @return {StyleFunction} Style function for use in\n * `ol.layer.Vector` or `ol.layer.VectorTile`.\n */\nexport function stylefunction(\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions = defaultResolutions,\n spriteData = undefined,\n spriteImageUrl = undefined,\n getFonts = undefined,\n getImage = undefined,\n) {\n if (typeof glStyle == 'string') {\n glStyle = JSON.parse(glStyle);\n }\n if (glStyle.version != 8) {\n throw new Error('glStyle version 8 required.');\n }\n styleFunctionArgs[getStyleFunctionKey(glStyle, olLayer)] =\n Array.from(arguments);\n\n let spriteImage, spriteImageSize;\n let spriteImageUnSDFed;\n\n if (spriteImageUrl) {\n if (typeof Image !== 'undefined') {\n const img = new Image();\n let blobUrl;\n toPromise(() => spriteImageUrl).then((spriteImageUrl) => {\n if (spriteImageUrl instanceof Request) {\n fetch(spriteImageUrl)\n .then((response) => response.blob())\n .then((blob) => {\n blobUrl = URL.createObjectURL(blob);\n img.src = blobUrl;\n })\n .catch(() => {});\n } else {\n img.crossOrigin = 'anonymous';\n img.src = spriteImageUrl;\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n }\n }\n });\n img.onload = function () {\n spriteImage = img;\n spriteImageSize = [img.width, img.height];\n olLayer.changed();\n img.onload = null;\n };\n } else if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { //eslint-disable-line\n const worker = /** @type {*} */ (self);\n // Main thread needs to handle 'loadImage' and dispatch 'imageLoaded'\n worker.postMessage({\n action: 'loadImage',\n src: spriteImageUrl,\n });\n worker.addEventListener('message', function handler(event) {\n if (\n event.data.action === 'imageLoaded' &&\n event.data.src === spriteImageUrl\n ) {\n spriteImage = event.data.image;\n spriteImageSize = [spriteImage.width, spriteImage.height];\n }\n });\n }\n }\n\n const allLayers = derefLayers(glStyle.layers);\n\n const layersBySourceLayer = {};\n const mapboxLayers = [];\n\n const iconImageCache = {};\n const patternCache = {};\n const functionCache = getFunctionCache(glStyle);\n const filterCache = getFilterCache(glStyle);\n\n let mapboxSource;\n for (let i = 0, ii = allLayers.length; i < ii; ++i) {\n const layer = allLayers[i];\n const layerId = layer.id;\n if (\n (typeof sourceOrLayers == 'string' && layer.source == sourceOrLayers) ||\n (Array.isArray(sourceOrLayers) && sourceOrLayers.indexOf(layerId) !== -1)\n ) {\n const sourceLayer = layer['source-layer'];\n if (!mapboxSource) {\n mapboxSource = layer.source;\n const source = glStyle.sources[mapboxSource];\n if (!source) {\n throw new Error(`Source \"${mapboxSource}\" is not defined`);\n }\n const type = source.type;\n if (type !== 'vector' && type !== 'geojson') {\n throw new Error(\n `Source \"${mapboxSource}\" is not of type \"vector\" or \"geojson\", but \"${type}\"`,\n );\n }\n } else if (layer.source !== mapboxSource) {\n throw new Error(\n `Layer \"${layerId}\" does not use source \"${mapboxSource}`,\n );\n }\n let layers = layersBySourceLayer[sourceLayer];\n if (!layers) {\n layers = [];\n layersBySourceLayer[sourceLayer] = layers;\n }\n layers.push({\n layer: layer,\n index: i,\n });\n mapboxLayers.push(layerId);\n }\n }\n\n const textHalo = new Stroke();\n const textColor = new Fill();\n\n const styles = [];\n\n /**\n * @param {import(\"ol/Feature\").default|import(\"ol/render/Feature\").default} feature Feature.\n * @param {number} resolution Resolution.\n * @param {string} [onlyLayer] Calculate style for this layer only.\n * @return {Array} Style.\n */\n const styleFunction = function (feature, resolution, onlyLayer) {\n const properties = feature.getProperties();\n const layers = layersBySourceLayer[properties.layer];\n if (!layers) {\n return undefined;\n }\n let zoom = resolutions.indexOf(resolution);\n if (zoom == -1) {\n zoom = getZoomForResolution(resolution, resolutions);\n }\n const type = types[feature.getGeometry().getType()];\n const f = {\n id: feature.getId(),\n properties: properties,\n type: type,\n };\n const featureState = olLayer.get('mapbox-featurestate')[feature.getId()];\n let stylesLength = -1;\n let featureBelongsToLayer;\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const layerData = layers[i];\n const layer = layerData.layer;\n const layerId = layer.id;\n if (onlyLayer !== undefined && onlyLayer !== layerId) {\n continue;\n }\n\n const layout = layer.layout || emptyObj;\n const paint = layer.paint || emptyObj;\n if (\n layout.visibility === 'none' ||\n ('minzoom' in layer && zoom < layer.minzoom) ||\n ('maxzoom' in layer && zoom >= layer.maxzoom)\n ) {\n continue;\n }\n const filter = layer.filter;\n if (!filter || evaluateFilter(layerId, filter, f, zoom, filterCache)) {\n featureBelongsToLayer = layer;\n let color, opacity, fill, stroke, strokeColor, style;\n const index = layerData.index;\n if (\n type == 3 &&\n (layer.type == 'fill' || layer.type == 'fill-extrusion')\n ) {\n opacity = getValue(\n layer,\n 'paint',\n layer.type + '-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (layer.type + '-pattern' in paint) {\n const fillIcon = getValue(\n layer,\n 'paint',\n layer.type + '-pattern',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (fillIcon) {\n const icon =\n typeof fillIcon === 'string'\n ? fromTemplate(fillIcon, properties)\n : fillIcon.toString();\n if (spriteImage && spriteData && spriteData[icon]) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getFill() ||\n style.getStroke() ||\n style.getText()\n ) {\n style = new Style({\n fill: new Fill(),\n });\n styles[stylesLength] = style;\n }\n fill = style.getFill();\n style.setZIndex(index);\n const icon_cache_key = icon + '.' + opacity;\n let pattern = patternCache[icon_cache_key];\n if (!pattern) {\n const spriteImageData = spriteData[icon];\n const canvas = createCanvas(\n spriteImageData.width,\n spriteImageData.height,\n );\n const ctx = /** @type {CanvasRenderingContext2D} */ (\n canvas.getContext('2d')\n );\n ctx.globalAlpha = opacity;\n ctx.drawImage(\n spriteImage,\n spriteImageData.x,\n spriteImageData.y,\n spriteImageData.width,\n spriteImageData.height,\n 0,\n 0,\n spriteImageData.width,\n spriteImageData.height,\n );\n pattern = ctx.createPattern(canvas, 'repeat');\n patternCache[icon_cache_key] = pattern;\n }\n fill.setColor(pattern);\n }\n }\n } else {\n color = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n layer.type + '-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n );\n if (layer.type + '-outline-color' in paint) {\n strokeColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n layer.type + '-outline-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n );\n }\n if (!strokeColor) {\n strokeColor = color;\n }\n if (color || strokeColor) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n (color && !style.getFill()) ||\n (!color && style.getFill()) ||\n (strokeColor && !style.getStroke()) ||\n (!strokeColor && style.getStroke()) ||\n style.getText()\n ) {\n style = new Style({\n fill: color ? new Fill() : undefined,\n stroke: strokeColor ? new Stroke() : undefined,\n });\n styles[stylesLength] = style;\n }\n if (color) {\n fill = style.getFill();\n fill.setColor(color);\n }\n if (strokeColor) {\n stroke = style.getStroke();\n stroke.setColor(strokeColor);\n stroke.setWidth(0.5);\n }\n style.setZIndex(index);\n }\n }\n }\n if (type != 1 && layer.type == 'line') {\n if (!('line-pattern' in paint)) {\n color = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'line-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n getValue(\n layer,\n 'paint',\n 'line-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n } else {\n color = undefined;\n }\n const width = getValue(\n layer,\n 'paint',\n 'line-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (color && width > 0) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getStroke() ||\n style.getFill() ||\n style.getText()\n ) {\n style = new Style({\n stroke: new Stroke(),\n });\n styles[stylesLength] = style;\n }\n stroke = style.getStroke();\n stroke.setLineCap(\n getValue(\n layer,\n 'layout',\n 'line-cap',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n stroke.setLineJoin(\n getValue(\n layer,\n 'layout',\n 'line-join',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n stroke.setMiterLimit(\n getValue(\n layer,\n 'layout',\n 'line-miter-limit',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n stroke.setColor(color);\n stroke.setWidth(width);\n stroke.setLineDash(\n paint['line-dasharray']\n ? getValue(\n layer,\n 'paint',\n 'line-dasharray',\n zoom,\n f,\n functionCache,\n featureState,\n ).map(function (x) {\n return x * width;\n })\n : null,\n );\n style.setZIndex(index);\n }\n }\n\n let hasImage = false;\n let text = null;\n let placementAngle = 0;\n let icon, iconImg, skipLabel;\n if ((type == 1 || type == 2) && 'icon-image' in layout) {\n const iconImage = getValue(\n layer,\n 'layout',\n 'icon-image',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (iconImage) {\n icon =\n typeof iconImage === 'string'\n ? fromTemplate(iconImage, properties)\n : iconImage.toString();\n let styleGeom = undefined;\n const imageElement = getImage ? getImage(olLayer, icon) : undefined;\n if (\n (spriteImage && spriteData && spriteData[icon]) ||\n imageElement\n ) {\n const iconRotationAlignment = getValue(\n layer,\n 'layout',\n 'icon-rotation-alignment',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (type == 2) {\n const geom = /** @type {*} */ (feature.getGeometry());\n // ol package and ol-debug.js only\n if (geom.getFlatMidpoint || geom.getFlatMidpoints) {\n const extent = geom.getExtent();\n const size = Math.sqrt(\n Math.max(\n Math.pow((extent[2] - extent[0]) / resolution, 2),\n Math.pow((extent[3] - extent[1]) / resolution, 2),\n ),\n );\n if (size > 150) {\n //FIXME Do not hard-code a size of 150\n const midpoint =\n geom.getType() === 'MultiLineString'\n ? geom.getFlatMidpoints()\n : geom.getFlatMidpoint();\n if (!renderFeature) {\n renderFeatureCoordinates = [NaN, NaN];\n renderFeature = new RenderFeature(\n 'Point',\n renderFeatureCoordinates,\n [],\n 2,\n {},\n undefined,\n );\n }\n styleGeom = renderFeature;\n renderFeatureCoordinates[0] = midpoint[0];\n renderFeatureCoordinates[1] = midpoint[1];\n const placement = getValue(\n layer,\n 'layout',\n 'symbol-placement',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (\n placement === 'line' &&\n iconRotationAlignment === 'map'\n ) {\n const stride = geom.getStride();\n const coordinates = geom.getFlatCoordinates();\n for (\n let i = 0, ii = coordinates.length - stride;\n i < ii;\n i += stride\n ) {\n const x1 = coordinates[i];\n const y1 = coordinates[i + 1];\n const x2 = coordinates[i + stride];\n const y2 = coordinates[i + stride + 1];\n const minX = Math.min(x1, x2);\n const minY = Math.min(y1, y2);\n const maxX = Math.max(x1, x2);\n const maxY = Math.max(y1, y2);\n if (\n midpoint[0] >= minX &&\n midpoint[0] <= maxX &&\n midpoint[1] >= minY &&\n midpoint[1] <= maxY\n ) {\n placementAngle = Math.atan2(y1 - y2, x2 - x1);\n break;\n }\n }\n }\n }\n }\n }\n if (type !== 2 || styleGeom) {\n const iconSize = getValue(\n layer,\n 'layout',\n 'icon-size',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const iconColor =\n paint['icon-color'] !== undefined\n ? getValue(\n layer,\n 'paint',\n 'icon-color',\n zoom,\n f,\n functionCache,\n featureState,\n )\n : null;\n if (!iconColor || iconColor.a !== 0) {\n const haloColor = getValue(\n layer,\n 'paint',\n 'icon-halo-color',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const haloWidth = getValue(\n layer,\n 'paint',\n 'icon-halo-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n let iconCacheKey = `${icon}.${iconSize}.${haloWidth}.${haloColor}`;\n if (iconColor !== null) {\n iconCacheKey += `.${iconColor}`;\n }\n iconImg = iconImageCache[iconCacheKey];\n if (!iconImg) {\n const declutterMode = getDeclutterMode(\n layer,\n zoom,\n f,\n 'icon',\n functionCache,\n );\n let displacement;\n if ('icon-offset' in layout) {\n displacement = getValue(\n layer,\n 'layout',\n 'icon-offset',\n zoom,\n f,\n functionCache,\n featureState,\n ).slice(0);\n displacement[0] *= iconSize;\n displacement[1] *= -iconSize;\n }\n let color = iconColor\n ? [\n iconColor.r * 255,\n iconColor.g * 255,\n iconColor.b * 255,\n iconColor.a,\n ]\n : undefined;\n if (imageElement) {\n const iconOptions = {\n color: color,\n rotateWithView: iconRotationAlignment === 'map',\n displacement: displacement,\n declutterMode: declutterMode,\n scale: iconSize,\n };\n if (typeof imageElement === 'string') {\n // it is a src URL\n iconOptions.src = imageElement;\n } else {\n iconOptions.img = imageElement;\n iconOptions.imgSize = [\n imageElement.width,\n imageElement.height,\n ];\n }\n iconImg = new Icon(iconOptions);\n } else {\n const spriteImageData = spriteData[icon];\n let img, size, offset;\n if (haloWidth) {\n if (spriteImageData.sdf) {\n img = drawIconHalo(\n drawSDF(\n spriteImage,\n spriteImageData,\n iconColor || [0, 0, 0, 1],\n ),\n {\n x: 0,\n y: 0,\n width: spriteImageData.width,\n height: spriteImageData.height,\n pixelRatio: spriteImageData.pixelRatio,\n },\n haloWidth,\n haloColor,\n );\n color = undefined; // do not tint haloed icons\n } else {\n img = drawIconHalo(\n spriteImage,\n spriteImageData,\n haloWidth,\n haloColor,\n );\n }\n } else {\n if (spriteImageData.sdf) {\n if (!spriteImageUnSDFed) {\n spriteImageUnSDFed = drawSDF(\n spriteImage,\n {\n x: 0,\n y: 0,\n width: spriteImageSize[0],\n height: spriteImageSize[1],\n },\n {r: 1, g: 1, b: 1, a: 1},\n );\n }\n img = spriteImageUnSDFed;\n } else {\n img = spriteImage;\n }\n size = [spriteImageData.width, spriteImageData.height];\n offset = [spriteImageData.x, spriteImageData.y];\n }\n iconImg = new Icon({\n color: color,\n img: img,\n // @ts-ignore\n imgSize: spriteImageSize,\n size: size,\n offset: offset,\n rotateWithView: iconRotationAlignment === 'map',\n scale: iconSize / spriteImageData.pixelRatio,\n displacement: displacement,\n declutterMode: declutterMode,\n });\n }\n iconImageCache[iconCacheKey] = iconImg;\n }\n }\n if (iconImg) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getImage() ||\n style.getFill() ||\n style.getStroke()\n ) {\n style = new Style();\n styles[stylesLength] = style;\n }\n style.setGeometry(styleGeom);\n iconImg.setRotation(\n placementAngle +\n deg2rad(\n getValue(\n layer,\n 'layout',\n 'icon-rotate',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n ),\n );\n iconImg.setOpacity(\n getValue(\n layer,\n 'paint',\n 'icon-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n iconImg.setAnchor(\n anchor[\n getValue(\n layer,\n 'layout',\n 'icon-anchor',\n zoom,\n f,\n functionCache,\n featureState,\n )\n ],\n );\n style.setImage(iconImg);\n text = style.getText();\n style.setText(undefined);\n style.setZIndex(index);\n hasImage = true;\n skipLabel = false;\n }\n } else {\n skipLabel = true;\n }\n }\n }\n }\n\n if (type == 1 && layer.type === 'circle') {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getImage() ||\n style.getFill() ||\n style.getStroke()\n ) {\n style = new Style();\n styles[stylesLength] = style;\n }\n const circleRadius =\n 'circle-radius' in paint\n ? getValue(\n layer,\n 'paint',\n 'circle-radius',\n zoom,\n f,\n functionCache,\n featureState,\n )\n : 5;\n const circleStrokeColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'circle-stroke-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n getValue(\n layer,\n 'paint',\n 'circle-stroke-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n\n const circleTranslate = getValue(\n layer,\n 'paint',\n 'circle-translate',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const circleColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'circle-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n getValue(\n layer,\n 'paint',\n 'circle-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n const circleStrokeWidth = getValue(\n layer,\n 'paint',\n 'circle-stroke-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const cache_key =\n circleRadius +\n '.' +\n circleStrokeColor +\n '.' +\n circleColor +\n '.' +\n circleStrokeWidth +\n '.' +\n circleTranslate[0] +\n '.' +\n circleTranslate[1];\n\n iconImg = iconImageCache[cache_key];\n if (!iconImg) {\n iconImg = new Circle({\n radius: circleRadius,\n displacement: [circleTranslate[0], -circleTranslate[1]],\n stroke:\n circleStrokeColor && circleStrokeWidth > 0\n ? new Stroke({\n width: circleStrokeWidth,\n color: circleStrokeColor,\n })\n : undefined,\n fill: circleColor\n ? new Fill({\n color: circleColor,\n })\n : undefined,\n declutterMode: 'none',\n });\n iconImageCache[cache_key] = iconImg;\n }\n style.setImage(iconImg);\n text = style.getText();\n style.setText(undefined);\n style.setGeometry(undefined);\n style.setZIndex(index);\n hasImage = true;\n }\n\n let label, font, textLineHeight, textSize, letterSpacing, maxTextWidth;\n if ('text-field' in layout) {\n textSize = Math.round(\n getValue(\n layer,\n 'layout',\n 'text-size',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n );\n const fontArray = getValue(\n layer,\n 'layout',\n 'text-font',\n zoom,\n f,\n functionCache,\n featureState,\n );\n textLineHeight = getValue(\n layer,\n 'layout',\n 'text-line-height',\n zoom,\n f,\n functionCache,\n featureState,\n );\n font = mb2css(\n getFonts\n ? getFonts(\n fontArray,\n glStyle.metadata\n ? glStyle.metadata['ol:webfonts']\n : undefined,\n )\n : fontArray,\n textSize,\n textLineHeight,\n );\n if (!font.includes('sans-serif')) {\n font += ',sans-serif';\n }\n letterSpacing = getValue(\n layer,\n 'layout',\n 'text-letter-spacing',\n zoom,\n f,\n functionCache,\n featureState,\n );\n maxTextWidth = getValue(\n layer,\n 'layout',\n 'text-max-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const textField = getValue(\n layer,\n 'layout',\n 'text-field',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (typeof textField === 'object' && textField.sections) {\n if (textField.sections.length === 1) {\n label = textField.toString();\n } else {\n label = textField.sections.reduce((acc, chunk, i) => {\n const fonts = chunk.fontStack\n ? chunk.fontStack.split(',')\n : fontArray;\n const chunkFont = mb2css(\n getFonts ? getFonts(fonts) : fonts,\n textSize * (chunk.scale || 1),\n textLineHeight,\n );\n let text = chunk.text;\n if (text === '\\n') {\n acc.push('\\n', '');\n return acc;\n }\n if (type == 2) {\n acc.push(applyLetterSpacing(text, letterSpacing), chunkFont);\n return;\n }\n text = wrapText(\n text,\n chunkFont,\n maxTextWidth,\n letterSpacing,\n ).split('\\n');\n for (let i = 0, ii = text.length; i < ii; ++i) {\n if (i > 0) {\n acc.push('\\n', '');\n }\n acc.push(text[i], chunkFont);\n }\n return acc;\n }, []);\n }\n } else {\n label = fromTemplate(textField, properties).trim();\n }\n opacity = getValue(\n layer,\n 'paint',\n 'text-opacity',\n zoom,\n f,\n functionCache,\n featureState,\n );\n }\n if (label && opacity && !skipLabel) {\n if (!hasImage) {\n ++stylesLength;\n style = styles[stylesLength];\n if (\n !style ||\n !style.getText() ||\n style.getFill() ||\n style.getStroke()\n ) {\n style = new Style();\n styles[stylesLength] = style;\n }\n style.setImage(undefined);\n style.setGeometry(undefined);\n }\n const declutterMode = getDeclutterMode(\n layer,\n zoom,\n f,\n 'text',\n functionCache,\n );\n if (!style.getText()) {\n style.setText(text);\n }\n text = style.getText();\n if (\n !text ||\n ('getDeclutterMode' in text &&\n text.getDeclutterMode() !== declutterMode)\n ) {\n text = new Text({\n padding: [2, 2, 2, 2],\n // @ts-ignore\n declutterMode: declutterMode,\n });\n style.setText(text);\n }\n const textTransform = getValue(\n layer,\n 'layout',\n 'text-transform',\n zoom,\n f,\n functionCache,\n featureState,\n );\n if (textTransform == 'uppercase') {\n label = Array.isArray(label)\n ? label.map((t, i) => (i % 2 ? t : t.toUpperCase()))\n : label.toUpperCase();\n } else if (textTransform == 'lowercase') {\n label = Array.isArray(label)\n ? label.map((t, i) => (i % 2 ? t : t.toLowerCase()))\n : label.toLowerCase();\n }\n const wrappedLabel = Array.isArray(label)\n ? label\n : type == 2\n ? applyLetterSpacing(label, letterSpacing)\n : wrapText(label, font, maxTextWidth, letterSpacing);\n text.setText(wrappedLabel);\n text.setFont(font);\n text.setRotation(\n deg2rad(\n getValue(\n layer,\n 'layout',\n 'text-rotate',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n ),\n );\n const textAnchor = getValue(\n layer,\n 'layout',\n 'text-anchor',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const placement =\n hasImage || type == 1\n ? 'point'\n : getValue(\n layer,\n 'layout',\n 'symbol-placement',\n zoom,\n f,\n functionCache,\n featureState,\n );\n let textAlign;\n if (placement === 'line-center') {\n text.setPlacement('line');\n textAlign = 'center';\n } else {\n text.setPlacement(placement);\n }\n if (placement === 'line' && typeof text.setRepeat === 'function') {\n const symbolSpacing = getValue(\n layer,\n 'layout',\n 'symbol-spacing',\n zoom,\n f,\n functionCache,\n featureState,\n );\n text.setRepeat(symbolSpacing * 2);\n }\n text.setOverflow(placement === 'point');\n let textHaloWidth = getValue(\n layer,\n 'paint',\n 'text-halo-width',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const textOffset = getValue(\n layer,\n 'layout',\n 'text-offset',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const textTranslate = getValue(\n layer,\n 'paint',\n 'text-translate',\n zoom,\n f,\n functionCache,\n featureState,\n );\n // Text offset has to take halo width and line height into account\n let vOffset = 0;\n let hOffset = 0;\n if (placement == 'point') {\n textAlign = 'center';\n if (textAnchor.indexOf('left') !== -1) {\n textAlign = 'left';\n hOffset = textHaloWidth;\n } else if (textAnchor.indexOf('right') !== -1) {\n textAlign = 'right';\n hOffset = -textHaloWidth;\n }\n const textRotationAlignment = getValue(\n layer,\n 'layout',\n 'text-rotation-alignment',\n zoom,\n f,\n functionCache,\n featureState,\n );\n text.setRotateWithView(textRotationAlignment == 'map');\n } else {\n text.setMaxAngle(\n (deg2rad(\n getValue(\n layer,\n 'layout',\n 'text-max-angle',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n ) *\n label.length) /\n wrappedLabel.length,\n );\n text.setRotateWithView(false);\n }\n text.setTextAlign(textAlign);\n let textBaseline = 'middle';\n if (textAnchor.indexOf('bottom') == 0) {\n textBaseline = 'bottom';\n vOffset = -textHaloWidth - 0.5 * (textLineHeight - 1) * textSize;\n } else if (textAnchor.indexOf('top') == 0) {\n textBaseline = 'top';\n vOffset = textHaloWidth + 0.5 * (textLineHeight - 1) * textSize;\n }\n text.setTextBaseline(textBaseline);\n const textJustify = getValue(\n layer,\n 'layout',\n 'text-justify',\n zoom,\n f,\n functionCache,\n featureState,\n );\n text.setJustify(textJustify === 'auto' ? undefined : textJustify);\n text.setOffsetX(\n textOffset[0] * textSize + hOffset + textTranslate[0],\n );\n text.setOffsetY(\n textOffset[1] * textSize + vOffset + textTranslate[1],\n );\n textColor.setColor(\n colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'text-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n ),\n );\n text.setFill(textColor);\n const haloColor = colorWithOpacity(\n getValue(\n layer,\n 'paint',\n 'text-halo-color',\n zoom,\n f,\n functionCache,\n featureState,\n ),\n opacity,\n );\n if (haloColor && textHaloWidth > 0) {\n textHalo.setColor(haloColor);\n // spec here : https://docs.mapbox.com/mapbox-gl-js/style-spec/#paint-symbol-text-halo-width\n // Halo width must be doubled because it is applied around the center of the text outline\n textHaloWidth *= 2;\n // 1/4 of text size (spec) x 2\n const halfTextSize = 0.5 * textSize;\n textHalo.setWidth(\n textHaloWidth <= halfTextSize ? textHaloWidth : halfTextSize,\n );\n text.setStroke(textHalo);\n } else {\n text.setStroke(undefined);\n }\n const textPadding = getValue(\n layer,\n 'layout',\n 'text-padding',\n zoom,\n f,\n functionCache,\n featureState,\n );\n const padding = text.getPadding();\n if (textPadding !== padding[0]) {\n padding[0] = textPadding;\n padding[1] = textPadding;\n padding[2] = textPadding;\n padding[3] = textPadding;\n }\n style.setZIndex(index);\n }\n }\n }\n\n if (stylesLength > -1) {\n styles.length = stylesLength + 1;\n if (recordLayer) {\n if ('set' in feature) {\n // ol/Feature\n feature.set('mapbox-layer', featureBelongsToLayer);\n } else {\n // ol/render/Feature\n feature.getProperties()['mapbox-layer'] = featureBelongsToLayer;\n }\n }\n return styles;\n }\n return undefined;\n };\n\n olLayer.setStyle(styleFunction);\n olLayer.set('mapbox-source', mapboxSource);\n olLayer.set('mapbox-layers', mapboxLayers);\n olLayer.set('mapbox-featurestate', olLayer.get('mapbox-featurestate') || {});\n return styleFunction;\n}\n\n/**\n * Get the the style for a specific Mapbox layer only. This can be useful for creating a legend.\n * @param {import(\"ol/Feature\").default|import(\"ol/render/Feature\").default} feature OpenLayers feature.\n * @param {number} resolution View resolution.\n * @param {import(\"ol/layer\").Vector|import(\"ol/layer\").VectorTile} olLayer OpenLayers layer.\n * @param {string} layerId Id of the Mapbox layer to get the style for\n * @return {Array} Styles for the provided Mapbox layer.\n */\nexport function getStyleForLayer(feature, resolution, olLayer, layerId) {\n const evaluateStyle = olLayer.getStyleFunction();\n if (evaluateStyle.length === 3) {\n // @ts-ignore\n return evaluateStyle(feature, resolution, layerId);\n }\n return undefined;\n}\n\nexport {\n colorWithOpacity as _colorWithOpacity,\n evaluateFilter as _evaluateFilter,\n fromTemplate as _fromTemplate,\n getValue as _getValue,\n};\n","/**\n * Generates a shaded relief image given elevation data. Uses a 3x3\n * neighborhood for determining slope and aspect.\n * @param {Array} inputs Array of input images.\n * @param {Object} data Data added in the \"beforeoperations\" event.\n * @return {ImageData} Output image.\n */\nexport function hillshade(inputs, data) {\n const elevationImage = inputs[0];\n const width = elevationImage.width;\n const height = elevationImage.height;\n const elevationData = elevationImage.data;\n const shadeData = new Uint8ClampedArray(elevationData.length);\n const dp = data.resolution * 2;\n const maxX = width - 1;\n const maxY = height - 1;\n const pixel = [0, 0, 0, 0];\n const twoPi = 2 * Math.PI;\n const halfPi = Math.PI / 2;\n const sunEl = (Math.PI * data.sunEl) / 180;\n const sunAz = (Math.PI * data.sunAz) / 180;\n const cosSunEl = Math.cos(sunEl);\n const sinSunEl = Math.sin(sunEl);\n const highlightColor = data.highlightColor;\n const shadowColor = data.shadowColor;\n const accentColor = data.accentColor;\n const encoding = data.encoding;\n\n let pixelX,\n pixelY,\n x0,\n x1,\n y0,\n y1,\n offset,\n z0,\n z1,\n dzdx,\n dzdy,\n slope,\n aspect,\n accent,\n scaled,\n shade,\n scaledAccentColor,\n compositeShadeColor,\n clamp,\n slopeScaleBase,\n scaledSlope,\n cosIncidence;\n\n function calculateElevation(pixel, encoding = 'mapbox') {\n // The method used to extract elevations from the DEM.\n //\n // The supported methods are the Mapbox format\n // (red * 256 * 256 + green * 256 + blue) * 0.1 - 10000\n // and the Terrarium format\n // (red * 256 + green + blue / 256) - 32768\n //\n if (encoding === 'mapbox') {\n return (pixel[0] * 256 * 256 + pixel[1] * 256 + pixel[2]) * 0.1 - 10000;\n }\n if (encoding === 'terrarium') {\n return pixel[0] * 256 + pixel[1] + pixel[2] / 256 - 32768;\n }\n }\n for (pixelY = 0; pixelY <= maxY; ++pixelY) {\n y0 = pixelY === 0 ? 0 : pixelY - 1;\n y1 = pixelY === maxY ? maxY : pixelY + 1;\n for (pixelX = 0; pixelX <= maxX; ++pixelX) {\n x0 = pixelX === 0 ? 0 : pixelX - 1;\n x1 = pixelX === maxX ? maxX : pixelX + 1;\n\n // determine elevation for (x0, pixelY)\n offset = (pixelY * width + x0) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z0 = data.vert * calculateElevation(pixel, encoding);\n\n // determine elevation for (x1, pixelY)\n offset = (pixelY * width + x1) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z1 = data.vert * calculateElevation(pixel, encoding);\n\n dzdx = (z1 - z0) / dp;\n\n // determine elevation for (pixelX, y0)\n offset = (y0 * width + pixelX) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z0 = data.vert * calculateElevation(pixel, encoding);\n\n // determine elevation for (pixelX, y1)\n offset = (y1 * width + pixelX) * 4;\n pixel[0] = elevationData[offset];\n pixel[1] = elevationData[offset + 1];\n pixel[2] = elevationData[offset + 2];\n pixel[3] = elevationData[offset + 3];\n z1 = data.vert * calculateElevation(pixel, encoding);\n\n dzdy = (z1 - z0) / dp;\n\n aspect = Math.atan2(dzdy, -dzdx);\n if (aspect < 0) {\n aspect = halfPi - aspect;\n } else if (aspect > halfPi) {\n aspect = twoPi - aspect + halfPi;\n } else {\n aspect = halfPi - aspect;\n }\n\n // Bootstrap slope and corresponding incident values\n slope = Math.atan(Math.sqrt(dzdx * dzdx + dzdy * dzdy));\n cosIncidence =\n sinSunEl * Math.cos(slope) +\n cosSunEl * Math.sin(slope) * Math.cos(sunAz - aspect);\n accent = Math.cos(slope);\n // 255 for Hex colors\n scaled = 255 * cosIncidence;\n\n /*\n * The following is heavily inspired\n * by [Maplibre's equivalent WebGL shader](https://github.com/maplibre/maplibre-gl-js/blob/main/src/shaders/hillshade.fragment.glsl)\n */\n\n // Forces given value to stay between two given extremes\n clamp = Math.min(Math.max(2 * data.sunEl, 0), 1);\n\n // Intensity basis for hillshade opacity\n slopeScaleBase = 1.875 - data.opacity * 1.75;\n // Intensity interpolation so that higher intensity values create more opaque hillshading\n scaledSlope =\n data.opacity !== 0.5\n ? halfPi *\n ((Math.pow(slopeScaleBase, slope) - 1) /\n (Math.pow(slopeScaleBase, halfPi) - 1))\n : slope;\n\n // Accent hillshade color with given accentColor to emphasize rougher terrain\n scaledAccentColor = {\n r: (1 - accent) * accentColor.r * clamp * 255,\n g: (1 - accent) * accentColor.g * clamp * 255,\n b: (1 - accent) * accentColor.b * clamp * 255,\n a: (1 - accent) * accentColor.a * clamp * 255,\n };\n\n // Allows highlight vs shadow discrimination\n shade = Math.abs((((aspect + sunAz) / Math.PI + 0.5) % 2) - 1);\n // Creates a composite color mix between highlight & shadow colors to emphasize slopes\n compositeShadeColor = {\n r: (highlightColor.r * (1 - shade) + shadowColor.r * shade) * scaled,\n g: (highlightColor.g * (1 - shade) + shadowColor.g * shade) * scaled,\n b: (highlightColor.b * (1 - shade) + shadowColor.b * shade) * scaled,\n a: (highlightColor.a * (1 - shade) + shadowColor.a * shade) * scaled,\n };\n\n // Fill in result color value\n offset = (pixelY * width + pixelX) * 4;\n shadeData[offset] =\n scaledAccentColor.r * (1 - shade) + compositeShadeColor.r;\n shadeData[offset + 1] =\n scaledAccentColor.g * (1 - shade) + compositeShadeColor.g;\n shadeData[offset + 2] =\n scaledAccentColor.b * (1 - shade) + compositeShadeColor.b;\n // Key opacity on the scaledSlope to improve legibility by increasing higher elevation rates' contrast\n shadeData[offset + 3] =\n elevationData[offset + 3] *\n data.opacity *\n clamp *\n Math.sin(scaledSlope);\n }\n }\n\n return new ImageData(shadeData, width, height);\n}\n","/*\nol-mapbox-style - Use Mapbox Style objects with OpenLayers\nCopyright 2016-present ol-mapbox-style contributors\nLicense: https://raw.githubusercontent.com/openlayers/ol-mapbox-style/master/LICENSE\n*/\n\nimport GeoJSON from 'ol/format/GeoJSON.js';\nimport ImageLayer from 'ol/layer/Image.js';\nimport Layer from 'ol/layer/Layer.js';\nimport LayerGroup from 'ol/layer/Group.js';\nimport MVT from 'ol/format/MVT.js';\nimport Map from 'ol/Map.js';\nimport Raster from 'ol/source/Raster.js';\nimport Source from 'ol/source/Source.js';\nimport TileGrid from 'ol/tilegrid/TileGrid.js';\nimport TileJSON from 'ol/source/TileJSON.js';\nimport TileLayer from 'ol/layer/Tile.js';\nimport VectorLayer from 'ol/layer/Vector.js';\nimport VectorSource from 'ol/source/Vector.js';\nimport VectorTileLayer from 'ol/layer/VectorTile.js';\nimport VectorTileSource, {defaultLoadFunction} from 'ol/source/VectorTile.js';\nimport View from 'ol/View.js';\nimport derefLayers from '@mapbox/mapbox-gl-style-spec/deref.js';\nimport {METERS_PER_UNIT} from 'ol/proj/Units.js';\nimport {\n _colorWithOpacity,\n stylefunction as applyStylefunction,\n getValue,\n styleFunctionArgs,\n} from './stylefunction.js';\nimport {bbox as bboxStrategy} from 'ol/loadingstrategy.js';\nimport {createXYZ} from 'ol/tilegrid.js';\nimport {\n defaultResolutions,\n fetchResource,\n getFilterCache,\n getFunctionCache,\n getGlStyle,\n getResolutionForZoom,\n getStyleFunctionKey,\n getTileJson,\n getZoomForResolution,\n} from './util.js';\nimport {\n equivalent,\n fromLonLat,\n getPointResolution,\n get as getProjection,\n getUserProjection,\n} from 'ol/proj.js';\nimport {getCenter, getTopLeft} from 'ol/extent.js';\nimport {getFonts} from './text.js';\nimport {hillshade} from './shaders.js';\nimport {\n normalizeSourceUrl,\n normalizeSpriteUrl,\n normalizeStyleUrl,\n} from './mapbox.js';\n\n/**\n * @typedef {Object} FeatureIdentifier\n * @property {string|number} id The feature id.\n * @property {string} source The source id.\n */\n\n/**\n * @typedef {Object} Options\n * @property {string} [accessToken] Access token for 'mapbox://' urls.\n * @property {function(string, import(\"./util.js\").ResourceType): (Request|string|Promise|void)} [transformRequest]\n * Function for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying\n * the url, adding headers or setting credentials options. Called with the url and the resource\n * type as arguments, this function is supposed to return a `Request` or a url `string`, or a promise tehereof.\n * Without a return value the original request will not be modified.\n * @property {string} [projection='EPSG:3857'] Only useful when working with non-standard projections.\n * Code of a projection registered with OpenLayers. All sources of the style must be provided in this\n * projection. The projection must also have a valid extent defined, which will be used to determine the\n * origin and resolutions of the tile grid for all tiled sources of the style. When provided, the bbox\n * placeholder in tile and geojson urls changes: the default is `{bbox-epsg-3857}`, when projection is e.g.\n * set to `EPSG:4326`, the bbox placeholder will be `{bbox-epsg-4326}`.\n * @property {Array} [resolutions] Only useful when working with non-standard projections.\n * Resolutions for mapping resolution to the `zoom` used in the Mapbox style.\n * @property {string} [styleUrl] URL of the Mapbox GL style. Required for styles that were provided\n * as object, when they contain a relative sprite url, or sources referencing data by relative url.\n * @property {string} [webfonts] Template for resolving webfonts. Can be used to specify where to fetch\n * web fonts when no `ol:webfonts` metadata is set in the style object. See `getFonts()` and the\n * \"Font handling\" section in `README.md` for details.\n * @property {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined]\n * Function that returns an image for an icon name. If the result is an HTMLImageElement, it must already be\n * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished.\n * This function be used for icons not in the sprite or to override sprite icons.\n * @property {string} [accessTokenParam='access_token'] Access token param. For internal use.\n */\n\n/**\n * @typedef {Object} ApplyStyleOptions\n * @property {string} [source=''] Source. Default is `''`, which causes the first source in the\n * style to be used.\n * @property {Array} [layers] Layers. If no source is provided, the layers with the\n * provided ids will be used from the style's `layers` array. All layers need to use the same source.\n * @property {boolean} [updateSource=true] Update or create vector (tile) layer source with parameters\n * specified for the source in the mapbox style definition.\n */\n\n/**\n * @param {import(\"ol/proj/Projection.js\").default} projection Projection.\n * @param {number} [tileSize=512] Tile size.\n * @return {Array} Resolutions.\n */\nfunction getTileResolutions(projection, tileSize = 512) {\n return projection.getExtent()\n ? createXYZ({\n extent: projection.getExtent(),\n tileSize: tileSize,\n maxZoom: 22,\n }).getResolutions()\n : defaultResolutions;\n}\n\n/**\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {Options} Completed options with accessToken and accessTokenParam.\n */\nfunction completeOptions(styleUrl, options) {\n if (!options.accessToken) {\n options = Object.assign({}, options);\n const searchParams = new URL(styleUrl).searchParams;\n // The last search parameter is the access token\n searchParams.forEach((value, key) => {\n options.accessToken = value;\n options.accessTokenParam = key;\n });\n }\n return options;\n}\n\n/**\n * Applies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector`\n * with an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source\n * yet, it will be created and populated from the information in the `glStyle` (unless `updateSource` is\n * set to `false`).\n *\n * **Example:**\n * ```js\n * import {applyStyle} from 'ol-mapbox-style';\n * import {VectorTile} from 'ol/layer.js';\n *\n * const layer = new VectorTile({declutter: true});\n * applyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');\n * ```\n *\n * The style function will render all layers from the `glStyle` object that use the source\n * of the first layer, the specified `source`, or a subset of layers from the same source. The\n * source needs to be a `\"type\": \"vector\"` or `\"type\": \"geojson\"` source.\n *\n * Two additional properties will be set on the provided layer:\n *\n * * `mapbox-source`: The `id` of the Mapbox Style document's source that the\n * OpenLayers layer was created from. Usually `apply()` creates one\n * OpenLayers layer per Mapbox Style source, unless the layer stack has\n * layers from different sources in between.\n * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are\n * included in the OpenLayers layer.\n *\n * @param {VectorTileLayer|VectorLayer} layer OpenLayers layer. When the layer has a source configured,\n * it will be modified to use the configuration from the glStyle's `source`. Options specified on the\n * layer's source will override those from the glStyle's `source`, except for `url` and\n * `tileUrlFunction`. When the source projection is the default (`EPSG:3857`), the `tileGrid` will\n * also be overridden. If you'd rather not have ol-mapbox-style modify the source, configure `applyStyle()`\n * with the `updateSource: false` option.\n * @param {string|Object} glStyle Mapbox Style object.\n * @param {string|Array|Options&ApplyStyleOptions} [sourceOrLayersOrOptions] Options or\n * `source` key or an array of layer `id`s from the Mapbox Style object. When a `source` key is\n * provided, all layers for the specified source will be included in the style function. When layer\n * `id`s are provided, they must be from layers that use the same source. When not provided or a falsey\n * value, all layers using the first source specified in the glStyle will be rendered.\n * @param {Options&ApplyStyleOptions|string} [optionsOrPath] **Deprecated**. Options. Alternatively the path of the style file\n * (only required when a relative path is used for the `\"sprite\"` property of the style).\n * @param {Array} [resolutions] **Deprecated**. Resolutions for mapping resolution to zoom level.\n * Only needed when working with non-standard tile grids or projections, can also be supplied with\n * options.\n * @return {Promise} Promise which will be resolved when the style can be used\n * for rendering.\n */\nexport function applyStyle(\n layer,\n glStyle,\n sourceOrLayersOrOptions = '',\n optionsOrPath = {},\n resolutions = undefined,\n) {\n let styleUrl, sourceId;\n /** @type {Options&ApplyStyleOptions} */\n let options;\n let sourceOrLayers;\n let updateSource = true;\n if (\n typeof sourceOrLayersOrOptions !== 'string' &&\n !Array.isArray(sourceOrLayersOrOptions)\n ) {\n options = sourceOrLayersOrOptions;\n sourceOrLayers = options.source || options.layers;\n optionsOrPath = options;\n } else {\n sourceOrLayers = sourceOrLayersOrOptions;\n }\n if (typeof optionsOrPath === 'string') {\n styleUrl = optionsOrPath;\n options = {};\n } else {\n styleUrl = optionsOrPath.styleUrl;\n options = optionsOrPath;\n }\n if (options.updateSource === false) {\n updateSource = false;\n }\n if (!resolutions) {\n resolutions = options.resolutions;\n }\n if (\n !styleUrl &&\n typeof glStyle === 'string' &&\n !glStyle.trim().startsWith('{')\n ) {\n styleUrl = glStyle;\n }\n if (styleUrl) {\n styleUrl = styleUrl.startsWith('data:')\n ? location.href\n : normalizeStyleUrl(styleUrl, options.accessToken);\n options = completeOptions(styleUrl, options);\n }\n\n return new Promise(function (resolve, reject) {\n // TODO: figure out where best place to check source type is\n // Note that the source arg is an array of gl layer ids and each must be\n // dereferenced to get source type to validate\n getGlStyle(glStyle, options)\n .then(function (glStyle) {\n if (glStyle.version != 8) {\n return reject(new Error('glStyle version 8 required.'));\n }\n if (\n !(layer instanceof VectorLayer || layer instanceof VectorTileLayer)\n ) {\n return reject(\n new Error('Can only apply to VectorLayer or VectorTileLayer'),\n );\n }\n\n const type = layer instanceof VectorTileLayer ? 'vector' : 'geojson';\n if (!sourceOrLayers) {\n sourceId = Object.keys(glStyle.sources).find(function (key) {\n return glStyle.sources[key].type === type;\n });\n sourceOrLayers = sourceId;\n } else if (Array.isArray(sourceOrLayers)) {\n sourceId = glStyle.layers.find(function (layer) {\n return layer.id === sourceOrLayers[0];\n }).source;\n } else {\n sourceId = sourceOrLayers;\n }\n if (!sourceId) {\n return reject(new Error(`No ${type} source found in the glStyle.`));\n }\n\n function assignSource() {\n if (!updateSource) {\n return Promise.resolve();\n }\n if (layer instanceof VectorTileLayer) {\n return setupVectorSource(\n glStyle.sources[sourceId],\n styleUrl,\n options,\n ).then(function (source) {\n const targetSource = layer.getSource();\n if (!targetSource) {\n layer.setSource(source);\n } else if (source !== targetSource) {\n targetSource.setTileUrlFunction(source.getTileUrlFunction());\n if (\n typeof targetSource.setUrls === 'function' &&\n typeof source.getUrls === 'function'\n ) {\n // to get correct keys for tile cache and queue\n targetSource.setUrls(source.getUrls());\n }\n //@ts-ignore\n if (!targetSource.format_) {\n //@ts-ignore\n targetSource.format_ = source.format_;\n }\n if (!targetSource.getAttributions()) {\n targetSource.setAttributions(source.getAttributions());\n }\n if (\n targetSource.getTileLoadFunction() === defaultLoadFunction\n ) {\n targetSource.setTileLoadFunction(\n source.getTileLoadFunction(),\n );\n }\n if (\n equivalent(\n targetSource.getProjection(),\n source.getProjection(),\n )\n ) {\n targetSource.tileGrid = source.getTileGrid();\n }\n }\n const tileGrid = layer.getSource().getTileGrid();\n if (\n !isFinite(layer.getMaxResolution()) &&\n !isFinite(layer.getMinZoom()) &&\n tileGrid.getMinZoom() > 0\n ) {\n layer.setMaxResolution(\n getResolutionForZoom(\n Math.max(0, tileGrid.getMinZoom() - 1e-12),\n tileGrid.getResolutions(),\n ),\n );\n }\n });\n }\n const glSource = glStyle.sources[sourceId];\n let source = layer.getSource();\n if (!source || source.get('mapbox-source') !== glSource) {\n source = setupGeoJSONSource(glSource, styleUrl, options);\n }\n const targetSource = /** @type {VectorSource} */ (layer.getSource());\n if (!targetSource) {\n layer.setSource(source);\n } else if (source !== targetSource) {\n if (!targetSource.getAttributions()) {\n targetSource.setAttributions(source.getAttributions());\n }\n //@ts-ignore\n if (!targetSource.format_) {\n //@ts-ignore\n targetSource.format_ = source.getFormat();\n }\n //@ts-ignore\n targetSource.url_ = source.getUrl();\n }\n return Promise.resolve();\n }\n\n let spriteScale, spriteData, spriteImageUrl, style;\n function onChange() {\n if (!style && (!glStyle.sprite || spriteData)) {\n if (options.projection && !resolutions) {\n const projection = getProjection(options.projection);\n const units = projection.getUnits();\n if (units !== 'm') {\n resolutions = defaultResolutions.map(\n (resolution) => resolution / METERS_PER_UNIT[units],\n );\n }\n }\n style = applyStylefunction(\n layer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n (fonts, templateUrl = options.webfonts) =>\n getFonts(fonts, templateUrl),\n options.getImage,\n );\n if (!layer.getStyle()) {\n reject(new Error(`Nothing to show for source [${sourceId}]`));\n } else {\n assignSource().then(resolve).catch(reject);\n }\n } else if (style) {\n layer.setStyle(style);\n assignSource().then(resolve).catch(reject);\n } else {\n reject(new Error('Something went wrong trying to apply style.'));\n }\n }\n\n if (glStyle.sprite) {\n const sprite = new URL(\n normalizeSpriteUrl(\n glStyle.sprite,\n options.accessToken,\n styleUrl || location.href,\n ),\n );\n spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;\n const sizeFactor = spriteScale == 0.5 ? '@2x' : '';\n let spriteUrl =\n sprite.origin +\n sprite.pathname +\n sizeFactor +\n '.json' +\n sprite.search;\n\n new Promise(function (resolve, reject) {\n fetchResource('Sprite', spriteUrl, options)\n .then(resolve)\n .catch(function (error) {\n spriteUrl =\n sprite.origin + sprite.pathname + '.json' + sprite.search;\n fetchResource('Sprite', spriteUrl, options)\n .then(resolve)\n .catch(reject);\n });\n })\n .then(function (spritesJson) {\n if (spritesJson === undefined) {\n reject(new Error('No sprites found.'));\n }\n spriteData = spritesJson;\n spriteImageUrl =\n sprite.origin +\n sprite.pathname +\n sizeFactor +\n '.png' +\n sprite.search;\n if (options.transformRequest) {\n const transformed =\n options.transformRequest(spriteImageUrl, 'SpriteImage') ||\n spriteImageUrl;\n if (\n transformed instanceof Request ||\n transformed instanceof Promise\n ) {\n spriteImageUrl = transformed;\n }\n }\n onChange();\n })\n .catch(function (err) {\n reject(\n new Error(\n `Sprites cannot be loaded: ${spriteUrl}: ${err.message}`,\n ),\n );\n });\n } else {\n onChange();\n }\n })\n .catch(reject);\n });\n}\n\nconst emptyObj = {};\n\nfunction setFirstBackground(mapOrLayer, glStyle, options) {\n glStyle.layers.some(function (layer) {\n if (layer.type === 'background') {\n if (mapOrLayer instanceof Layer) {\n mapOrLayer.setBackground(function (resolution) {\n return getBackgroundColor(layer, resolution, options, {});\n });\n return true;\n }\n if (mapOrLayer instanceof Map || mapOrLayer instanceof LayerGroup) {\n mapOrLayer\n .getLayers()\n .insertAt(0, setupBackgroundLayer(layer, options, {}));\n return true;\n }\n }\n });\n}\n\n/**\n * Applies properties of the Mapbox Style's first `background` layer to the\n * provided map or layer (group).\n *\n * **Example:**\n * ```js\n * import {applyBackground} from 'ol-mapbox-style';\n * import {Map} from 'ol';\n *\n * const map = new Map({target: 'map'});\n * applyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');\n * ```\n * @param {Map|import(\"ol/layer/Base.js\").default} mapOrLayer OpenLayers Map or layer (group).\n * @param {Object|string} glStyle Mapbox Style object or url.\n * @param {Options} options Options.\n * @return {Promise} Promise that resolves when the background is applied.\n */\nexport function applyBackground(mapOrLayer, glStyle, options = {}) {\n return getGlStyle(glStyle, options).then(function (glStyle) {\n setFirstBackground(mapOrLayer, glStyle, options);\n });\n}\n\nfunction getSourceIdByRef(layers, ref) {\n let sourceId;\n layers.some(function (layer) {\n if (layer.id == ref) {\n sourceId = layer.source;\n return true;\n }\n });\n return sourceId;\n}\n\nfunction extentFromTileJSON(tileJSON, projection) {\n const bounds = tileJSON.bounds;\n if (bounds) {\n const ll = fromLonLat([bounds[0], bounds[1]], projection);\n const tr = fromLonLat([bounds[2], bounds[3]], projection);\n return [ll[0], ll[1], tr[0], tr[1]];\n }\n return getProjection(projection).getExtent();\n}\n\nfunction sourceOptionsFromTileJSON(glSource, tileJSON, options) {\n const tileJSONSource = new TileJSON({\n tileJSON: tileJSON,\n tileSize: glSource.tileSize || tileJSON.tileSize || 512,\n });\n const tileJSONDoc = tileJSONSource.getTileJSON();\n const tileGrid = tileJSONSource.getTileGrid();\n const projection = getProjection(options.projection || 'EPSG:3857');\n const extent = extentFromTileJSON(tileJSONDoc, projection);\n const projectionExtent = projection.getExtent();\n const minZoom = tileJSONDoc.minzoom || 0;\n const maxZoom = tileJSONDoc.maxzoom || 22;\n /** @type {import(\"ol/source/VectorTile.js\").Options} */\n const sourceOptions = {\n attributions: tileJSONSource.getAttributions(),\n projection: projection,\n tileGrid: new TileGrid({\n origin: projectionExtent\n ? getTopLeft(projectionExtent)\n : tileGrid.getOrigin(0),\n extent: extent || tileGrid.getExtent(),\n minZoom: minZoom,\n resolutions: getTileResolutions(projection, tileJSON.tileSize).slice(\n 0,\n maxZoom + 1,\n ),\n tileSize: tileGrid.getTileSize(0),\n }),\n };\n if (Array.isArray(tileJSONDoc.tiles)) {\n sourceOptions.urls = tileJSONDoc.tiles;\n } else {\n sourceOptions.url = tileJSONDoc.tiles;\n }\n return sourceOptions;\n}\n\nfunction getBackgroundColor(glLayer, resolution, options, functionCache) {\n const background = {\n id: glLayer.id,\n type: glLayer.type,\n };\n const layout = glLayer.layout || {};\n const paint = glLayer.paint || {};\n background['paint'] = paint;\n const zoom = getZoomForResolution(\n resolution,\n options.resolutions || defaultResolutions,\n );\n let opacity;\n const bg = getValue(\n background,\n 'paint',\n 'background-color',\n zoom,\n emptyObj,\n functionCache,\n );\n if (paint['background-opacity'] !== undefined) {\n opacity = getValue(\n background,\n 'paint',\n 'background-opacity',\n zoom,\n emptyObj,\n functionCache,\n );\n }\n return layout.visibility == 'none'\n ? undefined\n : _colorWithOpacity(bg, opacity);\n}\n\n/**\n * @param {Object} glLayer Mapbox Style layer object.\n * @param {Options} options Options.\n * @param {Object} functionCache Cache for functions.\n * @return {Layer} OpenLayers layer.\n */\nfunction setupBackgroundLayer(glLayer, options, functionCache) {\n const div = document.createElement('div');\n div.className = 'ol-mapbox-style-background';\n div.style.position = 'absolute';\n div.style.width = '100%';\n div.style.height = '100%';\n return new Layer({\n source: new Source({}),\n render(frameState) {\n const color = getBackgroundColor(\n glLayer,\n frameState.viewState.resolution,\n options,\n functionCache,\n );\n div.style.backgroundColor = color;\n return div;\n },\n });\n}\n\n/**\n * Creates an OpenLayers VectorTile source for a gl source entry.\n * @param {Object} glSource \"source\" entry from a Mapbox Style object.\n * @param {string|undefined} styleUrl URL to use for the source. This is expected to be the complete http(s) url,\n * with access key applied.\n * @param {Options} options Options.\n * @return {Promise} Promise resolving to a VectorTile source.\n * @private\n */\nexport function setupVectorSource(glSource, styleUrl, options) {\n return new Promise(function (resolve, reject) {\n getTileJson(glSource, styleUrl, options)\n .then(function ({tileJson, tileLoadFunction}) {\n const sourceOptions = sourceOptionsFromTileJSON(\n glSource,\n tileJson,\n options,\n );\n sourceOptions.tileLoadFunction = tileLoadFunction;\n sourceOptions.format = new MVT();\n resolve(new VectorTileSource(sourceOptions));\n })\n .catch(reject);\n });\n}\n\nfunction setupVectorLayer(glSource, styleUrl, options) {\n const layer = new VectorTileLayer({\n declutter: true,\n visible: false,\n });\n setupVectorSource(glSource, styleUrl, options)\n .then(function (source) {\n source.set('mapbox-source', glSource);\n layer.setSource(source);\n })\n .catch(function (error) {\n layer.setSource(undefined);\n });\n return layer;\n}\n\nfunction getBboxTemplate(projection) {\n const projCode = projection ? projection.getCode() : 'EPSG:3857';\n return `{bbox-${projCode.toLowerCase().replace(/[^a-z0-9]/g, '-')}}`;\n}\n\nfunction setupRasterSource(glSource, styleUrl, options) {\n return new Promise(function (resolve, reject) {\n getTileJson(glSource, styleUrl, options)\n .then(function ({tileJson, tileLoadFunction}) {\n const source = new TileJSON({\n interpolate:\n options.interpolate === undefined ? true : options.interpolate,\n transition: 0,\n crossOrigin: 'anonymous',\n tileJSON: tileJson,\n });\n source.tileGrid = sourceOptionsFromTileJSON(\n glSource,\n tileJson,\n options,\n ).tileGrid;\n if (options.projection) {\n //@ts-ignore\n source.projection = getProjection(options.projection);\n }\n const getTileUrl = source.getTileUrlFunction();\n if (tileLoadFunction) {\n source.setTileLoadFunction(tileLoadFunction);\n }\n source.setTileUrlFunction(function (tileCoord, pixelRatio, projection) {\n const bboxTemplate = getBboxTemplate(projection);\n let src = getTileUrl(tileCoord, pixelRatio, projection);\n if (src.indexOf(bboxTemplate) != -1) {\n const bbox = source.getTileGrid().getTileCoordExtent(tileCoord);\n src = src.replace(bboxTemplate, bbox.toString());\n }\n return src;\n });\n source.set('mapbox-source', glSource);\n resolve(source);\n })\n .catch(function (error) {\n reject(error);\n });\n });\n}\n\nfunction setupRasterLayer(glSource, styleUrl, options) {\n const layer = new TileLayer();\n setupRasterSource(glSource, styleUrl, options)\n .then(function (source) {\n layer.setSource(source);\n })\n .catch(function () {\n layer.setSource(undefined);\n });\n return layer;\n}\n\n/**\n *\n * @param {Object} glSource \"source\" entry from a Mapbox Style object.\n * @param {string} styleUrl Style url\n * @param {Options} options ol-mapbox-style options.\n * @return {ImageLayer} The raster layer\n */\nfunction setupHillshadeLayer(glSource, styleUrl, options) {\n const tileLayer = setupRasterLayer(glSource, styleUrl, options);\n /** @type {ImageLayer} */\n const layer = new ImageLayer({\n source: new Raster({\n operationType: 'image',\n operation: hillshade,\n sources: [tileLayer],\n }),\n });\n return layer;\n}\n\n/**\n * @param {Object} glSource glStyle source.\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {VectorSource} Configured vector source.\n */\nfunction setupGeoJSONSource(glSource, styleUrl, options) {\n const geoJsonFormat = options.projection\n ? new GeoJSON({dataProjection: options.projection})\n : new GeoJSON();\n const data = glSource.data;\n const sourceOptions = {};\n if (typeof data == 'string') {\n const geoJsonUrl = normalizeSourceUrl(\n data,\n options.accessToken,\n options.accessTokenParam || 'access_token',\n styleUrl || location.href,\n );\n if (/\\{bbox-[0-9a-z-]+\\}/.test(geoJsonUrl)) {\n const extentUrl = (extent, resolution, projection) => {\n const bboxTemplate = getBboxTemplate(projection);\n return geoJsonUrl.replace(bboxTemplate, `${extent.join(',')}`);\n };\n const source = new VectorSource({\n attributions: glSource.attribution,\n format: geoJsonFormat,\n loader: (extent, resolution, projection, success, failure) => {\n const url =\n typeof extentUrl === 'function'\n ? extentUrl(extent, resolution, projection)\n : extentUrl;\n fetchResource('GeoJSON', url, options)\n .then((json) => {\n const features = /** @type {*} */ (\n source\n .getFormat()\n .readFeatures(json, {featureProjection: projection})\n );\n source.addFeatures(features);\n success(features);\n })\n .catch((response) => {\n source.removeLoadedExtent(extent);\n failure();\n });\n },\n strategy: bboxStrategy,\n });\n source.set('mapbox-source', glSource);\n return source;\n }\n const source = new VectorSource({\n attributions: glSource.attribution,\n format: geoJsonFormat,\n url: geoJsonUrl,\n loader: (extent, resolution, projection, success, failure) => {\n fetchResource('GeoJSON', geoJsonUrl, options)\n .then((json) => {\n const features = /** @type {*} */ (\n source\n .getFormat()\n .readFeatures(json, {featureProjection: projection})\n );\n source.addFeatures(features);\n success(features);\n })\n .catch((response) => {\n source.removeLoadedExtent(extent);\n failure();\n });\n },\n });\n return source;\n }\n sourceOptions.features = geoJsonFormat.readFeatures(data, {\n featureProjection: getUserProjection() || 'EPSG:3857',\n });\n\n const source = new VectorSource(\n Object.assign(\n {\n attributions: glSource.attribution,\n format: geoJsonFormat,\n },\n sourceOptions,\n ),\n );\n source.set('mapbox-source', glSource);\n return /** @type {VectorSource} */ (source);\n}\n\nfunction setupGeoJSONLayer(glSource, styleUrl, options) {\n return new VectorLayer({\n declutter: true,\n source: setupGeoJSONSource(glSource, styleUrl, options),\n visible: false,\n });\n}\n\nfunction prerenderRasterLayer(glLayer, layer, functionCache) {\n let zoom = null;\n return function (event) {\n if (\n glLayer.paint &&\n 'raster-opacity' in glLayer.paint &&\n event.frameState.viewState.zoom !== zoom\n ) {\n zoom = event.frameState.viewState.zoom;\n delete functionCache[glLayer.id];\n updateRasterLayerProperties(glLayer, layer, zoom, functionCache);\n }\n };\n}\n\nfunction updateRasterLayerProperties(glLayer, layer, zoom, functionCache) {\n const opacity = getValue(\n glLayer,\n 'paint',\n 'raster-opacity',\n zoom,\n emptyObj,\n functionCache,\n );\n layer.setOpacity(opacity);\n}\n\nfunction manageVisibility(layer, mapOrGroup) {\n function onChange() {\n const glStyle = mapOrGroup.get('mapbox-style');\n if (!glStyle) {\n return;\n }\n const mapboxLayers = derefLayers(glStyle.layers);\n const layerMapboxLayerids = layer.get('mapbox-layers');\n const visible = mapboxLayers\n .filter(function (mapboxLayer) {\n return layerMapboxLayerids.includes(mapboxLayer.id);\n })\n .some(function (mapboxLayer) {\n return (\n !mapboxLayer.layout ||\n !mapboxLayer.layout.visibility ||\n mapboxLayer.layout.visibility === 'visible'\n );\n });\n if (layer.get('visible') !== visible) {\n layer.setVisible(visible);\n }\n }\n layer.on('change', onChange);\n onChange();\n}\n\nexport function setupLayer(glStyle, styleUrl, glLayer, options) {\n const functionCache = getFunctionCache(glStyle);\n const glLayers = glStyle.layers;\n const type = glLayer.type;\n\n const id = glLayer.source || getSourceIdByRef(glLayers, glLayer.ref);\n const glSource = glStyle.sources[id];\n let layer;\n if (type == 'background') {\n layer = setupBackgroundLayer(glLayer, options, functionCache);\n } else if (glSource.type == 'vector') {\n layer = setupVectorLayer(glSource, styleUrl, options);\n } else if (glSource.type == 'raster') {\n layer = setupRasterLayer(glSource, styleUrl, options);\n layer.setVisible(\n glLayer.layout ? glLayer.layout.visibility !== 'none' : true,\n );\n layer.on('prerender', prerenderRasterLayer(glLayer, layer, functionCache));\n } else if (glSource.type == 'geojson') {\n layer = setupGeoJSONLayer(glSource, styleUrl, options);\n } else if (glSource.type == 'raster-dem' && glLayer.type == 'hillshade') {\n const hillshadeLayer = setupHillshadeLayer(glSource, styleUrl, options);\n layer = hillshadeLayer;\n hillshadeLayer.getSource().on('beforeoperations', function (event) {\n const data = event.data;\n data.resolution = getPointResolution(\n options.projection || 'EPSG:3857',\n event.resolution,\n getCenter(event.extent),\n 'm',\n );\n const zoom = getZoomForResolution(\n event.resolution,\n options.resolutions || defaultResolutions,\n );\n data.encoding = glSource.encoding;\n data.vert =\n 5 *\n getValue(\n glLayer,\n 'paint',\n 'hillshade-exaggeration',\n zoom,\n emptyObj,\n functionCache,\n );\n data.sunAz = getValue(\n glLayer,\n 'paint',\n 'hillshade-illumination-direction',\n zoom,\n emptyObj,\n functionCache,\n );\n data.sunEl = 35;\n data.opacity = 0.3;\n data.highlightColor = getValue(\n glLayer,\n 'paint',\n 'hillshade-highlight-color',\n zoom,\n emptyObj,\n functionCache,\n );\n data.shadowColor = getValue(\n glLayer,\n 'paint',\n 'hillshade-shadow-color',\n zoom,\n emptyObj,\n functionCache,\n );\n data.accentColor = getValue(\n glLayer,\n 'paint',\n 'hillshade-accent-color',\n zoom,\n emptyObj,\n functionCache,\n );\n });\n layer.setVisible(\n glLayer.layout ? glLayer.layout.visibility !== 'none' : true,\n );\n }\n const glSourceId = id;\n if (layer) {\n layer.set('mapbox-source', glSourceId);\n }\n return layer;\n}\n\n/**\n * @param {*} glStyle Mapbox Style.\n * @param {Map|LayerGroup} mapOrGroup Map or layer group.\n * @param {string} styleUrl Style URL.\n * @param {Options} options Options.\n * @return {Promise} Promise that resolves when the style is loaded.\n */\nfunction processStyle(glStyle, mapOrGroup, styleUrl, options) {\n const promises = [];\n\n let view = null;\n if (mapOrGroup instanceof Map) {\n view = mapOrGroup.getView();\n if (!view.isDef() && !view.getRotation() && !view.getResolutions()) {\n const projection = options.projection\n ? getProjection(options.projection)\n : view.getProjection();\n view = new View(\n Object.assign(view.getProperties(), {\n maxResolution:\n defaultResolutions[0] / METERS_PER_UNIT[projection.getUnits()],\n projection: options.projection || view.getProjection(),\n }),\n );\n mapOrGroup.setView(view);\n }\n\n if ('center' in glStyle && !view.getCenter()) {\n view.setCenter(fromLonLat(glStyle.center, view.getProjection()));\n }\n if ('zoom' in glStyle && view.getZoom() === undefined) {\n view.setResolution(\n defaultResolutions[0] /\n METERS_PER_UNIT[view.getProjection().getUnits()] /\n Math.pow(2, glStyle.zoom),\n );\n }\n if (!view.getCenter() || view.getZoom() === undefined) {\n view.fit(view.getProjection().getExtent(), {\n nearest: true,\n size: mapOrGroup.getSize(),\n });\n }\n }\n mapOrGroup.set('mapbox-style', glStyle);\n mapOrGroup.set('mapbox-metadata', {styleUrl, options});\n\n const glLayers = glStyle.layers;\n let layerIds = [];\n\n let layer, glSourceId, id;\n for (let i = 0, ii = glLayers.length; i < ii; ++i) {\n const glLayer = glLayers[i];\n const type = glLayer.type;\n if (type == 'heatmap') {\n //FIXME Unsupported layer type\n // eslint-disable-next-line no-console\n console.debug(`layers[${i}].type \"${type}\" not supported`);\n continue;\n } else {\n id = glLayer.source || getSourceIdByRef(glLayers, glLayer.ref);\n // this technique assumes gl layers will be in a particular order\n if (!id || id != glSourceId) {\n if (layerIds.length) {\n promises.push(\n finalizeLayer(\n layer,\n layerIds,\n glStyle,\n styleUrl,\n mapOrGroup,\n options,\n ),\n );\n layerIds = [];\n }\n\n layer = setupLayer(glStyle, styleUrl, glLayer, options);\n if (\n !(layer instanceof VectorLayer || layer instanceof VectorTileLayer)\n ) {\n layerIds = [];\n }\n glSourceId = layer.get('mapbox-source');\n }\n layerIds.push(glLayer.id);\n }\n }\n promises.push(\n finalizeLayer(layer, layerIds, glStyle, styleUrl, mapOrGroup, options),\n );\n return Promise.all(promises);\n}\n\n/**\n * Loads and applies a Mapbox Style object into an OpenLayers Map or LayerGroup.\n * This includes the map background, the layers, and for Map instances that did not\n * have a View defined yet also the center and the zoom.\n *\n * **Example:**\n * ```js\n * import apply from 'ol-mapbox-style';\n *\n * apply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});\n * ```\n *\n * The center and zoom will only be set if present in the Mapbox Style document,\n * and if not already set on the OpenLayers map.\n *\n * Layers will be added to the OpenLayers map, without affecting any layers that\n * might already be set on the map.\n *\n * Layers added by `apply()` will have two additional properties:\n *\n * * `mapbox-source`: The `id` of the Mapbox Style document's source that the\n * OpenLayers layer was created from. Usually `apply()` creates one\n * OpenLayers layer per Mapbox Style source, unless the layer stack has\n * layers from different sources in between.\n * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are\n * included in the OpenLayers layer.\n *\n * This function sets an additional `mapbox-style` property on the OpenLayers\n * Map or LayerGroup instance, which holds the Mapbox Style object.\n *\n * @param {Map|HTMLElement|string|LayerGroup} mapOrGroupOrElement Either an existing\n * OpenLayers Map instance, or a HTML element, or the id of a HTML element that will be\n * the target of a new OpenLayers Map, or a layer group. If layer group, styles\n * releated to the map and view will be ignored.\n * @param {string|Object} style JSON style object or style url pointing to a\n * Mapbox Style object. When using Mapbox APIs, the url is the `styleUrl`\n * shown in Mapbox Studio's \"share\" panel. In addition, the `accessToken` option\n * (see below) must be set.\n * When passed as JSON style object, all OpenLayers layers created by `apply()`\n * will be immediately available, but they may not have a source yet (i.e. when\n * they are defined by a TileJSON url in the Mapbox Style document). When passed\n * as style url, layers will be added to the map when the Mapbox Style document\n * is loaded and parsed.\n * @param {Options} options Options.\n * @return {Promise} A promise that resolves after all layers have been added to\n * the OpenLayers Map instance or LayerGroup, their sources set, and their styles applied. The\n * `resolve` callback will be called with the OpenLayers Map instance or LayerGroup as\n * argument.\n */\nexport function apply(mapOrGroupOrElement, style, options = {}) {\n let promise;\n /** @type {Map|LayerGroup} */\n let mapOrGroup;\n if (\n typeof mapOrGroupOrElement === 'string' ||\n mapOrGroupOrElement instanceof HTMLElement\n ) {\n mapOrGroup = new Map({\n target: mapOrGroupOrElement,\n });\n } else {\n mapOrGroup = mapOrGroupOrElement;\n }\n\n if (typeof style === 'string') {\n const styleUrl = style.startsWith('data:')\n ? location.href\n : normalizeStyleUrl(style, options.accessToken);\n options = completeOptions(styleUrl, options);\n\n promise = new Promise(function (resolve, reject) {\n getGlStyle(style, options)\n .then(function (glStyle) {\n processStyle(glStyle, mapOrGroup, styleUrl, options)\n .then(function () {\n resolve(mapOrGroup);\n })\n .catch(reject);\n })\n .catch(function (err) {\n reject(new Error(`Could not load ${style}: ${err.message}`));\n });\n });\n } else {\n promise = new Promise(function (resolve, reject) {\n processStyle(\n style,\n mapOrGroup,\n !options.styleUrl || options.styleUrl.startsWith('data:')\n ? location.href\n : normalizeStyleUrl(options.styleUrl, options.accessToken),\n options,\n )\n .then(function () {\n resolve(mapOrGroup);\n })\n .catch(reject);\n });\n }\n\n return promise;\n}\n\n/**\n * If layerIds is not empty, applies the style specified in glStyle to the layer,\n * and adds the layer to the map.\n *\n * The layer may not yet have a source when the function is called. If so, the style\n * is applied to the layer via a once listener on the 'change:source' event.\n *\n * @param {Layer} layer An OpenLayers layer instance.\n * @param {Array} layerIds Array containing layer ids of already-processed layers.\n * @param {Object} glStyle Style as a JSON object.\n * @param {string|undefined} styleUrl The original style URL. Only required\n * when a relative path is used with the `\"sprite\"` property of the style.\n * @param {Map|LayerGroup} mapOrGroup OpenLayers Map.\n * @param {Options} options Options.\n * @return {Promise} Returns a promise that resolves after the source has\n * been set on the specified layer, and the style has been applied.\n */\nexport function finalizeLayer(\n layer,\n layerIds,\n glStyle,\n styleUrl,\n mapOrGroup,\n options = {},\n) {\n let minZoom = 24;\n let maxZoom = 0;\n const glLayers = glStyle.layers;\n for (let i = 0, ii = glLayers.length; i < ii; ++i) {\n const glLayer = glLayers[i];\n if (layerIds.indexOf(glLayer.id) !== -1) {\n minZoom = Math.min('minzoom' in glLayer ? glLayer.minzoom : 0, minZoom);\n maxZoom = Math.max('maxzoom' in glLayer ? glLayer.maxzoom : 24, maxZoom);\n }\n }\n return new Promise(function (resolve, reject) {\n const setStyle = function () {\n const source = layer.getSource();\n if (!source || source.getState() === 'error') {\n reject(\n new Error(\n 'Error accessing data for source ' + layer.get('mapbox-source'),\n ),\n );\n return;\n }\n if ('getTileGrid' in source) {\n const tileGrid =\n /** @type {import(\"ol/source/Tile.js\").default|import(\"ol/source/VectorTile.js\").default} */ (\n source\n ).getTileGrid();\n if (tileGrid) {\n const sourceMinZoom = tileGrid.getMinZoom();\n if (minZoom > 0 || sourceMinZoom > 0) {\n layer.setMaxResolution(\n Math.min(\n getResolutionForZoom(\n Math.max(0, minZoom - 1e-12),\n defaultResolutions,\n ),\n getResolutionForZoom(\n Math.max(0, sourceMinZoom - 1e-12),\n tileGrid.getResolutions(),\n ),\n ),\n );\n }\n if (maxZoom < 24) {\n layer.setMinResolution(\n getResolutionForZoom(maxZoom, defaultResolutions),\n );\n }\n }\n } else {\n if (minZoom > 0) {\n layer.setMaxResolution(\n getResolutionForZoom(\n Math.max(0, minZoom - 1e-12),\n defaultResolutions,\n ),\n );\n }\n }\n if (\n source instanceof VectorSource ||\n source instanceof VectorTileSource\n ) {\n applyStyle(\n /** @type {import(\"ol/layer/Vector\").default|import(\"ol/layer/VectorTile\").default} */ (\n layer\n ),\n glStyle,\n layerIds,\n Object.assign({styleUrl: styleUrl}, options),\n )\n .then(function () {\n manageVisibility(layer, mapOrGroup);\n resolve();\n })\n .catch(reject);\n } else {\n resolve();\n }\n };\n\n layer.set('mapbox-layers', layerIds);\n const layers = mapOrGroup.getLayers();\n if (layers.getArray().indexOf(layer) === -1) {\n layers.push(layer);\n }\n\n if (layer.getSource()) {\n setStyle();\n } else {\n layer.once('change:source', setStyle);\n }\n });\n}\n\n/**\n * Get the Mapbox Layer object for the provided `layerId`.\n * @param {Map|LayerGroup} mapOrGroup Map or LayerGroup.\n * @param {string} layerId Mapbox Layer id.\n * @return {Object} Mapbox Layer object.\n */\nexport function getMapboxLayer(mapOrGroup, layerId) {\n const style = mapOrGroup.get('mapbox-style');\n const layerStyle = style.layers.find(function (layer) {\n return layer.id === layerId;\n });\n return layerStyle;\n}\n\n/**\n * Add a new Mapbox Layer object to the style. The map will be re-rendered.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {Object} mapboxLayer Mapbox Layer object.\n * @param {string} [beforeLayerId] Optional id of the Mapbox Layer before the new layer that will be added.\n * @return {Promise} Resolves when the added layer is available.\n */\nexport function addMapboxLayer(mapOrGroup, mapboxLayer, beforeLayerId) {\n const glStyle = mapOrGroup.get('mapbox-style');\n const mapboxLayers = glStyle.layers;\n let spliceIndex;\n let sourceIndex = -1;\n if (beforeLayerId !== undefined) {\n const beforeMapboxLayer = getMapboxLayer(mapOrGroup, beforeLayerId);\n if (beforeMapboxLayer === undefined) {\n throw new Error(`Layer with id \"${beforeLayerId}\" not found.`);\n }\n spliceIndex = mapboxLayers.indexOf(beforeMapboxLayer);\n } else {\n spliceIndex = mapboxLayers.length;\n }\n let sourceOffset;\n if (\n spliceIndex > 0 &&\n mapboxLayers[spliceIndex - 1].source === mapboxLayer.source\n ) {\n sourceIndex = spliceIndex - 1;\n sourceOffset = -1;\n } else if (\n spliceIndex < mapboxLayers.length &&\n mapboxLayers[spliceIndex].source === mapboxLayer.source\n ) {\n sourceIndex = spliceIndex;\n sourceOffset = 0;\n }\n if (sourceIndex === -1) {\n const {options, styleUrl} = mapOrGroup.get('mapbox-metadata');\n const layer = setupLayer(glStyle, styleUrl, mapboxLayer, options);\n if (beforeLayerId) {\n const beforeLayer = getLayer(mapOrGroup, beforeLayerId);\n const beforeLayerIndex = mapOrGroup\n .getLayers()\n .getArray()\n .indexOf(beforeLayer);\n mapOrGroup.getLayers().insertAt(beforeLayerIndex, layer);\n }\n mapboxLayers.splice(spliceIndex, 0, mapboxLayer);\n return finalizeLayer(\n layer,\n [mapboxLayer.id],\n glStyle,\n styleUrl,\n mapOrGroup,\n options,\n );\n }\n\n if (mapboxLayers.some((layer) => layer.id === mapboxLayer.id)) {\n throw new Error(`Layer with id \"${mapboxLayer.id}\" already exists.`);\n }\n const sourceLayerId = mapboxLayers[sourceIndex].id;\n const args =\n styleFunctionArgs[\n getStyleFunctionKey(\n mapOrGroup.get('mapbox-style'),\n getLayer(mapOrGroup, sourceLayerId),\n )\n ];\n mapboxLayers.splice(spliceIndex, 0, mapboxLayer);\n if (args) {\n const [\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n ] = args;\n if (Array.isArray(sourceOrLayers)) {\n const layerIndex = sourceOrLayers.indexOf(sourceLayerId) + sourceOffset;\n sourceOrLayers.splice(layerIndex, 0, mapboxLayer.id);\n }\n applyStylefunction(\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n );\n } else {\n getLayer(mapOrGroup, mapboxLayers[sourceIndex].id).changed();\n }\n return Promise.resolve();\n}\n\n/**\n * Update a Mapbox Layer object in the style. The map will be re-rendered with the new style.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {Object} mapboxLayer Updated Mapbox Layer object.\n */\nexport function updateMapboxLayer(mapOrGroup, mapboxLayer) {\n const glStyle = mapOrGroup.get('mapbox-style');\n const mapboxLayers = glStyle.layers;\n const index = mapboxLayers.findIndex(function (layer) {\n return layer.id === mapboxLayer.id;\n });\n if (index === -1) {\n throw new Error(`Layer with id \"${mapboxLayer.id}\" not found.`);\n }\n const oldLayer = mapboxLayers[index];\n if (oldLayer.source !== mapboxLayer.source) {\n throw new Error(\n 'Updated layer and previous version must use the same source.',\n );\n }\n delete getFunctionCache(glStyle)[mapboxLayer.id];\n delete getFilterCache(glStyle)[mapboxLayer.id];\n mapboxLayers[index] = mapboxLayer;\n const args =\n styleFunctionArgs[\n getStyleFunctionKey(\n mapOrGroup.get('mapbox-style'),\n getLayer(mapOrGroup, mapboxLayer.id),\n )\n ];\n if (args) {\n applyStylefunction.apply(undefined, args);\n } else {\n getLayer(mapOrGroup, mapboxLayer.id).changed();\n }\n}\n\n/**\n * Updates a Mapbox source object in the style. The according OpenLayers source will be replaced\n * and the map will be re-rendered.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {string} id Key of the source in the `sources` object literal.\n * @param {Object} mapboxSource Mapbox source object.\n * @return {Promise} Promise that resolves when the source has been updated.\n */\nexport function updateMapboxSource(mapOrGroup, id, mapboxSource) {\n const currentSource = getSource(mapOrGroup, id);\n const layers = /** @type {Array} */ (\n mapOrGroup\n .getLayers()\n .getArray()\n .filter(function (layer) {\n return (\n (layer instanceof VectorLayer ||\n layer instanceof TileLayer ||\n layer instanceof VectorTileLayer) &&\n layer.getSource() === currentSource\n );\n })\n );\n const metadata = mapOrGroup.get('mapbox-metadata');\n let newSourcePromise;\n switch (mapboxSource.type) {\n case 'vector':\n newSourcePromise = setupVectorSource(\n mapboxSource,\n metadata.styleUrl,\n metadata.options,\n );\n break;\n case 'geojson':\n newSourcePromise = Promise.resolve(\n setupGeoJSONSource(mapboxSource, metadata.styleUrl, metadata.options),\n );\n break;\n case 'raster':\n case 'raster-dem':\n newSourcePromise = setupRasterSource(\n mapboxSource,\n metadata.styleUrl,\n metadata.options,\n );\n break;\n default:\n return Promise.reject(\n new Error('Unsupported source type ' + mapboxSource.type),\n );\n }\n newSourcePromise.then(function (newSource) {\n layers.forEach(function (layer) {\n layer.setSource(newSource);\n });\n });\n return newSourcePromise;\n}\n\n/**\n * Remove a Mapbox Layer object from the style. The map will be re-rendered.\n * @param {Map|LayerGroup} mapOrGroup The Map or LayerGroup `apply` was called on.\n * @param {string|Object} mapboxLayerIdOrLayer Mapbox Layer id or Mapbox Layer object.\n */\nexport function removeMapboxLayer(mapOrGroup, mapboxLayerIdOrLayer) {\n const mapboxLayerId =\n typeof mapboxLayerIdOrLayer === 'string'\n ? mapboxLayerIdOrLayer\n : mapboxLayerIdOrLayer.id;\n const layer = getLayer(mapOrGroup, mapboxLayerId);\n /** @type {Array} */\n const layerMapboxLayers = layer.get('mapbox-layers');\n if (layerMapboxLayers.length === 1) {\n throw new Error(\n 'Cannot remove last Mapbox layer from an OpenLayers layer.',\n );\n }\n layerMapboxLayers.splice(layerMapboxLayers.indexOf(mapboxLayerId), 1);\n const glStyle = mapOrGroup.get('mapbox-style');\n const layers = glStyle.layers;\n layers.splice(\n layers.findIndex((layer) => layer.id === mapboxLayerId),\n 1,\n );\n const args = styleFunctionArgs[getStyleFunctionKey(glStyle, layer)];\n if (args) {\n const [\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n ] = args;\n if (Array.isArray(sourceOrLayers)) {\n sourceOrLayers.splice(\n sourceOrLayers.findIndex((layer) => layer === mapboxLayerId),\n 1,\n );\n }\n applyStylefunction(\n olLayer,\n glStyle,\n sourceOrLayers,\n resolutions,\n spriteData,\n spriteImageUrl,\n getFonts,\n getImage,\n );\n } else {\n getLayer(mapOrGroup, mapboxLayerId).changed();\n }\n}\n\n/**\n * Get the OpenLayers layer instance that contains the provided Mapbox Style\n * `layer`. Note that multiple Mapbox Style layers are combined in a single\n * OpenLayers layer instance when they use the same Mapbox Style `source`.\n * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup.\n * @param {string} layerId Mapbox Style layer id.\n * @return {Layer} OpenLayers layer instance.\n */\nexport function getLayer(map, layerId) {\n const layers = map.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const mapboxLayers = layers[i].get('mapbox-layers');\n if (mapboxLayers && mapboxLayers.indexOf(layerId) !== -1) {\n return /** @type {Layer} */ (layers[i]);\n }\n }\n return undefined;\n}\n\n/**\n * Get the OpenLayers layer instances for the provided Mapbox Style `source`.\n * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup.\n * @param {string} sourceId Mapbox Style source id.\n * @return {Array} OpenLayers layer instances.\n */\nexport function getLayers(map, sourceId) {\n const result = [];\n const layers = map.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n if (layers[i].get('mapbox-source') === sourceId) {\n result.push(/** @type {Layer} */ (layers[i]));\n }\n }\n return result;\n}\n\n/**\n * Get the OpenLayers source instance for the provided Mapbox Style `source`.\n * @param {Map|LayerGroup} map OpenLayers Map or LayerGroup.\n * @param {string} sourceId Mapbox Style source id.\n * @return {Source} OpenLayers source instance.\n */\nexport function getSource(map, sourceId) {\n const layers = map.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const source = /** @type {Layer} */ (layers[i]).getSource();\n if (layers[i].get('mapbox-source') === sourceId) {\n return source;\n }\n }\n return undefined;\n}\n\n/**\n * Sets or removes a feature state. The feature state is taken into account for styling,\n * just like the feature's properties, and can be used e.g. to conditionally render selected\n * features differently.\n *\n * The feature state will be stored on the OpenLayers layer matching the feature identifier, in the\n * `mapbox-featurestate` property.\n * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer OpenLayers Map or layer to set the feature\n * state on.\n * @param {FeatureIdentifier} feature Feature identifier.\n * @param {Object|null} state Feature state. Set to `null` to remove the feature state.\n */\nexport function setFeatureState(mapOrLayer, feature, state) {\n const layers =\n 'getLayers' in mapOrLayer\n ? getLayers(mapOrLayer, feature.source)\n : [mapOrLayer];\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const featureState = layers[i].get('mapbox-featurestate');\n if (featureState) {\n if (state) {\n featureState[feature.id] = state;\n } else {\n delete featureState[feature.id];\n }\n layers[i].changed();\n } else {\n throw new Error(`Map or layer for source \"${feature.source}\" not found.`);\n }\n }\n}\n\n/**\n * Sets or removes a feature state. The feature state is taken into account for styling,\n * just like the feature's properties, and can be used e.g. to conditionally render selected\n * features differently.\n * @param {Map|VectorLayer|VectorTileLayer} mapOrLayer Map or layer to set the feature state on.\n * @param {FeatureIdentifier} feature Feature identifier.\n * @return {Object|null} Feature state or `null` when no feature state is set for the given\n * feature identifier.\n */\nexport function getFeatureState(mapOrLayer, feature) {\n const layers =\n 'getLayers' in mapOrLayer\n ? getLayers(mapOrLayer, feature.source)\n : [mapOrLayer];\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n const featureState = layers[i].get('mapbox-featurestate');\n if (featureState && featureState[feature.id]) {\n return featureState[feature.id];\n }\n }\n return undefined;\n}\n","import BaseEvent from 'ol/events/Event.js';\nimport EventType from 'ol/events/EventType.js';\nimport MVT from 'ol/format/MVT.js';\nimport VectorTileLayer from 'ol/layer/VectorTile.js';\nimport VectorTileSource from 'ol/source/VectorTile.js';\nimport {applyBackground, applyStyle} from './apply.js';\n\n/** @typedef {import(\"ol/Map.js\").default} Map */\n\n/**\n * @classdesc\n * Event emitted on configuration or loading error.\n */\nclass ErrorEvent extends BaseEvent {\n /**\n * @param {Error} error error object.\n */\n constructor(error) {\n super(EventType.ERROR);\n\n /**\n * @type {Error}\n */\n this.error = error;\n }\n}\n\n/**\n * @typedef {Object} Options\n * @property {string} styleUrl The URL of the Mapbox style object to use for this layer. For a\n * style created with Mapbox Studio and hosted on Mapbox, this will look like\n * 'mapbox://styles/you/your-style'.\n * @property {string} [accessToken] The access token for your Mapbox style. This has to be provided\n * for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query\n * parameter of the style url.\n * @property {string} [source] If your style uses more than one source, you need to use either the\n * `source` property or the `layers` property to limit rendering to a single vector source. The\n * `source` property corresponds to the id of a vector source in your Mapbox style.\n * @property {Array} [layers] Limit rendering to the list of included layers. All layers\n * must share the same vector source. If your style uses more than one source, you need to use\n * either the `source` property or the `layers` property to limit rendering to a single vector\n * source.\n * @property {boolean} [declutter=true] Declutter images and text. Decluttering is applied to all\n * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority\n * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.\n * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has\n * higher priority.\n *\n * As an optimization decluttered features from layers with the same `className` are rendered above\n * the fill and stroke styles of all of those layers regardless of z-index. To opt out of this\n * behavior and place declutterd features with their own layer configure the layer with a `className`\n * other than `ol-layer`.\n * @property {import(\"ol/layer/Base.js\").BackgroundColor|false} [background] Background color for the layer.\n * If not specified, the background from the Mapbox style object will be used. Set to `false` to prevent\n * the Mapbox style's background from being used.\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"ol/extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will\n * match the style source's `minzoom`.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will\n * be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match\n * the style source's `minzoom`.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {import(\"ol/render.js\").OrderFunction} [renderOrder] Render order. Function to be used when sorting\n * features before rendering. By default features are drawn in the order that they are created. Use\n * `null` to avoid the sort, but get an undefined draw order.\n * @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the\n * renderer when getting features from the vector tile for the rendering or hit-detection.\n * Recommended value: Vector tiles are usually generated with a buffer, so this value should match\n * the largest possible buffer of the used tiles. It should be at least the size of the largest\n * point symbol or line width.\n * @property {import(\"ol/layer/VectorTile.js\").VectorTileRenderType} [renderMode='hybrid'] Render mode for vector tiles:\n * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom\n * animations. Point symbols and texts are accurately rendered as vectors and can stay upright on\n * rotated views.\n * * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector\n * tile layers with only a few rendered features (e.g. for highlighting a subset of features of\n * another layer with the same source).\n * @property {import(\"ol/Map.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use `map.addLayer()`.\n * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be\n * recreated during animations. This means that no vectors will be shown clipped, but the setting\n * will have a performance impact for large amounts of vector data. When set to `false`, batches\n * will be recreated when no animation is active.\n * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will be\n * recreated during interactions. See also `updateWhileAnimating`.\n * @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`\n * means no preloading.\n * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.\n * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @classdesc\n * ```js\n * import {MapboxVectorLayer} from 'ol-mapbox-style';\n * ```\n * A vector tile layer based on a Mapbox style that uses a single vector source. Configure\n * the layer with the `styleUrl` and `accessToken` shown in Mapbox Studio's share panel.\n * If the style uses more than one source, use the `source` property to choose a single\n * vector source. If you want to render a subset of the layers in the style, use the `layers`\n * property (all layers must share the same vector source). See the constructor options for\n * more detail.\n *\n * const map = new Map({\n * view: new View({\n * center: [0, 0],\n * zoom: 1,\n * }),\n * layers: [\n * new MapboxVectorLayer({\n * styleUrl: 'mapbox://styles/mapbox/bright-v9',\n * accessToken: 'your-mapbox-access-token-here',\n * }),\n * ],\n * target: 'map',\n * });\n *\n * On configuration or loading error, the layer will trigger an `'error'` event. Listeners\n * will receive an object with an `error` property that can be used to diagnose the problem.\n *\n * **Note for users of the full build**: The `MapboxVectorLayer` requires the\n * [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) library to be loaded as well.\n *\n * @param {Options} options Options.\n * @extends {VectorTileLayer}\n * @fires module:ol/events/Event~BaseEvent#event:error\n * @api\n */\nexport default class MapboxVectorLayer extends VectorTileLayer {\n /**\n * @param {Options} options Layer options. At a minimum, `styleUrl` and `accessToken`\n * must be provided.\n */\n constructor(options) {\n const declutter = 'declutter' in options ? options.declutter : true;\n const source = new VectorTileSource({\n state: 'loading',\n format: new MVT(),\n });\n\n super({\n source: source,\n background: options.background,\n declutter: declutter,\n className: options.className,\n opacity: options.opacity,\n visible: options.visible,\n zIndex: options.zIndex,\n minResolution: options.minResolution,\n maxResolution: options.maxResolution,\n minZoom: options.minZoom,\n maxZoom: options.maxZoom,\n renderOrder: options.renderOrder,\n renderBuffer: options.renderBuffer,\n renderMode: options.renderMode,\n map: options.map,\n updateWhileAnimating: options.updateWhileAnimating,\n updateWhileInteracting: options.updateWhileInteracting,\n preload: options.preload,\n useInterimTilesOnError: options.useInterimTilesOnError,\n properties: options.properties,\n });\n\n if (options.accessToken) {\n this.accessToken = options.accessToken;\n }\n const url = options.styleUrl;\n const promises = [\n applyStyle(this, url, options.layers || options.source, {\n accessToken: this.accessToken,\n }),\n ];\n if (this.getBackground() === undefined) {\n promises.push(\n applyBackground(this, options.styleUrl, {\n accessToken: this.accessToken,\n }),\n );\n }\n Promise.all(promises)\n .then(() => {\n source.setState('ready');\n })\n .catch((error) => {\n this.dispatchEvent(new ErrorEvent(error));\n const source = this.getSource();\n source.setState('error');\n });\n }\n}\n"],"names":["kCSSColorTable","transparent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","clamp_css_byte","i","Math","round","clamp_css_float","f","parse_css_int","str","length","parseFloat","parseInt","parse_css_float","css_hue_to_rgb","m1","m2","h","exports","css_str","iv","replace","toLowerCase","slice","substr","op","indexOf","ep","fname","params","split","alpha","pop","s","l","e","Color","constructor","r","g","b","a","this","parse","input","rgba","parseCSSColor","toString","toArray","toArray01","toArray01PremultipliedAlpha","Color$1","convertLiteral","value","convertFunction","parameters","propertySpec","stops","get","property","undefined","default","type","Object","keys","values","expression","splice","convertIdentityFunction","zoomAndFeatureDependent","featureDependent","zoomDependent","map","stop","tokens","convertTokenString","featureFunctionParameters","featureFunctionStops","zoomStops","zoom","push","functionType","getFunctionType","getInterpolateOperator","z","appendStopPair","convertPropertyFunction","fixupDegenerateStepCurve","convertZoomAndPropertyFunction","isStep","Error","base","convertZoomFunction","colorSpace","getFallback","defaultValue","curve","output","interpolated","result","re","pos","match","exec","literal","lastIndex","ParsingError","key","message","super","ParsingError$1","Scope","parent","bindings","name","concat","has","Scope$1","NullType","kind","NumberType","StringType","BooleanType","ColorType","ObjectType","ValueType","CollatorType","FormattedType","ResolvedImageType","array","itemType","N","valueMemberTypes","checkSubtype","expected","t","memberType","isValidType","provided","allowedTypes","some","isValidNativeType","Array","isArray","Collator","caseSensitive","diacriticSensitive","locale","sensitivity","collator","Intl","usage","compare","lhs","rhs","resolvedLocale","resolvedOptions","FormattedSection","text","image","scale","fontStack","textColor","normalize","Formatted","sections","fromString","unformatted","isEmpty","section","factory","join","serialize","serialized","options","ResolvedImage","available","validateRGBA","isValue","mixed","item","typeOf","String","JSON","stringify","Literal","args","context","error","expectedType","evaluate","eachChild","outputDefined","Literal$1","RuntimeError$1","toJSON","types","string","number","boolean","object","Assertion","floor","parsed","ctx","RuntimeError","fn","forEach","every","arg","Assertion$1","FormatExpression","firstArg","nextTokenMayBeObject","font","lastExpression","content","evaluatedContent","ImageExpression","evaluatedImageName","availableImages","Coercion","Boolean","c","parseColor","num","Number","isNaN","valueToString","child","Coercion$1","geometryTypes","EvaluationContext$1","globals","feature","featureState","formattedSection","_parseColorCache","canonical","featureTileCoord","featureDistanceData","id","geometryType","geometry","canonicalID","properties","distanceFromCenter","center","x","y","dX","dY","bearing","cached","CompoundExpression","_evaluate","definition","definitions","availableOverloads","overloads","filter","signature","signatureContext","ParsingContext","registry","path","scope","parsedArgs","argParseFailed","errors","signatures","stringifySignature","actualTypes","register","CompoundExpression$1","CollatorExpression","EXTENT","updateBBox","bbox","coord","min","max","boxWithinBox","bbox1","bbox2","getTileCoordinates","p","lng","lat","PI","log","tilesAtZoom","pow","onBoundary","p1","p2","x1","y1","x2","y2","pointWithinPolygon","point","rings","inside","len","ring","j","len2","pointWithinPolygons","polygons","twoSided","q1","q2","x3","y3","det1","det2","lineIntersectLine","d","vectorP","vectorQ","v1","v2","lineIntersectPolygon","polygon","lineStringWithinPolygon","line","lineStringWithinPolygons","getTilePolygon","coordinates","getTilePolygons","updatePoint","polyBBox","worldSize","halfWorldSize","shift","getTilePoints","pointBBox","shifts","tilePoints","points","getTileLines","lineBBox","tileLines","tileLine","Infinity","Within","geojson","geometries","features","polygonGeometry","tilePolygon","tilePolygons","pointsWithinPolygons","linesWithinPolygons","Within$1","isFeatureConstant","test","isStateConstant","isGlobalPropertyConstant","Var","boundExpression","Var$1","part","expr","index","_parse","annotate","typeAnnotation","Expr","actual","isConstant","ec","EvaluationContext","k","ParsingContext$1","isTypeAnnotation","childrenConstant","findStopLessThanOrEqualTo","currentValue","nextValue","lowerIndex","upperIndex","currentIndex","Step","labels","outputs","label","outputType","labelKey","valueKey","stopCount","out","Step$1","module","UnitBezier","p1x","p1y","p2x","p2y","cx","bx","ax","cy","by","ay","prototype","sampleCurveX","sampleCurveY","sampleCurveDerivativeX","solveCurveX","epsilon","t0","t1","t2","abs","d2","solve","from","to","Xn","Yn","Zn","t3","deg2rad","rad2deg","xyz2lab","lab2xyz","xyz2rgb","rgb2xyz","rgbToLab","rgbColor","labToRgb","labColor","interpolateHue","lab","forward","reverse","interpolate","interpolateNumber","hcl","atan2","sqrt","hclColor","cos","sin","Interpolate","operator","interpolation","interpolationFactor","lower","upper","exponentialInterpolation","controlPoints","rest","outputLower","outputUpper","lowerValue","upperValue","difference","progress","Interpolate$1","Coalesce","needsAnnotation","firstImage","argCount","Coalesce$1","Let","binding","Let$1","At","At$1","In","needle","haystack","In$1","IndexOf","fromIndex","IndexOf$1","Match","inputType","cases","otherwise","labelContext","MAX_SAFE_INTEGER","sortedLabels","sort","groupedByOutput","outputLookup","outputIndex","coerceLabel","Match$1","Case","branches","_","Case$1","Slice","beginIndex","endIndex","Slice$1","isComparableType","eqCollate","makeComparison","compareBasic","compareWithCollator","isOrderComparison","Comparison","hasUntypedArgument","lt","rt","Equals","NotEquals","LessThan","GreaterThan","LessThanOrEqual","GreaterThanOrEqual","NumberFormat","currency","unit","minFractionDigits","maxFractionDigits","style","minimumFractionDigits","maximumFractionDigits","format","Length","expressions","at","case","coalesce","in","let","step","var","within","obj","v","varargs","typeof","typeToString","rgb","pitch","heatmapDensity","lineProgress","skyRadialProgress","accumulated","ln2","LN2","pi","E","log10","n","LN10","ln","log2","asin","acos","atan","ceil","m","binarySearch","all","any","isSupportedScript","upcase","toUpperCase","downcase","success","isFunction","StyleExpression","_warningHistory","_evaluator","_defaultValue","spec","getDefaultValue","_enumValues","evaluateWithoutErrorHandling","val","console","warn","createExpression","parser","color","enum","formatted","resolvedImage","getExpectedType","ZoomConstantExpression","_styleExpression","isStateDependent","ZoomDependentExpression","interpolationType","createPropertyExpression","supportsPropertyExpression","isZoomConstant","supportsZoomExpression","zoomCurve","findZoomCurve","supportsInterpolation","childResult","deepUnbundle","unbundledValue","valueOf","unbundle","$version","$root","version","required","metadata","period","units","light","terrain","fog","sources","sprite","glyphs","transition","projection","layers","source","source_vector","vector","url","tiles","bounds","scheme","xyz","tms","minzoom","maxzoom","attribution","promoteId","volatile","source_raster","raster","tileSize","source_raster_dem","encoding","terrarium","mapbox","source_geojson","data","buffer","maximum","minimum","tolerance","cluster","clusterRadius","clusterMaxZoom","clusterMinPoints","clusterProperties","lineMetrics","generateId","source_video","video","urls","source_image","layer","fill","symbol","circle","heatmap","hillshade","background","sky","layout","paint","layout_background","visibility","visible","none","layout_sky","layout_fill","layout_circle","layout_heatmap","private","layout_line","butt","square","bevel","miter","requires","layout_symbol","auto","viewport","width","height","both","left","right","top","bottom","horizontal","vertical","uppercase","lowercase","layout_raster","layout_hillshade","filter_symbol","filter_fill","filter_line","filter_circle","filter_heatmap","filter_operator","geometry_type","Point","LineString","Polygon","function","identity","exponential","interval","categorical","function_stop","expression_name","group","distance","range","anchor","position","intensity","albers","equalEarth","equirectangular","lambertConformalConic","mercator","naturalEarth","winkelTripel","globe","parallels","exaggeration","paint_fill","paint_line","paint_circle","paint_heatmap","paint_symbol","overridable","paint_raster","linear","nearest","paint_hillshade","paint_background","paint_sky","gradient","atmosphere","duration","delay","constant","isExpressionFilter","createFilter","layerType","needGeometry","needFeature","convertFilter","filterExp","staticFilter","isDynamicFilter","unionDynamicBranches","collapseDynamicBooleanExpressions","extractStaticFilter","filterSpec","latest","compiledStaticFilter","filterFunc","err","globalProperties","dynamicFilterFunc","compiledDynamicFilter","dynamicFilter","geometryNeeded","collapsed","dynamicConditionExpressions","collapsedExpression","subExpression","isBranchingDynamically","Set","filters","convertComparisonOp","convertNegation","convertInOp","convertHasOp","refProperties","deref","derefLayers","create","ref","fontWeights","thin","hairline","book","regular","normal","plain","roman","standard","medium","bold","heavy","fat","poster","sp","italicRE","fontCache","fonts","size","lineHeight","cssData","haveWeight","haveStyle","weight","fontFamilies","ii","parts","maybeWeight","w","previousPart","startsWith","fontFamily","mapboxBaseUrl","getMapboxPath","normalizeStyleUrl","token","mapboxPath","decodeURI","URL","location","href","normalizeSourceUrl","tokenParam","styleUrl","urlObject","searchParams","set","window","devicePixelRatio","functionCacheByStyleId","filterCacheByStyleId","styleId","getStyleId","glStyle","getStyleFunctionKey","olLayer","getUid","getFunctionCache","functionCache","getFilterCache","filterCache","degrees","defaultResolutions","resolutions","res","createCanvas","WorkerGlobalScope","self","OffscreenCanvas","canvas","document","createElement","getZoomForResolution","resolution","zoomFactor","getResolutionForZoom","factor","pendingRequests","fetchResource","resourceType","request","transformedRequest","transformRequest","pendingRequest","toPromise","then","Request","headers","fetch","response","ok","json","Promise","reject","catch","getGlStyle","glStyleOrUrl","resolve","trim","accessToken","tilejsonCache","getTileJson","glSource","cacheKey","promise","tileLoadFunction","tile","src","VectorTile","setLoader","extent","arrayBuffer","getFormat","readFeatures","featureProjection","setFeatures","setState","TileState","ERROR","img","getImage","blob","createObjectURL","addEventListener","revokeObjectURL","normalizedSourceUrl","accessTokenParam","tileJson","assign","expandUrl","tileUrl","drawIconHalo","spriteImage","spriteImageData","haloWidth","haloColor","imgSize","pixelRatio","imageCanvas","imageContext","getContext","drawImage","imageData","getImageData","globalCompositeOperation","fillStyle","jj","arc","smoothstep","drawSDF","area","gamma","putImageData","hairSpacePool","applyLetterSpacing","letterSpacing","textWithLetterSpacing","lines","joinSpaceString","ll","measureContext","getMeasureContext","measureText","measureCache","wrapText","em","hardLines","wrappedText","words","maxWidth","word","testLine","prevWidth","nextWidth","next","lineWords","lastWord","fontFamilyRegEx","stripQuotesRegEx","loadedFontFamilies","hasFontFamily","family","styleSheets","styleSheet","cssRules","rules","cssRule","cssText","processedFontFamilies","MultiPoint","MultiLineString","MultiPolygon","expressionData","rawExpression","compiledExpression","emptyObj","zoomObj","renderFeatureCoordinates","renderFeature","getValue","layoutOrPaint","layerId","functions","isExpr","bind","getDeclutterMode","prefix","evaluateFilter","renderTransparentEnabled","colorWithOpacity","opacity","templateRegEx","fromTemplate","recordLayer","styleFunctionArgs","stylefunction","sourceOrLayers","spriteData","spriteImageUrl","getFonts","spriteImageSize","spriteImageUnSDFed","arguments","Image","blobUrl","crossOrigin","onload","changed","worker","postMessage","action","event","allLayers","layersBySourceLayer","mapboxLayers","iconImageCache","patternCache","mapboxSource","sourceLayer","textHalo","Stroke","Fill","styles","styleFunction","onlyLayer","getProperties","getGeometry","getType","getId","featureBelongsToLayer","stylesLength","layerData","stroke","strokeColor","fillIcon","icon","getFill","getStroke","getText","Style","setZIndex","icon_cache_key","pattern","globalAlpha","createPattern","setColor","setWidth","setLineCap","setLineJoin","setMiterLimit","setLineDash","iconImg","skipLabel","textLineHeight","textSize","maxTextWidth","hasImage","placementAngle","iconImage","styleGeom","imageElement","iconRotationAlignment","geom","getFlatMidpoint","getFlatMidpoints","getExtent","midpoint","NaN","RenderFeature","stride","getStride","getFlatCoordinates","minX","minY","maxX","maxY","iconSize","iconColor","iconCacheKey","declutterMode","displacement","iconOptions","rotateWithView","Icon","offset","sdf","setGeometry","setRotation","setOpacity","setAnchor","setImage","setText","circleRadius","circleStrokeColor","circleTranslate","circleColor","circleStrokeWidth","cache_key","Circle","radius","fontArray","mb2css","includes","textField","reduce","acc","chunk","chunkFont","Text","padding","textTransform","wrappedLabel","setFont","textAnchor","placement","textAlign","setPlacement","setRepeat","symbolSpacing","setOverflow","textHaloWidth","textOffset","textTranslate","vOffset","hOffset","textRotationAlignment","setRotateWithView","setMaxAngle","setTextAlign","textBaseline","setTextBaseline","textJustify","setJustify","setOffsetX","setOffsetY","setFill","halfTextSize","setStroke","textPadding","getPadding","setStyle","inputs","elevationImage","elevationData","shadeData","Uint8ClampedArray","dp","pixel","twoPi","halfPi","sunEl","sunAz","cosSunEl","sinSunEl","highlightColor","shadowColor","accentColor","pixelX","pixelY","x0","y0","z0","z1","dzdx","dzdy","slope","aspect","accent","scaled","shade","scaledAccentColor","compositeShadeColor","clamp","slopeScaleBase","scaledSlope","cosIncidence","calculateElevation","vert","ImageData","getTileResolutions","createXYZ","maxZoom","getResolutions","completeOptions","applyStyle","sourceOrLayersOrOptions","optionsOrPath","sourceId","updateSource","VectorLayer","VectorTileLayer","find","assignSource","setupVectorSource","targetSource","getSource","setTileUrlFunction","getTileUrlFunction","setUrls","getUrls","format_","getAttributions","setAttributions","getTileLoadFunction","defaultLoadFunction","setTileLoadFunction","equivalent","getProjection","tileGrid","getTileGrid","setSource","isFinite","getMaxResolution","getMinZoom","setMaxResolution","setupGeoJSONSource","url_","getUrl","spriteScale","onChange","getUnits","METERS_PER_UNIT","applyStylefunction","templateUrl","webfonts","fontsKey","fontDescriptions","cssFont","registerFont","fontDescription","checkedFonts","fontUrl","querySelector","markup","rel","head","appendChild","getStyle","normalizeSpriteUrl","sizeFactor","spriteUrl","origin","pathname","search","spritesJson","transformed","applyBackground","mapOrLayer","Layer","setBackground","getBackgroundColor","Map","LayerGroup","getLayers","insertAt","setupBackgroundLayer","setFirstBackground","getSourceIdByRef","sourceOptionsFromTileJSON","tileJSON","tileJSONSource","TileJSON","tileJSONDoc","getTileJSON","fromLonLat","tr","extentFromTileJSON","projectionExtent","minZoom","sourceOptions","attributions","TileGrid","getTopLeft","getOrigin","getTileSize","glLayer","bg","_colorWithOpacity","div","className","Source","render","frameState","viewState","backgroundColor","MVT","VectorTileSource","getBboxTemplate","getCode","setupRasterSource","getTileUrl","tileCoord","bboxTemplate","getTileCoordExtent","setupRasterLayer","TileLayer","geoJsonFormat","GeoJSON","dataProjection","geoJsonUrl","extentUrl","VectorSource","loader","failure","addFeatures","removeLoadedExtent","strategy","bboxStrategy","getUserProjection","prerenderRasterLayer","updateRasterLayerProperties","setupLayer","glLayers","declutter","setupVectorLayer","setVisible","on","setupGeoJSONLayer","hillshadeLayer","tileLayer","ImageLayer","Raster","operationType","operation","setupHillshadeLayer","getPointResolution","getCenter","glSourceId","processStyle","mapOrGroup","promises","view","getView","isDef","getRotation","View","maxResolution","setView","setCenter","getZoom","setResolution","fit","getSize","layerIds","finalizeLayer","debug","apply","mapOrGroupOrElement","HTMLElement","target","getState","sourceMinZoom","setMinResolution","layerMapboxLayerids","mapboxLayer","manageVisibility","getArray","once","getMapboxLayer","getLayer","ErrorEvent","BaseEvent","EventType","MapboxVectorLayer","state","zIndex","minResolution","renderOrder","renderBuffer","renderMode","updateWhileAnimating","updateWhileInteracting","preload","useInterimTilesOnError","getBackground","dispatchEvent","beforeLayerId","spliceIndex","sourceOffset","sourceIndex","beforeMapboxLayer","beforeLayer","beforeLayerIndex","sourceLayerId","layerIndex","evaluateStyle","getStyleFunction","record","mapboxLayerIdOrLayer","mapboxLayerId","layerMapboxLayers","findIndex","enabled","clearFunctionCache","currentSource","newS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AASygB,EAAYhmC,WACtC6lB,GAAeN,GAASygB,EAAYhmC,IAC3C4wB,EAAahpB,GAASo+B,EACtB,MAAMvpC,EACJ+yB,GACEhK,GACE+e,EAAW9vC,IAAI,gBACf4xC,GAAS9B,EAAYyB,EAAYhmC,MAGnCvD,EACFmhC,GAAmB4H,WAAM7wC,EAAW8H,GAEpC4pC,GAAS9B,EAAYyB,EAAYhmC,IAAIqwB,SA5BkB,uBAwCpD,SAA4BkU,EAAYvkC,EAAI+wB,GACjD,MAAMyX,EAAgBvM,GAAUsI,EAAYvkC,GACtC0X,EACJ6sB,EACG5E,YACAuG,WACA/kC,QAAO,SAAU8Y,GAChB,OACGA,aAAiB0hB,YAChB1hB,aAAiBooB,GADlB,SAECpoB,aAAiB2hB,GAAAA,UACnB3hB,EAAMgiB,cAAgBuM,CALD,IASvBzxB,EAAWwtB,EAAW9vC,IAAI,mBAChC,IAAIg0C,EACJ,OAAQ1X,EAAal8B,MACnB,IAAK,SACH4zC,EAAmB1M,GACjBhL,EACAha,EAAS8N,SACT9N,EAASlb,SAEX,MACF,IAAK,UACH4sC,EAAmB3gB,QAAQK,QACzBkV,GAAmBtM,EAAcha,EAAS8N,SAAU9N,EAASlb,UAE/D,MACF,IAAK,SACL,IAAK,aACH4sC,EAAmB1G,GACjBhR,EACAha,EAAS8N,SACT9N,EAASlb,SAEX,MACF,QACE,OAAOisB,QAAQC,OACb,IAAItxB,MAAM,2BAA6Bs6B,EAAal8B,OAQ1D,OALA4zC,EAAiBlhB,MAAK,SAAUmhB,GAC9BhxB,EAAO5Z,SAAQ,SAAUmc,GACvBA,EAAM+iB,UAAU0L,EADc,GADS,IAKpCD,CAhDwD"} \ No newline at end of file diff --git a/dist/shaders.d.ts b/dist/shaders.d.ts new file mode 100644 index 00000000..c8bc67cc --- /dev/null +++ b/dist/shaders.d.ts @@ -0,0 +1,8 @@ +/** + * Generates a shaded relief image given elevation data. Uses a 3x3 + * neighborhood for determining slope and aspect. + * @param {Array} inputs Array of input images. + * @param {Object} data Data added in the "beforeoperations" event. + * @return {ImageData} Output image. + */ +export function hillshade(inputs: Array, data: any): ImageData; diff --git a/dist/stylefunction.d.ts b/dist/stylefunction.d.ts new file mode 100644 index 00000000..5dca90d4 --- /dev/null +++ b/dist/stylefunction.d.ts @@ -0,0 +1,136 @@ +/** + * @private + * @param {Object} layer Gl object layer. + * @param {string} layoutOrPaint 'layout' or 'paint'. + * @param {string} property Feature property. + * @param {number} zoom Zoom. + * @param {Object} feature Gl feature. + * @param {Object} [functionCache] Function cache. + * @param {Object} [featureState] Feature state. + * @return {?} Value. + */ +export function getValue(layer: any, layoutOrPaint: string, property: string, zoom: number, feature: any, functionCache?: any, featureState?: any): unknown; +/** + * Configure whether features with a transparent style should be rendered. When + * set to `true`, it will be possible to hit detect content that is not visible, + * like transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or + * `ol/Map#getFeaturesAtPixel()` + * @param {boolean} enabled Rendering of transparent elements is enabled. + * Default is `false`. + */ +export function renderTransparent(enabled: boolean): void; +/** + * Turns recording of the Mapbox Style's `layer` on and off. When turned on, + * the layer that a rendered feature belongs to will be set as the feature's + * `mapbox-layer` property. + * @param {boolean} record Recording of the style layer is on. + */ +export function recordStyleLayer(record?: boolean): void; +/** + * Creates a style function from the `glStyle` object for all layers that use + * the specified `source`, which needs to be a `"type": "vector"` or + * `"type": "geojson"` source and applies it to the specified OpenLayers layer. + * + * Two additional properties will be set on the provided layer: + * + * * `mapbox-source`: The `id` of the Mapbox Style document's source that the + * OpenLayers layer was created from. Usually `apply()` creates one + * OpenLayers layer per Mapbox Style source, unless the layer stack has + * layers from different sources in between. + * * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are + * included in the OpenLayers layer. + * + * This function also works in a web worker. In worker mode, the main thread needs + * to listen to messages from the worker and respond with another message to make + * sure that sprite image loading works: + * + * ```js + * worker.addEventListener('message', event => { + * if (event.data.action === 'loadImage') { + * const image = new Image(); + * image.crossOrigin = 'anonymous'; + * image.addEventListener('load', function() { + * createImageBitmap(image, 0, 0, image.width, image.height).then(imageBitmap => { + * worker.postMessage({ + * action: 'imageLoaded', + * image: imageBitmap, + * src: event.data.src + * }, [imageBitmap]); + * }); + * }); + * image.src = event.data.src; + * } + * }); + * ``` + * + * @param {VectorLayer|VectorTileLayer} olLayer OpenLayers layer to + * apply the style to. In addition to the style, the layer will get two + * properties: `mapbox-source` will be the `id` of the `glStyle`'s source used + * for the layer, and `mapbox-layers` will be an array of the `id`s of the + * `glStyle`'s layers. + * @param {string|Object} glStyle Mapbox Style object. + * @param {string|Array} sourceOrLayers `source` key or an array of layer `id`s + * from the Mapbox Style object. When a `source` key is provided, all layers for + * the specified source will be included in the style function. When layer `id`s + * are provided, they must be from layers that use the same source. + * @param {Array} resolutions + * Resolutions for mapping resolution to zoom level. + * @param {Object} spriteData Sprite data from the url specified in + * the Mapbox Style object's `sprite` property. Only required if a `sprite` + * property is specified in the Mapbox Style object. + * @param {string|Request|Promise} spriteImageUrl Sprite image url for the sprite + * specified in the Mapbox Style object's `sprite` property. Only required if a + * `sprite` property is specified in the Mapbox Style object. + * @param {function(Array, string=):Array} getFonts Function that + * receives a font stack and the url template from the GL style's `metadata['ol:webfonts']` + * property (if set) as arguments, and returns a (modified) font stack that + * is available. Font names are the names used in the Mapbox Style object. If + * not provided, the font stack will be used as-is. This function can also be + * used for loading web fonts. + * @param {function(VectorLayer|VectorTileLayer, string):HTMLImageElement|HTMLCanvasElement|string|undefined} [getImage=undefined] + * Function that returns an image or a URL for an image name. If the result is an HTMLImageElement, it must already be + * loaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished. + * This function can be used for icons not in the sprite or to override sprite icons. + * @return {StyleFunction} Style function for use in + * `ol.layer.Vector` or `ol.layer.VectorTile`. + */ +export function stylefunction(olLayer: import("ol/layer").Vector | VectorTileLayer, glStyle: string | any, sourceOrLayers: string | Array, resolutions?: Array, spriteData?: any, spriteImageUrl?: string | Request | Promise, getFonts?: (arg0: Array, arg1: string | undefined) => Array, getImage?: ((arg0: import("ol/layer").Vector | VectorTileLayer, arg1: string) => HTMLImageElement | HTMLCanvasElement | string | undefined) | undefined, ...args: any[]): StyleFunction; +/** + * Get the the style for a specific Mapbox layer only. This can be useful for creating a legend. + * @param {import("ol/Feature").default|import("ol/render/Feature").default} feature OpenLayers feature. + * @param {number} resolution View resolution. + * @param {import("ol/layer").Vector|import("ol/layer").VectorTile} olLayer OpenLayers layer. + * @param {string} layerId Id of the Mapbox layer to get the style for + * @return {Array} Styles for the provided Mapbox layer. + */ +export function getStyleForLayer(feature: import("ol/Feature").default | import("ol/render/Feature").default, resolution: number, olLayer: import("ol/layer").Vector | import("ol/layer").VectorTile, layerId: string): Array; +export const styleFunctionArgs: {}; +export type VectorLayer = import("ol/layer").Vector; +export type VectorTileLayer = import("ol/layer/VectorTile").default; +export type StyleFunction = import("ol/style/Style").StyleFunction; +export type ResourceType = import('./util.js').ResourceType; +/** + * @private + * @param {?} color Color. + * @param {number} [opacity] Opacity. + * @return {string} Color. + */ +declare function colorWithOpacity(color: unknown, opacity?: number | undefined): string; +/** + * @private + * @param {string} layerId Layer id. + * @param {?} filter Filter. + * @param {Object} feature Feature. + * @param {number} zoom Zoom. + * @param {Object} [filterCache] Filter cache. + * @return {boolean} Filter result. + */ +declare function evaluateFilter(layerId: string, filter: unknown, feature: any, zoom: number, filterCache?: any): boolean; +/** + * @private + * @param {string} text Text. + * @param {Object} properties Properties. + * @return {string} Text. + */ +declare function fromTemplate(text: string, properties: any): string; +export { colorWithOpacity as _colorWithOpacity, evaluateFilter as _evaluateFilter, fromTemplate as _fromTemplate, getValue as _getValue }; diff --git a/dist/text.d.ts b/dist/text.d.ts new file mode 100644 index 00000000..2e57444a --- /dev/null +++ b/dist/text.d.ts @@ -0,0 +1,9 @@ +export function applyLetterSpacing(text: any, letterSpacing: any): any; +export function wrapText(text: any, font: any, em: any, letterSpacing: any): any; +/** + * @param {Array} fonts Fonts. + * @param {string} [templateUrl] Template URL. + * @return {Array} Processed fonts. + * @private + */ +export function getFonts(fonts: any[], templateUrl?: string | undefined): any[]; diff --git a/dist/util.d.ts b/dist/util.d.ts new file mode 100644 index 00000000..bc19bcc2 --- /dev/null +++ b/dist/util.d.ts @@ -0,0 +1,90 @@ +export function getStyleId(glStyle: any): any; +export function getStyleFunctionKey(glStyle: any, olLayer: any): string; +/** + * @param {Object} glStyle Mapboox style object. + * @return {Object} Function cache. + */ +export function getFunctionCache(glStyle: any): any; +export function clearFunctionCache(): void; +/** + * @param {Object} glStyle Mapboox style object. + * @return {Object} Filter cache. + */ +export function getFilterCache(glStyle: any): any; +export function deg2rad(degrees: any): number; +/** + * @param {number} width Width of the canvas. + * @param {number} height Height of the canvas. + * @return {HTMLCanvasElement} Canvas. + */ +export function createCanvas(width: number, height: number): HTMLCanvasElement; +export function getZoomForResolution(resolution: any, resolutions: any): number; +export function getResolutionForZoom(zoom: any, resolutions: any): number; +/** + * @param {ResourceType} resourceType Type of resource to load. + * @param {string} url Url of the resource. + * @param {Options} [options={}] Options. + * @param {{request?: Request}} [metadata] Object to be filled with the request. + * @return {Promise} Promise that resolves with the loaded resource + * or rejects with the Response object. + * @private + */ +export function fetchResource(resourceType: ResourceType, url: string, options?: import("./apply.js").Options | undefined, metadata?: { + request?: Request | undefined; +} | undefined): Promise; +export function getGlStyle(glStyleOrUrl: any, options: any): Promise; +/** + * @param {Object} glSource glStyle source object. + * @param {string} styleUrl Style URL. + * @param {Options} options Options. + * @return {Promise<{tileJson: Object, tileLoadFunction: import('ol/Tile.js').LoadFunction}?>} TileJson and load function + */ +export function getTileJson(glSource: any, styleUrl: string, options?: Options): Promise<{ + tileJson: any; + tileLoadFunction: import('ol/Tile.js').LoadFunction; +} | null>; +/** + * @param {HTMLImageElement|HTMLCanvasElement} spriteImage Sprite image id. + * @param {{x: number, y: number, width: number, height: number, pixelRatio: number}} spriteImageData Sprite image data. + * @param {number} haloWidth Halo width. + * @param {{r: number, g: number, b: number, a: number}} haloColor Halo color. + * @return {HTMLCanvasElement} Canvas element with the halo. + */ +export function drawIconHalo(spriteImage: HTMLImageElement | HTMLCanvasElement, spriteImageData: { + x: number; + y: number; + width: number; + height: number; + pixelRatio: number; +}, haloWidth: number, haloColor: { + r: number; + g: number; + b: number; + a: number; +}): HTMLCanvasElement; +/** + * @param {HTMLImageElement} image SDF image + * @param {{x: number, y: number, width: number, height: number}} area Area to unSDF + * @param {{r: number, g: number, b: number, a: number}} color Color to use + * @return {HTMLCanvasElement} Regular image + */ +export function drawSDF(image: HTMLImageElement, area: { + x: number; + y: number; + width: number; + height: number; +}, color: { + r: number; + g: number; + b: number; + a: number; +}): HTMLCanvasElement; +export const defaultResolutions: number[]; +export type ResourceType = 'Style' | 'Source' | 'Sprite' | 'SpriteImage' | 'Tiles' | 'GeoJSON'; +export type Map = import("ol").Map; +export type Layer = import("ol/layer").Layer; +export type LayerGroup = import("ol/layer").Group; +export type VectorLayer = import("ol/layer").Vector; +export type VectorTileLayer = import("ol/layer").VectorTile; +export type Source = import("ol/source").Source; +export type Options = import("./apply.js").Options;