{"analyzedAt":"2023-01-03T08:22:46.566Z","collected":{"metadata":{"name":"ol-mapbox-style","scope":"unscoped","version":"9.4.0","description":"Create OpenLayers maps from Mapbox Style objects","keywords":["openlayers","mapbox","vector tiles"],"date":"2023-01-03T08:22:22.924Z","publisher":{"username":"ahocevar","email":"andreas.hocevar@gmail.com"},"maintainers":[{"username":"ahocevar","email":"andreas.hocevar@gmail.com"},{"username":"tschaub","email":"tim.schaub@gmail.com"},{"username":"fredj","email":"frederic.junod@gmail.com"},{"username":"bartvde","email":"bartvde@boundlessgeo.com"}],"repository":{"type":"git","url":"git://github.com/openlayers/ol-mapbox-style.git"},"links":{"npm":"https://www.npmjs.com/package/ol-mapbox-style","homepage":"https://github.com/openlayers/ol-mapbox-style#readme","repository":"https://github.com/openlayers/ol-mapbox-style","bugs":"https://github.com/openlayers/ol-mapbox-style/issues"},"license":"BSD-2-Clause","dependencies":{"@mapbox/mapbox-gl-style-spec":"^13.23.1","mapbox-to-css-font":"^2.4.1"},"devDependencies":{"@mapbox/flow-remove-types":"^2.0.0","@rollup/plugin-buble":"^1.0.1","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-node-resolve":"^15.0.1","@types/arcgis-rest-api":"^10.4.4","@types/mocha":"^10.0.0","@types/offscreencanvas":"^2019.6.4","@types/topojson-specification":"^1.0.1","add-text-to-markdown":"^2.0.0","babel-loader":"^9.1.0","buble":"^0.20.0","buble-loader":"^0.5.1","concat-md":"^0.5.0","copy-webpack-plugin":"^11.0.0","coverage-istanbul-loader":"^3.0.5","cross-env":"^7.0.3","css-loader":"^6.5.1","deep-freeze":"0.0.1","eslint":"^8.2.0","eslint-config-openlayers":"^17.0.0","eslint-import-resolver-alias":"^1.1.2","html-webpack-plugin":"^5.5.0","karma":"^6.3.4","karma-chrome-launcher":"^3.1.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-mocha":"^2.0.1","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^5.0.0","mapbox-gl-styles":"^2.0.2","mini-css-extract-plugin":"^2.4.4","mocha":"^10.0.0","nanoassert":"^2.0.0","ol":"^7.2.3-dev.1672696068643","puppeteer":"^19.2.2","remove-flow-types-loader":"^1.1.0","rollup":"^2.70.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-unassert":"^0.5.0","should":"^13.2.3","sinon":"^15.0.1","style-loader":"^3.3.1","typedoc":"^0.23.10","typedoc-plugin-markdown":"^3.13.4","typedoc-plugin-missing-exports":"^1.0.0","typescript":"^4.6.0-beta","webpack":"^5.62.1","webpack-cli":"^5.0.0","webpack-dev-server":"^4.4.0"},"releases":[{"from":"2022-12-04T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":1},{"from":"2022-10-05T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":5},{"from":"2022-07-07T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":10},{"from":"2022-01-03T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":29},{"from":"2021-01-03T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":42}],"hasTestScript":true,"readme":"# ol-mapbox-style\n\nCreate [OpenLayers](https://openlayers.org/) maps from [Mapbox Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/) objects.\n\n## Getting started\n\nGet an impression of what this library does by exploring the [live examples](https://unpkg.com/ol-mapbox-style/dist/examples/index.html). \n\n### Installation\n\nTo use the library in an application with an npm based dev environment, install it with\n\n    npm install ol-mapbox-style\n\nWhen installed this way, just import the ol-mapbox-style module, like in the usage example below. To use a standalone build of ol-mapbox-style, just include 'dist/olms.js' on your HTML page, and access the exported functions from the global `olms` object (e.g. `olms.apply()`, `olms.applyBackground()`). Note that the standalone build depends on the full build of OpenLayers.\n\n**ol-mapbox-style v9 requires [OpenLayers](https://npmjs.com/package/ol) version >= 7 &lt; 8**.\n\n**ol-mapbox-style v8 requires [OpenLayers](https://npmjs.com/package/ol) version >= 6.13.0 &lt; 7**.\n\n### Usage\n\n**See the [API](#api) section for the full documentation.**\n\nThe code below creates an OpenLayers map from Mapbox's Bright v9 style, using a `https://` url:\n\n```js\nimport { apply } from 'ol-mapbox-style';\n\napply('map', 'https://api.mapbox.com/styles/v1/mapbox/bright-v9?access_token=YOUR_MAPBOX_TOKEN');\n```\n\nTo assign style and source to a layer only, use `applyStyle()`. `mapbox://` urls are also supported:\n\n```js\nimport {applyStyle} from 'ol-mapbox-style';\nimport VectorTileLayer from 'ol/layer/VectorTile.js'\n\nconst layer = new VectorTileLayer({declutter: true});\napplyStyle(layer, 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});\n```\n\nTo apply the properties of the Mapbox Style's `background` layer to the map or a `VectorTile` layer, use the `applyBackground()` function.\n\nThere is also a low-level API available. To create a style function for individual OpenLayers vector or vector tile layers, use the `stylefunction` module:\n\n```js\nimport {stylefunction} from 'ol-mapbox-style';\nimport VectorLayer from 'ol/layer/Vector.js';\nimport VectorSource from 'ol/source/Vector.js';\nimport GeoJSON from 'ol/format/GeoJSON.js';\n\nconst layer = new VectorLayer({\n  source: new VectorSource({\n    format: new GeoJSON(),\n    url: 'data/states.geojson'\n  })\n});\n\nfetch('data/states.json').then(function(response) {\n  response.json().then(function(glStyle) {\n    stylefunction(layer, glStyle, 'states');\n  });\n});\n```\n\nNote that this low-level API does not create a source for the layer, and extra work is required to set up sprite handling for styles that use icons.\n\n## Compatibility notes\n\n### Font handling\n\nOnly commonly available system fonts and [Google Fonts](https://developers.google.com/fonts/) will automatically be available for any `text-font` defined in the Mapbox Style object. It is the responsibility of the application to load other fonts. Because `ol-mapbox-style` uses system and web fonts instead of PBF/SDF glyphs, the [font stack](https://www.mapbox.com/help/manage-fontstacks/) is treated a little different: style and weight are taken from the primary font (i.e. the first one in the font stack). Subsequent fonts in the font stack are only used if the primary font is not available/loaded, and they will be used with the style and weight of the primary font.\n\n## Building the library\n\n    npm run build\n\nThe resulting distribution files will be in the `dist/` folder. To see the library in action, navigate to `dist/index.html`.\n\nTo run test locally, run\n\n    npm test\n\nFor debugging tests in the browser, run\n\n    npm run karma\n\nand open a browser on the host and port indicated in the console output (usually <http://localhost:9876/>) and click the 'DEBUG' button to go to the debug environment.\n\n[![Test Job](https://github.com/openlayers/ol-mapbox-style/actions/workflows/test.yml/badge.svg)](https://github.com/openlayers/ol-mapbox-style/actions/workflows/test.yml)\n\n# API\n\n<a name=\"readmemd\"></a>\n\n## ol-mapbox-style\n\n### Table of contents\n\n#### References\n\n- [default](#default)\n\n#### Modules\n\n- [&lt;internal\\\\>](#modulesinternal_md)\n\n#### Functions\n\n- [apply](#apply)\n- [applyBackground](#applyBackground)\n- [applyStyle](#applyStyle)\n- [getFeatureState](#getFeatureState)\n- [getLayer](#getLayer)\n- [getLayers](#getLayers)\n- [getSource](#getSource)\n- [recordStyleLayer](#recordStyleLayer)\n- [renderTransparent](#renderTransparent)\n- [setFeatureState](#setFeatureState)\n- [stylefunction](#stylefunction)\n\n### References\n\n#### default\n\nRenames and re-exports [apply](#apply)\n\n### Functions\n\n#### apply\n\n▸ **apply**(`mapOrGroup`, `style`, `options?`): `Promise`&lt;`Map` \\| `LayerGroup`>\n\nLoads and applies a Mapbox Style object into an OpenLayers Map or LayerGroup.\nThis includes the map background, the layers, and for Map instances that did not\nhave a View defined yet also the center and the zoom.\n\n**Example:**\n\n```js\nimport apply from 'ol-mapbox-style';\n\napply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});\n```\n\nThe center and zoom will only be set if present in the Mapbox Style document,\nand if not already set on the OpenLayers map.\n\nLayers will be added to the OpenLayers map, without affecting any layers that\nmight already be set on the map.\n\nLayers 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\nThis function sets an additional `mapbox-style` property on the OpenLayers\nMap or LayerGroup instance, which holds the Mapbox Style object.\n\n##### Parameters\n\n| Name         | Type                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n| :----------- | :------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `mapOrGroup` | `string` \\| `HTMLElement` \\| `Map` \\| `LayerGroup` | 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.                                                                                                                                                                                                                                                                                                                                    |\n| `style`      | `any`                                              | 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. |\n| `options`    | [`Options`](#interfacesinternal_optionsmd)         | Options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n\n##### Returns\n\n`Promise`&lt;`Map` \\| `LayerGroup`>\n\nA promise that resolves after all layers have been added to\nthe 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\nargument.\n\n* * *\n\n#### applyBackground\n\n▸ **applyBackground**(`mapOrLayer`, `glStyle`, `options?`): `Promise`&lt;`any`>\n\nApplies properties of the Mapbox Style's first `background` layer to the\nprovided map or VectorTile layer.\n\n**Example:**\n\n```js\nimport {applyBackground} from 'ol-mapbox-style';\nimport {Map} from 'ol';\n\nconst map = new Map({target: 'map'});\napplyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');\n```\n\n##### Parameters\n\n| Name         | Type                                       | Description                         |\n| :----------- | :----------------------------------------- | :---------------------------------- |\n| `mapOrLayer` | `VectorTileLayer` \\| `Map`                 | OpenLayers Map or VectorTile layer. |\n| `glStyle`    | `any`                                      | Mapbox Style object or url.         |\n| `options`    | [`Options`](#interfacesinternal_optionsmd) | Options.                            |\n\n##### Returns\n\n`Promise`&lt;`any`>\n\nPromise that resolves when the background is applied.\n\n* * *\n\n#### applyStyle\n\n▸ **applyStyle**(`layer`, `glStyle`, `sourceOrLayersOrOptions?`, `optionsOrPath?`, `resolutions?`): `Promise`&lt;`any`>\n\nApplies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector`\nwith an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source\nyet, it will be created and populated from the information in the `glStyle`.\n\n**Example:**\n\n```js\nimport {applyStyle} from 'ol-mapbox-style';\nimport {VectorTile} from 'ol/layer.js';\n\nconst layer = new VectorTile({declutter: true});\napplyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');\n```\n\nThe style function will render all layers from the `glStyle` object that use the source\nof the first layer, the specified `source`, or a subset of layers from the same source. The\nsource needs to be a `\"type\": \"vector\"` or `\"type\": \"geojson\"` source.\n\nTwo 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##### Parameters\n\n| Name                       | Type                                                                                                                                   | Default value | Description                                                                                                                                                                                                                                                                                                                                                                                       |\n| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `layer`                    | `VectorLayer`&lt;`any`> \\| `VectorTileLayer`                                                                                           | `undefined`   | 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`, `tileUrlFunction` and `tileGrid` (exception: when the source projection is not `EPSG:3857`).                                                       |\n| `glStyle`                  | `any`                                                                                                                                  | `undefined`   | Mapbox Style object.                                                                                                                                                                                                                                                                                                                                                                              |\n| `sourceOrLayersOrOptions?` | `string` \\| `string`\\[] \\| [`Options`](#interfacesinternal_optionsmd) & [`ApplyStyleOptions`](#interfacesinternal_applystyleoptionsmd) | `''`          | 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. |\n| `optionsOrPath?`           | `string` \\| [`Options`](#interfacesinternal_optionsmd)                                                                                 | `{}`          | **Deprecated**. Options. Alternatively the path of the style file (only required when a relative path is used for the `\"sprite\"` property of the style).                                                                                                                                                                                                                                          |\n| `resolutions?`             | `number`\\[]                                                                                                                            | `undefined`   | **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.                                                                                                                                                                                                                        |\n\n##### Returns\n\n`Promise`&lt;`any`>\n\nPromise which will be resolved when the style can be used\nfor rendering.\n\n* * *\n\n#### getFeatureState\n\n▸ **getFeatureState**(`mapOrLayer`, `feature`): `any`\n\nSets or removes a feature state. The feature state is taken into account for styling,\njust like the feature's properties, and can be used e.g. to conditionally render selected\nfeatures differently.\n\n##### Parameters\n\n| Name         | Type                                                           | Description                               |\n| :----------- | :------------------------------------------------------------- | :---------------------------------------- |\n| `mapOrLayer` | `VectorLayer`&lt;`any`> \\| `VectorTileLayer` \\| `Map`          | Map or layer to set the feature state on. |\n| `feature`    | [`FeatureIdentifier`](#interfacesinternal_featureidentifiermd) | Feature identifier.                       |\n\n##### Returns\n\n`any`\n\nFeature state or `null` when no feature state is set for the given\nfeature identifier.\n\n* * *\n\n#### getLayer\n\n▸ **getLayer**(`map`, `layerId`): `Layer`&lt;`Source`, `LayerRenderer`&lt;`any`>>\n\nGet the OpenLayers layer instance that contains the provided Mapbox Style\n`layer`. Note that multiple Mapbox Style layers are combined in a single\nOpenLayers layer instance when they use the same Mapbox Style `source`.\n\n##### Parameters\n\n| Name      | Type                  | Description                   |\n| :-------- | :-------------------- | :---------------------------- |\n| `map`     | `Map` \\| `LayerGroup` | OpenLayers Map or LayerGroup. |\n| `layerId` | `string`              | Mapbox Style layer id.        |\n\n##### Returns\n\n`Layer`&lt;`Source`, `LayerRenderer`&lt;`any`>>\n\nOpenLayers layer instance.\n\n* * *\n\n#### getLayers\n\n▸ **getLayers**(`map`, `sourceId`): `Layer`&lt;`Source`, `LayerRenderer`&lt;`any`>>\\[]\n\nGet the OpenLayers layer instances for the provided Mapbox Style `source`.\n\n##### Parameters\n\n| Name       | Type                  | Description                   |\n| :--------- | :-------------------- | :---------------------------- |\n| `map`      | `Map` \\| `LayerGroup` | OpenLayers Map or LayerGroup. |\n| `sourceId` | `string`              | Mapbox Style source id.       |\n\n##### Returns\n\n`Layer`&lt;`Source`, `LayerRenderer`&lt;`any`>>\\[]\n\nOpenLayers layer instances.\n\n* * *\n\n#### getSource\n\n▸ **getSource**(`map`, `sourceId`): `Source`\n\nGet the OpenLayers source instance for the provided Mapbox Style `source`.\n\n##### Parameters\n\n| Name       | Type                  | Description                   |\n| :--------- | :-------------------- | :---------------------------- |\n| `map`      | `Map` \\| `LayerGroup` | OpenLayers Map or LayerGroup. |\n| `sourceId` | `string`              | Mapbox Style source id.       |\n\n##### Returns\n\n`Source`\n\nOpenLayers source instance.\n\n* * *\n\n#### recordStyleLayer\n\n▸ **recordStyleLayer**(`record?`): `void`\n\nTurns recording of the Mapbox Style's `layer` on and off. When turned on,\nthe layer that a rendered feature belongs to will be set as the feature's\n`mapbox-layer` property.\n\n##### Parameters\n\n| Name     | Type      | Default value | Description                         |\n| :------- | :-------- | :------------ | :---------------------------------- |\n| `record` | `boolean` | `false`       | Recording of the style layer is on. |\n\n##### Returns\n\n`void`\n\n* * *\n\n#### renderTransparent\n\n▸ **renderTransparent**(`enabled`): `void`\n\nConfigure whether features with a transparent style should be rendered. When\nset to `true`, it will be possible to hit detect content that is not visible,\nlike transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or\n`ol/Map#getFeaturesAtPixel()`\n\n##### Parameters\n\n| Name      | Type      | Description                                                       |\n| :-------- | :-------- | :---------------------------------------------------------------- |\n| `enabled` | `boolean` | Rendering of transparent elements is enabled. Default is `false`. |\n\n##### Returns\n\n`void`\n\n* * *\n\n#### setFeatureState\n\n▸ **setFeatureState**(`mapOrLayer`, `feature`, `state`): `void`\n\nSets or removes a feature state. The feature state is taken into account for styling,\njust like the feature's properties, and can be used e.g. to conditionally render selected\nfeatures differently.\n\nThe feature state will be stored on the OpenLayers layer matching the feature identifier, in the\n`mapbox-featurestate` property.\n\n##### Parameters\n\n| Name         | Type                                                           | Description                                               |\n| :----------- | :------------------------------------------------------------- | :-------------------------------------------------------- |\n| `mapOrLayer` | `VectorLayer`&lt;`any`> \\| `VectorTileLayer` \\| `Map`          | OpenLayers Map or layer to set the feature state on.      |\n| `feature`    | [`FeatureIdentifier`](#interfacesinternal_featureidentifiermd) | Feature identifier.                                       |\n| `state`      | `any`                                                          | Feature state. Set to `null` to remove the feature state. |\n\n##### Returns\n\n`void`\n\n* * *\n\n#### stylefunction\n\n▸ **stylefunction**(`olLayer`, `glStyle`, `sourceOrLayers`, `resolutions?`, `spriteData?`, `spriteImageUrl?`, `getFonts?`, `getImage?`): `StyleFunction`\n\nCreates a style function from the `glStyle` object for all layers that use\nthe specified `source`, which needs to be a `\"type\": \"vector\"` or\n`\"type\": \"geojson\"` source and applies it to the specified OpenLayers layer.\n\nTwo 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\nThis function also works in a web worker. In worker mode, the main thread needs\nto listen to messages from the worker and respond with another message to make\nsure 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##### Parameters\n\n| Name             | Type                                                                                                                              | Default value        | Description                                                                                                                                                                                                                                                                                                             |\n| :--------------- | :-------------------------------------------------------------------------------------------------------------------------------- | :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `olLayer`        | `VectorLayer`&lt;`any`> \\| `VectorTileLayer`                                                                                      | `undefined`          | 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.                                                        |\n| `glStyle`        | `any`                                                                                                                             | `undefined`          | Mapbox Style object.                                                                                                                                                                                                                                                                                                    |\n| `sourceOrLayers` | `string` \\| `string`\\[]                                                                                                           | `undefined`          | `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.                                                    |\n| `resolutions`    | `number`\\[]                                                                                                                       | `defaultResolutions` | Resolutions for mapping resolution to zoom level.                                                                                                                                                                                                                                                                       |\n| `spriteData`     | `any`                                                                                                                             | `undefined`          | 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.                                                                                                                                                        |\n| `spriteImageUrl` | `string`                                                                                                                          | `undefined`          | 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.                                                                                                                                                 |\n| `getFonts`       | (`arg0`: `string`\\[]) => `string`\\[]                                                                                              | `undefined`          | Function that receives a font stack 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.                                            |\n| `getImage?`      | (`arg0`: `VectorLayer`&lt;`any`> \\| `VectorTileLayer`, `arg1`: `string`) => `string` \\| `HTMLCanvasElement` \\| `HTMLImageElement` | `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. |\n\n##### Returns\n\n`StyleFunction`\n\nStyle function for use in\n`ol.layer.Vector` or `ol.layer.VectorTile`.\n\n<a name=\"interfacesinternal_applystyleoptionsmd\"></a>\n\n## Interface: ApplyStyleOptions&lt;>\n\n[<internal>](#modulesinternal_md).ApplyStyleOptions\n\n### Table of contents\n\n#### Properties\n\n- [layers](#layers)\n- [source](#source)\n\n### Properties\n\n#### layers\n\n• **layers**: `string`\\[]\n\nLayers. If no source is provided, the layers with the\nprovided ids will be used from the style's `layers` array. All layers need to use the same source.\n\n* * *\n\n#### source\n\n• **source**: `string`\n\nSource. Default is `''`, which causes the first source in the\nstyle to be used.\n\n<a name=\"interfacesinternal_featureidentifiermd\"></a>\n\n## Interface: FeatureIdentifier&lt;>\n\n[<internal>](#modulesinternal_md).FeatureIdentifier\n\n### Table of contents\n\n#### Properties\n\n- [id](#id)\n- [source](#source)\n\n### Properties\n\n#### id\n\n• **id**: `string` \\| `number`\n\nThe feature id.\n\n* * *\n\n#### source\n\n• **source**: `string`\n\nThe source id.\n\n<a name=\"interfacesinternal_optionsmd\"></a>\n\n## Interface: Options&lt;>\n\n[<internal>](#modulesinternal_md).Options\n\n### Table of contents\n\n#### Properties\n\n- [accessToken](#accessToken)\n- [accessTokenParam](#accessTokenParam)\n- [getImage](#getImage)\n- [resolutions](#resolutions)\n- [styleUrl](#styleUrl)\n- [transformRequest](#transformRequest)\n\n### Properties\n\n#### accessToken\n\n• **accessToken**: `string`\n\nAccess token for 'mapbox://' urls.\n\n* * *\n\n#### accessTokenParam\n\n• **accessTokenParam**: `string`\n\nAccess token param. For internal use.\n\n* * *\n\n#### getImage\n\n• **getImage**: (`arg0`: `VectorLayer`&lt;`any`> \\| `VectorTileLayer`, `arg1`: `string`) => `string` \\| `HTMLCanvasElement` \\| `HTMLImageElement`\n\n##### Type declaration\n\n▸ (`arg0`, `arg1`): `string` \\| `HTMLCanvasElement` \\| `HTMLImageElement`\n\nFunction that returns an image for an icon name. If the result is an HTMLImageElement, it must already be\nloaded. The layer can be used to call layer.changed() when the loading and processing of the image has finished.\nThis function be used for icons not in the sprite or to override sprite icons.\n\n###### Parameters\n\n| Name   | Type                                         |\n| :----- | :------------------------------------------- |\n| `arg0` | `VectorLayer`&lt;`any`> \\| `VectorTileLayer` |\n| `arg1` | `string`                                     |\n\n###### Returns\n\n`string` \\| `HTMLCanvasElement` \\| `HTMLImageElement`\n\n* * *\n\n#### resolutions\n\n• **resolutions**: `number`\\[]\n\nResolutions for mapping resolution to zoom level.\nOnly needed when working with non-standard tile grids or projections.\n\n* * *\n\n#### styleUrl\n\n• **styleUrl**: `string`\n\nURL of the Mapbox GL style. Required for styles that were provided\nas object, when they contain a relative sprite url, or sources referencing data by relative url.\n\n* * *\n\n#### transformRequest\n\n• **transformRequest**: (`arg0`: `string`, `arg1`: [`ResourceType`](#ResourceType)) => `void` \\| `Request`\n\n##### Type declaration\n\n▸ (`arg0`, `arg1`): `void` \\| `Request`\n\nFunction for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying\nthe url, adding headers or setting credentials options. Called with the url and the resource\ntype as arguments, this function is supposed to return a `Request` object. Without a return value,\nthe original request will not be modified. For `Tiles` and `GeoJSON` resources, only the `url` of\nthe returned request will be respected.\n\n###### Parameters\n\n| Name   | Type                            |\n| :----- | :------------------------------ |\n| `arg0` | `string`                        |\n| `arg1` | [`ResourceType`](#ResourceType) |\n\n###### Returns\n\n`void` \\| `Request`\n\n<a name=\"modulesinternal_md\"></a>\n\n## Module: &lt;internal>\n\n### Table of contents\n\n#### Interfaces\n\n- [ApplyStyleOptions](#interfacesinternal_applystyleoptionsmd)\n- [FeatureIdentifier](#interfacesinternal_featureidentifiermd)\n- [Options](#interfacesinternal_optionsmd)\n\n#### Type Aliases\n\n- [ResourceType](#ResourceType)\n\n### Type Aliases\n\n#### ResourceType\n\nƬ **ResourceType**&lt;>: `\"Style\"` \\| `\"Source\"` \\| `\"Sprite\"` \\| `\"SpriteImage\"` \\| `\"Tiles\"` \\| `\"GeoJSON\"`"},"npm":{"downloads":[{"from":"2023-01-02T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":11260},{"from":"2022-12-27T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":57543},{"from":"2022-12-04T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":437743},{"from":"2022-10-05T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":1495733},{"from":"2022-07-07T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":2826792},{"from":"2022-01-03T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":5231132}],"starsCount":0},"github":{"homepage":"https://unpkg.com/ol-mapbox-style/dist/examples/index.html","starsCount":269,"forksCount":101,"subscribersCount":35,"issues":{"count":776,"openCount":49,"distribution":{"3600":241,"10800":68,"32400":65,"97200":71,"291600":84,"874800":100,"2624400":48,"7873200":30,"23619600":17,"70858800":12,"212576400":40},"isDisabled":false},"contributors":[{"username":"ahocevar","commitsCount":474},{"username":"dependabot[bot]","commitsCount":230},{"username":"fredj","commitsCount":19},{"username":"mike-000","commitsCount":14},{"username":"AlenKelemen","commitsCount":12},{"username":"fleur","commitsCount":9},{"username":"tschaub","commitsCount":7},{"username":"cns-solutions-admin","commitsCount":7},{"username":"theduckylittle","commitsCount":6},{"username":"GD-Aichi","commitsCount":6},{"username":"V-Roger","commitsCount":6},{"username":"chrismayer","commitsCount":5},{"username":"pakb","commitsCount":5},{"username":"petrsloup","commitsCount":4},{"username":"bovandersteene","commitsCount":4},{"username":"egaoneko","commitsCount":3},{"username":"tbarsballe","commitsCount":2},{"username":"songyumeng","commitsCount":2},{"username":"frankrowe","commitsCount":2},{"username":"HarelM","commitsCount":2},{"username":"eliask","commitsCount":2},{"username":"mikeydunnx","commitsCount":2},{"username":"M393","commitsCount":2},{"username":"ChristianKohler","commitsCount":2},{"username":"walkermatt","commitsCount":2},{"username":"ejn","commitsCount":2},{"username":"aberenyi","commitsCount":1},{"username":"Adrien-Atmosphere","commitsCount":1},{"username":"erictheise","commitsCount":1},{"username":"joux3","commitsCount":1},{"username":"Romaxx","commitsCount":1},{"username":"Jared-Miller","commitsCount":1},{"username":"scadergit","commitsCount":1},{"username":"irvingvjuarez","commitsCount":1}],"commits":[{"from":"2022-12-27T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":1},{"from":"2022-12-04T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":32},{"from":"2022-10-05T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":67},{"from":"2022-07-07T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":151},{"from":"2022-01-03T00:00:00.000Z","to":"2023-01-03T00:00:00.000Z","count":336}]},"source":{"files":{"readmeSize":31588,"testsSize":1590135,"hasNpmIgnore":true,"hasChangelog":true},"linters":["editorconfig","eslint"]}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.6,"health":1,"branding":0},"popularity":{"communityInterest":439,"downloadsCount":498577.6666666667,"downloadsAcceleration":408.0240867579905,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":1,"openIssues":1,"issuesDistribution":0.2748709919039786}},"score":{"final":0.6678597158973153,"detail":{"quality":0.9323791309610258,"popularity":0.2824122791121919,"maintenance":0.8265762254849727}}}