Geomap: Avoid exceptions when missing data and values (heatmap and zoom settings) (#40664)

(cherry picked from commit 43878ff05f)

Co-authored-by: nikki-kiga <42276368+nikki-kiga@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2021-10-20 07:36:04 -07:00
committed by GitHub
co-authored by nikki-kiga
parent e47b07ed19
commit 4a7abae6ae
2 changed files with 7 additions and 4 deletions
@@ -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) {