Mercurial > gemma
changeset 1068:c933665b0193
merge
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Fri, 26 Oct 2018 09:36:13 +0200 |
parents | 4372a489c9ad (current diff) 3f14b73414e2 (diff) |
children | 51e42c2e110a |
files | client/src/map/Maplayer.vue |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue Fri Oct 26 08:52:22 2018 +0200 +++ b/client/src/map/Maplayer.vue Fri Oct 26 09:36:13 2018 +0200 @@ -162,7 +162,12 @@ const areaSize = getArea(event.feature.getGeometry()); // also place the a rounded areaSize in a property, // so identify will show it - event.feature.set("area (km²)", Math.round(areaSize) / 1000); + if (areaSize > 100000) { + // convert into 1 km² == 1000*1000 m² and round to 1000 m² + event.feature.set("area (km²)", Math.round(areaSize / 1000) / 1000); + } else { + event.feature.set("area (m²)", Math.round(areaSize)); + } } if (this.drawMode === "LineString") { const length = getLength(event.feature.getGeometry());