-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot bind onClick to Marker or his childrens #19
Comments
I have the same issue |
I got it this way: I set to Marker latitude, longitude and a new parameter "handleClick" what is a function that will retrieve the click event:
After, in the path "yourProject/node_modules/react-here-maps/dist/Marker.js" you have to modify the method "Marker.prototype.addMarkerToMap" adding these lines:
|
Hi, thanks for the advice. i've added 2 props to Marker element: onTap (receive function) and styleClass (receive string of classes that added to 'dom-marker' element, i'm using it to edit the marker z-index). for example: |
Hi again if you are interested I have tried to retrieve a 'mapviewchange' event from a map. First, I sent to HEREMap.js (yourProject/node_modules/react-here-maps/dist) a function called 'userMove':
In the HEREMap.prototype.componentDidMount function I added these lines:
This is the full method code:
I used this for call to back to retrieve data using map position |
…-child-props-change Rerender marker on child props change
Is it possible to bind a onClick event to Marker element or to one of his children's?
<Marker {...coords} onClick={()=>console.log('test')}><div className='marker-child' onClick={()=>console.log('test')}></div></Marker>
The text was updated successfully, but these errors were encountered: