terence55 / react-baidu-maps

React Components for Baidu Maps
24 stars 4 forks source link

怎么设置地图的主题色 #8

Closed danranshizhi closed 6 years ago

danranshizhi commented 6 years ago

<BaiduMap enableScrollWheelZoom enableDragging={this.state.enableDragging} defaultZoom={this.state.zoom} id="location" mapContainer={<div style={{ height: document.body.clientHeight-62-40 }} />} ref={instance => (this.map = instance)} setMapStyle = {() => ( "styleJson":[ { "featureType": "all", "elementType": "geometry", "stylers": { "hue": "#007fff", "saturation": 89 } } ] )}> 这样设置是没有效果的,请问要如何设置

terence55 commented 6 years ago

BaiduMap有mapStyle属性,直接设置为styleJson里的值即可,所有已经对接到百度地图的属性都能在BaiduMap的controlledPropTypes里看到