Skip to content

Commit

Permalink
fix: 🐛 milepost labels swapped if end milepost < start milepost
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffJacobson committed Dec 17, 2024
1 parent 5a33065 commit c892aae
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const lineSegmentCimSymbol = new CIMSymbol({
export default new UniqueValueRenderer({
defaultSymbol: offsetAndMilepostCimSymbol,
defaultLabel: "Clicked Milepost",
valueExpression: "IIF($feature.EndSrmp != null, '1', '0')",
valueExpression: "IIf($feature.EndSrmp != null, '1', '0')",
valueExpressionTitle: "Has an End Milepost",
uniqueValueInfos: [
{
Expand Down
5 changes: 5 additions & 0 deletions src/layers/MilepostLayer/symbol/beginOverride.arcade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
IIf(
$feature.SRMP > $feature.EndSrmp,
`${$feature.Route}\n${$feature.EndSrmp}${$feature.EndBack}`,
`${$feature.Route}\n${$feature.SRMP}${$feature.Back}`
)
5 changes: 5 additions & 0 deletions src/layers/MilepostLayer/symbol/endOverride.arcade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
IIf(
$feature.SRMP > $feature.EndSrmp,
`${$feature.Route}\n${$feature.SRMP}${$feature.Back}`,
`${$feature.Route}\n${$feature.EndSrmp}${$feature.EndBack}`
)
7 changes: 5 additions & 2 deletions src/layers/MilepostLayer/symbol/primitiveOverrides.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import beginOverride from "./beginOverride.arcade?raw";
import endOverride from "./endOverride.arcade?raw";

/**
* The expression info for the primitive override for the milepost label symbol.
* This will be used on the milepost line layer.
*/
const beginMilepostExpressionInfo = {
expression: "`${$feature.Route}\\n${$feature.SRMP}${$feature.Back}`",
expression: beginOverride,
type: "CIMExpressionInfo",
returnType: "String",
} as const;
Expand All @@ -14,7 +17,7 @@ const beginMilepostExpressionInfo = {
*/
const endMilepostExpressionInfo = {
...beginMilepostExpressionInfo,
expression: "`${$feature.Route}\\n${$feature.EndSrmp}${$feature.EndBack}`",
expression: endOverride,
} as const;

/**
Expand Down

0 comments on commit c892aae

Please sign in to comment.