I really don't see what is so problematic. Did you try using itemChange() as I told you? You can check there if the new position of the item is on the polyline and if not, snap it to the desired position. The fact that the example uses a rectangular area doesn't mean you can only snap to rectangular areas.
Bookmarks