Fix application error on non-feature search results

Fixes #560
This commit is contained in:
John Firebaugh 2013-12-02 14:08:56 -08:00
parent 031afed7aa
commit 95f1069552

View file

@ -30,11 +30,16 @@ OSM.Search = function(map) {
center = L.latLng(data.lat, data.lon);
if (data.minLon && data.minLat && data.maxLon && data.maxLat) {
map.fitBounds([[data.minLat, data.minLon],
[data.maxLat, data.maxLon]]);
map.fitBounds([[data.minLat, data.minLon], [data.maxLat, data.maxLon]]);
} else {
map.setView(center, data.zoom);
}
// Let clicks to object browser links propagate.
if (data.type && data.id) return;
e.preventDefault();
e.stopPropagation();
}
var marker = L.marker([0, 0], {icon: getUserIcon()});