Merge pull request #815 from tschaub/override

Override for clarity
This commit is contained in:
Tim Schaub
2013-06-24 14:38:26 -07:00
+16 -11
View File
@@ -139,19 +139,12 @@ ol.Projection.prototype.getUnits = function() {
/** /**
* Get the amount of meters per unit of this projection. * Get the amount of meters per unit of this projection. If the projection is
* @return {number} Meters. * not configured with a units identifier, the return is `undefined`.
* @return {number|undefined} Meters.
*/ */
ol.Projection.prototype.getMetersPerUnit = function() { ol.Projection.prototype.getMetersPerUnit = function() {
var metersPerUnit; return ol.METERS_PER_UNIT[this.units_];
if (!goog.isNull(this.units_)) {
metersPerUnit = ol.METERS_PER_UNIT[this.units_];
} else {
if (this instanceof ol.Proj4jsProjection_) {
metersPerUnit = this.getProj4jsProj().to_meter;
}
}
return metersPerUnit;
}; };
@@ -231,6 +224,18 @@ ol.Proj4jsProjection_ = function(proj4jsProj, options) {
goog.inherits(ol.Proj4jsProjection_, ol.Projection); goog.inherits(ol.Proj4jsProjection_, ol.Projection);
/**
* @inheritDoc
*/
ol.Proj4jsProjection_.prototype.getMetersPerUnit = function() {
var metersPerUnit = this.proj4jsProj_.to_meter;
if (!goog.isDef(metersPerUnit)) {
metersPerUnit = ol.METERS_PER_UNIT[this.units_];
}
return metersPerUnit;
};
/** /**
* @inheritDoc * @inheritDoc
*/ */