import React from 'react';
import TrajectoryMap from './conponents/trajectoryMap'; //轨迹播放
import RoadMap from './conponents/roadMap'; //路网静态地图
export default React.forwardRef((props, ref) => <Trajectory {...props} forwardRef={ref}></Trajectory>);

class Trajectory extends React.Component {
  render() {
    const { forwardRef, ...props } = this.props;
    const type = this.props.graph && this.props.graph.length > 200 ? 'default' : 'road';
    console.log(type, props);
    return (
      <>
        {props.dataAnimation && <RoadMap type={type} {...props} ref={forwardRef}></RoadMap>}
        {!props.dataAnimation && <TrajectoryMap type={type} {...props} ref={forwardRef}></TrajectoryMap>}
      </>
    );
  }
}
Trajectory.defaultProps = {
  dataAnimation: true,
};
