add track casing + change color to magenta
This commit is contained in:
parent
e822c9a21c
commit
7c2df94fe8
5 changed files with 37 additions and 4 deletions
|
|
@ -13,6 +13,13 @@ BR.Elevation = L.Control.Elevation.extend({
|
|||
|
||||
update: function(track, layer) {
|
||||
this.clear();
|
||||
|
||||
// bring height indicator to front, because of track casing in BR.Routing
|
||||
if (this._mouseHeightFocus) {
|
||||
var g = this._mouseHeightFocus[0][0].parentNode;
|
||||
g.parentNode.appendChild(g);
|
||||
}
|
||||
|
||||
if (track && track.getLatLngs().length > 0) {
|
||||
this.addData(track.toGeoJSON(), layer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,13 @@ BR.Routing = L.Routing.extend({
|
|||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this._segmentsCasing = new L.FeatureGroup().addTo(map);
|
||||
|
||||
var container = L.Routing.prototype.onAdd.call(this, map);
|
||||
|
||||
this._segments.on('layeradd', this._addSegmentCasing, this);
|
||||
this._segments.on('layerremove', this._removeSegmentCasing, this);
|
||||
|
||||
// turn line mouse marker off while over waypoint marker
|
||||
this.on('waypoint:mouseover', function(e) {
|
||||
// L.Routing.Edit._segmentOnMouseout without firing 'segment:mouseout' (enables draw)
|
||||
|
|
@ -86,6 +91,17 @@ BR.Routing = L.Routing.extend({
|
|||
return container;
|
||||
}
|
||||
|
||||
,_addSegmentCasing: function(e) {
|
||||
var casing = L.polyline(e.layer.getLatLngs(), this.options.styles.trackCasing);
|
||||
this._segmentsCasing.addLayer(casing);
|
||||
e.layer._casing = casing;
|
||||
this._segments.bringToFront();
|
||||
}
|
||||
|
||||
,_removeSegmentCasing: function(e) {
|
||||
this._segmentsCasing.removeLayer(e.layer._casing);
|
||||
}
|
||||
|
||||
,_removeMarkerEvents: function(marker) {
|
||||
marker.off('mouseover', this._fireWaypointEvent, this);
|
||||
marker.off('mouseout' , this._fireWaypointEvent, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue