Take the 'us' and 'nautical' units into account

When converting pointResolution from degrees to meters
This commit is contained in:
Frederic Junod
2014-08-26 10:36:51 +02:00
parent b83e639301
commit 58e3561ba5

View File

@@ -213,7 +213,9 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
var units = this.getUnits(); var units = this.getUnits();
if (projectionUnits == ol.proj.Units.DEGREES && if (projectionUnits == ol.proj.Units.DEGREES &&
(units == ol.control.ScaleLineUnits.METRIC || (units == ol.control.ScaleLineUnits.METRIC ||
units == ol.control.ScaleLineUnits.IMPERIAL)) { units == ol.control.ScaleLineUnits.IMPERIAL ||
units == ol.control.ScaleLineUnits.US ||
units == ol.control.ScaleLineUnits.NAUTICAL)) {
// Convert pointResolution from degrees to meters // Convert pointResolution from degrees to meters
this.toEPSG4326_ = null; this.toEPSG4326_ = null;
@@ -244,7 +246,9 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
goog.asserts.assert( goog.asserts.assert(
((units == ol.control.ScaleLineUnits.METRIC || ((units == ol.control.ScaleLineUnits.METRIC ||
units == ol.control.ScaleLineUnits.IMPERIAL) && units == ol.control.ScaleLineUnits.IMPERIAL ||
units == ol.control.ScaleLineUnits.US ||
units == ol.control.ScaleLineUnits.NAUTICAL) &&
projectionUnits == ol.proj.Units.METERS) || projectionUnits == ol.proj.Units.METERS) ||
(units == ol.control.ScaleLineUnits.DEGREES && (units == ol.control.ScaleLineUnits.DEGREES &&
projectionUnits == ol.proj.Units.DEGREES)); projectionUnits == ol.proj.Units.DEGREES));