Reputation: 10422
I'm using the GMaps API v 3 Drawing Manager to let users draw shapes on a map.
I can use the complete
events to trigger actions when a shape is added to the map (eg. overlaycomplete
or polygoncomplete
)-- but I am also allowing the user to edit the completed shapes.
Is there a way to trigger an action when a shape is changed? I can't see any way to fire another function when a shape is modified.
Upvotes: 7
Views: 12552
Reputation: 4133
List of editing events can be found here:
Here is an example how to use it with DrawingManager when a circle's radius has changed:
google.maps.event.addListener(drawingManager, 'circlecomplete', function (circle) {
google.maps.event.addListener(circle, 'radius_changed', function () {
console.log('radius changed');
});
});
You can use the same approach for polygons/rectangles.
Upvotes: 13