Fix map zoom failing due to hidden owner layers on load
Deploy TrassenPlaner / deploy (push) Waiting to run
Details
Deploy TrassenPlaner / deploy (push) Waiting to run
Details
This commit is contained in:
parent
c1004108d0
commit
d226fe5bdd
|
|
@ -2890,8 +2890,13 @@
|
||||||
updateOwnerLayer();
|
updateOwnerLayer();
|
||||||
|
|
||||||
// Zoom to owner data if available
|
// Zoom to owner data if available
|
||||||
if (layers.owners && layers.owners.getBounds().isValid()) {
|
if (state.owners && state.owners.features.length > 0) {
|
||||||
map.fitBounds(layers.owners.getBounds(), { padding: [20, 20] });
|
try {
|
||||||
|
const bounds = L.geoJSON(state.owners).getBounds();
|
||||||
|
if (bounds.isValid()) {
|
||||||
|
map.fitBounds(bounds, { padding: [20, 20] });
|
||||||
|
}
|
||||||
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) { console.error("[V3-Sync] Owners Error:", e); }
|
} catch (e) { console.error("[V3-Sync] Owners Error:", e); }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue