In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
26 lines
654 B
JavaScript
26 lines
654 B
JavaScript
import Map from '../src/ol/Map.js';
|
|
import View from '../src/ol/View.js';
|
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
|
import MouseWheelZoom from '../src/ol/interaction/MouseWheelZoom.js';
|
|
import TileLayer from '../src/ol/layer/Tile.js';
|
|
import OSM from '../src/ol/source/OSM.js';
|
|
|
|
|
|
const map = new Map({
|
|
interactions: defaultInteractions({mouseWheelZoom: false}).extend([
|
|
new MouseWheelZoom({
|
|
constrainResolution: true // force zooming to a integer zoom
|
|
})
|
|
]),
|
|
layers: [
|
|
new TileLayer({
|
|
source: new OSM()
|
|
})
|
|
],
|
|
target: 'map',
|
|
view: new View({
|
|
center: [0, 0],
|
|
zoom: 2
|
|
})
|
|
});
|