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:
parent
5844f1ef51
commit
96119e02ef
10 changed files with 146 additions and 88 deletions
|
|
@ -507,8 +507,10 @@ const UI = (() => {
|
|||
return L.marker([lat, lon], { icon });
|
||||
},
|
||||
|
||||
// Engine-neutral: Kreis-Marker (Leaflet L.circleMarker bzw. GL-HTML-Punkt).
|
||||
// Engine-neutral: Kreis-Marker. Akzeptiert (lat, lon, opts) ODER ([lat,lon], opts) (Leaflet-Stil).
|
||||
circleMarker(lat, lon, opts = {}) {
|
||||
if (Array.isArray(lat)) { opts = lon || {}; lon = lat[1]; lat = lat[0]; }
|
||||
else if (lat && lat.lat != null) { opts = lon || {}; lon = lat.lng; lat = lat.lat; }
|
||||
if (_uiGL && window.MapGLMini) return MapGLMini.circleMarker(lat, lon, opts);
|
||||
return L.circleMarker([lat, lon], opts);
|
||||
},
|
||||
|
|
@ -519,6 +521,18 @@ const UI = (() => {
|
|||
return L.featureGroup(markers);
|
||||
},
|
||||
|
||||
// Engine-neutral: Polylinie (Route/Track).
|
||||
polyline(latlngs, opts = {}) {
|
||||
if (_uiGL && window.MapGLMini) return MapGLMini.polyline(latlngs, opts);
|
||||
return L.polyline(latlngs, opts);
|
||||
},
|
||||
|
||||
// Engine-neutral: Cluster-/Marker-Gruppe (GL: ohne Clustering, einfache Gruppe).
|
||||
clusterGroup(opts = {}) {
|
||||
if (_uiGL && window.MapGLMini) return MapGLMini.clusterGroup();
|
||||
return L.markerClusterGroup(opts);
|
||||
},
|
||||
|
||||
// Feature-Flag-Status der Vektor-Basemap (für Karten, die ihren Basemap-Layer
|
||||
// selbst verwalten, z.B. pages/map.js).
|
||||
vectorEnabled() { return _vectorMapEnabled(); },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue