fxies bugs with mapwithelevationmultiple

This commit is contained in:
Christian Beutel
2024-09-10 18:38:19 +02:00
parent 19415f7bcb
commit 421191ec77
4 changed files with 18 additions and 16 deletions

View File

@@ -226,7 +226,7 @@ export const GpxGroup = L.GpxGroup = L.Class.extend({
this._elevation.import([this._elevation.__LGEOMUTIL, this._elevation.__LDISTANCEM]).then(() => {
route.addTo(this._layers);
route.addTo(this._layers);
route.eachLayer((layer) => this._onEachRouteLayer(route, layer));
@@ -255,7 +255,9 @@ export const GpxGroup = L.GpxGroup = L.Class.extend({
html: '<i class="px-2 py-2 text-white bg-gray-500 rounded-lg fa fa-flag-checkered -translate-x-1/2"></i>',
className: 'end-icon'
});
const latlngs = polyline.getLatLngs();
const latlngs = polyline.getLatLngs().flat(1);
polyline.setLatLngs(latlngs);
if (this._loadedCount == 0 || !this.options.itinerary) {
L.marker(latlngs[0], { icon: startIcon }).addTo(this._markers)

View File

@@ -816,7 +816,7 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
}
},
onEachFeature: (feature, layer) => feature.geometry && feature.geometry.type != 'Point' && this.addData(feature, layer),
});
});
this.import(this.__D3).then(() => {
this._initMapIntegrations(layer);