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

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

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 = '';