Avoiding vertex drag maps api v3
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: 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