Select to view content in your preferred language

How to get the created from "id" of a feature service view?

559
1
12-12-2021 05:20 AM
KarstenRank
Frequent Contributor

Hi,

I want to write a script that compares to web maps. One web maps consists of feature service, the other of the views of the feature services of map one.

How can I  get the related id to the feature service of a view with using the python api?

Thanks a lot

Karsten

0 Kudos
1 Reply
jcarlson
MVP Esteemed Contributor

Using the layers property can get you a list of layers in a given map. Simply iterate over that list to view the layers, or get the specific layer you're looking for by searching each layer's keys/values for the title or URL. Once you have your layer, itemID is simply another property.

{
"id":"2018_Contours_Display_8051",
"layerType":"ArcGISMapServiceLayer",
"url":"some URL",
"visibility":false,
"opacity":1,
"title":"2018 Contours",
"itemId":"53de4e2da18d472583c853ba89baa554",
"maxScale":0,
"minScale":20000,
"showLegend":true
}

 

- Josh Carlson
Kendall County GIS
0 Kudos