Improve route interactivity by using canvas

This commit is contained in:
Norbert Renner 2021-05-20 13:11:18 +02:00
parent 2cd233f70d
commit 47f3a06be6
3 changed files with 16 additions and 1 deletions

View file

@ -63,6 +63,16 @@ BR.Heightgraph = function (map, layersControl, routing, pois) {
},
},
onAdd(map) {
// As we're using canvas, initialize an `svg` root that is needed for map marker,
// see `Heightgraph._showMapMarker`
if (!document.querySelector('.leaflet-overlay-pane svg')) {
L.svg().addTo(map);
}
return L.Control.Heightgraph.prototype.onAdd.call(this, map);
},
addBelow: function (map) {
// waiting for https://github.com/MrMufflon/Leaflet.Elevation/pull/66
// this.width($('#map').outerWidth());