Applies properties of the Mapbox/MapLibre Style's first background layer to the provided map or layer (group).
background
Example:
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'); Copy
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');
OpenLayers Map or layer (group).
Mapbox/MapLibre Style object or url.
Options.
Promise that resolves when the background is applied.
Applies properties of the Mapbox/MapLibre Style's first
background
layer to the provided map or layer (group).Example: