Seitenkarten GL Runde 2: Events, Gassi, Routen + Facade-Erweiterung

- Facade: Polyline (geojson line-source, addTo/setLatLngs/getBounds/remove), clusterGroup,
  marker.getLatLng, map.distance(Haversine), on('click') normalisiert e.latlng aus e.lngLat, _ll objekttauglich
- events: L.markerClusterGroup→UI.map.clusterGroup
- walks: window.L-Guard, L.featureGroup→UI.map.featureGroup, fitBounds ohne .pad
- routes: L.polyline/L.circleMarker→UI.map.*, navMap/Pfeil-Marker→svgMarker, latLngBounds→coords,
  trimMap distance/click, Mini-Vorschauen auf SVG (kein WebGL-Limit, kein OSM-Raster)
This commit is contained in:
rene 2026-06-05 12:48:09 +02:00
parent 5844f1ef51
commit 96119e02ef
10 changed files with 146 additions and 88 deletions

View file

@ -369,7 +369,7 @@ window.Page_walks = (() => {
}
function _renderMarkers() {
if (!_map || !window.L) return;
if (!_map) return;
_markers.forEach(m => m.remove());
_markers = [];
_data.forEach(w => {
@ -386,8 +386,8 @@ window.Page_walks = (() => {
if (_markers.length === 1) {
_map.setView(_markers[0].getLatLng(), 13);
} else if (_markers.length > 1) {
const group = L.featureGroup(_markers);
_map.fitBounds(group.getBounds().pad(0.2));
const group = UI.map.featureGroup(_markers);
_map.fitBounds(group, { padding: 50 });
}
}