Merge pull request #7462 from ahocevar/scaleline-meters-per-unit

Respect metersPerUnit in ScaleLine control
This commit is contained in:
Andreas Hocevar authored and GitHub committed 2017-11-13 11:39:32 +01:00
commit a77d01945f
3 files changed
+40 -3

No files matched your search

+3
View File
@@ -174,6 +174,9 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
ol.proj.Units.METERS;
var pointResolution =
ol.proj.getPointResolution(projection, viewState.resolution, center, pointResolutionUnits);
if (units != ol.control.ScaleLineUnits.DEGREES) {
pointResolution *= projection.getMetersPerUnit();
}
var nominalCount = this.minWidth_ * pointResolution;
var suffix = '';