set_at事件中的Google Map可编辑多边形过滤器拖动事件

Jam*_*Lin 3 javascript events google-maps polygon drag

我有一个可编辑的多边形,我想听一个顶点被拖动时的事件(调整多边形的大小)。通常将路径附加到'set_at'事件是好的,但是当整个多边形被拖动时会触发很多事件。

google.maps.event.addListener(polygon, 'dragend', function(){search();});
google.maps.event.addListener(polygon.getPath(), 'insert_at', function(e, e1){search();});
google.maps.event.addListener(polygon.getPath(), 'remove_at', function(e, e1){search();});
//this also fires a lot of events when ploygon is dragged
google.maps.event.addListener(polygon.getPath(), 'set_at', function(){search();});
Run Code Online (Sandbox Code Playgroud)

我要实现的是有一个类似“ shape_changed”的事件,它在拖动时不会触发事件。

Dr.*_*lle 5

移除set_at-listener dragstart并重新分配set_at-listenerdragend