Files
openlayers/examples/canvas-tiles.js
Tim Schaub ad62739a6e Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
2018-01-12 00:50:30 -07:00

34 lines
793 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 TileLayer from '../src/ol/layer/Tile.js';
import {fromLonLat} from '../src/ol/proj.js';
import OSM from '../src/ol/source/OSM.js';
import TileDebug from '../src/ol/source/TileDebug.js';
const osmSource = new OSM();
const map = new Map({
layers: [
new TileLayer({
source: osmSource
}),
new TileLayer({
source: new TileDebug({
projection: 'EPSG:3857',
tileGrid: osmSource.getTileGrid()
})
})
],
target: 'map',
controls: defaultControls({
attributionOptions: {
collapsible: false
}
}),
view: new View({
center: fromLonLat([-0.1275, 51.507222]),
zoom: 10
})
});