diff --git a/components/Map/Map.tsx b/components/Map/Map.tsx index a4ebf9b..a1b00bd 100644 --- a/components/Map/Map.tsx +++ b/components/Map/Map.tsx @@ -42,14 +42,24 @@ const Tooltip: React.FC<{ dataService: DataService }> = ({ dataService }) => { } const { x, y, id } = tooltip const datasets = Object.keys(dataService.data) - const data = datasets.map((d) => dataService.data[d]?.[id]).filter(Boolean) + const data = datasets.map((d) => dataService.data[d]?.[+id]).filter(Boolean) return ( -
+
{data.map((d) => Object.entries(d!).map(([k, v], i) => { return ( -

+

{k}: {v}

) @@ -102,10 +112,10 @@ export const Map = () => { getFillColor: [isReady, currentColumnSpec?.column], }, onHover: (info: any) => { - if (info?.x !== -1 && info?.y !== -1) { + if (info?.x && info?.y) { dispatch(setTooltipInfo({ x: info.x, y: info.y, id: info.object?.properties?.GEOID })) } else { - // dispatch(setTooltipInfo(null)) + dispatch(setTooltipInfo(null)) } }, lineWidthMinPixels: 1,