需要定位的地方的经纬度获取:
https://lbs.amap.com/console/show/picker
import React from 'react';
import { connect } from 'dva';
import Map from 'react-amap/lib/map';//需要安装的模块
import Marker from 'react-amap/lib/marker';//需要安装的模块
import Information from "~/components/Information/Information";
import styles from "./Contact.less";
//import styles from './index.less';
@connect(state => ({
global: state.global,
}))
export default class Contact extends React.Component {
constructor(props){
super(props);
this.ajaxFlag = true;
this.state = {
}
}
componentDidMount(){
}
render(){
//116.429828,39.84504
const position = { longitude: 116.429828, latitude: 39.84504}//需要定位的经纬度
//zoom 需要放大的倍数
//宋家庄交通枢纽站是指定的添加的小气泡
return(
<div>
<Information>
{/*联系我们*/}
<p className={styles.title}>联系我们丨Contact us</p>
{/*地图显示*/}
<div className={styles.mapImg}>
<Map plugins={['ToolBar']} zoom={18} center={position}>
<Marker position={position} ><div className={styles.tag}>宋家庄交通枢纽站</div></Marker>
</Map>
</div>
<div className={styles.clean}></div>
{/*调整地图的小气泡*/}
{/*<div className={styles.clean}></div>*/}
{/*<div className={styles.tag}>宋家庄交通枢纽站</div>*/}
</Information>
</div>
)
}
}