From 958e1b6ad06b37d666eb7599857dc244c75a54dd Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Mon, 11 Jul 2022 16:32:16 +0300 Subject: [PATCH] Geomap: Fix layer extent (#51956) --- public/app/plugins/panel/geomap/utils/getLayersExtent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/geomap/utils/getLayersExtent.ts b/public/app/plugins/panel/geomap/utils/getLayersExtent.ts index fe73c991a6a..8284ac656e8 100644 --- a/public/app/plugins/panel/geomap/utils/getLayersExtent.ts +++ b/public/app/plugins/panel/geomap/utils/getLayersExtent.ts @@ -12,7 +12,9 @@ export function getLayersExtent(layers: Collection): Extent { if (l instanceof LayerGroup) { return getLayerGroupExtent(l); } else if (l instanceof VectorLayer) { - return l.getSource().getExtent() ?? []; + return [l.getSource().getExtent()] ?? []; + } else { + return []; } }) .reduce(extend, createEmpty());