Only use Canvas for routing segments
Routing trailers are lagging behind and Canvas by default might have side effects (Plugins)
This commit is contained in:
parent
855dc81283
commit
72588f3fd9
5 changed files with 6 additions and 13 deletions
|
|
@ -63,16 +63,6 @@ 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());
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ BR.Routing = L.Routing.extend({
|
|||
|
||||
this._segmentsCasing = new L.FeatureGroup().addTo(map);
|
||||
this._loadingTrailerGroup = new L.FeatureGroup().addTo(map);
|
||||
this._loadingTrailerRenderer = L.svg(); // CSS animation based on SVG path element
|
||||
|
||||
var container = L.Routing.prototype.onAdd.call(this, map);
|
||||
|
||||
|
|
@ -389,7 +388,6 @@ BR.Routing = L.Routing.extend({
|
|||
opacity: this.options.styles.trailer.opacity,
|
||||
dashArray: [10, 10],
|
||||
className: 'loading-trailer',
|
||||
renderer: this._loadingTrailerRenderer,
|
||||
});
|
||||
this._loadingTrailerGroup.addLayer(loadingTrailer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ BR.tracksLoader = function (map, layersControl, routing, pois) {
|
|||
}
|
||||
},
|
||||
});
|
||||
|
||||
// make sure tracks are always shown below route by adding a custom pane below `leaflet-overlay-pane`
|
||||
map.createPane('tracks');
|
||||
map.getPane('tracks').style.zIndex = 350;
|
||||
|
||||
var tracksLoaderControl = new TracksLoader();
|
||||
tracksLoaderControl.addTo(map);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue