AnsweredAssumed Answered

Can labels be restyled via the REST API?  Stuck on syntax.

Question asked by MappingSupport on Oct 2, 2017
Latest reply on Oct 27, 2017 by MappingSupport

I am using the ArcGIS Server REST API to display MapServer data that supports dynamic layers. I know how to restyle line and polygon geometry when my code calls for the tiles.

Question: Is it also possible to restyle labels?

 

The following link displays one tile with label data:

 

https://services.nationalmap.gov/arcgis/rest/services/govunits/MapServer/export?bboxSR=4326&layers=show:15&size=256,256&imageSR=3857&format=png&transparent=true&dpi=&f=image&bbox=-94.921875,30.751277776257812,-94.21875,30.14512718337613

 

And here is my call for the same tile where I am trying to make the text magenta:

 

https://services.nationalmap.gov/arcgis/rest/services/govunits/MapServer/export?bboxSR=4326&layers=show:15&size=256,256&imageSR=3857&format=png&transparent=true&dpi=&f=image&dynamicLayers=[{'source':{'type':'mapLayer','mapLayerId':15},'drawingInfo':{'labelingInfo':{'symbol':{'color':[255,0,255,255]}}}}]&bbox=-94.921875,30.751277776257812,-94.21875,30.14512718337613

 

However my call results in the following nastygram:

{"error":{"code":400,"message":"Invalid dynamic layer definition for labeling classes.","details":[]}}

 

Can anyone shed light and show where I have gone astray in the syntax?

 

Joseph Elfelt
https://mappingsupport.com

Outcomes