From 3f5dd4531079799da59b47cc5522af1c3870146c Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 21 Oct 2014 23:00:10 -0600 Subject: [PATCH] One OSM attribution --- examples/igc.js | 2 +- examples/localized-openstreetmap.js | 4 ++-- examples/xyz.js | 2 +- src/ol/attribution.js | 2 +- src/ol/source/mapquestsource.js | 4 ++-- src/ol/source/osmsource.js | 25 ++----------------------- src/ol/source/stamensource.js | 2 +- 7 files changed, 10 insertions(+), 31 deletions(-) diff --git a/examples/igc.js b/examples/igc.js index d3d48381bd3..afb3e004bd3 100644 --- a/examples/igc.js +++ b/examples/igc.js @@ -73,7 +73,7 @@ var map = new ol.Map({ html: 'All maps © ' + 'OpenCycleMap' }), - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ], url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png' }) diff --git a/examples/localized-openstreetmap.js b/examples/localized-openstreetmap.js index 4f9edd9e276..41e41f22d9c 100644 --- a/examples/localized-openstreetmap.js +++ b/examples/localized-openstreetmap.js @@ -16,7 +16,7 @@ var openCycleMapLayer = new ol.layer.Tile({ html: 'All maps © ' + 'OpenCycleMap' }), - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ], url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png' }) @@ -29,7 +29,7 @@ var openSeaMapLayer = new ol.layer.Tile({ html: 'All maps © ' + 'OpenSeaMap' }), - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ], crossOrigin: null, url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png' diff --git a/examples/xyz.js b/examples/xyz.js index a29ebd60927..041e6d983fd 100644 --- a/examples/xyz.js +++ b/examples/xyz.js @@ -27,7 +27,7 @@ var map = new ol.Map({ html: 'Tiles © ' + 'OpenCycleMap' }), - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ], url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png' }) diff --git a/src/ol/attribution.js b/src/ol/attribution.js index eb0dd8a6569..da38e4a3884 100644 --- a/src/ol/attribution.js +++ b/src/ol/attribution.js @@ -16,7 +16,7 @@ goog.require('ol.TileRange'); * html: 'All maps © ' + * 'OpenCycleMap' * }), - * ol.source.OSM.DATA_ATTRIBUTION + * ol.source.OSM.ATTRIBUTION * ], * .. * diff --git a/src/ol/source/mapquestsource.js b/src/ol/source/mapquestsource.js index aa169337642..6b9f7f59f3e 100644 --- a/src/ol/source/mapquestsource.js +++ b/src/ol/source/mapquestsource.js @@ -59,7 +59,7 @@ ol.source.MapQuestConfig = { maxZoom: 28, attributions: [ ol.source.MapQuest.TILE_ATTRIBUTION, - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ] }, 'sat': { @@ -76,7 +76,7 @@ ol.source.MapQuestConfig = { maxZoom: 18, attributions: [ ol.source.MapQuest.TILE_ATTRIBUTION, - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ] } }; diff --git a/src/ol/source/osmsource.js b/src/ol/source/osmsource.js index 605d5121494..b100bbbcdf4 100644 --- a/src/ol/source/osmsource.js +++ b/src/ol/source/osmsource.js @@ -23,7 +23,7 @@ ol.source.OSM = function(opt_options) { if (goog.isDef(options.attributions)) { attributions = options.attributions; } else { - attributions = ol.source.OSM.ATTRIBUTIONS; + attributions = [ol.source.OSM.ATTRIBUTION]; } var crossOrigin = goog.isDef(options.crossOrigin) ? @@ -51,29 +51,8 @@ goog.inherits(ol.source.OSM, ol.source.XYZ); * @type {ol.Attribution} * @api */ -ol.source.OSM.DATA_ATTRIBUTION = new ol.Attribution({ +ol.source.OSM.ATTRIBUTION = new ol.Attribution({ html: '© ' + 'OpenStreetMap ' + 'contributors.' }); - - -/** - * @const - * @type {ol.Attribution} - * @api - */ -ol.source.OSM.TILE_ATTRIBUTION = new ol.Attribution({ - html: '© ' + - 'OpenStreetMap ' + - 'contributors.' -}); - - -/** - * @const - * @type {Array.} - */ -ol.source.OSM.ATTRIBUTIONS = [ - ol.source.OSM.TILE_ATTRIBUTION -]; diff --git a/src/ol/source/stamensource.js b/src/ol/source/stamensource.js index 78d02791264..2980756c2b2 100644 --- a/src/ol/source/stamensource.js +++ b/src/ol/source/stamensource.js @@ -128,5 +128,5 @@ ol.source.Stamen.ATTRIBUTIONS = [ 'under CC BY' + ' 3.0.' }), - ol.source.OSM.DATA_ATTRIBUTION + ol.source.OSM.ATTRIBUTION ];