简体   繁体   中英

Marker animation in google-maps-react

Does anyone know how to add animation to Marker in google-maps-react library or any kind of google-maps library for React?

Thank you,

这对我有用:

<Marker defaultAnimation={google.maps.Animation.DROP} />

It's in the docs.

https://developers.google.com/maps/documentation/javascript/examples/marker-animations .

marker = new google.maps.Marker({
  map: map,
  draggable: true,
  animation: google.maps.Animation.DROP,
  position: {lat: 59.327, lng: 18.067}
});

marker.setAnimation(google.maps.Animation.BOUNCE);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM