Skip to content

Cleanup #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ nojekyll
noopener
noreferrer
NOSONAR
Noto
osmzoom
RDWY
Rrts
Expand Down
14 changes: 7 additions & 7 deletions src/layers/MilepostLayer/symbol/beginOverride.arcade
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Console("beginOverride.arcade begins")

Console($feature);

// Determine if the route segment has an end SRMP attribute.
// Locations located by user click will not have an end SRMP attribute.
// If the end SRMP is greater than the begin SRMP, then the
// mileposts displayed at the route ends need to be reversed.
var showEnd = HasKey($feature, "EndSrmp") && $feature.EndSrmp != null && $feature.Srmp > $feature.EndSrmp;

// Get the appropriate SRMP and back indicator values based on the showEnd flag.
var srmp = IIf(showEnd, $feature.EndSrmp, $feature.Srmp);
// The Back attribute should always be either a "B" or an empty string.
var back = IIf(showEnd, $feature.EndBack, $feature.Back);

// Create the label string
var output = `${$feature.Route}\n${Text(srmp, "#.##")}${back}`;



Console("beginOverride.arcade ends")
return output;
5 changes: 0 additions & 5 deletions src/layers/MilepostLayer/symbol/endOverride.arcade

This file was deleted.

21 changes: 1 addition & 20 deletions src/layers/MilepostLayer/symbol/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import CIMSymbol from "@arcgis/core/symbols/CIMSymbol";
import {
endMilepostLabelPrimitiveOverride,
milepostLabelPrimitiveOverride,
} from "./primitiveOverrides";
import { milepostLabelPrimitiveOverride } from "./primitiveOverrides";

const cimCallout: __esri.CIMBackgroundCallout = {
type: "CIMBackgroundCallout",
Expand Down Expand Up @@ -100,26 +97,10 @@ const cimPointSymbol: __esri.CIMPointSymbol = {
angleAlignment: "Display",
};

const endpointCimPointSymbol: __esri.CIMPointSymbol = {
...cimPointSymbol,
symbolLayers: [segmentEndpointCimVectorMarker],
};

export const milepostSymbol = new CIMSymbol({
data: {
primitiveOverrides: [milepostLabelPrimitiveOverride],
type: "CIMSymbolReference",
symbol: cimPointSymbol,
},
});

export const endpointMilepostSymbol = new CIMSymbol({
data: {
primitiveOverrides: [
milepostLabelPrimitiveOverride,
endMilepostLabelPrimitiveOverride,
],
type: "CIMSymbolReference",
symbol: endpointCimPointSymbol,
},
});
20 changes: 0 additions & 20 deletions src/layers/MilepostLayer/symbol/primitiveOverrides.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import beginOverride from "./beginOverride.arcade?raw";
import endOverride from "./endOverride.arcade?raw";

/**
* The expression info for the primitive override for the milepost label symbol.
Expand All @@ -11,15 +10,6 @@ const beginMilepostExpressionInfo = {
returnType: "String",
} as const;

/**
* The expression info for the primitive override for the end milepost label symbol.
* This will be used on the route segment line layer.
*/
const endMilepostExpressionInfo = {
...beginMilepostExpressionInfo,
expression: endOverride,
} as const;

/**
* The primitive override for the milepost label symbol.
* This will be used on the milepost line layer.
Expand All @@ -30,13 +20,3 @@ export const milepostLabelPrimitiveOverride = {
type: "CIMPrimitiveOverride",
valueExpressionInfo: beginMilepostExpressionInfo,
} as const;

/**
* The primitive override for the end milepost label symbol.
* This will be used on the route segment line layer.
*/
export const endMilepostLabelPrimitiveOverride = {
...milepostLabelPrimitiveOverride,
primitiveName: "endMilepostLabel",
valueExpressionInfo: endMilepostExpressionInfo,
} as const;
Loading