The Get Layer activity is a useful tool that is often necessary for relating your workflows to your map data. However, the inputs for the activity depend on the viewer type and on the layer type, so configuring them correctly can sometimes be a challenge. The following article outlines the necessary inputs for each viewer type and layer type.
Please note that non-spatial tables should not be accessed using the Get Layer activity. The Get Table activity should be used instead. This takes different inputs than the Get Layer activity and is not covered here.
NOTE: This article is based on the following versions. Configuration for the Get Layer activity may vary if you are using versions other than the ones listed.
- VertiGIS Studio Workflow 5.37.0
- VertiGIS Studio Web 5.27.0
- VertiGIS Studio Mobile/Go 5.27.0
- Geocortex Essentials/Viewer for HTML5 4.15.1
- ArcGIS Experience Builder 1.10.0
- ArcGIS Web AppBuilder 2.28
Navigate to:
- VertiGIS Studio Web/Mobile
- Geocortex Viewer for HTML5
- ArcGIS Experience Builder
- ArcGIS Web AppBuilder
VertiGIS Studio Web/Mobile
NOTE: For VertiGIS Studio Web, Geocortex Viewer for HTML5, and ArcGIS Experience Builder, entering an incorrect value in the Sublayer Id input will cause the Get Layer activity to fail, even if the Layer Id input is valid. (This does not apply to VertiGIS Studio Mobile, which will output a layer if the Layer Id input is correct, even if the Sublayer Id input is not.)
Feature Layer
This applies to individual layers that have been added directly to the webmap or to layers contained within a group layer. The Sublayer Id input of the Get Layer activity should be left blank, and the Layer Id input can be supplied with one of the following:
-
Layer Title
- This should be the title of the layer as it appears in the layer list. The name displayed at the service REST endpoint will not work.
-
Layer ID
- This should look something like "Victoria_Buildings_4805" or "18d0e99c4b4-layer-14". An ID that looks like "a21bf6a1-c4c5-4ec9-871a-daed318ff613" or "2b10ed91bc574d96a5016cfa9c474d35" will not work.
-
- This can be found by either using the Get Map activity, searching VertiGIS Studio Item Manager, or downloading the app.
- Get Map Activity: The benefit of this method is that it can function automatically, meaning it can be used to recursively retrieve the layer ID for each layer in your webmap without requiring you to manually delve in to your app's JSON. To set it up, add a Get Map activity to your workflow. The map object will contain an array of all the layers in the webmap. Each layer object should include an id value.
- VertiGIS Studio Item Manager: Open Item Manager, select your Web app, and navigate to Item Content. Click anywhere in the content itself and press CTRL+F to open the search tool. Search for the layer name and locate the ID in the layer's $ref object. NOTE: Be careful not to accidentally modify your app, as unwanted changes made here may prevent your app from functioning or from loading in Web Designer.
- Download App: Download your app by clicking File > Download App in Web Designer. Extract the ZIP file and open the app.json file in a text editor like Notepad. Search for the layer name and locate the ID in the layer's $ref object.
- This can be found by either using the Get Map activity, searching VertiGIS Studio Item Manager, or downloading the app.
Map Service
This applies to map services that have been added as a whole to the webmap. In VertiGIS Studio Web, whole map services get treated as layers with sublayers. The map service itself can be referenced by supplying the Layer Id input of the Get Layer activity in the same manner as a feature layer.
The map service's sublayers, however, can only be referenced by ID. To use the Get Layer activity on a sublayer, fill out the Layer Id input as above, then enter the sublayer's ID in the Sublayer Id section. This ID should be an integer and should match the ID of the sublayer at the service REST endpoint. For example, the sublayer at https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3 would have an ID of "3".
Group Layer
A group layer can be referenced in the same way as a feature layer. However, any layers or map services contained within it cannot be accessed as "sublayers". As such, layers and map services contained within a group layer should be accessed directly, with no reference to the group layer.
Geocortex Viewer for HTML5
NOTE: For VertiGIS Studio Web, Geocortex Viewer for HTML5, and ArcGIS Experience Builder, entering an incorrect value in the Sublayer Id input will cause the Get Layer activity to fail, even if the Layer Id input is correct.
Feature Layer
This applies to services that have been added to the map using "Add as Feature Layer". The service should be displayed with a box-like icon in the Map Services list.
To access the appropriate ID for the Layer Id input, open Essentials Manager and click the "Edit map service" icon next to the feature service.
The ID will be displayed at the top of the Details page.
Do not enter anything for the Sublayer Id input.
Map Service
This applies to services that have been added to the map using "Add to Map" or "Add as Map Service". The service should be displayed with a globe icon in the Map Services list.
To access the whole map service, enter its ID in the Layer Id input. To find this ID, open Essentials Manager and click the "Edit map service" icon next to the map service.
The ID will be displayed at the top of the Details page.
To reference a map service's sublayer, configure the Layer Id as above, then click the "Edit layer" icon next to the layer in the Map Services list or Layer List.
The Layer ID can be found on the Details page under the Layer Name.
Enter this ID into the Sublayer Id input.
ArcGIS Experience Builder
NOTE: For VertiGIS Studio Web, Geocortex Viewer for HTML5, and ArcGIS Experience Builder, entering an incorrect value in the Sublayer Id input will cause the Get Layer activity to fail, even if the Layer Id input is correct.
Feature Layer
See the configuration for VertiGIS Studio Web/Mobile.
Map Service
See the configuration for VertiGIS Studio Web/Mobile.
Group Layer
A group layer can be referenced in the same way as a feature layer. However, any layers or map services contained within it cannot be accessed as "sublayers". To access a layer or map service contained in a group layer, its own layer ID should be input directly into the Layer Id parameter of the activity - the layer name will not work in this case.
ArcGIS Web AppBuilder
All layers can be accessed by title only, meaning the title that appears in the layer list. This applies regardless of whether a layer is coming from a feature service or from a map service.
In the case of a map service, the Sublayer Id input can be used to access a nested layer, however it is not necessary - the layer's title can be entered directly into the Layer Id parameter with no reference to its map service and it will still succeed.
The Layer Id and Sublayer Id inputs work somewhat independently of each other, meaning either one will still successfully output a layer even if the other is incorrect.
Comments
0 comments
Article is closed for comments.