You can use one or more basemap layers to provide visual and geographic context for the data layers displayed.
Basemap layer types
There are two fundamental types of basemap layers: vector tile and image tile. There are many vector tile styles available, such as streets and streets night, gray canvas, navigation, and topographic. Image tiles include satellite imagery, ocean, hillshade, and others.
Vector tile layers contain a vector representation of the data and a separate visual style. Tile access performance combined means vector tile layers can adapt to any display resolution across device types.
In addition to the default vector basemap styles, you can create custom vector basemap styles with ArcGIS Vector Tile Style Editor.
Image tile layers display pre-rendered image or raster data stored as tiles of .png or .jpeg images that can be displayed at different scales.
For a complete list of styles, see the Basemap layer service topic in the Mapping APIs and location services guide.
Basemaps
Basemap layers are organized as a basemap and you use the Basemap property of the ArcGIS Map to control the basemap in your scene.
The following are the source and source types to create a Basemap to use in your ArcGIS Map.
Source | Source type |
---|---|
Basemap layer | Basemap |
Web map | Basemap |
Image tile layer | Image layer |
Vector tile layer | Vector tile layer |
Basemaps from the basemap layer service
The basemap layer service provides vector tile and image tile global basemap layers in a variety of styles to use in mapping applications.
There are two ways to access basemap layers: through the basemap styles service or the tile services. You can access the basemap styles service with a URL and parameters to get the JSON definition for a specific basemap style. To see a complete list of styles, visit the Basemap styles service (v1) in the Mapping APIs and location services guide, and the Basemap styles service (v2) in the ArcGIS REST APIs documentation.
With the plugin, you can use the standard endpoint formatted as follows.
-
For the basemap styles service (v1):
Use dark colors for code blocks Copy https://basemaps-api.arcgis.com/arcgis/rest/services/styles/{basemapStyle}?type=webmap
-
For the basemap styles service (v2):
Use dark colors for code blocks Copy https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps/{data_source}/{style}
For information about tile services, see the image tile layers and vector tile layers sections.
Basemaps from web maps
As mentioned previously, you can create a basemap from a URL that references a web map by providing the item page URL or the JSON, typically read from an item with type Web Map
which is stored in an ArcGIS Portal.
You can load any web map that contains image tile layers, vector tile layers, or reference layers as a basemap. It is possible to use web maps that contain other layer types, but they will not be displayed in the viewport.
The SDK provides several preset basemaps from the Map Creator UI. These also use the basemap layer service with the web map format.
There are two ways to format the URL to create a basemap from a web map:
- Item page URL
- REST endpoint URL
Set a basemap
In the Basemap panel is a list of selectable, preset basemaps. You can also set a basemap from a basemap layer service, a web map, an image tile layer, a vector tile layer, or a local tile package.
If you do not want to set a basemap, click the ArcGIS Map Actor in the Outliner panel and empty the Basemap field in the Details panel.
The preset basemaps are listed in the World Basemaps for Developers group in ArcGIS Online. Preset basemaps do not include Human Geography Map and Human Geography Dark Map.
To set a custom basemap:
-
Click the Basemap tab.
-
Click + Add New at the bottom of the list. A pop-up window opens.
-
In the Source field, enter a service URL or a local file path.
- To use a basemap layer service or a web map, select Basemap from the Type drop-down list.
- To use an image tile layer service, select Image Layer from the Type drop-down list.
- To use a
.tpk
or.tpkx
tile package as a basemap source, copy and paste the local tile package file path, then select Image Layer from the Type drop-down list. - To use a vector tile layer service, select Vector Tile Layer from the Type drop-down list.
- To use a
.vtpk
file package as a basemap source, copy and paste the local vector tile package file path, then select Vector Tile Layer from the Type drop-down list. - To use a privately hosted web map or services, select the matching configuration from the Authentication drop-down list. For more information about using private content, see user authentication.
-
Type a Name for your basemap; this will be used to identify it in the basemap gallery.
-
Click Add to finish creating the custom basemap. The pop-up window closes.
-
Verify that the custom basemap is selected in the gallery.
To remove a custom basemap registry from the basemap gallery, click on X on the thumbnail.
-
Click on the ArcGISMap in the Outliner panel.
-
Expand the Basemap section in the Details panel.
-
Provide the URL of an online service or local tile package path in the Basemap field.
- To use a basemap layer service or a web map, select Basemap from the Type drop-down list.
- To use an image tile layer service,
.tpk
or.tpkx
tile package, select Image Layer from the Type drop-down list. - To use a vector tile layer service or
.vtpk
tile package as a basemap source, select Vector Tile Layer from the Type drop-down list. - To use a privately hosted web map or services, select the matching configuration from the Authentication drop-down list. For more information about using private content, see user authentication.
- To set up a basemap, use nodes in ArcGIS Maps SDK > ArcGIS Basemap.
- To create a basemap from a web map, select Create ArcGIS Basemap with Basemap Source to create a basemap and introduce the URL for a web map in the source field.
- To create a basemap from an image tile service, vector tile service, image tile package, or vector tile package, select Create ArcGIS Basemap with Layer Source and Type. Enter an online service URL or a local tile package path in the source field and select ArcGIS Image Layer or ArcGIS Vector Tile Layer as the type according to the source.
- To create a basemap from the basemap styles service, select Create ArcGIS Basemap with Basemap Style. Select a basemap style from the Basemap Style drop-down list.
- Connect the API key variable to the API Key pin.
- Use the Set Basemap node to set a basemap for the ArcGIS Map.
Set a basemap with ArcGISBasemap
. If you want to use an image tile layer, vector tile layer, or a local tile package as the basemap, specify the layer type in the constructor.
Use ArcGISBasemap
to use the preset basemaps that are listed on the Modes Panel UI.
You can find the sample code to set a Basemap in the ArcGISImagery
value with ArcGISBasemap
class in the SampleAPIMapCreator.cpp file. The sample script file is located in:
Plugins/ArcGISMapsSDK/Source/ArcGISSamples/Private
Refer to the FAQ to troubleshoot data loading issues.