fix: Blickfeld aus initialwert lassen

in MapComponent.js
map.fitBounds(group.getBounds().pad(0.5));. Diese Zeile passt die Karte an, sodass alle Elemente in group (also Marker und Polylinien) im Blickfeld sind. Dies kann dazu führen, dass der Zoom-Level geändert wird,
This commit is contained in:
ISA
2024-06-18 11:25:57 +02:00
parent 7cecef4925
commit 3590213286

View File

@@ -2199,7 +2199,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
// Fit map to show all markers and polylines
const group = new L.featureGroup([...markers, polyline]);
map.fitBounds(group.getBounds().pad(0.5));
// map.fitBounds(group.getBounds().pad(0.5));
});
}, [map, linePositions, lineColors]); // Run this effect when `map` is ready