如何在函数 onDrawCreate
中的 console.log 中获取数组多边形我想将函数中的值多边形拉到某个变量
const onDrawCreate = ({features}) => (console.log(features[0].geometry.coordinates));
const onDrawUpdate = ({features}) => (console.log(features[0].geometry.coordinates));
export default class MapBox extends Component {
render() {
return (
<Map
style={"mapbox://styles/mapbox/streets-v10"}
zoom={zoom}
center={center}
containerStyle={{
height: "80vh",
width: "78vw"
}}>
<DrawControl onDrawCreate={onDrawCreate} onDrawUpdate={onDrawUpdate}/>
</Map>
);
}
}