Files
openlayers/examples/full-screen-drag-rotate-and-zoom.js
Éric Lemoine 3f6b9c9434 Use ol.Collection#extend in examples
This commit changes the examples to using ol.control.defaults().extend to extend the collection of controls. This is in preparation for a future commit that will remove the 2nd argument to ol.control.defaults. The same is done for ol.interaction.defaults.
2013-08-19 14:25:38 +02:00

36 lines
959 B
JavaScript

goog.require('ol.Map');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.control.FullScreen');
goog.require('ol.control.defaults');
goog.require('ol.interaction.DragRotateAndZoom');
goog.require('ol.interaction.defaults');
goog.require('ol.layer.TileLayer');
goog.require('ol.source.BingMaps');
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.FullScreen()
]),
interactions: ol.interaction.defaults().extend([
new ol.interaction.DragRotateAndZoom()
]),
layers: [
new ol.layer.TileLayer({
source: new ol.source.BingMaps({
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
style: 'Aerial'
})
})
],
// Use the canvas renderer because it's currently the fastest
renderer: ol.RendererHint.CANVAS,
target: 'map',
view: new ol.View2D({
center: [-33519607, 5616436],
rotation: -Math.PI / 8,
zoom: 8
})
});