huiyan-fe / react-bmapgl

基于百度地图JavaScript GL版API封装的React组件库
http://huiyan.baidu.com/github/react-bmapgl/
MIT License
112 stars 19 forks source link

在Marker组件获取实例之后,在实例中的对象marker上setAnimation(BMAP_ANIMATION_BOUNCE)不生效的问题 #82

Open Loveapleace opened 3 months ago

Loveapleace commented 3 months ago
class MapMarker extends React.Component {
  render(): React.ReactNode {
    return (
        <Marker
          position={{
            lng: Number(lng),
            lat: Number(lat),
            equals: undefined!
          }}
          icon={CommonIcon}
          map={undefined!}
          ref={(e) => this.markerRef(e)}
        />
    )
  }

  markerRef=(e: any) => {
      const marker: BMapGL.Marker = e.marker
      marker.setAnimation(BMAP_ANIMATION_BOUNCE)
    }
}
Loveapleace commented 3 months ago

是否在setAnimation之后还有其他方法需要调用,或者还有其他可以实现标记点动画效果的吗?