SharingLink Module

The SharingLink Module creates viewer URLs that the Share Module can share with other applications.

As part of creating a viewer URL to share, the SharingLink Module assembles URL parameters. The URL parameters for sharing links fall into two categories:

Intrinsic URL Parameters

Intrinsic URL parameters come from the URL that the user used to launch the viewer. Usually, intrinsic parameters are essential for the viewer to function properly. By default, the following URL parameters are intrinsic:

For example, suppose the original URL uses the viewerConfigUri parameter to point to the viewer's configuration files. When the SharingLink Module assembles a URL to share, it copies the viewerConfigUri parameter and its value from the original URL to the sharing URL that it is assembling.

You can override the default list of intrinsic parameters using the intrinsicUrlParameters property. Note that intrinsicUrlParameters overrides the default list—it does not add to it. This means that you must include the default intrinsic parameters in the list, as well as any other parameters that you want to preserve from the original URL.

For example, suppose the original URL contains the viewerConfigUri, extent, and runWorkflow parameters. Under the default configuration, the SharingLink Module copies viewerConfigUri to the sharing URL, but not extent or runWorkflow. If you want sharing links to run the workflow but not set the extent to the original URL's extent, you could configure intrinsicUrlParameters as follows:

  {
    "moduleName": "SharingLink",
    "moduleType": "geocortex.essentialsHtmlViewer.mapping.modules.sharingLink.SharingLinkModule",
    "configuration": {
      intrinsicUrlparameters [
        configBase,
        viewer,
        viewerConfigUri,
        runWorkflow
      ],
    ...

In this example, you do not have to include viewer and viewerConfigUri in intrinsicUrlParameters. However, it is a good practice to list all of the default intrinsic parameters.

We recommend that you list all the default intrinsic parameters in intrinsicUrlParameters, even if you do not use them all in the URLs that you distribute to your users. Then, if you ever change the method that you use to point to the viewer's configuration files, sharing links will still work.

The intrinsicUrlParameters property can include any of the parameters listed in the URL Parameters Reference.

State-Preserving URL Parameters

State-preserving URL parameters preserve the state of the viewer when the user shares the link. Preserving the viewer's state ensures that other users see the same view of the map as the user who shared the link. For example, a URL parameter that captures the current map extent is state preserving.

The SharingLink Module creates state-preserving URL parameters when it assembles the sharing link. The specific parameters are determined by the sharingLinkProviders property. Each sharing link provider corresponds to a URL parameter that the SharingLink Module includes in the sharing link. The sharing link providers are:

By default, the layer theme, layer visibility, center, and scale providers are enabled, and the extent provider is disabled. There is no need to enable the extent provider when the center and scale providers are enabled.

The SharingLink Module has a HandleGenerateSharingLink command that creates the URL. If a sharing link provider's generate property is true, HandleGenerateSharingLink creates the parameter for that provider and includes it in the URL.

Each sharing link provider also has an apply property, which applies the parameter when the site is first loaded. By default, generate and apply are true. To disable a sharing link provider, set generate and apply to false. If you want the end user to supply the URL parameter, set generate to false and apply to true.

Each sharing link provider has a name property that you can use to change the names of the state-preserving URL parameters that are included in sharing links. This is useful for localization. For example, if your users are predominantly French, you could set each provider's name property to the name's French translation. Users who click the shared link will see the French names for the URL parameters.

Configuration Properties

Module

Views

The SharingLinks Module does not have any views.

View Models

The SharingLinks Module does not have any view models.

See also...

Share Module

© 2018 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 4.9