UNPKG

556 BJavaScriptView Raw
1goog.require('ol.Map');
2goog.require('ol.View');
3goog.require('ol.interaction');
4goog.require('ol.interaction.PinchZoom');
5goog.require('ol.layer.Tile');
6goog.require('ol.source.OSM');
7
8
9var map = new ol.Map({
10 interactions: ol.interaction.defaults({pinchZoom: false}).extend([
11 new ol.interaction.PinchZoom({
12 constrainResolution: true // force zooming to a integer zoom
13 })
14 ]),
15 layers: [
16 new ol.layer.Tile({
17 source: new ol.source.OSM()
18 })
19 ],
20 target: 'map',
21 view: new ol.View({
22 center: [0, 0],
23 zoom: 2
24 })
25});