/** * 切换地图按钮 */ import React, { Component } from 'react'; import { Row, Col, Popover, Tooltip } from "antd"; import { connect } from "dva"; @connect((state) => ({ mapStyle: state.command.mapStyle, })) export default class SwitchStyle extends Component { constructor(props) { super(props); this.state = { visible: false, satellite: true }; } componentDidMount(){ // if(this.props.layerSatatus !=="aPicture"){ // this.props.setSatellite(false) // } } hide = () => { this.setState({ visible: false, }); }; handleVisibleChange = visible => { this.setState({ visible }); }; switch(param) { const { onSwitch } = this.props; this.hide() onSwitch && onSwitch(param); this.props.dispatch({ type: 'command/setMapStyle', payload: param }) if (param == 'satellite') { this.setState({ satellite: true }) } else { this.setState({ satellite: false }) } } render() { const { mapStyle, layerStatus } = this.props; const { satellite } = this.state; const content = (
{/* TAG: 根据需求437,去除功能 */} {/*
{ this.switch('dark') }}>深色地图
*/}
浅色地图
{ layerStatus == "aPicture" &&
卫星地图
}
); return (
); } }