changeset 5709:a23fabfd54bb sr-v2

Merged default
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 20 Feb 2024 21:28:15 +0100
parents 83d8d11a069d (current diff) b1a10654bf0f (diff)
children 37c8feeecb4d
files
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/map/Map.vue	Tue Feb 20 21:27:47 2024 +0100
+++ b/client/src/components/map/Map.vue	Tue Feb 20 21:28:15 2024 +0100
@@ -62,6 +62,7 @@
 import { pane } from "@/lib/mixins";
 import { layerFactory } from "@/components/layers/layers";
 import { ImageWMS as ImageSource } from "ol/source";
+import { ScaleLine } from "ol/control.js";
 import { styles } from "@/components/layers/styles";
 import "ol/ol.css";
 
@@ -331,7 +332,7 @@
       this.map = new Map({
         layers: this.layers.config,
         target: "map-" + this.paneId,
-        controls: [],
+        controls: [new ScaleLine()],
         view:
           this.syncedMaps.includes(this.paneId) || this.paneId === "main"
             ? this.syncedView
@@ -515,3 +516,14 @@
   }
 };
 </script>
+
+<style>
+.ol-scale-line {
+  background: rgba(0, 0, 0, 0.45);
+  border-radius: 4px;
+  bottom: 8px;
+  left: 8px;
+  padding: 2px;
+  position: absolute;
+}
+</style>