A layer theme is a subset of the Layer List, optionally with different visibility settings for the layers. The layers that are included in a layer theme usually have some theme in common. For example, you could define a Hydrography layer theme that turns on the map's water-related layers, such as layers for streams, lakes, and watersheds, and turns off layers that are not related to water.
Layer themes make it possible to quickly flip between sets of layers that are defined for different purposes. When a user selects a layer theme, the map redraws to show the layers in the layer theme, and the Layer List refreshes to list the layers that are included in the layer theme. This streamlines and specializes layer selection.
Switch quickly between different layer themes
Common Uses of Layer Themes
Some common uses for layer themes are:
To configure layer themes that display only those layers that are needed for a specific task, analysis, or business need. This eliminates unneeded layers and makes it easier for users to quickly flip between the layers that they need when performing a particular task.
To group frequently used layers into the default theme. Group the other layers by specialized functions in order of priority or business needs. The reduction in the number of layers in the default theme provides performance benefits.
To configure multiple layer themes with the same layers, but different visibility settings. In this case, toggling between themes changes the visibility settings of multiple layers simultaneously.
To configure a set of layer themes that allow users to change the context of the map. This simplifies the viewer for users who are not familiar with the concept of map layers.
Layer Theme Permissions
Layer themes are securable. If the site is secured, you can give some users permission to use a particular theme, and deny permission to other users. For information, see Permissions.
Layer themes are configured on Manager's Layer Themes page. A site must have at least one layer theme, which is the theme that loads when the viewer launches. Initially, the All Available Layers theme is the default theme.
If the user selects a different default layer theme, the map redraws and the list of layers changes to the layer theme's list. If there are search results, selections, markup, and user-added layers when the user changes the theme, these items may no longer be available. Their availability depends on whether the layer is included and visible in the new layer theme.
All Available Layers
By default, every site has a layer theme called All Available Layers, which corresponds to the full Layer List.
The All Available Layers layer theme includes all the layers that the Layer List includes, with the same visibility settings as the Layer List. If you add or remove a layer from the Layer List or you change a visibility setting, your changes are reflected in the All Available layers theme.
You can hide the All Available Layers theme so it does not appear in viewers. For information see Hide the "All Available Layers" Theme.
Add and Edit Layer Themes
Initially, when you add a new layer theme, all the map services, layers, and folders that are included in the Layer List are also included in the theme. You can exclude any map services, layers, and folders that you want.
When you exclude a layer, the layer does not show in the map or in the list of layers, and the layer's data is not available for client-side operations like search. If you exclude an item that contains other items, all the contained items are also excluded. Layer themes automatically appear in the drop-down menu of available themes at the top of the Layer List.
Layer Visibility
Each map service and layer that is included in a layer theme has a visibility setting in the theme. The visibility that you configure in the layer theme overrides the visibility that is configured in the Layer List.
Layer Themes and the Basemap Switcher
The layer theme affects which basemaps show in the Basemap Switcher. When the user changes the layer theme, the basemaps that are available in the new layer theme are loaded into the Basemap Switcher and replace the basemaps from the previous layer theme.
A basemap is available in a layer theme if one or more of its map services is included in the layer theme. When a user selects a basemap with a mix of included and excluded map services, only the map services that are included in the layer theme show on the map.
If all of a basemap's map services are excluded from a layer theme, then the basemap does not show in the Basemap Switcher when that layer theme is selected.
See also...
Layer themes behave in the viewer in the following ways:
When users save a project, the selected layer theme is saved. When the project is opened, the saved layer theme is displayed.
It is possible to launch a viewer with a particular layer theme applied. This is done by adding the layerTheme
parameter to the URL.
The URL parameter uses the ID or Display Name of the layer theme. For example, if the layer theme you want to apply when the viewer starts has an ID of 2, you might use a URL similar to:
http://myserver/Html5Viewer/Index.html?configBase=http://myserver/Geocortex/Essentials/REST/sites/mysite/viewers/myviewer/virtualdirectory/Resources/Config/Default&layerTheme=2
Alternatively, if the layer theme's Display Name is Zoning, you might use a URL similar to:
http://myserver/Html5Viewer/Index.html?configBase=http://myserver/Geocortex/Essentials/REST/sites/mysite/viewers/myviewer/virtualdirectory/Resources/Config/Default&layerTheme=Zoning
To add a layer theme to a site:
In
Click the Edit icon in the Layer Themes toolbar on the Layer Themes page.
Location of icon to add, edit, and remove layer themes
Click Add New Layer Theme.
A new theme appears at the bottom of the list.
Type in a name for the layer theme.
Choose a name that is meaningful to end users. The name appears in the list of themes in the viewer.
If you want the new layer theme to load when the viewer is launched, select the Default button beside the theme.
If you want to move the layer theme to a different position in the list, grip the Sort Layer Theme handle the theme and drag it to its new position in the list.
Layer themes appear in the viewer in the same order that they appear in Manager.
Click OK.
The layer theme is created.
Select the new theme in the drop-down list in the Layer Themes toolbar at the top of the Layer Themes page.
The Include and Exclude icons
should also appear in the Layer Themes toolbar. If you do not see these icons, make sure you have selected a custom layer theme—the icons are not displayed when the predefined All Available Layers theme is selected.
Configure which map services, layers, and folders you want to have in the theme:
Exclude Items
To exclude an item (and its nested items), click the Include icon next to the item.
The item's text and icon are dimmed .
To exclude all items, use the Exclude icon in the Layer Themes toolbar.
If the list contains many items, most of which will be excluded, it is quicker to exclude them all and then re-include individual items than it is to exclude individual items.
Include Items
To re-include an item that you have excluded, click the item's Include icon .
If the item contains other items, the contained items will also be re-included.
To include all items, click the Include icon in the Layer Themes toolbar.
By default, all items are included.
Configure the default visibility of the layers that are included in the layer theme:
Select the checkbox next to a layer to show it on the map when the layer theme loads.
Clear the checkbox next to a layer to hide it on the map when the layer theme loads.
Click Apply Changes.
Every site has a layer theme called All Available Layers. The All Available Layers theme corresponds to the Layer List. It includes all the layers that the Layer List includes, with the same visibility settings as the Layer List. If you add or remove a layer from the Layer List or you change a visibility setting, your changes are reflected in the All Available Layers theme.
You cannot remove the All Available Layers theme, but you can hide it so that it does not appear in viewers. In order to hide the All Available Layers theme, the site must have at least one other layer theme configured.
To hide the All Available Layers theme:
In
Click Edit in the Layer Themes toolbar.
Clear the Allow All Layers checkbox.
When you clear the checkbox, the next layer theme in the list becomes the default layer theme.
Location of the checkbox to clear
Select the Default button for the layer theme that you want to load when the viewer is launched.
Click OK.
Click Save Site.
Layer themes appear in the viewer in the same order that they appear in Manager. You can reorder the list of layer themes by moving individual layer themes within the list.
To reorder the list of layer themes:
In
Click Edit in the Layer Themes toolbar.
Drag and drop the Sort Layer Theme icon next to a layer theme to move it in the list.
Repeat this step until you are satisfied with the order of the layer themes.
Click OK.
Click Save Site.