Use common attribution for OpenStreetMap
This commit is contained in:
@@ -4,6 +4,16 @@ goog.require('ol.Attribution');
|
|||||||
goog.require('ol.source.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<ol.Attribution>}
|
||||||
|
*/
|
||||||
|
ol.source.OPENSTREETMAP_ATTRIBUTIONS = [new ol.Attribution(
|
||||||
|
'© <a href="http://www.openstreetmap.org">OpenStreetMap</a> ' +
|
||||||
|
'contributors, ' +
|
||||||
|
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC BY-SA</a>')];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -20,14 +30,7 @@ ol.source.OpenStreetMap = function(opt_options) {
|
|||||||
} else if (goog.isDef(options.attribution)) {
|
} else if (goog.isDef(options.attribution)) {
|
||||||
attributions = [options.attribution];
|
attributions = [options.attribution];
|
||||||
} else {
|
} else {
|
||||||
attributions = [
|
attributions = ol.source.OPENSTREETMAP_ATTRIBUTIONS;
|
||||||
new ol.Attribution(
|
|
||||||
'© <a href="http://www.openstreetmap.org">OpenStreetMap</a> ' +
|
|
||||||
'contributors, ' +
|
|
||||||
'<a href="http://creativecommons.org/licenses/by-sa/2.0/"> ' +
|
|
||||||
'CC BY-SA' +
|
|
||||||
'</a>')
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxZoom = goog.isDef(options.maxZoom) ? options.maxZoom : 18;
|
var maxZoom = goog.isDef(options.maxZoom) ? options.maxZoom : 18;
|
||||||
|
|||||||
Reference in New Issue
Block a user