How to retrieve layer by layer name in workflow
Hi All,
I want to know how to retrieve layer by layer name from GetMap activity Mapinfo object.
I tried and using the map object as in “Get Map activity with an ID of map, you should be able to use a Create Value activity to store the layer, then use a Set Property activity to populate it using =$map.map.map.getLayer(Layer Name).” I got exception.
I noticed, map object need to load by calling load method somehow,
I tried and use like $map.map.load() with evaluate expression async activity but no hope it is not working, Can anyone guide me please?
Environment: Workflow :Version 5.41.0 , JS 4 , Vertigis Web
-
I do not know about the getLayer() method, but I use this to return a Layer object, which was recommended to me from support sometime in the past year.
=$Map.map.map.allLayers.items.filter(x => (x.title == ‘<layer name>’))[0]2 -
Usually I would recommend using the Get Layer activity when trying to get a layer from the map. This should look inside the same map object you would get from the Get Map activity, and the map and layers should already have loaded by this point.
1 -
Alex St. John, small thing but you can use .find() instead and ditch the bit in brackets at the end, saving yourself a couple of characters. .find is like .filter but it simply returns the first result (then stops looking). The Get Layer activity is still my #1 (recommended by Ken Lyon), but I wish the Get Table activity behaved the same way (you need the table ID presently) so I always use .find for tables.
1 -
Thanks Alex St. John and Zack Robison ,
It helps,
May I know where can I read more about graphic layer related activity for workflow?
Best Regards,
0 -
Than Aung Some documentation links on Get Graphics (and Add Graphics)
Get Graphics Activity https://docs.vertigisstudio.com/workflow/latest/help/get-graphics-layer-features.html
VSWF Workflows Sample Site https://support.vertigis.com/hc/en-us/articles/11461058301586-VSWF-Workflows-Sample-Site > Graphics Layer Activities
VSWF - All Graphics Layer Activities https://latitudegeo.maps.arcgis.com/home/item.html?id=2ba579550636432a9cd38bfab298332eUse the Add Graphics Activity for Visualization https://docs.vertigisstudio.com/workflow/latest/help/visualization-using-add-graphics-layer-features.html
0 -
Thanks Nico Burgerhart ,
I will read through.
The scenario we are trying to achieve is that we want to manipulate the graphics(features) dynamically - filter, query, zoom in, selection and so on. So we are trying to find a way to create graphic layers, feature layers and so on. If the layers are already created, we are trying to find a way to retrieve and then manipulate the graphics from the layer.
Best Regards,
Than
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
6 commentaires