Closed ultimateakash closed 1 year ago
How to listen onDragEnd and onClick(extend polygon) events using DrawingManager as we have on Polygon
onDragEnd
onClick
DrawingManager
os: windows 11
node --version: 14.17.3
react version: 17.0.2
@react-google-maps/api: 2.12.0
I need to edit and drag the polygon after drawing on the map. I have tried with addListener and its working
const onOverlayComplete = ($overlayEvent) => { overlayRef.current = $overlayEvent.overlay; drawingManagerRef.current.setDrawingMode(null); google.maps.event.addListener(overlayRef.current, 'dragend', handlePolygonEvents); google.maps.event.addListener(overlayRef.current.getPath(), 'insert_at', handlePolygonEvents); google.maps.event.addListener(overlayRef.current.getPath(), 'remove_at', handlePolygonEvents); google.maps.event.addListener(overlayRef.current.getPath(), 'set_at', handlePolygonEvents); }
but I have checked the documentation for DrawingManager, there is no way to handle the above events. please help. https://react-google-maps-api-docs.netlify.app/#drawingmanager
Please provide an explanation of the issue
How to listen
onDragEnd
andonClick
(extend polygon) events usingDrawingManager
as we have on PolygonYour Environment
os: windows 11
node --version: 14.17.3
react version: 17.0.2
@react-google-maps/api: 2.12.0
How does it behave?
I need to edit and drag the polygon after drawing on the map. I have tried with addListener and its working
but I have checked the documentation for
DrawingManager
, there is no way to handle the above events. please help. https://react-google-maps-api-docs.netlify.app/#drawingmanager