Geomap: Fix layer extent (#51956)

This commit is contained in:
Alexander Zobnin 2022-07-11 16:32:16 +03:00 committed by GitHub
parent f1960b8ffc
commit 958e1b6ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,9 @@ export function getLayersExtent(layers: Collection<BaseLayer>): Extent {
if (l instanceof LayerGroup) { if (l instanceof LayerGroup) {
return getLayerGroupExtent(l); return getLayerGroupExtent(l);
} else if (l instanceof VectorLayer) { } else if (l instanceof VectorLayer) {
return l.getSource().getExtent() ?? []; return [l.getSource().getExtent()] ?? [];
} else {
return [];
} }
}) })
.reduce(extend, createEmpty()); .reduce(extend, createEmpty());