nebula-bmap
v0.1.5
Published
react-bmap
Downloads
5
Readme
nebula-bmap
A react baidu map components
You can use npm or yarn to install this package. 你可以用npm或者yarn安装
npm install nebula-bmap
or
yarn add nebula-bmap
用法 Usage
import React, { useState } from 'react';
import { Map, Marker } from 'nebula-bmap';
export default () => {
const [showMarker, setShowMarker] = useState(false);
return (
<div style={{ width: '100%', height: '100%' }}>
<Map
protocal="https"
version="1.0"
mode="webgl"
akey="your key"
mapStyleV2={{ styleId: "your style id" }}
zoom={14}
center={[108.95509, 34.27779]}
// tile={50}
// heading={64.5}
scrollWheelZoom
inertialDragging
>
<Marker />
</Map>
</div>
);
}
注意 Attention ⚠️
Map组件应挂载在一个有固定宽高的容器内部。