/**
 * 切换地图按钮
 */
import React, { Component } from 'react';
import { Row, Col } from 'antd';
export default class SwitchMap extends Component {
  constructor(props) {
    super(props);
    this.state = {
      layerSatatus: props.layerSatatus
    };
  }

  componentDidMount() {}
  componentWillReceiveProps(nextPorps) {
    this.setState({
      layerSatatus: nextPorps.layerSatatus
    });
  }
  render() {
    return (
      <div className="radio_container-switch">
        <div
          className="switch-button"
          className={
            this.state.layerSatatus==='attendance' ? 'switch-button active' : 'switch-button'
          }
          onClick={() => {
            this.props.switchMap('attendance');
          }}
        >
          <img src={require('../../../assets/images/prevention/map.png')}></img>
          <div className="text">基础信息</div>
        </div>
        <div
          className="switch-button"
          className={
            this.state.layerSatatus==='person' ? 'switch-button active' : 'switch-button'
          }
          onClick={() => {
            this.props.switchMap('person');
          }}
        >
          <img src={require('../../../assets/images/prevention/person.jpg')}></img>
          <div className="text">三维信息</div>
        </div>
        <div
          className={
            this.state.layerSatatus==='mass' ? 'switch-button active' : 'switch-button'
          }
          onClick={() => {
            this.props.switchMap('mass');
          }}
        >
          <img src={require('../../../assets/images/prevention/mass.png')}></img>
          <div className="text">大数据闪点图层</div>
        </div>
      </div>
    );
  }
}
