1 | goog.require('ol.Map');
|
2 | goog.require('ol.View');
|
3 | goog.require('ol.interaction');
|
4 | goog.require('ol.interaction.PinchZoom');
|
5 | goog.require('ol.layer.Tile');
|
6 | goog.require('ol.source.OSM');
|
7 |
|
8 |
|
9 | var map = new ol.Map({
|
10 | interactions: ol.interaction.defaults({pinchZoom: false}).extend([
|
11 | new ol.interaction.PinchZoom({
|
12 | constrainResolution: true
|
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 | });
|