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

This commit is contained in:
nikki-kiga
2021-10-19 19:31:33 -07:00
committed by GitHub
parent 36e12e2b26
commit 43878ff05f
2 changed files with 7 additions and 4 deletions

View File

@@ -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}

View File

@@ -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) {