Adding attribution control and attribution.

This commit is contained in:
ahocevar
2012-06-24 22:22:18 +02:00
parent dfc21754c9
commit 9c46aadd22
6 changed files with 131 additions and 10 deletions
+16 -1
View File
@@ -4,4 +4,19 @@ goog.provide('ol.layer.Layer');
* @constructor
* @export
*/
ol.layer.Layer = function() {};
ol.layer.Layer = function() {
/**
* @type {string}
* @protected
*/
this.attribution_;
};
/**
* @return {string}
*/
ol.layer.Layer.prototype.getAttribution = function() {
return this.attribution_;
};
+6 -1
View File
@@ -9,7 +9,12 @@ goog.require('ol.layer.XYZ');
* @constructor
* @extends {ol.layer.XYZ}
*/
ol.layer.OSM = function() {
ol.layer.OSM = function() {
//TODO Is this attribution still correct?
/** @inheritDoc */
this.attribution_ = "Data CC-By-SA by <a target='_blank' href='http://openstreetmap.org/'>OpenStreetMap</a>";
goog.base(this, 'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png');
};