google-maps-react
google-maps-react copied to clipboard
Dynamically updating marker icon svg fill color
Hi,
I'm injecting some svg code inline to the icon prop on the Marker component. When I click it I want to highlight the marker by changing the fill color on the
Here's some of the code: (and yes, i'm updating the state on click, so it re-renders the component).
<Marker
onClick={this.onMarkerClick.bind(this, item)}
icon={`data:image/svg+xml;utf-8, <svg width="50" height="50" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg"><circle fill="${fillVariable}" opacity="0.25" cx="50%" cy="50%" r="${radiusVariable}"/></svg>`}
/>
Hm... Not sure. Is this still an issue?
@auser yes
click to place a marker, then click on marker should change it to blue
observe the console to see that the icon fillColor has been updated after clicking
https://codesandbox.io/s/l5vojmv7ol
Why is this still open @auser? :(
Same issue with fillColor and strokeColor.