Routen-GL-Fix: Detail/Suggest-Karte fittet Route korrekt (Modal-0×0-Timing)
- Facade fitBounds: try/catch + skip wenn Container 0×0 (sonst NaN-LngLat im Modal) - createMap: mehrfaches resize() nach Erstellung (Modal-Animation) - _buildDetailMap/_suggestMap: Re-Fit nach 200/500ms (Route ganz sichtbar, Pfeile) - Facade: scrollWheelZoom-Stub (map.scrollZoom)
This commit is contained in:
parent
96119e02ef
commit
fbaf7c5409
7 changed files with 35 additions and 22 deletions
|
|
@ -617,8 +617,8 @@ window.Page_routes = (() => {
|
|||
UI.map.circleMarker(lls[0], { radius:7, color:'#22C55E', fillColor:'#22C55E', fillOpacity:1, weight:2 }).addTo(_suggestMap);
|
||||
UI.map.circleMarker(lls.at(-1), { radius:7, color:'#EF4444', fillColor:'#EF4444', fillOpacity:1, weight:2 }).addTo(_suggestMap);
|
||||
_addRouteArrows(_suggestMap, track, '#3b82f6');
|
||||
_suggestMap.fitBounds(poly.getBounds(), { padding: [16, 16] });
|
||||
setTimeout(() => _suggestMap?.invalidateSize(), 120);
|
||||
const _sfit = () => { _suggestMap?.invalidateSize(); _suggestMap?.fitBounds(poly.getBounds(), { padding: [16, 16] }); };
|
||||
_sfit(); setTimeout(_sfit, 200); setTimeout(_sfit, 500);
|
||||
};
|
||||
_initMap();
|
||||
|
||||
|
|
@ -2653,7 +2653,11 @@ window.Page_routes = (() => {
|
|||
_addRouteArrows(m, track, '#3b82f6');
|
||||
UI.map.circleMarker(lls[0], { radius:7, color:'#22C55E', fillColor:'#22C55E', fillOpacity:1 }).addTo(m);
|
||||
UI.map.circleMarker(lls.at(-1), { radius:7, color:'#EF4444', fillColor:'#EF4444', fillOpacity:1 }).addTo(m);
|
||||
m.fitBounds(poly.getBounds(), { padding:[10,10] });
|
||||
// Mehrfach fitten: beim Erstellen ist der Modal-Container evtl. noch 0×0 → nach
|
||||
// der Animation (resize) erneut auf die ganze Route zoomen.
|
||||
const _fit = () => { m.invalidateSize(); m.fitBounds(poly.getBounds(), { padding:[16,16] }); };
|
||||
_fit();
|
||||
setTimeout(_fit, 200); setTimeout(_fit, 500);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue