use constant for default dpi

This commit is contained in:
mike-000
2020-04-03 17:17:11 +01:00
committed by GitHub
parent 6aa953b571
commit fb84426411

View File

@@ -437,7 +437,7 @@ class ScaleLine extends Control {
this.viewState_.resolution,
this.viewState_.center
);
const dpi = this.dpi_ || (25.4 / 0.28);
const dpi = this.dpi_ || DEFAULT_DPI;
const mpu = this.viewState_.projection.getMetersPerUnit();
const inchesPerMeter = 39.37;
return parseFloat(resolution.toString()) * mpu * inchesPerMeter * dpi;