diff --git a/src/ol/source/stamensource.js b/src/ol/source/stamensource.js index 6ea87b6ab4..a29ec962da 100644 --- a/src/ol/source/stamensource.js +++ b/src/ol/source/stamensource.js @@ -74,6 +74,16 @@ ol.source.StamenProviderConfig = { }; +/** + * @const {Array.} + */ +ol.source.STAMEN_ATTRIBUTIONS = [new ol.Attribution( + 'Map tiles by Stamen Design, under ' + + 'CC BY 3.0. ' + + 'Data by OpenStreetMap, under ' + + 'CC BY SA.')]; + + /** * @constructor @@ -82,14 +92,6 @@ ol.source.StamenProviderConfig = { */ ol.source.Stamen = function(options) { - var attribution = new ol.Attribution( - 'Map tiles by Stamen Design, ' + - 'under ' + - 'CC BY 3.0. ' + - 'Data by OpenStreetMap, ' + - 'under ' + - 'CC BY SA.'); - var i = options.layer.indexOf('-'); var provider = i == -1 ? options.layer : options.layer.slice(0, i); goog.asserts.assert(provider in ol.source.StamenProviderConfig); @@ -103,7 +105,7 @@ ol.source.Stamen = function(options) { layerConfig.extension; goog.base(this, { - attributions: [attribution], + attributions: ol.source.STAMEN_ATTRIBUTIONS, maxZoom: providerConfig.maxZoom, // FIXME uncomment the following when tilegrid supports minZoom //minZoom: providerConfig.minZoom,