Merge pull request #241 from matzepan/feature/center-track

Feature/Center the map to the track when hovering on it
This commit is contained in:
Norbert Renner 2019-10-11 12:39:35 +02:00 committed by GitHub
commit cb8aeee6ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,6 +196,7 @@ BR.TrackMessages = L.Class.extend({
edgeLatLngs = trackLatLngs.slice(startIndex, endIndex + 1);
this._selectedEdge = L.polyline(edgeLatLngs, this.options.edgeStyle).addTo(this._map);
this._map.panTo(this._selectedEdge.getBounds().getCenter());
},
_handleHoverOut: function(evt) {