From 58e3561ba5d6ac419ddefd915184826b38c8b0c4 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 26 Aug 2014 10:36:51 +0200 Subject: [PATCH] Take the 'us' and 'nautical' units into account When converting pointResolution from degrees to meters --- src/ol/control/scalelinecontrol.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ol/control/scalelinecontrol.js b/src/ol/control/scalelinecontrol.js index 6d44010d9d..2e3eb4e39d 100644 --- a/src/ol/control/scalelinecontrol.js +++ b/src/ol/control/scalelinecontrol.js @@ -213,7 +213,9 @@ ol.control.ScaleLine.prototype.updateElement_ = function() { var units = this.getUnits(); if (projectionUnits == ol.proj.Units.DEGREES && (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 this.toEPSG4326_ = null; @@ -244,7 +246,9 @@ ol.control.ScaleLine.prototype.updateElement_ = function() { goog.asserts.assert( ((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) || (units == ol.control.ScaleLineUnits.DEGREES && projectionUnits == ol.proj.Units.DEGREES));