I'd like to use an Arcade Function to populate the Road Name for a Work Zone Layer based off an underlying Road layer. The issue that I'm running into is that the expression is pulling the name from an intersecting road and not from the main line that I'm digitizing along.
// Create a feature set using the 'All Roads' layer in the map
var roads = FeatureSetByName($map, 'All Roadways', ['MAP_LBL'])
// Intersect the current location with the road and
// get the first road
var road = First(Intersects($feature, roads))
// If the current location does intersect a feature,
// return the name of the road. Otherwise, return null
if (!IsEmpty(road)) {
return road['MAP_LBL']
} else {
return null
}
