Open alexei55 opened 6 years ago
So I can do this:
#### Publish the Item to AGOL\ if len(item_search) == 0: pega_item = gis.content.add({ 'title': 'Pega Cases', 'tags': 'Pega, Demo, Test', 'type': 'GeoJson', 'typeKeywords': 'Coordinates Type, CRS, Feature, FeatureCollection, GeoJSON, Geometry, GeometryCollection' }, pega_temp) pega_fl = pega_item.publish() else: if(debug): print("Handle item update") item_search[0].update(None, pega_temp) fl_search = gis.content.search(query_string, 'Feature Layer') print(len(fl_search)) fl_search[0].delete() pega_fl = item_search[0].publish()
but that would mean each update will delete/recreate the FL. I would lose any configuration for symbols/colors/etc.
In the Publish block, else...
item_search[0].update(None, pega_temp)
updates the GeoJSON in AGOL But that does not trigger a re-publish of the FeatureLayer with new data... I tried:pega_fl = item_search[0].publish()
but that will fail if FL already existsWhat's the correct way to trigger the FL to update?