/** * 所有地图图层 */ import React, { Component } from 'react'; // import { Icon, Input, Button,message } from "antd"; // import styles from './index.less'; export default class EarthMap extends Component { constructor(props) { super(props); this.state = { // loadTransition: false, //地球切换成地图时的过渡 // keyWord: "" }; } componentDidMount() { // setTimeout(() => { // }, 5000) } // 利用此事件来决定何时需要重新渲染组件。 shouldComponentUpdate(nextProps, nextState) { if(nextProps.showEarchMap !== this.props.showEarchMap) { return true; } return false; } // TAG: 根据需求 394,取消搜索功能 // getCenterMark(e){ // console.log(this.state.keyWord) // this.props.clearRotation() // var placeSearch = new AMap.PlaceSearch({city: '全国'}); // placeSearch.search(this.state.keyWord, (status, result)=> { // // 搜索成功时,result即是对应的匹配数据 // console.log(result) // if(status === "complete" && result.poiList.count>0){ // let centerPoint = result.poiList.pois[0].location; // this.props.earthMap.centerAndZoom(new BMapGL.Point(centerPoint.lng, centerPoint.lat), 10); // console.log('EarthMap'); // // this.props.markEarthSearch({lng:centerPoint.lng, lat:centerPoint.lat}); // }else{ // message.info("未搜索到该地点") // } // }) // } render() { const {showEarchMap} = this.props return (
{/* 地球图层 */} {/* TAG: 根据需求 394,取消搜索功能*/} {/*
{ this.setState({ keyWord: e.target.value.trim(), }); }} onPressEnter={() => { //按下回车的事件 this.getCenterMark(); }} />
*/} {/*
*/}
); } }