mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: Avoid exceptions when missing data and values (heatmap and zoom settings)
This commit is contained in:
@@ -49,9 +49,9 @@ export const MapViewEditor: FC<StandardEditorProps<MapViewConfig, any, GeomapPan
|
||||
onChange({
|
||||
...value,
|
||||
id: v.id,
|
||||
lat: v.lat ?? value.lat,
|
||||
lon: v.lon ?? value.lon,
|
||||
zoom: v.zoom ?? value.zoom,
|
||||
lat: v.lat ?? value?.lat,
|
||||
lon: v.lon ?? value?.lon,
|
||||
zoom: v.zoom ?? value?.zoom,
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -99,7 +99,7 @@ export const MapViewEditor: FC<StandardEditorProps<MapViewConfig, any, GeomapPan
|
||||
<InlineFieldRow>
|
||||
<InlineField label="Zoom" labelWidth={labelWidth} grow={true}>
|
||||
<NumberInput
|
||||
value={value.zoom ?? 1}
|
||||
value={value?.zoom ?? 1}
|
||||
min={1}
|
||||
max={18}
|
||||
step={0.01}
|
||||
|
||||
@@ -74,6 +74,9 @@ export const heatmapLayer: MapLayerRegistryItem<HeatmapConfig> = {
|
||||
vectorLayer.getSource().removeFeature(feature);
|
||||
});
|
||||
|
||||
if (!frame) {
|
||||
return;
|
||||
}
|
||||
// Get data points (latitude and longitude coordinates)
|
||||
const info = dataFrameToPoints(frame, matchers);
|
||||
if (info.warning) {
|
||||
|
||||
Reference in New Issue
Block a user