Closed danranshizhi closed 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 } } ] )}> 这样设置是没有效果的,请问要如何设置
BaiduMap有mapStyle属性,直接设置为styleJson里的值即可,所有已经对接到百度地图的属性都能在BaiduMap的controlledPropTypes里看到
<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 } } ] )}> 这样设置是没有效果的,请问要如何设置