POST
|
Hello simo ! Yes I can view the Web Map properly in the viewer! And the map sharing's properties are as desired, which is group only. So is the View Layer featured in the Web Map. Earlier yesterday, I could not get the Web Map to appear in Collector. By adding this snippet in the Web Map properties, I was able to get it to show. That being said, the points hosted in the view do not appear on the map (although, in the layer menu, I can see the layer in Collector). Here's the snippet I added : empty_webmap = WebMap()
empty_webmap.add_layer(view_item, options={'title': view_name})
webmap_item_properties = {'title': str(municipality) + '_Implantation',
'snippet': str(municipality) + '_Implantation', 'tags': '2019',
"typeKeywords": ['ArcGIS Online', 'Collector', 'Data Editing',
'Explorer Web Map', 'Map', 'Offline', 'Online Map', 'Web Map']}
empty_webmap.save(webmap_item_properties)
... View more
06-12-2019
06:19 AM
|
0
|
1
|
861
|
POST
|
Hello ! I have a script automating map generation. It basically creates an empty WebMap instance and adds a Hosted View in it. Although I am able to get the WebMap to show in Collector (by editing the WebMap typeKeywords), the layer itself does not show. It appears in the layer tab, but does not show in the map viewer. I am lost, since when I save a duplicate of this map via AGOL it works perfectly! Anybody has an idea? Thanks
... View more
06-11-2019
12:47 PM
|
0
|
3
|
967
|
POST
|
Sure thing, try this out : #Road Infrastructures
print('Enabling Editing, Sync, Create, Delete, Query, Update and ChangeTracking')
item_to_search = 'XXXXXXXX')
owner = 'XXXXX'
item = gis.content.search(query="title:" + item_to_search + " AND owner: " + owner, item_type="Feature Layer", sort_field='title', sort_order='asc')
flc = FeatureLayerCollection.fromitem(item[0])
print("Road Infrastructures Initial Capabilities ==> {}".format(flc.properties.capabilities))
print("Road Infrastructures Initial Layer capabilities ==> {}".format(flc.layers[0].properties.capabilities))
print(' ')
print('Updating Editing options ...')
flc.manager.update_definition({'capabilities' : 'Query,Sync'})
layer = flc.layers[0]
layer.manager.update_definition({'capabilities' : 'Query,Sync'})
#Check results
# item = gis.content.search(query="title:" + item_to_search + " AND owner: " + owner, item_type="Feature Layer", sort_field='title', sort_order='asc')
# flc = FeatureLayerCollection.fromitem(item[0])
print("Road Infrastructures Updated Capabilities ==> {}".format(flc.properties.capabilities))
print("Road Infrastructures Updated Layer capabilities ==> {}".format(flc.layers[0].properties.capabilities))
print("=================================================================================================================")
... View more
04-15-2019
09:14 AM
|
0
|
0
|
333
|
POST
|
Regarding this question, does anybody know if it is possible via Python to change the order in which the pop-ups appear in the menu? You can do it via the Web Interface, but I haven't found a way to do so with Python. Anyone has ever tried?
... View more
04-15-2019
09:08 AM
|
1
|
3
|
2089
|
POST
|
The transparency of the layer ('opacity') can be edited upon creation of the feature layer via the add_layer function called over a WebMap just like so : item_to_search = 'City_limits_' + str(municipality)
owner = 'XXXXXXXX'
item = gis.content.search(query="title:" + item_to_search + " AND owner: " + owner, item_type="Feature Layer", sort_field='title', sort_order='asc')
print(item)
item_selected = item[0]
empty_webmap.add_layer(item_selected, options={'title':'City limits','opacity':'0.4'}) Hope this helps, M.C.
... View more
03-29-2019
06:07 AM
|
0
|
0
|
1734
|
POST
|
Hello, thanks for the input, it works great. If that's not too much to ask, maybe you could help me out! I ran this code to apply a filter to a web feature layer hosted on my web server and it works great. The problem is when i create a view (create_view) made from this parenting layer, the filter is not carried with it. And re-using this code doesn't work as the layer as no properties for some reason. Here's the code : srcResults = gis.content.search(query='ENERGEREGLOBALE_V2', item_type='Feature Layer')
featCollection = srcResults[0]
# update a featurecollection layer filter
featCollD = featCollection.get_data(try_json=True)
# make a copy to manipulate the properties
featCollDCopy = copy.deepcopy(featCollD)
sql = 'Municipalité IS NULL'
# The code below assumes that 1 FeatureLayer was found within the collection
# Modify the number or loop on the layers for more
featCollDCopy['layers'][0]['layerDefinition']['definitionExpression'] = sql
# send the update to modify the Feature Layers within the FeatureCollection
featCollection.update(item_properties={'text': json.dumps(featCollDCopy)})
print(featCollection.get_data(try_json=True))
################################################################# #Generate View
flc = arcgis.features.FeatureLayerCollection.fromitem(featCollection)
view = flc.manager.create_view(name='TEST', spatial_reference=None, extent=None, allow_schema_changes=False, updateable=True, capabilities='Query, Update, Delete') #view_layers= [flc.layers[0]]
print(view) If you guys have any idea on how to make the filter follow the view, or how to apply a new filter to the view, that would be very appreciated! Thanks, R.Muller
... View more
02-07-2019
10:28 AM
|
0
|
1
|
3071
|
POST
|
can you define more on how you get the item's ID ? Especially if you generate the results automatically from a script and you simply want to move that feature layer into another folder on your arcgis online profile?
... View more
01-31-2019
11:30 AM
|
2
|
0
|
2574
|
Title | Kudos | Posted |
---|---|---|
2 | 01-31-2019 11:30 AM | |
1 | 04-15-2019 09:08 AM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|