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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user