MapTips Module

The MapTips module implements map tips in the HTML5 Viewer. Map tips are the pop-up windows that appear on the map when the user clicks on the map.

In order for map tips to work in an HTML5 viewer, you must enable map tips for each layer that you want to support map tips. You must also configure the content that you want to appear in map tips. The header and main content are configured in the layer. See Map Tips for information.

Example of a map tip, showing the configurable parts

The footer content is configured in the Menu Module's MapTipActions menu. See Menu Module.

You can also customize the message that displays in map tips when no results are returned. Use the Results module's customSearchSuggestions property to customize the message. See Results Module for information.

The Identify module performs the query when a user clicks the map. See Identify Module for information.

Before version 2.4 of the HTML5 Viewer, map tips displayed in callouts. Starting in version 2.4, the HTML5 Viewer supports both fixed-location and callout-style map tips.

Fixed-Location Map Tips

By default, HTML5 viewers display map tips at a fixed location. For example, the Desktop and Tablet interfaces show map tips in the NavigationMapRegion by default.

The HTML5 Viewer has the following commands for working with fixed-location map tips:

For more information about these commands, refer to Viewer Commands and Events.

The MapTips module has three views—MapTipView, MapTipHeaderView, and MapTipContentView. Fixed-location map tips use all three of these views.

MapTipHeaderView contains the map tip's header, controls, and title. MapTipContentView contains the map tip's main content and footer links. Both of these views appear within MapTipView in the viewer. The three views all share the same view model, MapTipViewModel.

Views used by fixed-location map tips

Callout-Style Map Tips

You can configure an HTML5 viewer to use callout-style map tips instead of fixed-location map tips. To do this, you replace the fixed-location version of map tip commands with the callout-style version of the commands in the configuration files. The HTML5 Viewer has the following commands for working with callout-style map tips:

For more information about these commands, refer to Viewer Commands and Events.

Callout-style map tips use two of the MapTips module's three views—MapTipHeaderView and MapTipContentView. MapTipHeaderView contains the map tip's header. MapTipContentView contains the map tip's main content and footer. The callout itself is built into the HTML5 Viewer—the callout does not have a view.

The views share the same view model, MapTipViewModel.

Views used by callout-style map tips

To configure an HTML5 viewer to use callout-style map tips:

  1. In a text editor or XML editor, open one of the viewer configuration files—Desktop.json.js or Tablet.json.js.

    By default, the configuration files are stored in the Sites folder:

    Sites\[site]\Viewers\[viewer]\VirtualDirectory\Resources\Config\Default

    Callout-style map tips are not supported in the Handheld configuration.

  2. Replace each instance of ShowMapTipResults with ShowMapTipResultsInCallout.

  3. Replace each instance of ShowMapTip with ShowMapTipInCallout.

  4. Save the file.

  5. Repeat these steps for each configuration file.

Map Tips with Null Geometry

When a feature is selected in the Results Table and it has no spatial data, a status message notifies the user with the following message: "The selected feature contains no spatial data and cannot be highlighted on the map."

If a selected feature does not have spatial data, the map tip displays a message, "No spatial data" in the map tip content.

Configuration Properties

Module

Views

View Models

Example - Add a Command with a Parameter to a Behavior

The following example demonstrates adding a new command with a parameter to the behavior, MapOnFeatureClickBehavior.

To add a command with a parameter to a behavior:

  1. Run an XML editor or text editor as an administrator.

  2. Open one of the viewer configuration files, Desktop.json.js, Tablet.json.js, or Handheld.json.js, in the editor.

    By default, the configuration files are here:

    C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\[instance]\REST Elements\Sites\[site]\Viewers\[viewer]\VirtualDirectory\Resources\Config\Default\

  3. In the MapTips module section, find the behaviors property. Locate the behavior you want to edit, for example, MapTipFeatureChangedBehavior.

    {
        "moduleName": "MapTips",
        ...
        "configuration": {
            ...
            "behaviors": [
                ...
                {   
                    "name": "MapTipFeatureChangedBehavior",
                    "commands": [
                        "PanToFeatureIfOutsideMapExtent"
                    ]
                }
            ]
        },
        ...
    }

    The behavior executes a single command: PanToFeatureIfOutsideMapExtent.

  4. Refer to Viewer Commands and Events to determine the type of parameter that is associated with the PanToFeatureIfOutsideMapExtent command.

    PanToFeatureIfOutsideMapExtent has a parameter of type, geocortex.essentialsHtmlViewer.mapping.infrastructure.Feature.

  5. Find a command that you want to add to the behavior that has the same parameter type, for example, PanToFeature.

  6. Add the desired command to the list of commands, separated by a comma. For example:

    "commands": [
        "PanToFeatureIfOutsideMapExtent",
        "PanToFeature"
    ]
  7. Save the file.

© 2019 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 4.11