# HG changeset patch # User Markus Kottlaender # Date 1541485849 -3600 # Node ID ef7c102497b870a4be9edf8862b4d533ae18901b # Parent ca754bdfae00e6d1b2f26a61f8c770f9c7d096f5 added default zoom level for search results that are cities/villages diff -r ca754bdfae00 -r ef7c102497b8 client/src/application/Topbar.vue --- 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,