Merge pull request #7908 from hyperknot/scaleline-fix

ScaleLine fix for non-degree based units
This commit is contained in:
Andreas Hocevar authored and GitHub committed 2018-04-20 15:40:56 +02:00
commit 23b54e6a9f
2 files changed
+39 -1

No files matched your search

+2 -1
View File
@@ -191,7 +191,8 @@ ScaleLine.prototype.updateElement_ = function() {
Units.METERS;
let pointResolution =
getPointResolution(projection, viewState.resolution, center, pointResolutionUnits);
if (projection.getUnits() != Units.DEGREES && units == ScaleLineUnits.METRIC) {
if (projection.getUnits() != Units.DEGREES && projection.getMetersPerUnit()
&& pointResolutionUnits == Units.METERS) {
pointResolution *= projection.getMetersPerUnit();
}