Follow

Hide a layer in your App

Sometimes, it can be useful to hide a layer in your app.   The better way to hide a layer in a layers tree is to add a "hidden form" to your layer in the Mapeditor.  Add this option to your Form or create a new one with this option in it.

{
   "display_in_layer_tree": false
}

NOTE 1: You must activate grouping option ( "enable_grouping": true) in the web App JSON config. 

NOTE 2: This form can be attached to a base layer.

Another option is to add this Javascript snippet to your app configuration:

context.datasources[2].display_in_layer_tree = false;

NOTE: Layer index starts from the top of layer tree at position 0.

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk