Arcade Scripts with Map Service

2857
7
12-14-2017 07:53 AM
JasonSmith6
New Contributor III

Has anyone had lucky getting Arcade scripts to work on symbology and labels for a Map Service?  I am publishing a map service from ArcMap since it supports grouping of layers, and want to add Arcade scripts to the sublayers.  But when I try to create a New Expression within AGOL either under symbology or labels, it doesn't show up as an option.  I can still use Arcade scripts for pop-ups, but I really need it to work symbols and labels.

arcade‌ arcade expressions mapserver# mapservice‌ #arcmap

0 Kudos
7 Replies
XanderBakker
Esri Esteemed Contributor

Can you share the service? I just used some maps services from the sample server, like this one: PublicSafety/PublicSafetyOperationalLayers (MapServer) and when I add the individual layers, I can add new expressions to define the symbology and labels. When I add the entire map service I can configure the pop-ups of the layers using new expressions, as advertised.

0 Kudos
JasonSmith6
New Contributor III

HI xander_bakker‌, yes you're correct.  When you add individual layer it works fine.  But I need to keep the Grouping heirarchy (in other words, the entire map service) together.  I then want to define the symbology and labels for each layer within the map service using new expressions, but can't.  I was just wondering if there is a workaround using code or another means?  Thanks.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Jason Smith ,

I'll assume that you are not the owner of the service or that there are other reasons to not implement this while publishing the data. When you add multiple layers of a MapService you do not have access to change the symbology or define labels. The only thing you have access to is the pop-up window where Arcade can be applied. Or at least that is what I am seeing:

Can you share the service or can you share a screenshot of what option you have?

You could use code (ArcGIS API for JavaScript) for this, but I wonder if you would like to go there: GroupLayer | API Reference | ArcGIS API for JavaScript 4.6 

0 Kudos
JasonSmith6
New Contributor III

Hi Xander Bakker‌,

Thank you for responding!  No I own the service and published it. Is there a setting in ArcMap that I can change?  The service is behind a firewall so unfortunately cannot share it.

Yes we looked at using JS 4.x which supports GroupLayer, but then it doesn't support labels natively and Arcade along with those.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Jason Smith , I assume that you are publishing to ArcGIS Server (when you mention it is behind a firewall). ArcMap can publish to ArcGIS Server, but does not support Arcade and ArcGIS Pro does support Arcade, but can't publish to ArcGIS Server. What kind of labels and symbology are you trying to obtain (or do you have)? Can you provide a screenshot?

As far as I can tell the ArcGIS for JavaScript API does support Arcade: Arcade | ArcGIS API for JavaScript 4.6 (although not the new geometry functions introduced at v1.3 of Arcade)

0 Kudos
XanderBakker
Esri Esteemed Contributor

Sorry, just noticed that labels is only supported in 3D. 2D will come... 

Known Limitations

Labeling is currently only supported in 3D SceneViews. Support for labeling in 2D MapViews will be added in a future release.

0 Kudos
JasonSmith6
New Contributor III

Yep! That’s my conundrum. Just can’t seem to have my cake and eat it too.

0 Kudos