mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: Fix data fit (#89247)
This commit is contained in:
parent
79540a20b9
commit
e53e6e7caa
@ -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()] ?? [];
|
||||
|
Loading…
Reference in New Issue
Block a user