# HG changeset patch # User Markus Kottlaender # Date 1540458373 -7200 # Node ID bdc8b416087263afa194165611adea0d9e03fe27 # Parent 2cbc905ff0e991b2bc78a27b3ce95d5e5ad2b5dc search results only zoom in, not out diff -r 2cbc905ff0e9 -r bdc8b4160872 client/src/application/Topbar.vue --- a/client/src/application/Topbar.vue Thu Oct 25 10:58:37 2018 +0200 +++ b/client/src/application/Topbar.vue Thu Oct 25 11:06:13 2018 +0200 @@ -212,9 +212,14 @@ // DEBUG console.log("Moving to", resultEntry); 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); view.animate( { - zoom: resultEntry.type === "bottleneck" ? 17 : 15, + zoom: newZoom, center: fromLonLat( resultEntry.geom.coordinates, view.getProjection()