To have the same path (starting with `ol/`, without `.js`) as in the documentation. The support was added in the webpack config in #8928
27 lines
489 B
JavaScript
27 lines
489 B
JavaScript
import Map from 'ol/Map';
|
|
import View from 'ol/View';
|
|
import TileLayer from 'ol/layer/Tile';
|
|
import OSM from 'ol/source/OSM';
|
|
|
|
const map = new Map({
|
|
layers: [
|
|
new TileLayer({
|
|
source: new OSM()
|
|
})
|
|
],
|
|
target: 'map',
|
|
view: new View({
|
|
center: [-8730000, 5930000],
|
|
rotation: Math.PI / 5,
|
|
zoom: 8
|
|
})
|
|
});
|
|
|
|
|
|
$('.ol-zoom-in, .ol-zoom-out').tooltip({
|
|
placement: 'right'
|
|
});
|
|
$('.ol-rotate-reset, .ol-attribution button[title]').tooltip({
|
|
placement: 'left'
|
|
});
|