Dear Robert Scheitlin, GISP -
I suceeded in developing Web AppBuilder (Developer Edition) 2.16 custom widget to add zipped shapefile to 3D scene by adapting code example: Create a FeatureLayer from a shapefile.
The example uses the next code:
var params = {
name: name,
targetSR: view.spatialReference,
maxRecordCount: 1000,
enforceInputFileSizeLimit: true,
enforceOutputJsonSizeLimit: true
};
// generalize features to 10 meters for better performance
params.generalize = true;
params.maxAllowableOffset = 10;
params.reducePrecision = true;
params.numberOfDigitsAfterDecimal = 0;
var myContent = {
filetype: "shapefile",
publishParameters: JSON.stringify(params),
f: "json"
};
request(portalUrl + "/sharing/rest/content/features/generate", {
query: myContent,
body: document.getElementById("uploadForm"),
responseType: "json"
})
I will appreciate explanations for the next few questions:
If I want to give my file by "sourceUrl" parameter (instead of using the html form), e.g. for using url of zip file in my Amazon S3 cloud, how do I exacly specify it and its accompanying parameters? because no matter how I try, I get error: "'Unable to generate features -- itemid', 'sourceUrl' or 'text' must be specified."
Help will be greatly appreciated,
Michael
Can you please refer to item "3" above? since I have not found detailed doc on ArcGIS REST API - Generate.
Michael
There is none that I am aware of.
Dear Robert Scheitlin, GISP,
I thank you very much for answering.
At least I know that being newbie has not caused me to miss some documentation.
I appreciate you for being a great help to many developers of esri WAB custom widgets.
Michael