Я хочу получить новые координаты из onDragEnd компонента Polygon response-google-map
class CustomMap extends React.Component {
handlePolygonDrag = (e) => {
console.log(e); // event does not have a polygon object
console.log(this); // this refers to the CustomMap component, not the Polygon
}
render() {
return (
<Div>
<Map>
<Polygon
path={R.map((index) => ({
lat: index[0],
lng: index[1],
}))(currentFence.shape.loc.coordinates)}
key={1}
options={this.state.polygon.options}
onDragEnd={this.handlePolygonDrag}
/>
</Map>
</Div>
);
}
}
Но не могу получить ссылку на полигон после перетаскивания. Пожалуйста, смотрите комментарии кода для фактических и ожидаемых результатов.