The Add Data widget enables end users to add data to the map by searching for layers in ArcGIS Online or Portal for ArcGIS content, entering URLs, or uploading local files including shapefiles, CSV, GPX, and GeoJSON. In this way, end users can temporarily add layers to the map and remove them from the map. However, they cannot save them to the map.
Configuring the Add Data widget
The Add Data widget can be set to open automatically when the app starts. To do so, click the dot on the widget to change it to dark green.
- Hover over the widget and click the small edit icon . The configuration window for this widget appears.
- Optionally click change widget icon and replace it with your own image.
A file explorer window opens, allowing you to select a local image file to use as the widget icon.
- Change the number of items per page for the search result. The default is 30.
- Use the following options to control the search scope in ArcGIS Online or Portal for ArcGIS.
Replace the default labels and select the default search option, if necessary.
- Allow My Content—Search for the private data owned by the end user.
- Allow My Organization—Search for the data shared within the organization.
- Allow ArcGIS Online—Search for the data publicly available though ArcGIS Online or Portal for ArcGIS if applicable.
- Allow Curated—Search for the data shared within a group. It requires the group ID with the group: prefix as a curated filter.
- The Allow URL option enables the end user to add services to the map.
- The Allow File option enables the end user to upload local files to the map, including shapefiles, CSV, GPX, and GeoJSON.
- Click OK to save the configuration.
Caution:When you deploy the app locally, keep in mind that unlike hosted apps in ArcGIS Online or Portal for ArcGIS, there is no scope control over the deployed apps. As a result, you may use the map scope to control the search scope of Add Data. If you want to search the data in My Organization or My Content, make sure the map is not shared publicly. In this way, when the deployed app opens the sign in dialog shows, passing the credentials to the Add Data widget. By default the widget only shows the public content if the credentials are not present.
Using the Add Data widget
- On the Search tab, choose the scope you want to search and click Add on a specific item to add the layer to the map. The added layer will appears in the Layer List widget as well. Click Remove to remove the layer from the map and the Layer List widget. Click Details to get information about the layer.
If the app is shared publicly, do not enable Allow My Organzation or Allow My Content as the search will only execute against the public items.
- Optionally, click the magnifying glass icon to search for layers.
- Click the icon to only search layers within the map area. Clicking it turns the icon red so you can search all layers in the scope.
- Click the sort icon to refine the type of search layer and sort the items.
- Click the Type drop-down list to search layers based on map service, feature service, image service, vector tile service, KML, or WMS.
- Click the Sort By drop-down list to sort items by relevance, title, owner, rating, view, or date.
- To add layers by URL, click the URL tab next to the Search tab. Choose a type and enter the URL. Click Add to add the data to the map. The added layer will appear in the Layer List widget as well. The following types are supported through the URL:
- ArcGIS for Server web service
- WMS OGC web service
For more information on CSV files, see CSV format information .
- Click Sample URL(s) to see the URL format for each type.
- Click the File tab to upload files locally. You can either drag and drop the file or browse to it. It supports shapefiles in Zip format, and CSV, GPX and GeoJSON files.
- To remove the layers added in step 5 and 7, click LAYERS in the lower right corner of the widget. In the Layers panel, click the trash can icon next to the layer to remove it.
- Click BACK in the lower right corner to return to the main panel.