Skip to content

Commit

Permalink
feat: Add tooltip showing municipality name
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Sep 9, 2024
1 parent 0d7560d commit 726b601
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions website/src/components/Mutations/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,25 @@ const MutationsMap = ({
geoData: ReturnType<typeof useGeoData>["data"];
} & ComponentProps<typeof DeckGL>) => {
return (
<DeckGL controller={MapController} {...props}>
<DeckGL
controller={MapController}
getTooltip={({
object,
}: {
object: { properties: { name: string } };
}) => {
if (!object) {
return;
}
return "Municipality: " + object.properties.name;
}}
{...props}
>
{geoData.municipalities && (
<GeoJsonLayer
id="municipalities"
data={geoData.municipalities}
pickable={false}
pickable={true}
stroked={true}
filled={true}
extruded={false}
Expand Down

0 comments on commit 726b601

Please sign in to comment.