Learn how to use the Map Viewer to create a web map for your application.
This tutorial shows you how to use the Map Viewer to create and save a web map with hosted feature layers. You also inspect the JSON that contains the web map settings stored in the item.
Prerequisites
You need an ArcGIS Location Platform or ArcGIS Online account for this tutorial.
Steps
Set the basemap layer
To create a web map with the Map Viewer, start by setting the basemap layer. Use the Outdoor vector tile basemap layer.
-
Open the Map Viewer and sign into your ArcGIS account.
-
In the left panel, click Basemap > Outdoor.
-
In the left panel, click Basemap to close the window.
Add data layers
To display data in a web map, you can add hosted feature layers for trailheads, trails, and parks in the Santa Monica Mountain area.
-
In the left panel, click Add data > Web service.
-
For each URL:
- Copy and paste the URL > Add to map.
- Parks and Open Space:
https
://services3.arcgis.com/ G Vgb Jbqm8h XASV Yi/ ArcGI S/rest/services/ Parks _and _Open _Space/ Feature Server/0 - Trails:
https
://services3.arcgis.com/ G Vgb Jbqm8h XASV Yi/arcgis/rest/services/ Trails/ Feature Server/0 - Trailheads:
https
://services3.arcgis.com/ G Vgb Jbqm8h XASV Yi/arcgis/rest/services/ Trailheads/ Feature Server/0 - Boundary:
https
://services3.arcgis.com/ G Vgb Jbqm8h XASV Yi/ ArcGI S/rest/services/ Boundary/ Feature Server/0
- Parks and Open Space:
- Copy and paste the URL > Add to map.
Save the web map
After you create a web map, you can save it. Saving the map will create a new item and you can access the map in an application. You can also set the security of the item to the appropriate sharing level if you have an ArcGIS Online account.
-
In the left panel, click Save. At minimum, you need to provide a title and tags for your web map.
-
Optionally, set the sharing level of the map in the item page.
Your web map should look something like this.
View the web map JSON
A web map item contains JSON that defines the map properties. The structure of the JSON is defined by the Web Map Specification. Applications can access a web map item or read the JSON directly to format layers and create a map, so it is useful to know how to get the JSON for a web map.
-
In your web browser, find the item ID at the end of the URL for the web map just saved.
- For example:
c1ed0753d9be4492a6d4c167febf2163
- For example:
-
In a new browser tab, copy and paste the following URL and insert your item ID. This will return the JSON for your web map.
https
://www.arcgis.com/sharing/rest/content/items/ <ITEM _ID >/data - For example: https://www.arcgis.com/sharing/rest/content/items/c1ed0753d9be4492a6d4c167febf2163/data
-
In the JSON, identify the operational (data) layer and basemap layer settings set earlier. Here's an example:
{
"operationalLayers":[
{
"id":"Boundary_6040",
"layerType":"ArcGISFeatureLayer",
"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Boundary/FeatureServer/0",
"visibility":true,
"opacity":1,
"title":"Boundary",
"itemId":"30cf3b4c11c5408d87f255ba4e9aa611",
"popupInfo":{
"title":"Boundary_0",
"fieldInfos":[
{
"fieldName":"OBJECTID",
"label":"OBJECTID",
"isEditable":true,
"tooltip":"",
"visible":false,
"format":{
Now that you have a web map, you can follow more tutorials to style the layers with the Map Viewer or display it in an application with an API.
What's next?
Learn how to use additional tools, APIs, and location services in these tutorials:
Style layers in a web map
Display a web map
Create and display a map from a web map.