In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
35 lines
753 B
JavaScript
35 lines
753 B
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 ScaleLine from '../src/ol/control/ScaleLine.js';
|
|
import TileLayer from '../src/ol/layer/Tile.js';
|
|
import TileWMS from '../src/ol/source/TileWMS.js';
|
|
|
|
|
|
const layers = [
|
|
new TileLayer({
|
|
source: new TileWMS({
|
|
url: 'https://ahocevar.com/geoserver/wms',
|
|
params: {
|
|
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
|
|
'TILED': true
|
|
}
|
|
})
|
|
})
|
|
];
|
|
|
|
const map = new Map({
|
|
controls: defaultControls().extend([
|
|
new ScaleLine({
|
|
units: 'degrees'
|
|
})
|
|
]),
|
|
layers: layers,
|
|
target: 'map',
|
|
view: new View({
|
|
projection: 'EPSG:4326',
|
|
center: [0, 0],
|
|
zoom: 2
|
|
})
|
|
});
|