-
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
Setting map options leads to flicker #86
Comments
Meanwhile I figured out the source of my problem. I define custom position of the map controls and pass the map options as props:
By some reason, React thinks the props has changed (while they aren't) and redraws the map controls. |
More exactly, any customisation of the map controls in props leads to controls flickering when the children are updated. E.g.
Do you have any suggestion how to solve that? |
Hi @ksavenkov , I took a day to rewrite the module from scratch on #88 . Not sure if it will help but it will be great if you could take a look at it. Thanks! |
@tomchentw, great improvement! Yes, now the problem resolved. However, it's a bit tedious to write "default" prefix for all 10+ map options - is that possible to make defaultOptions={...} prop work for GoogleMap component much like it works for markers etc. ? |
|
I mean, it seems they aren't supported for GoogleMap component. |
I saw there's a |
My bad - I wrapped props for GoogleMap in |
I actually just ran into a similar situation. I'm leaving this note for someone else in the future. After a good amount of hair pulling I found that if you're passing "options" and the map is flickering like crazy, you should instead pass the values as "defaultOptions". |
map is flickering while typing input and searchbox |
This is actually a question. I want to highlight polylines on hover event.
I am doing that in in the following fashion:
That works, but leads to blinking of the map controls - apparently, they are rerendered. What I expect to have - to mimic native Google Maps solution, when you bind polyline.setOptions to the mouseover event, which doesn't lead to rerendering of the controls.
What's the best way to achieve that with react-google-maps?
Thanks!
The text was updated successfully, but these errors were encountered: