Description

The ArcGIS Portal API is a REST API that allows developers to work with content from ArcGIS Online. Portions of this API were integrated into the ArcGIS API for JavaScript at version 2.8. If you need access to capability not exposed via the classes in the ArcGIS API for JavaScript you can use esri/request to work directly with the ArcGIS Portal REST API.

This sample demonstrates how to use the Generate operation to generate a feature collection from an input shapefile. The application contains a form with an input element of type file that allows users to navigate to a zipped shapefile. This snippet calls the generate operation, note that the form used to capture the input shapefile is specified using the form parameter.

When the generate operation successfully completes the addShapefileToMap function is executed that adds the feature collection to the map.

Note: There are some limitations to be aware of when adding shapefiles to the map. View the About shapefiles help topic in ArcGIS.com documentation for details.