How do I disable the ability for a user to select (direct_select) the midpoint of a LineString in mapbox-gl-draw? I have a custom mode for "annotations", which should only allow for LineStrings with 2 vertices.
I've tried some of the lifecycle hooks in custom modes (https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/MODES.md), specifically for draw_line_string
, including onDrag. My problem is I don't want the drag point to exist at all (it would involve the user seeing a midpoint, dragging that vertex, and then seeing it snap back).
I've also tried dealing with the draw styles, but they are general to all midpoints (include polygons).
A third way might be to invalidate this outside of mapbox-gl-draw, in my framework, but I'd like to avoid even the ability to select a midpoint at all.