import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import MVT from '../src/ol/format/MVT.js'; import VectorTileLayer from '../src/ol/layer/VectorTile.js'; import VectorTileSource from '../src/ol/source/VectorTile.js'; import {Fill, Icon, Stroke, Style, Text} from '../src/ol/style.js'; const key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q'; const map = new Map({ layers: [ new VectorTileLayer({ declutter: true, source: new VectorTileSource({ attributions: '© Mapbox ' + '© ' + 'OpenStreetMap contributors', format: new MVT(), url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' + '{z}/{x}/{y}.vector.pbf?access_token=' + key }), style: createMapboxStreetsV6Style(Style, Fill, Stroke, Icon, Text) }) ], target: 'map', view: new View({ center: [0, 0], zoom: 2 }) });