Hi,
Fiddling around with some map labels in Web Map Viewer Classic. I'm labelling a roads layer right now, and there's a specific class of road don't want labeled, but I still want symbolized by a different field.
For example:
Symbol draws all features by $feature["ROAD_USGS_CLASS_LBL"]
It labels all features by $feature["ROAD_NM"] except for one type, i.e. $feature["ROAD_USGS_CLASS_LBL"] = "Unknown"
Is there a way to exclude that specific case from labeling using an Arcade expression in the label text?
Thanks!
Solved! Go to Solution.
maybe something like
if ($feature.ROAD_USGS_CLASS_LBL == 'Unknown') {
return ""
}
else {
return $feature.ROAD_NM
}
maybe something like
if ($feature.ROAD_USGS_CLASS_LBL == 'Unknown') {
return ""
}
else {
return $feature.ROAD_NM
}
Thanks David,
Wasn't working for a bit, but turns out that the name was recorded as Unknown, not the label class - I modified my expression like so:
if ($feature["ROAD_NM"] == "UNKNOWN"){
return ""
}
else {
return $feature["ROAD_NM"]
}
And it seemed to do the trick!
You could filter out that label using the new map viewer with the field-exludes-Unknown.