Avoid exception dragging during shutdown.

Really TileLayer.js should have a clean on remove that dis-connects
from drag, resize etc. but it doesn't yet.

Change-Id: Ia2c2268875187a2f1115b7d357fd56ab825bb77f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88578
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Michael Meeks 2020-02-13 04:25:36 +00:00 committed by Ashod Nakashian
parent 2adc32fab5
commit 1bc1034543

View file

@ -446,6 +446,7 @@ L.GridLayer = L.Layer.extend({
},
_updateScrollOffset: function () {
if (!this._map) return;
var centerPixel = this._map.project(this._map.getCenter());
var newScrollPos = centerPixel.subtract(this._map.getSize().divideBy(2));
var x = Math.round(newScrollPos.x < 0 ? 0 : newScrollPos.x);