parent
031afed7aa
commit
95f1069552
1 changed files with 7 additions and 2 deletions
|
@ -30,11 +30,16 @@ OSM.Search = function(map) {
|
||||||
center = L.latLng(data.lat, data.lon);
|
center = L.latLng(data.lat, data.lon);
|
||||||
|
|
||||||
if (data.minLon && data.minLat && data.maxLon && data.maxLat) {
|
if (data.minLon && data.minLat && data.maxLon && data.maxLat) {
|
||||||
map.fitBounds([[data.minLat, data.minLon],
|
map.fitBounds([[data.minLat, data.minLon], [data.maxLat, data.maxLon]]);
|
||||||
[data.maxLat, data.maxLon]]);
|
|
||||||
} else {
|
} else {
|
||||||
map.setView(center, data.zoom);
|
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()});
|
var marker = L.marker([0, 0], {icon: getUserIcon()});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue