0

I want to modify the JSON properties of a Feature Layer hosted online to display a certain field in symbology. I am able to access the JSON properties, even the property itself but when I call an .update_definition on it I get :

AttributeError: 'PropertyMap' instance has no attribute 'update_definition'

Here is my code :

item = gis.content.get('XXXXXXXXXXXXX')
print(item)
flc = FeatureLayerCollection.fromitem(item)
print(flc)
print(flc.manager.properties)
#print(flc.manager.properties.maxRecordCount)
#flc.manager.update_definition({'maxRecordCount':2000})#works
print(flc.manager.properties.layers[0].drawingInfo.renderer.field1)
flc.manager.properties.layers[0].drawingInfo.renderer.update_definition({'field1':'AQROUTES_2'})

What is weird to me is that I am able to modify the maxRecordCount attribute (commented out) but not the drawingInfo.

Has anyone ever had success doing this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.