SocialGouv/react-departements

Display a text department wise

Closed this issue · 4 comments

Hi,

Is it possible to display a some text on each departmen? which we are passing from departements.

<France departements={[75, 89, 21, 33, 47, 74, "2a", 976]} />;

Thanks

Hi, not possible at the moment, but happy to help land a pull request for it

One could imagine a retro compatible API that could handle both formats, for example

const dtps = [{id: 75, text:"Ici c'est Paris!", background: "blue"}, 89, 21, 33, 47, 74, "2a", 976]} />;

Another option is using React:

<France>
   <Departement id="75">Some text for <b>Paris</b></Department>
   <Departement id="23" backgroundColor="pink"/>
</France>

Now, as the map is SVG based, how should the overlay be displayed ?

Actually I'm trying to update svg map based on dynamic data change from dropdown. Please have a look on my attached screenshot.
Is it posible to achieve this feature using your package? Or should I look something else.
Thanks
image

this is "regions" not "departements" so you'd better use svg-maps or similar imho

As departements are smaller areas, only an overlay on mouseover could fit i guess.