-
-
Notifications
You must be signed in to change notification settings - Fork 453
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 apply animation to overlay view #224
Comments
I don't follow. Do you have some animation in place or are you just expecting smooth transition between two supplied points? I think that's out of the scope of the library. Either you have to have a very detailed path of points (can be calculated) or take care of movement smoothing somehow (not sure how). |
So, google calculates the So a transition is all I've added. As I said, older versions of Actually, aside from not being able to animate, performance is really bad as soon as I get more than about 30 OverlayViews on the map, things get really janky. So this might not actually be about animations, and maybe more about performance implications. So I think if dom nodes weren't remounted on each rerender, both my problems would be solved. If supporting maps that have that many elements isn't actually part of the scope of this library, just let me know :) |
Alright, in that case, it's more about #198 (comment). @JustFly1984 Probably best to close that issue and track it in this one which is more on the point. |
closing an issue in favor to #198 |
Unable to apply animation to OverlayViews because of remounting
Your Environment
os: mac
node --version: 10.13.0
react version: 16.9.0
webpack version: 4.39.2
@babel version: 7.5.5
@react-google-maps/api version: 1.7.5
How does it behave?
In this animated gif, the vehicle jumps around and the title flashes out and in again.
When a new array of "vehicle markers" is passed in and
OverlayView
s are rendered, the animation is broken (title fades back in, indicating a complete remounting of the element) and therefore the position is not animating either.How should it behave correctly?
In this animated gif, you see the transition of position happens, with the animation and no flashing of the title.
I upgraded to
react v16
and to@react-google-maps/api
fromreact-google-maps v4.11.0
. This second animated gif shows animations running smoothly under the oldreact-google-maps v4.11.0
. I noticed animations broke down when I upgraded toreact-google-maps v9.4.5
- but I can't identify what in the source code changed to prevent animations from working between rerenders.Sample Code
Parent Component:
(A new array of
filteredVehicles
is passed in each time vehicle positions are updated)Map Component
Calling the
renderVehicles
function in the children ofGoogleMap
(see next)renderVehicles()
This returns an array of
OverlayView
s, each having a key assigned to it.I wish I could provide some ideas on how to fix this, but as I said, I don't have any. Thanks for taking over
react-google-maps
, by the way!The text was updated successfully, but these errors were encountered: