From e53e6e7caa29b8caa7bf30c40d662e8c39a9d08d Mon Sep 17 00:00:00 2001 From: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:09:47 -0700 Subject: [PATCH] Geomap: Fix data fit (#89247) --- public/app/plugins/panel/geomap/utils/getLayersExtent.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/geomap/utils/getLayersExtent.ts b/public/app/plugins/panel/geomap/utils/getLayersExtent.ts index 300808964b2..425009cbec1 100644 --- a/public/app/plugins/panel/geomap/utils/getLayersExtent.ts +++ b/public/app/plugins/panel/geomap/utils/getLayersExtent.ts @@ -1,6 +1,7 @@ import { createEmpty, extend, Extent } from 'ol/extent'; import LayerGroup from 'ol/layer/Group'; import VectorLayer from 'ol/layer/Vector'; +import VectorImage from 'ol/layer/VectorImage'; import { MapLayerState } from '../types'; @@ -11,12 +12,12 @@ export function getLayersExtent( layer: string | undefined ): Extent { return layers - .filter((l) => l.layer instanceof VectorLayer || l.layer instanceof LayerGroup) + .filter((l) => l.layer instanceof VectorLayer || l.layer instanceof LayerGroup || l.layer instanceof VectorImage) .flatMap((ll) => { const l = ll.layer; if (l instanceof LayerGroup) { return getLayerGroupExtent(l); - } else if (l instanceof VectorLayer) { + } else if (l instanceof VectorLayer || l instanceof VectorImage) { if (allLayers) { // Return everything from all layers return [l.getSource().getExtent()] ?? [];