AnsweredAssumed Answered

How to update layer properties in FeatureLayerCollection?

Question asked by trace.stanford9 on Dec 10, 2019
Latest reply on Dec 12, 2019 by mboyceesriaustralia-com-au-esridist

So I know you can update the properties of a FeatureLayerCollection by using a dictionary...My question is: how can you update the layer properties? The layers are a list in the properties dictionary, and I can't figure out how to update the name of a layer, for example...

 

{
  "layers": [
    {
      "id": 0,
      "name": "gggg",
      "parentLayerId": -1,
      "defaultVisibility": true,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0,
      "geometryType": "esriGeometryPoint"
    }
  ]
}

I'm using a dictionary to try and update, but can't figure out the proper syntax to access the layer name and update it...

 

update_dict = {
  "serviceDescription": 'newname',
  "layers":[
    {
      "name": 'newname',
    }
    ]
}

Outcomes