Show Results in the Geocortex Viewer for HTML5

The Show Results activity takes any feature, collection of features, or feature set that exists in the workflow, converts it to a feature set if necessary, adds the feature set to a collection, and displays the features. If the collection already exists, you can combine the feature set with an existing feature set, provided the features are from the same layer.

The Geocortex Viewer for HTML5 displays results in a list in the side panel by default (). The geometries are highlighted on the map (). In the screen capture, the state of Montana is highlighted a different color because the user is hovering the pointer over Montana in the Results list ().

Features displayed using the Show Results activity, shown in the Geocortex Viewer for HTML5

The Geocortex Viewer for HTML5 offers many additional functions for working with results:

 

View Feature Details - Clicking a particular feature in the Results list zooms the map to that feature and displays details about the feature, including the feature's attributes. To return to the Results list, the user clicks the close icon .

Panel Actions Menu - The Panel Actions menu offers functions that operate on the features in the Results list, such as exporting or saving the features. The Panel Actions menu also has an option to switch between list view and table view.

Feature Actions Menu - The Feature Actions menu offers functions that operate on a particular feature in the Results list, such as buffering the feature or removing the feature from the list.

Collection Panel - The Geocortex Viewer for HTML5 supports multiple feature sets in a collection. Clicking the icon to go to the previous panel shows the feature sets in the collection. The Results Actions menu () has functions that operate on the feature sets, such as combining feature sets.

The Show Results activity fulfills the same purpose in VertiGIS Studio Workflow as the Select Features activity fulfills in Geocortex Essentials Workflow.

Configure the Show Results Activity to Run in the Geocortex Viewer for HTML5

To configure a Show Results activity, you must configure the Features input, which specifies the features to show. You will configure additional inputs. The particular inputs you configure depend on your scenario. The main factors that determine which inputs to configure are:

Inputs Supported by the Geocortex Viewer for HTML5

The Geocortex Viewer for HTML5 supports all of the Show Results activity's inputs:

Example 1 - Format Features Using the Show Results Activity’s Inputs

This example shows you how to use a Show Results activity to display the features returned by a Query Layer activity when the Show Results activity does not have access to the layer's configuration. Because the Show Results activity does not have access to the layer, the geometries are displayed on a graphics layer created for that purpose.

This example assumes that you already have Geocortex Viewer for HTML5 to run the workflow. To demonstrate conclusively that the Show Results activity uses the formatting configured in the activity, rather than the formatting in the layer’s configuration, the layer should not exist in the site.

Workflow Logic

The workflow has the following activities, in the order shown:

To format and show query results that are displayed by a Show Results activity:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

    • Query Layer (query1)
    • Show Results
  3. Query Layer (query1): Configure the inputs:

    • Url: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

      This is the URL for a layer of US states.

    • Where: SUB_REGION='Mountain'

    • Return Geometry: true

    • Output Spatial Reference: Enter the spatial reference of the map. This ensures that the geometries are rendered accurately on the map.

    • Output Fields: STATE_NAME, SQMI, POP2007

  4. Show Results: Configure the inputs:

    • Set the Features input to: =$query1.results

      This specifies the features to display.

    • Set the Label Format input to: State: <i>{STATE_NAME}</i>

      This specifies the heading text to display for each feature. When the features are displayed, {STATE_NAME} will be replaced by the value of the STATE_NAME field for this feature.

    • If your viewer is configured to use Feature Long Description in the Results list, configure the Long Description Format input. If your viewer is configured to use Feature Description, configure Description Format. Use the following value:

      Population: <i>{POP2007}</i><br />
      Area: <i>{SQMI} sq.mi.</i>

      This specifies the information to display below the label.

  5. Press Ctrl+S to save the workflow.

  6. Configure your viewer to run the workflow.

    See Host and Run Workflows in the Geocortex Viewer for HTML5 for information.

  7. Launch or refresh the viewer and run the workflow.

    The features listed in the Results list are formatted using the formatting configured in the Show Results activity.

Example 2 - Format Features Using the Layer’s Existing Configuration

In this example, the features come from a Query Layer activity that is configured the same as the Query Layer activity in Example 1. In this example, however, the layer that the features belong to exists in the map. The Show Results activity is configured to take advantage of the layer's configuration:

Workflow Logic

The workflow has the following activities, in the order shown:

If you want to try this example, configure the following site and viewer:

  1. Create an empty site.

  2. Add the Open Street Map basemap: Click Add Map Service, search for Open Street Map, and click Add to Map.

    The map service's ID should be 0. The ID is given on the map service's Details tab.

  3. Set the layer's Feature Label to: State Name: <i>{STATE_NAME}</i>

  4. Set the layer's Feature Long Description to:

    Population: <i>{POP2007}</i><br />
    Area: <i>{SQMI} sq.mi.</i>

  5. Add the following layer to the map: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

    This is the URL for a layer of US states. The layer's ID is 3.

  6. Add an HTML5 viewer.

To use the viewer's configuration to format query results that are displayed by a Show Results activity:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

    • Query Layer (query1)
    • Show Results
  3. Query Layer (query1): Configure the inputs:

    • Url: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

    • Where: SUB_REGION='Mountain'

    • Return Geometry: true

    • Output Spatial Reference: 102100

    • Output Fields: STATE_NAME, SQMI, POP2007

  4. Show Results: Configure the inputs:

    • Set the Features input to: =$query1.results

      This specifies the features to display.

    • Set the Map Service Id input to: 0

      Alternatively, you can specify the Map Service ID as a string: ="0"

      Set the Layer Id input to: 3

      Alternatively, you can specify the Layer ID as a string: ="3"

      Together, these inputs provide the information that the Show Results activity needs in order to access the layer and its configuration.

    • Make sure the Label Format, Long Description Format, Description Format, and Icon URI are blank.

  5. Press Ctrl+S to save the workflow.

  6. Configure the viewer to run the workflow.

    See Host and Run Workflows in the Geocortex Viewer for HTML5 for information.

  7. Launch or refresh the viewer and run the workflow.

    The features in the Results list are formatted using the formatting configured in the layer's configuration.

Example 3 - Combine Feature Sets

This example shows you how to use a Show Results activity to combine the feature set with an existing feature set from an earlier Show Results activity. The features belong to a layer of US states returned by two Query Layer activities. The first query returns the 3 states in the Middle Atlantic region. The second query returns the 4 states in the East South Central region. The second Show Results activity combines the two sets of states using a union operation, resulting in a feature set of 7 states, which are displayed using the layer's configuration.

Workflow Logic

The workflow has the following activities, in the order shown:

If you want to try this example, follow the instructions in Example 2 to configure the site and viewer.

To combine feature sets using two Show Results activities:

  1. Open Workflow Designer.

  2. In a new, blank workflow, add the following activities and connect them in the given order:

    • Query Layer (query1)
    • Show Results
    • Delay
    • Query Layer (query2)
    • Show Results
  3. Query Layer (query1): Configure the inputs:

    • Url: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

    • Where: SUB_REGION='Middle Atlantic'

    • Return Geometry: true

    • Output Spatial Reference: 102100

    • Output Fields: STATE_NAME, SQMI, POP2007

  4. Show Results: Configure the inputs:

    • Set the Features input to: =$query1.results

      This specifies the features to display.

    • Set the Map Service Id input to: 0

      Alternatively, you can specify the Map Service ID as a string: ="0"

      Set the Layer Id input to: 3

      Alternatively, you can specify the Layer ID as a string: ="3"

      Together, these inputs provide the information that the Show Results activity needs in order to access the layer and its configuration.

    • Set Collection Name to: US States

      The combine operation will be performed on this collection.

    • Make sure the Label Format, Long Description Format, Description Format, and Icon URI are blank.

      This ensures that the Show Results activity uses the configuration from the layer instead of from the activity.

  5. Delay: Set the Duration input to: 5000

  6. Query Layer (query2): Configure the inputs:

    • Url: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

    • Where: SUB_REGION='East South Central'

    • Return Geometry: true

    • Output Spatial Reference: 102100

    • Output Fields: STATE_NAME, SQMI, POP2007

  7. Show Results: Configure the inputs:

    • Set the Features input to: =$query2.results

      This specifies the features to display.

    • Set the Map Service Id input to: 0

      Alternatively, you can specify the Map Service ID as a string: ="0"

      Set the Layer Id input to: 3

      Alternatively, you can specify the Layer ID as a string: ="3"

      Together, these inputs provide the information that the Show Results activity needs in order to access the layer and its configuration.

    • Set Collection Name to: US States

      In order to combine the feature sets, the two Show Results activities must operate on the same collection.

    • Set Combine Mode to: union

      This specifies the operation to use to combine the two feature sets.

    • Make sure the Label Format, Long Description Format, Description Format, and Icon URI are blank.

      This ensures that the Show Results activity uses the configuration from the layer instead of from the activity.

  8. Press Ctrl+S to save the workflow.

  9. Configure your viewer to run the workflow.

    See Host and Run Workflows in the Geocortex Viewer for HTML5 for information.

  10. Launch or refresh the viewer and run the workflow.

    The features from both queries are displayed.

  11. Click the Go Back In Panel icon to go to the previous panel.

    The US States collection contains a single feature set with 7 features.