Use Polyline.getCenter instead of bounds to center hover on map (#241)
Returns point on line at half distance instead of centroid of bounds, which can be far off the line for curved lines and not show line at high zooms.
This commit is contained in:
parent
b57c4f2bf6
commit
0781bb85dc
1 changed files with 1 additions and 1 deletions
|
|
@ -208,7 +208,7 @@ BR.TrackMessages = L.Class.extend({
|
||||||
|
|
||||||
this._hoveredEdge = this._getRowEdge(tr).addTo(this._map);
|
this._hoveredEdge = this._getRowEdge(tr).addTo(this._map);
|
||||||
if (this.options.syncMap && !this._selectedEdge) {
|
if (this.options.syncMap && !this._selectedEdge) {
|
||||||
this._map.panTo(this._hoveredEdge.getBounds().getCenter());
|
this._map.panTo(this._hoveredEdge.getCenter());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue