Skip to content

Commit

Permalink
Symbology/restore srmp to marker label (#498)
Browse files Browse the repository at this point in the history
* fix: 🐛 user click marker does not show milepost, only route
* refactor: include alpha in highwaySignBackgroundColor
* chore: move ArcGIS Pro project
* chore: modify ArcGIS Pro symbology
* feat: remove route name from label

fixes #74455
  • Loading branch information
JeffJacobson authored Jan 16, 2025
1 parent 28c3d39 commit 996f4c5
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 34 deletions.
9 changes: 6 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ Procfile text
*.*ignore text
# Prevents massive diffs from built files
dist/* binary



*.stylx filter=lfs diff=lfs merge=lfs -text
*.aprx filter=lfs diff=lfs merge=lfs -text
*.gpkg filter=lfs diff=lfs merge=lfs -text
*.sde filter=lfs diff=lfs merge=lfs -text
*.atbx filter=lfs diff=lfs merge=lfs -text
*.lyrx filter=lfs diff=lfs merge=lfs -text
*.lpkx filter=lfs diff=lfs merge=lfs -text
Binary file modified ArcGIS Pro/Line Segment Label.lxp
Binary file not shown.
3 changes: 3 additions & 0 deletions ArcGIS Pro/LocateMP (Mobile).stylx
Git LFS file not shown
4 changes: 2 additions & 2 deletions ArcGIS Pro/LocateMP.stylx
Git LFS file not shown
3 changes: 3 additions & 0 deletions ArcGIS Pro/Milepost Symbols.aprx
Git LFS file not shown
Binary file removed ArcGIS Pro/Milepost Symbols/Milepost Symbols.aprx
Binary file not shown.
Binary file modified ArcGIS Pro/SampleRouteSegments.lpkx
Binary file not shown.
2 changes: 1 addition & 1 deletion src/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Color from "@arcgis/core/Color";
/**
* The shade of green for the background of highway signs.
*/
export const highwaySignBackgroundColor = new Color("#01735c");
export const highwaySignBackgroundColor = new Color([1, 115, 92, 255]);
/**
* The white outline around a sign, which is equivalent to "#ffffff" or "white".
*/
Expand Down
24 changes: 12 additions & 12 deletions src/layers/MilepostLayer/arcade/Route Segment Label.arcade
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ 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}`
function createLabel(includeRoute) {
var beginSrmp = formatSrmp($feature.Srmp, $feature.Back)
var dir = $feature.Direction
var output = IIf(includeRoute, `${$feature.Route} (${dir}): `, "")
output += `${beginSrmp}`
if (HasKey($feature, "EndSrmp")) {
var endSrmp = formatSrmp($feature.EndSrmp, $feature.EndBack)
output += ` — ${endSrmp}`
}
return output;
}
return `${$feature.Route} (${dir}) @ ${beginSrmp}`;

createLabel(false);
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,9 @@ const offsetAndMilepostCimSymbol = new CIMSymbol({
const lineSegmentSymbol = new SimpleLineSymbol({
color: highwaySignBackgroundColor,
width: 3,
marker: {
color: highwaySignBackgroundColor,
style: "square",
placement: "begin-end",
},
});

export const arcadeHasEndSrmp = "IIf($feature.EndSrmp != null, '1', '0')";
const arcadeHasEndSrmp = "IIf($feature.EndSrmp != null, '1', '0')";
/**
* Simple Renderer using a CIM symbol.
*/
Expand Down
18 changes: 13 additions & 5 deletions src/layers/MilepostLayer/symbol/beginOverride.arcade
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
var showEnd = HasKey($feature, "EndSrmp") && $feature.SRMP > $feature.EndSrmp
Console("beginOverride.arcade begins")

IIf(showEnd,
`${$feature.Route}\n${$feature.EndSrmp}${$feature.EndBack}`,
`${$feature.Route}\n${$feature.SRMP}${$feature.Back}`
)
Console($feature);

var showEnd = HasKey($feature, "EndSrmp") && $feature.EndSrmp != null && $feature.Srmp > $feature.EndSrmp;

var srmp = IIf(showEnd, $feature.EndSrmp, $feature.Srmp);
var back = IIf(showEnd, $feature.EndBack, $feature.Back);


var output = `${Text(srmp, "#.##")}${back}`;

Console("beginOverride.arcade ends")
return output;
11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,12 @@ if (!testWebGL2Support()) {
popupEnabled: false,
});

if (import.meta.env.DEV) {
view.watch("scale", (scale) => {
console.debug("scale changed", scale);
});
}
// Uncomment this section to debug scale changes 👇
// if (import.meta.env.DEV) {
// view.watch("scale", (scale) => {
// console.debug("scale changed", scale);
// });
// }

import("./setupPopupActions")
.then(({ setupPopupActions }) => {
Expand Down

0 comments on commit 996f4c5

Please sign in to comment.