Polygon paths_changed event missing. Any alternative way please?

120 views
Skip to first unread message

Q

unread,
Dec 30, 2011, 2:57:09 PM12/30/11
to google-map...@googlegroups.com
Hi,
 

My application requires the change listener for overlays, such as Circle, Rectangle and Polygon.

While there are center_changed, radius_changed events for Circle and bounds_changed event for Rectangle, there is no change event (e.g. paths_changed) for Polygon. All availables are mouse related event which do not seem to be relevant.

I was wondering:

  1. Why no such event as “paths_changed” for Polygon? (Thought this may be quite straight forward to do)
  2. While no change event for Polygon, is there any alternative way I could automatically detect a polygon has been changed (edited)?

Any anwser or advice would be much appreciated.

Enoch Lau (Google Employee)

unread,
Jan 3, 2012, 3:29:09 AM1/3/12
to google-map...@googlegroups.com
See http://code.google.com/apis/maps/documentation/javascript/overlays.html#user_editable_shapes_events

You listen to events on the polygon's path, not the polygon itself.

Enoch

Qunhuan

unread,
Jan 4, 2012, 8:13:50 AM1/4/12
to google-map...@googlegroups.com
Ah, that easy :-)

Changed my code and worked immediately. Thanks a lot!

Qunhuan
Reply all
Reply to author
Forward
0 new messages