+16
-11
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user