TransWikia.com

ArcGIS Python API - feature renderer faild in AGOL

Geographic Information Systems Asked by Antonis on June 13, 2021

I am trying to save a feature service in AGOL using ArcGIS Python API with symbols. I use the same symbols in a map widget and the features appear correctly but when I save the feature as a feature service in AGOL the symbols are not stored.
I use the following code:

#setting layer symbol properties
layer_options = { 
    "type": "FeatureLayer", 
    "renderer":"ClassedColorRenderer",
    "title":"{0} Recreation Distribution".format(choice), 
    "outline": {
        "color": "White",
        "width": 0.3,
        "type": "esriSLS",
        "style": "esriSLSNull"
        },
    "field_name":"PUD_YR_AVG",
    "opacity":0.6}

#upload shapefile to AGOL
sf_upload = gis.content.add({}, zip_file)
print(sf_upload.id)
published_service = sf_upload.publish()   
published_service.update(layer_options)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP