(closes#4841)
Before, first/last keyboard shortcuts only worked if you had a vertex selected.
Now you can navigate to the first/last vertices even if you have the way selected.
Trying to eliminate the minimum 10m distance for replacing the original
junction vertex - this is a small threshold. When _not_ replacing this
vertex, the unzorro code will wreck havok on a traffic circle.
(If there is no suitable vertex to use, it will snap to a point between
the nearest vertices, see #4146)
(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)
- Attempt fast save first, only perform conflict resolution if necessary (re: #3056)
- Block reentry of save, and dont keep focus on save button (closes#4641)
- Refactor modeSave() for code clarity (avoid shared state in closure variables)
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
The goal here is that the code that draws the targets should know better
what parts of the lines/vertices are targetable, rather than just
relying on CSS to ignore the pointer events on the whole line.
e.g. when drawing a line, it's ok for it to loop back and connect
to itself, just not on a segment or vertex adjacent to the active
node.
This allows the label collision boxes for the vertices to update
during these modes. Otherwise the labels.js `isInterestingVertex()`
function doesn't consider them interesting enough to update.
Some highlights
- `getSiblingAndChildVertices` are expensive, so they're saved and called less frequently
- draw touch targets for all the visible vertices
- remove redundant css classes and `setClass` function
(re: #3003 / #4602)
For now, drawHover is commented out. Still not sure what I will do with it.
This means that things flicker a bit when dragging, also connecting nodes
(and closing lines) does not currently work.
There was lot going on preventing the vertices from rendering while dragging.
1. `modeDragNode` needed a proper `selectedIDs()` function that works like other
modes.. Many other places in iD (including the vertex renderer) call `context.selectedIDs()`..
This means that `modeDragNode` needs a new function `restoreSelectedIDs()` to do what
`selectedIDs()` was previously doing (a place to store selectedIDs so that we
can reselect those entities after the user is done dragging a node in select mode)
2. Just so many things in svg/vertices.js
- siblingAndChildVertices was missing some things for points that we render
as vertices (points in wireframe, points with directions)
- the sibling vertices weren't being included in the `filter` function, so
would disappear when doing differenced/extent redraws
- probably some other things
(closes#4237)
New rules:
- Rotation available if at least 2 unique nodes in selectedIDs
- Reflection available if at least 3 unique nodes in selectedIDs
1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
(e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them