-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add direction to line segment label
fix: 🐛 fix point symbol issue refactor: ♻️ Move route segment label class expression to arcade module
- Loading branch information
1 parent
e762b38
commit 2d12fce
Showing
5 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
`${$feature.Route}: ${$feature.SRMP}${$feature.Back} to ${$feature.EndSrmp}${$feature.EndBack}` | ||
/** | ||
* Formats to return as string containing | ||
route, direction, begin and end SRMPs with | ||
their "B" back indicator when applicable. | ||
|
||
Example response: | ||
"002COBROWNE (I) : 287.45 — 287.46" | ||
*/ | ||
|
||
/** | ||
* @param {number} srmp - SRMP | ||
* @param {string} abIndicator - "B" or "b" for back mileage. Any other value is assumed to be ahead. | ||
* @returns {string|null} - SRMP with "B" back indicator if the {@link srmp} is not null and is not NaN | ||
*/ | ||
function formatSrmp(srmp, abIndicator) { | ||
return Text(srmp, "#.##") + IIf(Upper(abIndicator) == "B", "B", "") | ||
} | ||
|
||
Console("Begin SRMP", $feature.Srmp) | ||
Console("Back", $feature.Back) | ||
Console("End SRMP", $feature.EndSrmp) | ||
Console("End Back", $feature.EndBack) | ||
Console("Direction", $feature.Direction) | ||
|
||
var beginSrmp = formatSrmp($feature.Srmp, $feature.Back) | ||
var dir = $feature.Direction | ||
if (HasKey($feature, "EndSrmp")) { | ||
var endSrmp = formatSrmp($feature.EndSrmp, $feature.EndBack) | ||
return `${$feature.Route} (${dir}): ${beginSrmp} — ${endSrmp}` | ||
} | ||
return `${$feature.Route} (${dir}) @ ${beginSrmp}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
IIf( | ||
$feature.SRMP > $feature.EndSrmp, | ||
`${$feature.Route}\n${$feature.EndSrmp}${$feature.EndBack}`, | ||
var showEnd = HasKey($feature, "EndSrmp") && $feature.SRMP > $feature.EndSrmp | ||
|
||
IIf(showEnd, | ||
`${$feature.Route}\n${$feature.EndSrmp}${$feature.EndBack}`, | ||
`${$feature.Route}\n${$feature.SRMP}${$feature.Back}` | ||
) |