fix(plugin-map): should filter empty data, Close T-1380 (#2447)

This commit is contained in:
Dunqing 2023-08-15 08:39:14 +08:00 committed by GitHub
parent 26cd9e810c
commit 95a0e2de83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -137,7 +137,9 @@ export const AMapBlock = (props) => {
return overlay; return overlay;
}); });
}) })
.flat(); .flat()
.filter(Boolean);
mapRef.current?.map?.setFitView(overlays); mapRef.current?.map?.setFitView(overlays);
const events = overlays.map((o: AMap.Marker) => { const events = overlays.map((o: AMap.Marker) => {

View File

@ -173,7 +173,8 @@ export const GoogleMapsBlock = (props) => {
return overlay; return overlay;
}); });
}) })
.flat(); .flat()
.filter(Boolean);
overlaysRef.current = overlays; overlaysRef.current = overlays;
mapRef.current?.setFitView(overlays); mapRef.current?.setFitView(overlays);