mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 23:53:25 +00:00
avoid zooming on first file point
This commit is contained in:
@@ -73,7 +73,7 @@ const targetMapBounds = writable({
|
||||
});
|
||||
|
||||
derived([targetMapBounds, map], x => x).subscribe(([bounds, $map]) => {
|
||||
if ($map === null || bounds.count !== bounds.total) {
|
||||
if ($map === null || bounds.count !== bounds.total || (bounds.bounds.getSouth() === 90 && bounds.bounds.getWest() === 180 && bounds.bounds.getNorth() === -90 && bounds.bounds.getEast() === -180)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,10 @@ export function updateTargetMapBounds(bounds: {
|
||||
northEast: Coordinates
|
||||
}) {
|
||||
if (bounds.southWest.lat == 90 && bounds.southWest.lon == 180 && bounds.northEast.lat == -90 && bounds.northEast.lon == -180) { // Avoid update for empty (new) files
|
||||
targetMapBounds.update((target) => {
|
||||
target.count += 1;
|
||||
return target;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user