dynamiclayers (Export Map) does not work in 10.8.1

746
1
Jump to solution
05-10-2021 04:25 PM
DeveloperGtinteg
New Contributor II

We just migrated ArcGIS Enterprise from 10.5.1 to 10.8.1 and now all our Export Map code that uses dynamiclayers no longer work.  We get an http 400 error.  If dynamiclayers is not used, everything works fine.  We reviewed the changes in between versions and supposedly there was not impact whatsoever on the capabilities and attributes that we've been using.  We also went back to the ESRI documentation in https://developers.arcgis.com/rest/services-reference/enterprise/export-map.htm and found that even their own example does not work (see Example 5), it gives the exact same 400 error that we get.

This is the ESRI example that does not work:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/export?bbox=-183.780014...": {"type":"simple", "symbol": {"type":"esriSFS","style":"esriSFSSolid","color":[255,0,0,255],"outline":{"type":"esriSLS","style":"esriSLSSolid","color":[0,255,0,255],"width":1}}}}}]&gdbVersion=&f=html

This is our original code that we've used for years and now suddenly won't work:

&dynamicLayers=[{"id": 3,"source":{"type": "mapLayer","mapLayerId": 1},"definitionExpression": "MYID = Poly-600","drawingInfo": {"renderer":{"type": "simple","symbol":{"type" : "esriSFS", "style" : "esriSFSSolid", "color" : [166,36,0,255], "outline" : {"type" : "esriSLS", "style" : "esriSLSSolid", "color" : [110,110,110,255], "width" : 0.5}},"description": ""},"transparency": 75},"showLabels": true,},{"id": 0,"source":{"type": "mapLayer","mapLayerId": 0},"drawingInfo": {"transparency": 65},},{"id": 2,"source":{"type": "mapLayer","mapLayerId": 1},"drawingInfo":{"showLabels": false}}]

 

We also tried dynamiclayers on a 10.6.1 instance and it still works, but  simply couldn't get any proper result on 10.8.1.  Would greatly appreciate any assistance.  Thanks!

0 Kudos
1 Solution

Accepted Solutions
DeveloperGtinteg
New Contributor II

We resolved this issue.  Seems like 10.8.1 only accepts encoded URL.  So, for instance, to get the ESRI example in their Export Map specification of the REST API, you would now have to pass something like this:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/export?bbox=-183.780014...

This tools can help encode the URL properly: https://ascii.cl/url-encoding.htm

View solution in original post

0 Kudos
1 Reply
DeveloperGtinteg
New Contributor II

We resolved this issue.  Seems like 10.8.1 only accepts encoded URL.  So, for instance, to get the ESRI example in their Export Map specification of the REST API, you would now have to pass something like this:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/export?bbox=-183.780014...

This tools can help encode the URL properly: https://ascii.cl/url-encoding.htm

0 Kudos