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.
This commit is contained in:
@@ -64,7 +64,7 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
|
|||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new app.RotateNorthControl()
|
new app.RotateNorthControl()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ goog.require('ol.source.MapQuestOpenAerial');
|
|||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
interactions: ol.interaction.defaults({}, [
|
interactions: ol.interaction.defaults().extend([
|
||||||
new ol.interaction.DragRotateAndZoom()
|
new ol.interaction.DragRotateAndZoom()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ var layers = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new ol.control.ScaleLine({
|
new ol.control.ScaleLine({
|
||||||
units: ol.control.ScaleLineUnits.DEGREES
|
units: ol.control.ScaleLineUnits.DEGREES
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ goog.require('ol.source.BingMaps');
|
|||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new ol.control.FullScreen()
|
new ol.control.FullScreen()
|
||||||
]),
|
]),
|
||||||
interactions: ol.interaction.defaults({}, [
|
interactions: ol.interaction.defaults().extend([
|
||||||
new ol.interaction.DragRotateAndZoom()
|
new ol.interaction.DragRotateAndZoom()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ var view = new ol.View2D({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new ol.control.FullScreen()
|
new ol.control.FullScreen()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var mousePositionControl = new ol.control.MousePosition({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [mousePositionControl]),
|
controls: ol.control.defaults().extend([mousePositionControl]),
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ goog.require('ol.source.OSM');
|
|||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new ol.control.ZoomToExtent({
|
new ol.control.ZoomToExtent({
|
||||||
extent: [
|
extent: [
|
||||||
813079.7791264898,
|
813079.7791264898,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ goog.require('ol.source.OSM');
|
|||||||
var scaleLineControl = new ol.control.ScaleLine();
|
var scaleLineControl = new ol.control.ScaleLine();
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
scaleLineControl
|
scaleLineControl
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ var lineStringCollection = ol.geom2.LineStringCollection.pack([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new ol.control.MousePosition({
|
new ol.control.MousePosition({
|
||||||
undefinedHTML: ' '
|
undefinedHTML: ' '
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var layers = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults().extend([
|
||||||
new ol.control.ScaleLine({
|
new ol.control.ScaleLine({
|
||||||
units: ol.control.ScaleLineUnits.METRIC
|
units: ol.control.ScaleLineUnits.METRIC
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user