Aller au contenu principal

Show/hide layer comparison tool

Commentaires

3 commentaires

  • Nico Burgerhart

    With the layer-comparison.set-mode command

    https://developers.vertigisstudio.com/docs/web/api-commands-operations/#command-layer-comparison.set-mode

    [
       {
           "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
  • Yannick Mijnheer

    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
  • Victor Catalán

    Hi Yannick;

    you can achieve this with the following command: layer-comparison.set-mode

    Here is an example in which some properties are also set:

    1. Set the desired basemap
    2. Switch on layer-comparision mode
    3. Incluse a leading layer
    4. 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: 

    0

Vous devez vous connecter pour laisser un commentaire.