img-mapper/react-img-mapper

preStrokeColor prop

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
I want an area to be always highlighted like the preFillColor works, but I want only the stroke to be drawn. The stroke should be white and if the mouse enter the area the stroke should turn green.

Describe the solution you'd like
I want a new prop preStrokeColor that allows to set different stroke color in highlighted and default state.

Describe alternatives you've considered
I tried using the the preFillColor with alpha 0, but that way the stroke color is always the same if the mouse moves over the are or not. I need the stroke to be always white and if the mouse enters the are the stroke should turn green.

I also tried to use the callbacks onMouseEnter and onMouseLeave to change the map areas stroke color. But the rerendering gave me flashings and unexpected results.

There could be a natural fillColor variable as well.
P.S.: I have just discovered, there is a preFillColor