diff --git a/app/charts/map/chart-map.tsx b/app/charts/map/chart-map.tsx index bc533c2d1..fae4f2457 100644 --- a/app/charts/map/chart-map.tsx +++ b/app/charts/map/chart-map.tsx @@ -155,7 +155,18 @@ export const ChartMapVisualization = ({ } }, [areaLayer, dimensions, observations, symbolDimensionIri, geoCoordinates]); - if (measures && dimensions && observations) { + const areaLayerPrepared = + areaDimensionIri !== "" ? areaLayer !== undefined : true; + const symbolLayerPrepared = + symbolDimensionIri !== "" ? symbolLayer !== undefined : true; + + if ( + measures && + dimensions && + observations && + areaLayerPrepared && + symbolLayerPrepared + ) { return ( ); - } else if (fetching) { + } else if (fetching || !areaLayerPrepared || !symbolLayerPrepared) { return ; } else if (error) { return ; diff --git a/app/charts/map/map.tsx b/app/charts/map/map.tsx index 4b79bdc63..d692fe78a 100644 --- a/app/charts/map/map.tsx +++ b/app/charts/map/map.tsx @@ -192,6 +192,8 @@ export const MapComponent = () => { ); const baseLayerStyle = useMemo(() => getBaseLayerStyle({ locale }), [locale]); + const featuresLoaded = + features.areaLayer !== undefined || features.symbolLayer !== undefined; return ( @@ -208,9 +210,7 @@ export const MapComponent = () => { - {(areaLayer.data.length > 0 - ? shapes.features !== undefined - : features.symbolLayer?.points.length !== undefined) && ( + {featuresLoaded && (