import React, {Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { MJMap, MapSuggestion, utils } from 'react-gmap-mj';
class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div style={{width: '500px', height: '500px'}} >
<MJMap
centerDisabled={false}
zoomDisabled={false}
options={options}
posOptions={null}/>
<MapSuggestion
className={`custom-map-search ${showErrNoAddr||showErrNoCoord ? 'error' : ''}`}
width='100%'
allowClear={true}
allowSearch={true}
onSearchClick={this.onSearchClick}
onClearClick = {this.onClearClick}
placeholder='请搜索地址,或单击地图直接标记中心点'
popupContainer= {() => document.getElementById('custom-poi-container')}
value={addr}
onSelect={this.handleSelect}/>
</div>
)
}
}
ReactDOM.render(
<App />,
document.getElementById('container')
);