How To: Add tile layers to an ArcGIS Pro project using ArcGIS API for Python
Summary
Adding tile layers to an ArcGIS Pro project is time-consuming if there are many tile layers to be added, as the process requires multiple uses of the Add Data process in ArcGIS Pro. This article provides a workflow to add tile layers to an ArcGIS Pro project using ArcGIS API for Python.
Procedure
- Open the ArcGIS Pro project.
- On the Insert tab, in the Project group, click New Notebook.
- On the New Notebook tab, copy and paste the following script into the cell.
- Import the necessary modules.
import arcpy
- Specify the project file to store the tile layer.
aprx=arcpy.mp.ArcGISProject('CURRENT')
- List the map layer from the project file. Replace LAYERNAME with the name of the map layer.
m=aprx.listMaps('LAYERNAME')[0]
- Add the tile layer to the map layer. Replace URL_1 with the URL for the tile layer.
m.addDataFromPath('URL_1')
- Click Run.
The code block below presents the full script used to add a tile layer to the map in ArcGIS Pro.
import arcpy aprx = arcpy.mp.ArcGISProject('CURRENT') m = aprx.listMaps('Layer_Name')[0] m.addDataFromPath('https://a.tile.test123.org/cycle/{level}/{col}/{row}.png')

Note: Repeat Steps 3d and 4 with subsequent tile layer URLs to add the additional layers to the project.
Related Information
- Esri BeLux: XYZ Tile layers in ArcGIS platform
- ArcGIS Pro: Add data from a path
- ArcGIS Pro: Methods
- ArcGIS Pro: Share a web tile layer
- ArcGIS Pro: Notebooks in ArcGIS Pro
Last Published: 1/31/2023
Article ID: 000029157
Software: ArcGIS API for Python 2.0.1, 2.0, 1.9.1, 1.9, 1.8.5, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.1, 1.7.0, 1.6.1, 1.6 ArcGIS Pro 3.0.3, 3.0.2, 3.0.1, 3.0, 2.9.6, 2.9.5, 2.9.4, 2.9.3, 2.9.2, 2.9.1, 2.9, 2.8.8, 2.8.7, 2.8.6, 2.8.5, 2.8.4, 2.8.3, 2.8.2, 2.8.1, 2.8, 2.7.7, 2.7.6, 2.7.5, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7