-
Notifications
You must be signed in to change notification settings - Fork 935
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
Trying to get a hover event in application to trigger a marker animation without re-rendering entire map #273
Comments
or am i missing this in the other issues somewhere? |
It may be related to #240 |
@eamonpenland it would be best if you could post an example to reproduce your issue. |
@rewop sure thing https://gist.github.com/eamonpenland/6e135678dab10a5f9f9c547e8e0968ed Someone else wrote this code. I'm in the process of refactoring and improving! I think i will need to use shouldComponentUpdate. Ideally I would like to make the hover effect function like this example. http://istarkov.github.io/google-map-react/map/main/ |
Thanks @eamonpenland I will look into it asap. |
hey @rewop any thoughts on this issue? |
+1. If I only want to replace one of the markers instead of the entire map, do I still have to re-render the entire map? |
@eamonpenland Did you solve this issue/find a workaround? |
Sorry guys for the delay. I will look into this in the weekend. |
@RishabhJain96 Hey! sorry for the late reply. I haven't found a solution. Actually, I put the refactor of that component on the back burner as the re-render was annoying but not unusable in production. Revisiting the refactor now though. @rewop any ideas? |
I managed a workaround albeit using Rectangles rather than Markers. The gist was wrapping all the components in another component and then using MobX observables to prevent rerendering of the entire map. |
@RishabhJain96 interesting. Was there a reason for using Rectangles vs Markers? Any way you could share a gist? |
Sorry for the delay, I can't actually share a gist. The rectangle vs markers didn't actually matter. |
Hi @eamonpenland did you solve this issue/find a workaround? |
Please refer to Getting Help section in the README (or #469). |
Hi, I had a similar issue when I wanted to handle I could avoid re-rendering of whole map by splitting components and handle It still re-renders whole map when I add or remove I paste my code as sample. I hope it helps someone like me.
|
Hey I am also looking for a solution for this; I am building an airbnb-like app where you have a bunch of cards on the left and a map on the right. When the user hovers on a card, it should highlight the marker on the map. As everyone in this issue, I managed to do this but the map re-renders every time a new card is hovered on. That very annoying and considering the new pricing of google map, I can't affort this solution in production. Did anyone managed to solve this problem ? |
Hi, I have a hover event on a info card that corresponds to a marker on the map. When I hover on the card, I successfully trigger the animation on the correct marker, but it triggers a full refresh of the map component. How can I prevent the map from doing a full refresh? Currently, I am just changing the animation property on the component based on which card is hovered.
The trigger data is tied into redux and then passed into my map component by a parent container.
Any help would be awesome. Thanks!
The text was updated successfully, but these errors were encountered: