Skip to content

Commit 5d11c42

Browse files
committed
Some clarifications about lane icon selection
1 parent ea2e8a5 commit 5d11c42

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/lanes.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@ This naming scheme assumes the following algorithm for translating the Mapbox Di
1313
* If `valid_indication` is leftward, prepend `opposite ` to any rightward indication and set the `flipped` flag.
1414
* If `valid_indication` is rightward, prepend `opposite ` to any leftward indication.
1515
* Otherwise, if the array contains a leftward indication, set the `flipped` flag.
16-
1. For each indication, replace any occurrence of `left` or `right` with `turn`.
17-
1. If `valid_indication` is set, replace any occurrence of `left` or `right` with `turn`.
16+
1. For each indication, replace any occurrence of `left` or `right` with `turn` inside the indication.
17+
1. If `valid_indication` is set, replace any occurrence of `left` or `right`with `turn` inside `valid_indication` .
1818
1. Sort the array of indications in the following order: `opposite uturn`, `opposite sharp turn`, `opposite turn`, `opposite slight turn`, `straight`, `slight turn`, `turn`, `sharp turn`, `uturn`.
1919
1. If there are more than three indications, keep one that matches `valid_indication` and two others and discard the rest.
2020
1. Set the canvas name to `lane ` followed by the array of indications joined by ` or `.
2121
1. If `valid_indication` is set, append ` using ` and the value of `valid_indication` to the canvas name.
2222
1. Look up the canvas by name:
2323
* If the canvas exists, draw it using the `primary_color` and `secondary_color`.
2424
* Otherwise, if it does not exist:
25-
* If `valid_indication` is set, draw the canvas with that name using the `primary_color`.
25+
* If `valid_indication` is set:
26+
1. Set the canvas name to the value of `valid_indication`, followed by ` using `, followed by the value of `valid_indication`.
27+
1. Draw the canvas with that name using the `primary_color`.
2628
* Otherwise, if `valid_indication` is unset, draw the canvas `straight` using the `secondary_color`.
2729
1. If the `flipped` flag is set, flip the image horizontally.
2830

0 commit comments

Comments
 (0)