wip: snapshot V2 cascade onglet 2 (sauvegarde avant chirurgie git-hygiene)
This commit is contained in:
@@ -128,8 +128,6 @@ async function initMap() {
|
||||
updateMarkers(L)
|
||||
}
|
||||
|
||||
let initialFitDone = false
|
||||
|
||||
function updateMarkers(L?: any) {
|
||||
if (!mapInstance || !clusterGroup) return
|
||||
const leaflet = L || (window as any).L
|
||||
@@ -170,25 +168,6 @@ function updateMarkers(L?: any) {
|
||||
markers.set(org.Id, marker)
|
||||
clusterGroup.addLayer(marker)
|
||||
})
|
||||
|
||||
// Bug E2E L3 : recadrer la carte sur les resultats filtres
|
||||
if (orgsWithCoords.length > 0 && initialFitDone) {
|
||||
try {
|
||||
const bounds = leaflet.latLngBounds(
|
||||
orgsWithCoords.map((o: any) => [o.latitude!, o.longitude!])
|
||||
)
|
||||
if (orgsWithCoords.length <= 15) {
|
||||
mapInstance.fitBounds(bounds, {
|
||||
padding: [40, 40],
|
||||
maxZoom: 10,
|
||||
animate: true,
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[NavMap] fitBounds echoue:', e)
|
||||
}
|
||||
}
|
||||
initialFitDone = true
|
||||
}
|
||||
|
||||
// Réagir aux changements de filtres (liste d'orgs)
|
||||
|
||||
Reference in New Issue
Block a user