From d5d5f58809ae0eddd1842858183e62623a29c317 Mon Sep 17 00:00:00 2001 From: Antoine Abt Date: Tue, 3 Jun 2014 15:55:56 +0200 Subject: [PATCH] Do not collapse Attributions when using OSM source --- examples/accessible.js | 6 ++++++ examples/animation.js | 6 ++++++ examples/bind-input.js | 6 ++++++ examples/canvas-tiles.js | 6 ++++++ examples/center.js | 6 ++++++ examples/custom-controls.js | 6 +++++- examples/device-orientation.js | 6 ++++++ examples/export-map.js | 6 ++++++ examples/geojson.js | 6 ++++++ examples/geolocation-orientation.js | 6 ++++++ examples/geolocation.js | 6 ++++++ examples/igc.js | 6 ++++++ examples/layer-clipping-webgl.js | 6 ++++++ examples/layer-clipping.js | 6 ++++++ examples/layer-swipe.js | 6 ++++++ examples/localized-openstreetmap.js | 6 ++++++ examples/min-max-resolution.js | 6 ++++++ examples/mouse-position.js | 6 +++++- examples/moveend.js | 6 ++++++ examples/navigation-controls.js | 6 +++++- examples/rotation.js | 6 ++++++ examples/scale-line.js | 6 +++++- examples/teleport.js | 6 ++++++ examples/vector-osm.js | 6 ++++++ examples/wmts.js | 6 ++++++ examples/xyz.js | 6 ++++++ 26 files changed, 152 insertions(+), 4 deletions(-) diff --git a/examples/accessible.js b/examples/accessible.js index 2d36f4c2f8..53a80398c1 100644 --- a/examples/accessible.js +++ b/examples/accessible.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -12,6 +13,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/animation.js b/examples/animation.js index 8965908c0c..2db3f7feab 100644 --- a/examples/animation.js +++ b/examples/animation.js @@ -1,6 +1,7 @@ goog.require('ol.Map'); goog.require('ol.View'); goog.require('ol.animation'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.proj'); goog.require('ol.source.OSM'); @@ -55,6 +56,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: view }); diff --git a/examples/bind-input.js b/examples/bind-input.js index 421e721156..0264930120 100644 --- a/examples/bind-input.js +++ b/examples/bind-input.js @@ -1,6 +1,7 @@ goog.require('ol.BrowserFeature'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.dom.Input'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -29,6 +30,11 @@ var map = new ol.Map({ layers: [layer], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: view }); diff --git a/examples/canvas-tiles.js b/examples/canvas-tiles.js index 120b0a4497..278fe22e31 100644 --- a/examples/canvas-tiles.js +++ b/examples/canvas-tiles.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.proj'); goog.require('ol.source.OSM'); @@ -23,6 +24,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: ol.proj.transform( [-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'), diff --git a/examples/center.js b/examples/center.js index 64dd9cad97..2c63b99bf8 100644 --- a/examples/center.js +++ b/examples/center.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.geom.Point'); goog.require('ol.geom.SimpleGeometry'); goog.require('ol.layer.Tile'); @@ -50,6 +51,11 @@ var map = new ol.Map({ vectorLayer ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: view }); diff --git a/examples/custom-controls.js b/examples/custom-controls.js index ceca3ad3ba..8181ecafc2 100644 --- a/examples/custom-controls.js +++ b/examples/custom-controls.js @@ -62,7 +62,11 @@ ol.inherits(app.RotateNorthControl, ol.control.Control); var map = new ol.Map({ - controls: ol.control.defaults().extend([ + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }).extend([ new app.RotateNorthControl() ]), layers: [ diff --git a/examples/device-orientation.js b/examples/device-orientation.js index d905ec97d2..8f3569367d 100644 --- a/examples/device-orientation.js +++ b/examples/device-orientation.js @@ -1,6 +1,7 @@ goog.require('ol.DeviceOrientation'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.dom.Input'); goog.require('ol.layer.Tile'); goog.require('ol.proj'); @@ -21,6 +22,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: view }); diff --git a/examples/export-map.js b/examples/export-map.js index 747c5dedb7..134972d1b7 100644 --- a/examples/export-map.js +++ b/examples/export-map.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -11,6 +12,11 @@ var map = new ol.Map({ }) ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/geojson.js b/examples/geojson.js index 1f1dea970b..4674cf4a33 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -1,6 +1,7 @@ goog.require('ol.Feature'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.geom.Circle'); goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); @@ -188,6 +189,11 @@ var map = new ol.Map({ vectorLayer ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/geolocation-orientation.js b/examples/geolocation-orientation.js index 4ac409b15b..99e653fcda 100644 --- a/examples/geolocation-orientation.js +++ b/examples/geolocation-orientation.js @@ -2,6 +2,7 @@ goog.require('ol.Geolocation'); goog.require('ol.Map'); goog.require('ol.Overlay'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.geom.LineString'); goog.require('ol.layer.Tile'); goog.require('ol.proj'); @@ -21,6 +22,11 @@ var map = new ol.Map({ }) ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: view }); diff --git a/examples/geolocation.js b/examples/geolocation.js index 3d99af6f03..af65afd0dd 100644 --- a/examples/geolocation.js +++ b/examples/geolocation.js @@ -3,6 +3,7 @@ goog.require('ol.FeatureOverlay'); goog.require('ol.Geolocation'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.dom.Input'); goog.require('ol.geom.Point'); goog.require('ol.layer.Tile'); @@ -21,6 +22,11 @@ var map = new ol.Map({ }) ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: view }); diff --git a/examples/igc.js b/examples/igc.js index 33b5924140..d3d48381bd 100644 --- a/examples/igc.js +++ b/examples/igc.js @@ -3,6 +3,7 @@ goog.require('ol.Feature'); goog.require('ol.FeatureOverlay'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.geom.LineString'); goog.require('ol.geom.Point'); goog.require('ol.layer.Tile'); @@ -83,6 +84,11 @@ var map = new ol.Map({ }) ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [703365.7089403362, 5714629.865071137], zoom: 9 diff --git a/examples/layer-clipping-webgl.js b/examples/layer-clipping-webgl.js index 4644390085..7d2a285617 100644 --- a/examples/layer-clipping-webgl.js +++ b/examples/layer-clipping-webgl.js @@ -1,6 +1,7 @@ goog.require('ol.BrowserFeature'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -20,6 +21,11 @@ if (!ol.BrowserFeature.HAS_WEBGL) { layers: [osm], renderer: 'webgl', target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/layer-clipping.js b/examples/layer-clipping.js index 5395501249..1a5fa76994 100644 --- a/examples/layer-clipping.js +++ b/examples/layer-clipping.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -10,6 +11,11 @@ var osm = new ol.layer.Tile({ var map = new ol.Map({ layers: [osm], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/layer-swipe.js b/examples/layer-swipe.js index 8b81ed6f05..c0a83fa434 100644 --- a/examples/layer-swipe.js +++ b/examples/layer-swipe.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.BingMaps'); goog.require('ol.source.OSM'); @@ -17,6 +18,11 @@ var bing = new ol.layer.Tile({ var map = new ol.Map({ layers: [osm, bing], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/localized-openstreetmap.js b/examples/localized-openstreetmap.js index 2018d609ca..4f9edd9e27 100644 --- a/examples/localized-openstreetmap.js +++ b/examples/localized-openstreetmap.js @@ -1,6 +1,7 @@ goog.require('ol.Attribution'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -42,6 +43,11 @@ var map = new ol.Map({ openSeaMapLayer ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ maxZoom: 18, center: [-244780.24508882355, 5986452.183179816], diff --git a/examples/min-max-resolution.js b/examples/min-max-resolution.js index b59a6b0836..6bfe03a9b5 100644 --- a/examples/min-max-resolution.js +++ b/examples/min-max-resolution.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); goog.require('ol.source.TileJSON'); @@ -27,6 +28,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [653600, 5723680], zoom: 5 diff --git a/examples/mouse-position.js b/examples/mouse-position.js index d451a16708..cdbf7eece1 100644 --- a/examples/mouse-position.js +++ b/examples/mouse-position.js @@ -19,7 +19,11 @@ var mousePositionControl = new ol.control.MousePosition({ }); var map = new ol.Map({ - controls: ol.control.defaults().extend([mousePositionControl]), + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }).extend([mousePositionControl]), layers: [ new ol.layer.Tile({ source: new ol.source.OSM() diff --git a/examples/moveend.js b/examples/moveend.js index 46340d3716..1f2799bfcd 100644 --- a/examples/moveend.js +++ b/examples/moveend.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.extent'); goog.require('ol.layer.Tile'); goog.require('ol.proj'); @@ -14,6 +15,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/navigation-controls.js b/examples/navigation-controls.js index 04538f83b7..cc9034a747 100644 --- a/examples/navigation-controls.js +++ b/examples/navigation-controls.js @@ -7,7 +7,11 @@ goog.require('ol.source.OSM'); var map = new ol.Map({ - controls: ol.control.defaults().extend([ + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }).extend([ new ol.control.ZoomToExtent({ extent: [ 813079.7791264898, 5929220.284081122, diff --git a/examples/rotation.js b/examples/rotation.js index 4106e99359..4fa63b6b28 100644 --- a/examples/rotation.js +++ b/examples/rotation.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -12,6 +13,11 @@ var map = new ol.Map({ ], renderer: exampleNS.getRendererFromQueryString(), target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [-25860000, 4130000], rotation: Math.PI / 6, diff --git a/examples/scale-line.js b/examples/scale-line.js index 447b4bb842..b495fed945 100644 --- a/examples/scale-line.js +++ b/examples/scale-line.js @@ -10,7 +10,11 @@ goog.require('ol.source.OSM'); var scaleLineControl = new ol.control.ScaleLine(); var map = new ol.Map({ - controls: ol.control.defaults().extend([ + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }).extend([ scaleLineControl ]), layers: [ diff --git a/examples/teleport.js b/examples/teleport.js index 02216f275c..3aea72d6b5 100644 --- a/examples/teleport.js +++ b/examples/teleport.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); @@ -11,6 +12,11 @@ var map = new ol.Map({ }) ], renderer: exampleNS.getRendererFromQueryString(), + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [0, 0], zoom: 2 diff --git a/examples/vector-osm.js b/examples/vector-osm.js index 9faed15dc9..d724b24320 100644 --- a/examples/vector-osm.js +++ b/examples/vector-osm.js @@ -1,5 +1,6 @@ goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.format.OSMXML'); goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); @@ -131,6 +132,11 @@ var raster = new ol.layer.Tile({ var map = new ol.Map({ layers: [raster, vector], target: document.getElementById('map'), + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [739218, 5906096], maxZoom: 19, diff --git a/examples/wmts.js b/examples/wmts.js index 4b2de5c726..6c64105f18 100644 --- a/examples/wmts.js +++ b/examples/wmts.js @@ -1,6 +1,7 @@ goog.require('ol.Attribution'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.extent'); goog.require('ol.layer.Tile'); goog.require('ol.proj'); @@ -53,6 +54,11 @@ var map = new ol.Map({ }) ], target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), view: new ol.View({ center: [-11158582, 4813697], zoom: 4 diff --git a/examples/xyz.js b/examples/xyz.js index 04ed95d1ef..a29ebd6092 100644 --- a/examples/xyz.js +++ b/examples/xyz.js @@ -1,6 +1,7 @@ goog.require('ol.Attribution'); goog.require('ol.Map'); goog.require('ol.View'); +goog.require('ol.control'); goog.require('ol.layer.Tile'); goog.require('ol.source.OSM'); goog.require('ol.source.XYZ'); @@ -13,6 +14,11 @@ var attribution = new ol.Attribution({ var map = new ol.Map({ target: 'map', + controls: ol.control.defaults({ + attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ + collapsible: false + }) + }), layers: [ new ol.layer.Tile({ source: new ol.source.OSM({