基于百度地图api封装的React组件库
可查看示例文件夹下的示例使用示例代码,示例效果可访问预览地址
npm install react-bmap
import {Map,Marker,NavigationControl,InfoWindow} from 'react-bmap'
<Map center={{lng: 116.402544, lat: 39.928216}}>
<Marker position={{lng: 116.402544, lat: 39.928216}} />
<NavigationControl />
<InfoWindow position={{lng: 116.402544, lat: 39.928216}} text="内容" title="标题"/>
</Map>
- Map <Map center={{lng: 116.402544, lat: 39.928216}} zoom="12" />
- Marker <Marker position={{lng: 116.402544, lat: 39.928216}}/>
- Control
- InfoWindow <InfoWindow position={{lng: 116.402544, lat: 39.928216}}/>
- Circle <Circle center={{lng: 116.403119, lat: 39.929543}} fillColor='blue' strokeColor='white' radius="3000" />
- Polyline <Polyline strokeColor='green' path={[ {lng: 116.403119, lat: 39.929543}, {lng: 116.265139, lat: 39.978658}, {lng: 116.217996, lat: 39.904309} ]} />
- Polygon <Polygon fillColor='red' strokeColor='yellow' path={[ {lng: 116.442519, lat: 39.945597}, {lng: 116.484488, lat: 39.905315}, {lng: 116.443094, lat: 39.886494}, {lng: 116.426709, lat: 39.900001} ]} />
<MapvLayer data={[]} options={{}} />