Use inheritance rather than creating an instance for OpenStreetMap, make attribution a function rather than a property

This commit is contained in:
Tom Payne
2012-07-26 00:25:03 +02:00
parent bcee2d3a12
commit ed4a888469
5 changed files with 77 additions and 56 deletions
+5 -10
View File
@@ -9,9 +9,8 @@ goog.require('ol.Projection');
* @constructor
* @param {ol.Projection} projection Projection.
* @param {ol.Extent=} opt_extent Extent.
* @param {string=} opt_attribution Attribution.
*/
ol.Store = function(projection, opt_extent, opt_attribution) {
ol.Store = function(projection, opt_extent) {
/**
* @private
@@ -25,20 +24,16 @@ ol.Store = function(projection, opt_extent, opt_attribution) {
*/
this.extent_ = goog.isDef(opt_extent) ? opt_extent : projection.getExtent();
/**
* @private
* @type {string|undefined}
*/
this.attribution_ = opt_attribution;
};
/**
* @param {ol.Extent} extent Extent.
* @param {number} resolution Resolution.
* @return {string|undefined} Attribution.
*/
ol.Store.prototype.getAttribution = function() {
return this.attribution_;
ol.Store.prototype.getAttribution = function(extent, resolution) {
return undefined;
};