zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.03k stars 424 forks source link

How to change text color for country names #331

Closed bbolek closed 11 months ago

bbolek commented 12 months ago

Hey all,

I want to change color of text for country names. image

style={{
            default: {
              fill: '#EEE',
              color: '#FFFF00',
            },
          }}

This did not work as it is SVG probably.

Can you help me on this?

Thanks

zimrick commented 12 months ago

Usually fill should change the text color if applied to a text svg tag. https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text

The code above is a little bit too little context to understand what is happening exactly, but it seems that you are trying to apply a fill to the geography and a text color to the label on it. In SVG this would be a separate element though, so the above will not work as intended.

bbolek commented 11 months ago

Yes @zimrick, thats is correct. Is there any easy way to change text color of label of country?

Thank you

bbolek commented 11 months ago

Ignore it please, I implemented custom Marker, and fixed it.

Thank you

EnettyTech commented 3 months ago

Ignore it please, I implemented custom Marker, and fixed it.

Thank you

How to show name of country in map? @bbolek