{
await visibility();
let container = DOM.element("div", {
style: `width:${width *0.75}px;height:${width * 0.75}px`
});
yield container;
const map = L.map(container, {
renderer: L.canvas()
});
tileProviders(selectedTile).addTo(map);
let geojsonlayer = L.geoJson(gpxToGeoJson(tracksUploaded), {
style: function (feature) {
return {
color: trackColor,
weight: 3
};
},
onEachFeature: function (feature, layer) {
let endIcon = L.icon({
iconUrl: end_icon,
iconSize: [50, 50]
});
let startIcon = L.icon({
iconUrl: start_icon,
iconSize: [50, 50]
});
let firstPoint = feature.geometry.coordinates[0];
let lastPoint =
feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
}
});
geojsonlayer.addTo(map);
map.fitBounds(geojsonlayer.getBounds());
map.zoomOut(1);
let legend = L.control({ position: "bottomleft" });
legend.onAdd = function (map) {
let div = L.DomUtil.create("div", "legend");
div.appendChild(graph);
return div;
};
legend.addTo(map);
invalidation.then(() => {
map.remove();
});
}