diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 16:28:53 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 16:28:53 +0200 |
| commit | 4f2f6d757380e80f8e2937ffe99f4390865cb7fa (patch) | |
| tree | 2177de9fc509652b4736619a43e25d6348412dfb /web | |
| parent | 2e3833dd30fafdc270e8d80a78af9116571dc247 (diff) | |
fix: do not fit passes in map
Diffstat (limited to 'web')
| -rw-r--r-- | web/frontend/ride-detail-map.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/web/frontend/ride-detail-map.ts b/web/frontend/ride-detail-map.ts index f571378..a9b9c06 100644 --- a/web/frontend/ride-detail-map.ts +++ b/web/frontend/ride-detail-map.ts @@ -40,6 +40,7 @@ export class RideDetailMap { }) .addTo(this.map); const bounds = routeLayer.getBounds(); + if (bounds.isValid()) this.map.fitBounds(bounds, { padding: [24, 24], maxZoom: 15 }); const passIcon = leaflet.divIcon({ className: "ride-map-pass-icon", html: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 19 10.5 6l3.25 5.5L16 8l5 11H3Z" fill="currentColor"/></svg>', @@ -51,9 +52,7 @@ export class RideDetailMap { const tooltip = document.createElement("span"); tooltip.textContent = `${pass.name || "Mountain pass"} | ${Math.round(pass.elevationM)} m`; marker.bindTooltip(tooltip); - bounds.extend(marker.getLatLng()); } - if (bounds.isValid()) this.map.fitBounds(bounds, { padding: [24, 24], maxZoom: 15 }); this.climbLayers = climbs.map((climb) => this.createClimbLayer(climb)); const climbStartIcon = leaflet.divIcon({ className: "ride-map-climb-start-icon", |
