With Google Map v2, I would like to be able to trigger a function when clicking a text in the InfoWindow of a GMarker.
$(\".foo\").click(myFunction);
...
marke
The simplest and fully describe solutions.
The infoWindow itself should only contain a placeholder div with a unique id:
{
this.onInfoWindowOpen(this.props, e);
}}
>
And inside the Mapcontainer, you define an onInfoWindowOpen callback, that inserts a single component/container with the onClick event and render it to a placeholder div:
onInfoWindowOpen = () => {
const button = ();
ReactDOM.render(React.Children.only(button),document.getElementById("xyz"));
}
Here is a working example:
One more complete example MAP, Marker and InfoWindow:
If you have any questions so please comment.