Please do not post unformatted code into issues, and please do not ask questions. Only real issues, PR's or feature requests are allowed. Minimal reproduction in codesandbox.io is required.
When an animation is applied to a MarkerF component, it will continue that animation until replaced with a different animation. It will never stop.
How should it behave correctly?
When the MarkerF component receives any value appropriate for the Google Map Marker#setAnimation() method, that method should be called with that value. This includes undefined as a value which stops an animation.
Basic implementation of incorrect behavior in codesandbox.com
Issue template
You can donate or became a sponsor https://opencollective.com/react-google-maps-api#category-CONTRIBUTE
If you want to ask question, please ask it in Github Discussions, Spectrum.chat or Slack channel
Please do not post unformatted code into issues, and please do not ask questions. Only real issues, PR's or feature requests are allowed. Minimal reproduction in codesandbox.io is required.
Please provide an explanation of the issue
When using the
MarkerF
component with animations, animations are not stopped when anull
,undefined
, or otherwise falsy value is provided. The reason can be traced to https://github.com/JustFly1984/react-google-maps-api/blob/develop/packages/react-google-maps-api/src/components/drawing/Marker.tsx#L282-L284, where.setAnimation()
is not called on the Marker instance unless the value is truthy.Your Environment
os: mac
node --version: v18.16.0
react version: 18.2.0
webpack version: 5.78.0
@babel version: 7.21.4
@react-google-maps/api version: 2.18.1
How does it behave?
When an animation is applied to a
MarkerF
component, it will continue that animation until replaced with a different animation. It will never stop.How should it behave correctly?
When the
MarkerF
component receives any value appropriate for the Google MapMarker#setAnimation()
method, that method should be called with that value. This includesundefined
as a value which stops an animation.Basic implementation of incorrect behavior in codesandbox.com