Restrict layers in attribute table widget in javastript?

493
2
02-27-2020 06:53 AM
DávidGregor
New Contributor II

Hello! I'm building a webapp, where you can change from several map services. In every map service there are several layers with same naming, but not with the same number of layers. I cannot set the attribute table widget up in webapp builder, because the json too hardcoded. I'm really new in javastript. Please help me!

I would make a list in js, what contains the allowed layer's  name:

layersToShow: [Layer1, Layer2, Layer3]

in the widget's _ResourceManager.js

I think here is the section from the manager, where i could repoint the reader. But i don't know how. i would add all the possible allowed layers to the list, and the js may fail to get the layerinfo. How would you accoplish this?

          if (updateConfig) {
            if (this.config.layerInfos.length === 0) {
              // if no config only display visible layers  ,egy tombot csinalok es amikor itt filterel, akkor egy consistal kerem le a tombbol
              var configLayerInfos = attrUtils.getConfigInfosFromLayerInfos(layerInfos);
              this.config.layerInfos = array.filter(configLayerInfosfunction(layer) {
                return layer.show;
              });
0 Kudos
2 Replies
DávidGregor
New Contributor II

Or anybody tried to use more AT widget config files in one app? Than i would set up the attr. table for every map one by one, and somehow i would set up the JS, to read the right config file.

0 Kudos
DávidGregor
New Contributor II

Any idea?

0 Kudos