Select to view content in your preferred language

transparency listlayer widget for sublayers of groups

4114
7
07-12-2016 02:02 PM
GilbertoMatos
Frequent Contributor

Hello! I'm trying to customize the widget layerlist web AppBuilder. I need to make the sublayers have the option of transparency as it appears from the submenu to the root layer.

I managed to figure out how to make the transparency option appeared with the slider for each of the layers. For this, I changed the PopupMenuInfo.js file "itemInfoCategoreList" variable, adding a new key {key: 'transparency'} for the 'FeatureLayer' array.

The problem is that I do not know where I need to change to make this functionality be effectively executed. Making a debug by google chrome, I realized that "if" is not run down to the sublayers, if the line (this.layerObject.setOpacity) always returns undefined:

setOpacity: function (opacity) {
       if (this.layerObject.setOpacity) {
         this.layerObject.setOpacity (opacity);
       }
     }


I appreciate any help.
I am using Web 2.0 AppBuilder.
Gilberto.

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Gilberto,

  Sublayers do not support setting their transparency unless you have the map service set to support dynamic layers (Supports Dynamic Layers: True). You will also have to ensure that the layer image output format is one that supports transparency like PNG32.

GilbertoMatos
Frequent Contributor

Hello! Friend, I am still new in the development of widgets for AppBuilder. Please, can I have another explanation?

What I have is a map, added to an application of AppBuilder. The address to search the layers is "http: // myserver / arcgis / rest / services / SIGBIO / Mapa_Basico_Sigbio / MapServer." In this layer, I can apply transparency. But in the other layers, the slider does not apply any transparency. I say to the layers below, for example:

"Http: // myserver / arcgis / rest / services / SIGBIO / Mapa_Basico_Sigbio / MapServer / 0"
"Http: // myserver / arcgis / rest / services / SIGBIO / Mapa_Basico_Sigbio / MapServer / 1"
"Http: // myserver / arcgis / rest / services / SIGBIO / Mapa_Basico_Sigbio / MapServer / 2"

I do not know how to proceed in this case. We have a purchased application, which works well, but in my customization of layers widget, I'm not getting.

I am Brazilian and I speak Portuguese. I'm using google translator. Sorry for that.

Thank you!
Gilberto.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Gilberto,

It is NOT possible to adjust the transparency of sublayers in a Map Service (like you have), unless you publish the map service with dynamic layer support. If you are able to do then you would have to be a good developer to add the ability to have a slider for each sublayer to the LayerList widget. Bottom line is unless you are a good developer that understands the JS API this is not going to be possible.

0 Kudos
GilbertoMatos
Frequent Contributor

Hello!

Where can we make this setup with support to dynamic layers and png32?

When I create the map in the portal, can set the visibility of each of the layers, but when I use this map AppBuilder, this functionality is not displayed.

Thank you!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Gilberto,

  The supports dynamic layers can be set when you publish your service to ArcGIS Server.

When I create the map in the portal, can set the visibility of each of the layers, but when I use this map AppBuilder, this functionality is not displayed.

That is because that functionality is NOT supported in WAB. You would have to enhance the layerlist widget to allow for this.

0 Kudos
GilbertoMatos
Frequent Contributor

Hello!

Friends, good news! I managed to set the transparency of sub layers. I made the change to the file "PopupMenuInfo.js" adding key "{key: transparency '} to the array." FeatureLayer "After that, I started to use a FeatureServer instead of a map server in my webmap I used the web AppBuilder . it worked perfectly and I started to be able to apply the transparency of layers and sub-layers. the only problem I found is that I lost the configuration of layer groups that was present in mapserver. you can not configure layer groups for featureserver?

Thank you!

Gilberto.

0 Kudos
by Anonymous User
Not applicable

I have dynamic capability enabled for the services. On 10.6.1. Sliders work in the web map. Just not WAB 2.9 or 2.10.  For example, there are no transparency sliders on the sublayers here. Only at the service level.  Test WAB app for transparency 

Team WAB - Is this not implemented in WAB? Is it planned for an update?  

Here are the services: Folder: SagisOrg2018 

Reason I ask, is tweaked the layerList to make it like AGS JS TOC. Here is the text app I am building. SAGIS Property Map Viewer    Like AGS JS TOC with symbols next to the layer.  Like the old site I did many years ago with legend/layerlist integrated: www.sagis.org/home/map 

I used CSS to avoid duplicate layer rows.  I am aware transparency works for feature layers.. Duplicate Layer Names in TOC in ArcOnline  I use dynamic map image layers for perfomance and web maps still don't support adding sublayers as dynamic layers. (featureLayers are far too slow from my tests, even with file gdb in web mercator. Meanwhile webGL layers also have problems (too many instances of webGL process).... so I use dynamic layers.  Esri will hopefully support adding sublayers as dynamic layers in a webmap when they implement grouping layers in the webmap)

0 Kudos