Excluding Labels for certain Classes in Web Map Viewer Classic

274
3
Jump to solution
06-08-2021 02:20 PM
Henry
by
Occasional Contributor

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!

Henry
0 Kudos
1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

maybe something like

if ($feature.ROAD_USGS_CLASS_LBL == 'Unknown') {
  return ""
}
else {
  return $feature.ROAD_NM
}

View solution in original post

3 Replies
DavidPike
MVP Frequent Contributor

maybe something like

if ($feature.ROAD_USGS_CLASS_LBL == 'Unknown') {
  return ""
}
else {
  return $feature.ROAD_NM
}

View solution in original post

Henry
by
Occasional Contributor

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!

Henry
0 Kudos
RussellRoberts1
Esri Frequent Contributor

You could filter out that label using the new map viewer with the field-exludes-Unknown.

RussellRoberts1_0-1623244032229.png

 

0 Kudos