guard for null

against map.getPixelFromCoordinateInternal() returning null

Per https://github.com/openlayers/openlayers/issues/11478
This commit is contained in:
davidiamaf
2020-08-27 16:15:09 -04:00
committed by GitHub
parent 218335d0c8
commit ce0d744a10

View File

@@ -458,6 +458,9 @@ class Overlay extends BaseObject {
.getView()
.getCenterInternal());
const centerPx = map.getPixelFromCoordinateInternal(center);
if (!centerPx) {
return;
}
const newCenterPx = [centerPx[0] + delta[0], centerPx[1] + delta[1]];
const panOptions = panIntoViewOptions.animation || {};