partially adresses bugs in #4968:
* doesn't crash anymore in complex situations (short FROM ways where both ends connect to a TO way)
* adding a only-restriction at one end of a short FROM doesn't delete restrictions on the other end of the same FROM anymore
(closes#4970)
They are still supported as translated strings, and user can still enter these
values in the raw tag editor, but they should not toggle with clicks in the
checkbox field. This is because novice users are confused by what they mean.
Fixes issue with nested/namespaced fields, such as `maxspeed/advisory`,
in situations where would try to use a css selector or element id.
Can't use characters like '/' in a css selector.
- change the "Up to {num} ways" to "Up to 2 ways"
(we don't plan to go above 2 for now)
- enumerate all the turn types No/Only/Allowed x Left/Right/Straight/U
- Add a line for "Click for" to let user know they can click to toggle
see https://github.com/openstreetmap/iD/pull/4768#pullrequestreview-100256196
- actionRestrictTurn will no longer "infer" the turn type
- restrictionType *must* be passed in - this is ok because the only code
we use this action (restrictions.js) already has inferred the type
- this simplifies what the action actually does
- moved the tests from restrict_turn.js that were really just testing
the restriction type inferrence over to intersection.js
(and added a few more tests for iD.osmInferRestriction)
This was used to decide whether to show the "Max Via" control.
(It's not really needed for a simple intersection)
However since we added the "Max Distance" control, it just makes
sense to show both sliders, since the distance can affect the
complexity.
"indirect only" means an only restriction elsewhere in the intersection
that affects the selected from way.
| |
---+--F--+---
A |
---v--T--+---
B |
In the above example
- 'only_straight_on' restriction "FROM way A VIA node V TO way B"
- way F is selected
This would indirectly prevent a u-turn "FROM way F VIA way A TO way T"
We want to display the straight on restriction in the UI as
"only_straight_on FROM way A VIA node V TO way B"
not
"only_left_turn FROM way F VIA way A TO way B"
When they are on the enter selection, they can stay "sticky" which has
the effect where you might move a slider and it puts the intersection
back to how it previously was (or returns to a previous intersection)
I really want the sidebar back to col4, so the user sees more main map.
This makes it very tricky to fit all of the intersection in the turn
restriction editor.
(I decided that the larger context of the intersection is important and
shouldn't be hidden from the user)
Also
- show detail slider only if the intersection is complex
- hide the restriction editor completely if there is no real intersection
(e.g. junction of `highway=path`)
- includes in the message the names of the streets
- also highlights related segments and nodes along the path
The messages are currently a bit rough:
U-Turns FROM Black Horse Pike IS allowed...
VIA Main Street TO Black Horse Pike
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