POST
|
EDIT: Just needed to use the data correctly. SOLUTION : webMapItem.layers[len(webMapItem.layers) - 1]['layerDefinition']['drawingInfo'] = json.loads(str(simbol)) where simbol is actualy the json data for symbology for the layer. Hi Jeff, In the same way 'definitionExpression' is set above, I`m trying to do with 'drawingInfo' property on the layer, but when I`m setting the info, I`m getting "Object of type 'PropertyMap' is not JSON serializable". Basically, I`m iterating every layer in the webmap, remove each one, and after add it again, set the 'layerDefinition''definitionExpression' to filter the data and after I`m trying to also set the intial symbol, but somehow it`s not working... Any idea?? Thanks, Ionut
... View more
10-15-2018
02:32 AM
|
2
|
0
|
3381
|
POST
|
Hi Jeff, That`s sweet! Thanks a lot! Although, what if get_data() method on my layer returns None? Because that`s what happened to me and I had replace the original layer with itself but with a filter applied... Again, thanks a lot for your feedback! Best, Ionut
... View more
09-05-2018
11:34 PM
|
0
|
0
|
3381
|
POST
|
UPDATE: You were right, I`ve used your solution to get a workflow. I`ve managed to iterate through layers in the webmap, and for each one, I`ve replace it with the same, just that I applied the definitionExpression on it; something like this: for layer in webMapLayers: layerTitle = layer.title srcResults = adminGIS.content.search(layerTitle) featCollection = srcResults[0] sql = "sql filter" webMapItem.remove_layer(layer) webMapItem.add_layer(featCollection) webMapItem.layers[0]['layerDefinition']['definitionExpression'] = sql webMapItem.update() Thanks again, Ionut
... View more
09-05-2018
07:07 AM
|
0
|
0
|
3381
|
POST
|
Hi Jeff, Thanks for the quick feedback! I tried the solution you provided but for some reason, the get_data() method returns None.. I`d also like to point out that in the solution you provided, the item is obtained by searching the content and retrieving the Feature Layer; in my case, I have an operational layer in a web map; not sure if it`s the same thing. As I can see, the sql expression is mounted on definitionExpression on the object, but in my case I cannot find this property on the layer object from my webmap. Thanks, Ionut
... View more
09-05-2018
02:15 AM
|
0
|
0
|
3381
|
POST
|
Hi all, Is there a posibility to filter an operational layer inside a webmap (similar to what definition query does in ArcMap) and after to save the webmap with the new updates? I`m at the step where I iterate through my layers from my map but I cannot find the solution to apply a filter/definition query to them. Thanks, Ionut
... View more
09-03-2018
06:53 AM
|
0
|
9
|
4490
|
POST
|
Hi Robert, I noticed that you have created a customized search widget and I would like to ask you if it has the functionality described here: https://community.esri.com/thread/215333-query-widget-spatial-filter-to-filter-input-results-to-drop-down-queries , or, if not, if you have any ideas how to implement this? Basically I need to be able to update the values from the drop downs (from the expresions) before clicking the 'Apply' button; Thank you very much, Ionut
... View more
06-27-2018
07:15 AM
|
0
|
1
|
684
|
POST
|
Hi all, I am trying to modify the Query Widget (WAB for Dev 2.8) and I`m trying to bind the draw functionality with the drop down queries created when creating the widget. Structure: The widget will have The Draw Widget at the top (A spatial filter) Other attributes drop downs below defined as expressions (Attribute filtering) The workflow should be like this: 1. The user is using the Draw widget to draw a polygon on the map 2. The drew polygon is querying the layer in the map and only the data that is contained in the polygon is available (shown in the map) 3. The following expressions to have only the data that is available after the spatial filtering. 4. Click Apply to filter (The above 3 steps should be happening before clicking Apply filter button) At the moment in the Query Widget, the expressions are not updating based on spatial filtering (what the user is drawing). (See image below, instead of all those values in the drop down, after spatial filter, only 1 value shold be availabe in the drop down) I have customized the widget to have the Spatial Filter UI at the top and to filter the layer but I`m not really sure how to make the widget to re-read what data is available to populate the expressions.. Doing a new query on the operational layer in the map I could obtain the new values and update the drop downs with the most recent values, the problem is that I cannot acces the values from the drop downs so I could do the replacing Thanks a lot in advance, Ionut
... View more
06-27-2018
07:11 AM
|
0
|
0
|
330
|
POST
|
LE: I have advanced into modifying the widget but cannot modify the text values from the drop-downs; Doing a new query on the operational layer in the map I could obtain the new values and update the drop downs with the most recent values, the problem is that I cannot acces the values from the drop downs so I could do the replacing
... View more
06-27-2018
07:09 AM
|
0
|
0
|
453
|
POST
|
Hi all, I am trying to modify the Query Widget (WAB for Dev 2.8) and I`m trying to bind the draw functionality with the drop down queries created when creating the widget. Structure: The widget will have The Draw Widget at the top (A spatial filter) Other attributes drop downs below defined as expressions (Attribute filtering) The workflow should be like this: 1. The user is using the Draw widget to draw a polygon on the map 2. The drew polygon is querying the layer in the map and only the data that is contained in the polygon is available (shown in the map) 3. The following expressions to have only the data that is available after the spatial filtering. 4. Click Apply to filter (The above 3 steps should be happening before clicking Apply filter button) At the moment in the Query Widget, the expressions are not updating based on spatial filtering (what the user is drawing). (See image below, instead of all those values in the drop down, after spatial filter, only 1 value shold be availabe in the drop down) I have customized the widget to have the Spatial Filter UI at the top and to filter the layer but I`m not really sure how to make the widget to re-read what data is available to populate the expressions.. Thanks a lot in advance, Ionut
... View more
05-23-2018
02:44 AM
|
0
|
1
|
733
|
Title | Kudos | Posted |
---|---|---|
2 | 10-15-2018 02:32 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|