Show/hide layer comparison tool
Hi,
How can I show/hide the layer comparison tool with a button? I want it to be inactive by default, but users should be able to activate it if they want to.
In the app config I found the parameter ‘layerComparisonIsActive’, but I can't think of a way to change this on the fly. Does anyone know how to achieve this?
Thanks in advance.
-
With the layer-comparison.set-mode command
[ { "name": "layer-comparison.set-mode", "arguments": { "active": true } } ]See the 'Lagen' and ‘Verberg slider’ buttons on the 'Gegevens' tab in the toolbar in this viewer https://geoweb.rijkswaterstaat.nl/ModuleViewer/?app=c70700cd9e7a49debd31b05d05ebdac1
1 -
Ahh, thanks once again Nico! I scanned all the commands, but ‘set-mode’ didn't trigger me, didn't sound like an ‘activate’ command. More carefull reading next time..
0 -
Hi Yannick;
you can achieve this with the following command:layer-comparison.set-modeHere is an example in which some properties are also set:
- Set the desired basemap
- Switch on layer-comparision mode
- Incluse a leading layer
-
Set the visibility of a layer
[ { "name": "basemap.set", "arguments": { "basemap": "item://basemap-extension/43a92a76-f6c5-4da8-927a-ee1f3e810a14" } }, { "name": "layer-comparison.set-mode", "arguments": { "active": true } }, { "name": "layer-comparison.add-leading-layers", "arguments": "My Satellite Layer" }, { "name": "layers.set-visibility", "arguments": { "layers": "My Satellite Layer", "visible": true } } ]
Important Links:- VertiGIS Studio Commands & Opperations: Here you can search for “layer-comparison” to find all commands related to layer-comparision action
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
3 commentaires