huiyan-fe / react-bmap

基于百度地图JavaScript API封装的React组件库
http://huiyan-fe.github.io/react-bmap
MIT License
497 stars 97 forks source link

NavigationControl NavigationControlType怎么设置 #16

Closed yishangtanhuan closed 7 years ago

yishangtanhuan commented 7 years ago

<Map center={{ lng: 105.403119, lat: 38.028658 }} zoom='5' mapStyle={simpleMapStyle}>

        <MapTypeControl />
        <ScaleControl />
        <OverviewMapControl />
    </Map>

代码中的控件类型怎么设置,比如NavigationControlType=BMAP_NAVIGATION_CONTROL_PAN,在react中怎么写呢

Junior2Ran commented 7 years ago

https://github.com/huiyan-fe/react-bmap/blob/master/docs/examples/components/control.js react-bmap封装了几个常用控件,在NavigationControl控件中要设置其type属性可以直接传递参数,如下: <NavigationControl type={BMAP_NAVIGATION_CONTROL_ZOOM}/>