Select to view content in your preferred language

Strange results creating a view with "view_layers" argument.

416
1
11-15-2023 05:45 AM
Labels (2)
RandyMcGregor_BMcD
New Contributor III

I have created a jupyter notebook that creates a view from a feature service:

This is the code that makes the view:

new_view = flc.manager.create_view(serviceName+"_View", view_layers=vl_list)

This is the list. There are 15 layers (specifics redacted):

[<FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/0">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/1">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/2">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/3">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/4">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/5">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/7">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/8">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/9">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/10">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/11">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/12">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/13">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/14">, <FeatureLayer url:"https://services1.arcgis.com/id_value/arcgis/rest/services/Feature_Layer_Name/FeatureServer/15">]

In the created view, there are ten layers - five are missing:

RandyMcGregor_BMcD_0-1700055410265.png

But it gets better. In the view url source, all layers 15 layers are listed:

RandyMcGregor_BMcD_1-1700055569602.png

And yet even better - When I open the view in a map, there are 15 layers, but many of them are repeats.

So, something is VERY off. Is there a known issue with constraining the number of layers in a view with the 'view_layers' argument?

Thank you for your time,

Randy McGregor

0 Kudos
1 Reply
RandyMcGregor_BMcD
New Contributor III

There is a follow up cell in the notebook that updates the definition query for each layer. It prints the layer name for each iteration as it updates.

All layers are listed and named correctly, so it 'see's all the layers:

RandyMcGregor_BMcD_0-1700056708424.png

 

0 Kudos