1. Create a map
The first step is to create a 2D map or 3D scene. You can create a map with code or create a web map or web scene interactively with tools such as Map Viewer, Scene Viewer, or ArcGIS Pro.
Create a map with code:
- Reference a client-side mapping library.
- Create a map.
Create a web map with ArcGIS tools:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Create a web map or web scene.
- Save the web map or web scene in your portal.
The web map is used in a later step to build a map app using web maps.
![map viewer step 0](/documentation/static/ba950e11431014b1e6ced927d09a78c7/4cdf7/map-viewer-step-0.png)
Create a web map with ArcGIS tools:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Create a web map or web scene.
- Save the web map or web scene in your portal.
The web map is used in a later step to build a map app from builders.
![map viewer step 0](/documentation/static/ba950e11431014b1e6ced927d09a78c7/4cdf7/map-viewer-step-0.png)
2. Set the basemap
The next step is to define the basemap layer. The most common data source for a basemap layer is the basemap styles service API but you can also use a custom basemap style or data service. The basemap styles service provides many styles you can choose from such as streets, navigation, outdoor, topographic, light gray, and satellite.
Define the basemap with code:
- Reference the mapping library.
- Create a map.
- Set the basemap source and style.
Example
esriConfig.apiKey = "YOUR_ACCESS_TOKEN";
const map = new Map();
map.basemap = "arcgis/navigation";
Set the basemap for the web map with ArcGIS tools:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Create a web map or web scene.
- Select a default basemap style, custom style, or a data service.
- Save the web map or web scene in your portal.
The web map will be used in a later step to build a map app using web maps.
![map viewer step 1](/documentation/static/bd6e934fa30414bc81702903f398ff42/4cdf7/map-viewer-step-1.png)
Set the basemap for the web map with ArcGIS tools:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Create a web map or web scene.
- Select a default basemap style, custom style, or a data service.
- Save the web map or web scene in your portal.
The web map will be used in a later step to build a map app from builders.
![map viewer step 1](/documentation/static/bd6e934fa30414bc81702903f398ff42/4cdf7/map-viewer-step-1.png)
3. Add data layers
After you define a basemap layer, you can add data to a map by adding data layers. A data layer is used to access and display data in data service such as a feature service, vector tile service, map tile service, or image service. The services are typically accessed by their URL or item ID in a portal. Data layers are also used to apply different styles and renderers to features through data visualization.
Define and add the data layers with code:
- Reference the mapping library.
- Create a map.
- Set the service URL or item ID for each data layer.
- Add each data layer.
Example
const trailheadsLayer = new FeatureLayer({
url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_styled/FeatureServer/0"
});
map.add(trailheadsLayer);
const trailsLayer = new FeatureLayer({
url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails_styled/FeatureServer/0"
});
map.add(trailsLayer,0);
const parksLayer = new FeatureLayer({
url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space_styled/FeatureServer/0"
});
map.add(parksLayer,0);
Add data layers to the web map with ArcGIS tools:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Create a web map or web scene.
- Add the data layers by their URL or item ID.
- Save the web map or web scene in your portal.
The web map will be used in a later step to build a map app using web maps.
![map viewer step 2](/documentation/static/a426aa7b4a44d68df58f7c8400886e28/4cdf7/map-viewer-step-2.png)
Add data layers to the web map with ArcGIS tools:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Create a web map or web scene.
- Add the data layers by their URL or item ID.
- Save the web map or web scene in your portal.
The web map will be used in a later step to build a map app from builders.
![map viewer step 2](/documentation/static/a426aa7b4a44d68df58f7c8400886e28/4cdf7/map-viewer-step-2.png)
4. Display the map
The final step is to display the basemap layer and data layers on a map. Depending on the client-side mapping library you are using, you can use a view to display the data in 2D as a map or 3D as a scene. You also need to set the location and zoom level or scale of the view.
Display the map using a view:
- Reference the mapping library.
- Create a map.
- Set the service URL or item ID for each data layer.
- Add each data layer.
- Set the map location.
- Set the zoom level or scale.
- Display the map.
const view = new MapView({
map: map,
center: [-118.805, 34.027], // Longitude, latitude
zoom: 13, // scale: 72223.819286
container: "viewDiv",
constraints: {
snapToZoom: false
}
});
Display the web map:
- Reference the mapping library.
- Load the web map.
- Display the web map.
const webmap = new WebMap({
portalItem: {
id: "1531b5d82e674a50adcf2eaf95156bc7" // Replace with your web map ID
}
});
Create a map app from a builder:
- Sign in to Map Viewer, Scene Viewer, or ArcGIS Pro.
- Select the web map.
- Create and save a new map app.
- Access and display the map app.
Note: No coding is required.
Additional resources
Tutorials
APIs
![](/documentation/static/display-a-map-b4974c7cfef498eb43e99ab60191cbaf.png)
Display a map
Create and display a map with the basemap styles service.
![](/documentation/static/display-a-scene-3ddcec3963df3ed3fad5880264630e3d.png)
Display a scene
Display a scene with the basemap styles service.
![](/documentation/static/change-a-basemap-layer-120a281804a3088480dad1792aaca418.png)
Change the basemap layer
Switch a basemap layer from streets to satellite imagery.
![](/documentation/static/change-the-place-label-language-67a7240aeafa12440103a7b5c0d1b1f8.png)
Change the place label language
![](/documentation/static/display-a-custom-basemap-style-570ef785765357c447c74dacaf8a3d26.png)
Display a custom basemap style
Add and display a styled vector tile basemap layer.
![](/documentation/static/basemap-places-629432d03331b940a2ced6669cd1c594.png)
Display basemap places
Learn how to use the basemap styles service to show place locations on a basemap.
![](/documentation/static/display-a-pop-up-f7e2fdd51199161a0a5405d24838a9e1.png)
Display a popup
Format a popup to show attributes in a feature layer.
![](/documentation/static/add-a-point-line-and-polygon-ad1787d05c24d050cd3ec5b3c7f1bc74.png)
Add a point, line, and polygon
Display point, line, and polygon graphics in a map.
![](/documentation/static/display-a-web-map-d79089c62a3da71ff0cc8879d285b10b.png)
Display a web map
Create and display a map from a web map.
![](/documentation/static/display-a-web-scene-9ea867b65faf091797b029697390a404.png)
Display a web scene
Create and display a scene from a web scene.
Tools
![](/documentation/static/create-a-custom-basemap-style-1636af48a04308bfba8d869b0a3ad681.png)