In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import Map from '../src/ol/Map.js';
|
|
import View from '../src/ol/View.js';
|
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
|
import TileLayer from '../src/ol/layer/Tile.js';
|
|
import OSM from '../src/ol/source/OSM.js';
|
|
|
|
|
|
const openCycleMapLayer = new TileLayer({
|
|
source: new OSM({
|
|
attributions: [
|
|
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
|
OSM.ATTRIBUTION
|
|
],
|
|
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
|
|
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
|
|
})
|
|
});
|
|
|
|
const openSeaMapLayer = new TileLayer({
|
|
source: new OSM({
|
|
attributions: [
|
|
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
|
|
OSM.ATTRIBUTION
|
|
],
|
|
opaque: false,
|
|
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
|
})
|
|
});
|
|
|
|
|
|
const map = new Map({
|
|
layers: [
|
|
openCycleMapLayer,
|
|
openSeaMapLayer
|
|
],
|
|
target: 'map',
|
|
controls: defaultControls({
|
|
attributionOptions: {
|
|
collapsible: false
|
|
}
|
|
}),
|
|
view: new View({
|
|
maxZoom: 18,
|
|
center: [-244780.24508882355, 5986452.183179816],
|
|
zoom: 15
|
|
})
|
|
});
|