| Numéro d’ID de bogue |
BUG-000171987 |
| Envoi | November 4, 2024 |
| Dernière modification | October 20, 2025 |
| S’applique à | ArcGIS Pro |
| Version trouvée | 3.2.4 |
| Système d’exploitation | Windows OS |
| Version du système d’exploitation | 11.0 64 bit |
| Statut | Under Consideration
Le problème a été examiné par l’équipe de développement. Il n’a pas été défini comme prioritaire dans un plan de version, mais un suivi va être mis en place pour déterminer son impact global. Les facteurs pris en compte dans le processus de hiérarchisation sont, entre autres, le nombre d’utilisateurs concernés ou à l’origine de la demande, l’impact sur les activités et l’existence d’une solution de contournement. Si un bogue a des effets négatifs sur vos activités, reportez-vous à la procédure de réaffectation d’un défaut (https://support.esri.com/en/technical-article/000024129).
|
Informations supplémentaires
Unlike Feature Services and many other data types, Map Services are not yet supported in the function. Map Services are also not supported in the Update Data Sources panel within the Catalog View in ArcGIS Pro. By setting the function, you are forcing the new URL into the layer, even though it is currently unsupported. If you set it, the layer will not be updated, which is by design until Map Services are officially supported.
But you can modify the CIM definition of the layer like this to update the Map Service URL:
aprx = arcpy.mp.ArcGISProject('current')
m = aprx.listMaps('Map')[0]
lyr = m.listLayers('PyUnit10931_2')[0]
c = lyr.getDefinition('V3')
c.serviceConnection.url = 'https://tiles.arcgis.com/tiles/k4wsDILUIGeQ5HvW/arcgis/rest/services/MyServiceName/MapServer'
lyr.setDefinition(c)
More information on the CIM can be found here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm
And here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS
Solution de contournement
Unlike Feature Services and many other data types, Map Services are not yet supported in UpdateConnectionProperties at this time. But you can modify the CIM definition of the layer like this:
aprx = arcpy.mp.ArcGISProject('current')
m = aprx.listMaps('Map')[0]
lyr = m.listLayers('PyUnit10931_2')[0]
c = lyr.getDefinition('V3')
c.serviceConnection.url = 'https://tiles.arcgis.com/tiles/k4wsDILUIGeQ5HvW/arcgis/rest/services/MyServiceName/MapServer'
lyr.setDefinition(c)
More information on the CIM can be found here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm
And here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS
Étapes pour reproduire
ID de bogue: BUG-000171987
Logiciel: