import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_control_ from '../src/ol/control.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; var map = new _ol_Map_({ layers: [ new _ol_layer_Tile_({ source: new _ol_source_OSM_() }) ], controls: _ol_control_.defaults({ attributionOptions: { collapsible: false } }), view: new _ol_View_({ center: [0, 0], zoom: 2 }) }); map.setTarget('map1'); var teleportButton = document.getElementById('teleport'); teleportButton.addEventListener('click', function() { var target = map.getTarget() === 'map1' ? 'map2' : 'map1'; map.setTarget(target); }, false);