Very simple. I want to avoid the dragging of the first and last vertices. I've tried using dragstart event, but apparently polyline doesn't listen to that one. I've managed to do something with set_at. I have the last position stored, when set_at is called, I check the index of that vertex, and then set the latLng for that vertex to the old one. This was only possible using setAt function which fires the event again. So a created a ignoreNextEvent flag, so It won't go for an infinite loop. problem is, setAt function os used plenty of times by the maps api, and the solution, although works, is