From: Martin Raifer Date: Mon, 5 Aug 2013 11:10:37 +0000 (+0200) Subject: Do not fit map to search result (object) twice X-Git-Tag: live~5875 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/79bdb0ff86651446437f19aae107294cbd59558c?ds=inline;hp=--cc Do not fit map to search result (object) twice When clicking on search results the respective osm object is loaded asynchronously and afterwards shown on the map. Some objects can take a few seconds to load however. If a user already panned/zoomed the map manually during this time then their actions are reverted because the map fits to the object again. There is actually no need for this behaviour, because a good geocoder already returns an appropriate bounding box for the search result. --- 79bdb0ff86651446437f19aae107294cbd59558c diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 19e1f16de..15acc6412 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -195,7 +195,7 @@ function setPositionLink(map) { } if (data.type && data.id) { - addObjectToMap(data, map, { zoom: true, style: { opacity: 0.2, fill: false } }); + addObjectToMap(data, map, { zoom: false, style: { opacity: 0.2, fill: false } }); } map.markerLayer.clearLayers();