Merge pull request #672 from tbsmark86/bug-clear
Bugfix: Selected edges stick on map after route clear
This commit is contained in:
commit
f99f3c5a0a
2 changed files with 20 additions and 0 deletions
|
|
@ -91,6 +91,14 @@ BR.TrackAnalysis = L.Class.extend({
|
|||
|
||||
if (segments.length === 0) {
|
||||
$('#track_statistics').html('');
|
||||
if (this.highlightedSegments) {
|
||||
this.map.removeLayer(this.highlightedSegments);
|
||||
this.highlightedSegments = null;
|
||||
}
|
||||
if (this.highlightedSegment) {
|
||||
this.map.removeLayer(this.highlightedSegment);
|
||||
this.highlightedSegment = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ BR.TrackMessages = L.Class.extend({
|
|||
}
|
||||
|
||||
this._destroyTable();
|
||||
this._destroyEdges();
|
||||
|
||||
if (data.length === 0) {
|
||||
this.listenMapEvents(layer, false);
|
||||
|
|
@ -146,6 +147,17 @@ BR.TrackMessages = L.Class.extend({
|
|||
return ele || document.getElementById('datatable');
|
||||
},
|
||||
|
||||
_destroyEdges: function () {
|
||||
if (this._selectedEdge) {
|
||||
this._map.removeLayer(this._selectedEdge);
|
||||
this._selectedEdge = null;
|
||||
}
|
||||
if (this._hoveredEdge) {
|
||||
this._map.removeLayer(this._hoveredEdge);
|
||||
this._hoveredEdge = null;
|
||||
}
|
||||
},
|
||||
|
||||
_getColumns: function (headings, data) {
|
||||
var columns = [],
|
||||
defaultOptions,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue