Move click-end-node-to-finish functionality from draw modes to behaviorDraw
Fix issue where the head node would get hover-highlighted when continuing from the end of a line
Fix issue where double-tap-to-zoom would not be properly disabled when drawing on touch devices (close#2128)
Support adding nodes to ways with double-tap with on touch devices (close#2677)
Support double-tap-to-zoom with styluses on touch devices
Don't accept double click/tap events if the taps are far apart
Don't re-enter modeSelect when clicking the selected feature again
(closes#4669)
Now instead of creating MultiLineString targets, we just create a bunch of
LineString targets. This makes the code simpler, and anyway the entity is
still there in `properties` for drawing code to decide what to do with the target.
Incidentally, this change allows iD to support an extrusion operation.
(Because each way segment has its own unique GeoJSON target now)
This makes the code a bit more consistent and lets us avoid some
hacky and probably non-performant things:
- abusing CSS classes in the draw/drag datum functions (classed `.target`)
(is this thing target? just check d.properties)
- regexing the id for `-nope$`
(is this thing a nope target? just check d.properties)
- using context.hasEntity to get a the real entity
(is this thing a real osmEntity? just check d.properties)
- fixes code like the restriction editor which uses fake ids for split ways
Mouseup was turning into a click on whatever was the last thing clicked.
In this walkthrough, this would sometimes be the "Add Area" mode button,
which would re-enter the add area mode and throw away the user's drawing.
(I have no idea why.)
(closes#3986)
Root cause was the vertex shadow strokes were too big, esp on endpoints.
For normal lines 16px stroke width centers on the line, but for vertices
it extends beyond the vertex radius, stealing clicks.
Also switched some "globals" to module variables in draw.js