Select to view content in your preferred language

How to set custom map extent in ArcGIS Pro using Python

1275
2
12-16-2019 10:39 AM
JohnFix2
Regular Contributor

I want to automate the creation of a set of vector tile caches, but each VTPK will be of a different map extent. I can manually change the map extent via the "Map Properties" dialog to "Use a customer extent". But I want to do that in my python script.

How do I do this? Or, is the "best" way to create vector tile cache index polygons and reference that in the "create vector tile cache"?

Thanks

0 Kudos
2 Replies
DylanT_EsriCanada
Esri Contributor

Looks like the Create Vector Tile Package tool will honor the map's extent as defined in the extent tab of the map settings, per this post: https://community.esri.com/t5/arcgis-pro-ideas/define-vector-tile-package-extent/idc-p/941775#M5802

You can set the extent using the setExtent function on Camera object, but I am not sure if this will change the actual map's defining bounds or just the current display: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/camera-class.htm

 

0 Kudos
JeanPIERRON
Emerging Contributor

Hi @JohnFix2 

Did you end ud finding a way to set the custom map extent using arcpy ?

0 Kudos