Files
openlayers/examples/pinch-zoom.js
Frederic Junod 4a3f70c09b Revert "Simplify import path in examples"
This reverts commit 79c8afdba8.
2018-11-27 16:49:55 +01:00

25 lines
585 B
JavaScript

import Map from '../src/ol/Map.js';
import View from '../src/ol/View.js';
import {defaults as defaultInteractions, PinchZoom} from '../src/ol/interaction.js';
import TileLayer from '../src/ol/layer/Tile.js';
import OSM from '../src/ol/source/OSM.js';
const map = new Map({
interactions: defaultInteractions({pinchZoom: false}).extend([
new PinchZoom({
constrainResolution: true // force zooming to a integer zoom
})
]),
layers: [
new TileLayer({
source: new OSM()
})
],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2
})
});