How to add shape file and display on map
Hi All,
I am trying to build a functionality similar as below:
Add a zipped shape file and display it on map.
Example: https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=portal_addshapefile
But I couldn't build a correct form data posting to generate feature operation.
I have tried to build my query this way:
={
'filetype':'shapefile',
'file':$form1.state.filePicker1.value.files[0],
'publishParameters':{},
'f':'json'
}
but the actual request is

Any idea?
Cheers,
Leo.
-
Hi Leo,
It looks to me like Workflow is having difficulty converting the file object to use in the request. What activity/property are you using it in? I did a quick test using the Convert To JSON activity and found that when it's used on a file object, the resulting json text is empty. I'll follow up on my end and see if this is something that we expect should be working.
0 -
Hi Leo,
I've been told that we don't expect converting a file object to json to work. Additionally:
"The ArcGIS endpoint can’t accept a JSON definition of a shapefile. You’d need to upload the raw file data in the Web Request by doing a multipart request. See http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Publish_Item/02r300000080000000/"
It sounds like adding a dedicated workflow Activity for this would be the best way to go from our perspective. Could you post this in the Ideas section so that others can vote to have that implemented?
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires