Fix: Gassi-Karte fitBounds auf alle Treffen beim Öffnen (SW by-v877)
This commit is contained in:
parent
69f5c2982a
commit
b6a644ac3a
5 changed files with 17 additions and 10 deletions
|
|
@ -330,6 +330,13 @@ window.Page_walks = (() => {
|
|||
.on('click', () => _openDetail(w.id));
|
||||
_markers.push(m);
|
||||
});
|
||||
// Karte auf alle Marker zoomen damit alle Treffen sichtbar sind
|
||||
if (_markers.length === 1) {
|
||||
_map.setView(_markers[0].getLatLng(), 13);
|
||||
} else if (_markers.length > 1) {
|
||||
const group = L.featureGroup(_markers);
|
||||
_map.fitBounds(group.getBounds().pad(0.2));
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue