loleaflet: don't scroll based on the selection, but based on the cursor
This commit is contained in:
parent
c639e76ac2
commit
b518046a59
1 changed files with 0 additions and 10 deletions
|
@ -417,16 +417,6 @@ L.TileLayer = L.GridLayer.extend({
|
|||
selectionCenter = selectionCenter.add(topLeftTwips);
|
||||
selectionCenter = selectionCenter.add(offset.divideBy(2));
|
||||
}
|
||||
// average of all rectangles' centers
|
||||
selectionCenter = selectionCenter.divideBy(strTwips.length / 4);
|
||||
selectionCenter = this._twipsToLatLng(selectionCenter);
|
||||
if (!this._map.getBounds().contains(selectionCenter)) {
|
||||
var center = this._map.project(selectionCenter);
|
||||
center = center.subtract(this._map.getSize().divideBy(2));
|
||||
center.x = Math.round(center.x < 0 ? 0 : center.x);
|
||||
center.y = Math.round(center.y < 0 ? 0 : center.y);
|
||||
this._map.fire('scrollto', {x: center.x, y: center.y});
|
||||
}
|
||||
|
||||
var polygons = L.PolyUtil.rectanglesToPolygons(rectangles, this);
|
||||
for (i = 0; i < polygons.length; i++) {
|
||||
|
|
Loading…
Reference in a new issue