Custom Layer Action to Display Metadata
I added a custom command to the layer actions. I want to display some custom metadata text in a popup based on the layer chosen. It currently just has the default “Hello World!” popup that displays when any layer is selected. What workflow or commands would allow for the specific metadata text to be parsed from like a json file into each layer when it's popup is displayed?
-
Hey Brandon, this sounds like something you might accomplish via either Arcade Script in VSW or potentially via Workflow if it is more complex. Can you give an example of the metadata you are looking to get from a layer/feature? I am wondering if this is data within your GIS records, or if based on your mention of a JSON file this is an external data source.
0 -
Hi Gareth,
I would like to parse the description for each layer in the map service. It seems like it could be achieved through some sort of get request. Here is one layer endpoint: https://arcgis.gis.lacounty.gov/arcgis/rest/services/DRP/SMMAR/MapServer/43
Where can Arcade Scripts be added in VSW just out of curiosity?
0 -
Also, is there a way to add some custom javascript within a workflow similar to the inject css? Parsing out the rest service description maybe possible that way.
0 -
I'd use a WF, query the layer REST endpoint, parse it, then format the parsed data as you like into a WF component. Otherwise you might consider writing a custom command. You're gonna struggle to get this with the builtin commands.
0 -
Brandon Price We're not going to allow custom javascript. That would be a security concern.
1 -
Ken Lyon, no problem. Just trying to see if there is a workflow activity that allows for the parsing of the description on an arcgis layer endpoint?
0 -
Brandon Price Nothing for that specifically, no.
0 -
Ken Lyon ok no problem
0 -
If you use the Send Web Request activity with
- URL: https://arcgis.gis.lacounty.gov/arcgis/rest/services/DRP/SMMAR/MapServer/43?f=json
- Channel Name: arcgis
It will fetch the layer metadata and automatically parse it.
You can then use something like an Alert activity with
- Text: =$webRequest1.json.data.description
to access/show the description.
3 -
@... Excellent. That works just fine. Thank you.
1
Du måste logga in om du vill lämna en kommentar.
Kommentarer
10 kommentarer