Files
openlayers/examples/navigation-controls.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

33 lines
698 B
JavaScript

goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.control.ZoomToExtent');
goog.require('ol.control.defaults');
goog.require('ol.layer.TileLayer');
goog.require('ol.source.OSM');
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.ZoomToExtent({
extent: [
813079.7791264898,
848966.9639063801,
5929220.284081122,
5936863.986909639
]
})
]),
layers: [
new ol.layer.TileLayer({
source: new ol.source.OSM()
})
],
renderers: ol.RendererHints.createFromQueryData(),
target: 'map',
view: new ol.View2D({
center: [0, 0],
zoom: 2
})
});