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.
This commit is contained in:
Martin Raifer 2013-08-05 13:10:37 +02:00 committed by Tom Hughes
parent b8f126bcf6
commit 79bdb0ff86

View file

@ -195,7 +195,7 @@ function setPositionLink(map) {
} }
if (data.type && data.id) { 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(); map.markerLayer.clearLayers();