add_layer works but feature collection symbology is wrong. Exent also is not recognized.

180
0
06-01-2021 06:06 AM
JoeNunn
Occasional Contributor

I am attempting to add a few layers from a single feature collection in to an existing webmap (Ecology_Map) on AGOL.  The feature collection consist of a point and a polygon layer:

JoeNunn_1-1622552193471.png

 

I use the add_layer function which adds the feature collection however the polygon seems to be symbolized as a point (the same as the first layer in the collection):

JoeNunn_0-1622552111841.png

Code used is here - it is a script I used in Pro

        lyrsToAdd = gis.content.search(query="title:"+service_name, item_type="Feature Layer")
        extent = lyrsToAdd[0].extent
        Ecology_Map = WebMap(item)
        Ecology_Map.add_layer(lyrsToAdd[0])
        Ecology_Map.update(item_properties={'extent': extent})   

In addition the Ecology_Map  extent is not changed to the extent of the feature collection.  Any ideas where I am going wrong?

Many thanks 

0 Kudos
0 Replies