Provide an asset and background layer selector
HTML Drawing Control
Provide an asset and background layer selector
The Asset and Background Layer Selector provides a user-friendly interface for asset and background layers selection. It is an optional add-on that you can specify in
addOnsConfig parameter
before you load HTML drawing control.
var parameters = new Ab.view.ConfigObject(); parameters['addOnsConfig'] = { 'LayersPopup': {divId: "svgDiv", layers: "rm$;rm$TXT;eq-assets;eq-labels;jk-assets;jk-labels;background", defaultLayers: "rm$;rm$TXT;eq-assets;jk-assets", customEvent: onCheckBoxChanged} };
Where:
divId | Required. Drawing control's container div id. | |
layers | Optional. Specify the layers to display in the popup. If empty or not specified, all published layers in SVG drawing will show. | |
defaultLayers |
Optional. Specify the checked layers after loading, which is a subset of
layers
. If
defaultLayers
is empty or not specified, all layers specified in
layers
parameter will turn on.
|
|
customEvent | Optional. Define custom event when users check/uncheck individual layer's checkbox. |
There are several layer sub-groups in
LayerPopup
:
- Asset/Label layers
- Other layers such as cluster/marker, markup/redlines.
- Background layers
All layers are sorted within each individual layer's sub-groups (such as asset/labels, backgrounds etc.)
Other layers and background layers are placed below asset/label layers with a horizontal separator bar. Cluster/Marker/Markup/Redlines layers are placed ahead of background layers.
The layer names displayed on the
LayersPopup
window are automatically set from the
afm_layrs
table, like using the title field or
title_<language>
for different languages. If values are not present in
afm_layrs
table, the publish titles will be displayed.
Both
layers
and
defaultLayers
support layer names from the published SVG (such as rm-assets, rm-labels), as well as the layer names from the
afm_layrs
table (such as RM$, RMM$TXT). You can also specify the
background
group, which will display all individual background layers.
When the view contains Highlight/Label Selector, when the user switches between different highlight datasources, the system highlights the assets that are of the same asset type that are related to fields of the datasource. For layers that are not related with any datasource fields defined in highlight/label datasource, the user can still check or uncheck them.
The example view below shows the asset layer popup, and how to define custom events when users check and uncheck the layer.