changeset 1117:ef7c102497b8

added default zoom level for search results that are cities/villages
author Markus Kottlaender <markus@intevation.de>
date Tue, 06 Nov 2018 07:30:49 +0100
parents ca754bdfae00
children 6d4cc4389c8f c316fcf94ea9
files client/src/application/Topbar.vue
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/application/Topbar.vue	Mon Nov 05 16:11:31 2018 +0100
+++ b/client/src/application/Topbar.vue	Tue Nov 06 07:30:49 2018 +0100
@@ -213,10 +213,13 @@
       if (resultEntry.geom.type == "Point") {
         let view = this.openLayersMap.getView();
         const currentZoom = view.getZoom();
-        const newZoom =
-          resultEntry.type === "bottleneck"
-            ? Math.max(17, currentZoom)
-            : Math.max(15, currentZoom);
+        let newZoom = 11;
+        if (resultEntry.type === "bottleneck")
+          newZoom = Math.max(17, currentZoom);
+        if (resultEntry.type === "rhm")
+          newZoom = Math.max(15, currentZoom);
+        if (resultEntry.type === "city")
+          newZoom = Math.max(13, currentZoom);
         view.animate(
           {
             zoom: newZoom,