Skip to content

Commit

Permalink
Update ScaleLine.js to reflect nm in scale bar
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilkpai committed Dec 30, 2023
1 parent 8abcf80 commit 2c6ff40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ol/control/ScaleLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ class ScaleLine extends Control {
pointResolution /= 1852;
suffix = 'NM';
} else if (units == 'metric') {
if (nominalCount < 0.001) {
if (nominalCount < 1e-6) {
suffix = 'nm';
pointResolution *= 1e9;
} else if (nominalCount < 0.001) {
suffix = 'μm';
pointResolution *= 1000000;
} else if (nominalCount < 1) {
Expand Down

0 comments on commit 2c6ff40

Please sign in to comment.