I'm labeling municipalities within a webmap on AGOL. I'm new to Arcade and am wondering if there is an Arcade expression that would allow labels to be visible only if they fit within there municipality(polygon), as to not clutter up the map?
Hi David Krady ,
I'm afraid that this is not possible for a number of reasons. The most important one being:
Best thing is to switch off labeling at a certain scale to avoid clutter.
If the feature class you want to label has an attribute for identifying the municipality in question, you could achieve this by making two layers.
So say for example, your feature class represents land parcels in your state. The feature class has an attribute which identifies the municipality the land parcel is in.
Then create two layers of this feature class by querying:
layer 1: Municipality = 'x'
layer 2: Municipality <> 'x'.
Then you simply chose to label layer 1, and not layer 2.
If this makes for an ugly layer list or legend you can choose to make layer 2 invisible in these (if working with layout legends or web applications, also that is assuming you have the same symbology for the land parcels in this example).
Hope that's helpful!