Skip to content

Commit

Permalink
Cleanup (#499)
Browse files Browse the repository at this point in the history
* chore: update cspell custom dictionary

* refactor: 🔇 Remove console messages

* chore: 🔥 Remove unused files, etc.
  • Loading branch information
JeffJacobson authored Jan 22, 2025
1 parent a368034 commit d720039
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 52 deletions.
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;

0 comments on commit d720039

Please sign in to comment.