Anyone having these issues with WAB on AGOL?

3782
10
Jump to solution
08-18-2015 06:32 AM
MonaBrisco
New Contributor III

1.  If adding layers individually from service you can configure transparency but if adding all layers at once there is no configure option.

2.  The above but labels on a layer do not appear.

3.  If adding a featurelayer for search service, there is no configuration for popup to show only specific attributes.

4.  There is no way to configure background color of splash screen.

5.  If Object ID is not visible in mxd it still appears as attribute but even if not checked in configuration for popup it still displays in popup.

6.  The TOC/Treeview (if adding layers as a group as opposed to individually) remains collapsed with no option to expand automatically showing layers.

1 Solution

Accepted Solutions
RobertSommers
New Contributor II

Mona - I am trying to do this exact same thing.  I am having trouble putting the id in the correct place. 

<tr class="jimu-widget-row layer-row jimu-widget-row-selected" layertrnodeid="GreenCo_GIS_base_9724">

I am using "GreenCo_GIS_base_9724" as my id.

I have tried many different combinations, but cannot find the right spot for it.  Where would I put this id in the code? Thanks for any help!

widget2Expand= this;

        setTimeout(function () {

            var layer1Table = document.querySelectorAll("[layercontenttrnodeid='id2Expand']")[0].childNodes[0].childNodes[0];

            var img = document.getElementsByClassName("showLegend-image")[0];

            widget2Expand.layerListView._onRowTrClick(widget2Expand.operLayerInfos._layerinfos[0], img, layer1Table.childNodes[0], layer1Table);

        }, 500);

View solution in original post

0 Kudos
10 Replies
MonaBrisco
New Contributor III

So with the GREAT patience and help of Nick at ESRI...using WAB Developer v1.2

You can edit the Widget.js file to expand the layers automatically so that when you

click on the widget the layers are expanded.  Edit the LayerListView.js file to hide a layer added individually or as a group.

Sample Code: Widget.js (place at end of startup function and find id in chrome developer tools)

...

        widget2Expand= this;

        setTimeout(function () {

            var layer1Table = document.querySelectorAll("[layercontenttrnodeid='id2Expand']")[0].childNodes[0].childNodes[0];

            var img = document.getElementsByClassName("showLegend-image")[0];

            widget2Expand.layerListView._onRowTrClick(widget2Expand.operLayerInfos._layerinfos[0], img, layer1Table.childNodes[0], layer1Table);

        }, 500);

...

Sample Code: LayerListView.js (find id in chrome developer tools)

      array.forEach(layerInfo.newSubLayers, lang.hitch(this, function (level, subLayerInfo) {

          console.info(subLayerInfo);

          if (subLayerInfo.id != "id2hide") {

              this.drawListNode(subLayerInfo, level + 1, nodeAndSubNode.subNode); //hide sublayer

          }

        //this.drawListNode(subLayerInfo, level + 1, nodeAndSubNode.subNode);

      }, level));

    },

Cheers,

Mona

RobertSommers
New Contributor II

Mona - I am trying to do this exact same thing.  I am having trouble putting the id in the correct place. 

<tr class="jimu-widget-row layer-row jimu-widget-row-selected" layertrnodeid="GreenCo_GIS_base_9724">

I am using "GreenCo_GIS_base_9724" as my id.

I have tried many different combinations, but cannot find the right spot for it.  Where would I put this id in the code? Thanks for any help!

widget2Expand= this;

        setTimeout(function () {

            var layer1Table = document.querySelectorAll("[layercontenttrnodeid='id2Expand']")[0].childNodes[0].childNodes[0];

            var img = document.getElementsByClassName("showLegend-image")[0];

            widget2Expand.layerListView._onRowTrClick(widget2Expand.operLayerInfos._layerinfos[0], img, layer1Table.childNodes[0], layer1Table);

        }, 500);

View solution in original post

0 Kudos
ScottKiley
Occasional Contributor II

Derrick Frese​ - replace id2Expand with your layer ID inside the single quotes. However, this only works when the LayerList widget is NOT opened at startup. The Layers expand when the LayerList is opened in the app.

MonaBrisco
New Contributor III

Thanks Scott for pointing out to Derrick that 'id2Expand' was where he should put his id.  If you want to hide layers then "id2hide" should be replaced with id.  Sorry Derrick I have been tied up.

Update: All but #5 have been resolved via custom code and/or WAB v1.3.

Any ideas on how to capture the zoom event on the map in Developer Edition?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mona,

  I think this is what you are looking for:

on(this.map, 'zoom-end', function(evt){

  console.info(evt);

});

0 Kudos
MonaBrisco
New Contributor III

Hi Robert! 

First let me say thanks for the code for layerlist(LL) widget it helped me a lot.  I have the layers greyed out

initially until a user clicks on LL and zooms in on the map so they become visible.  However, if they zoom in before clicking on widget then it does not apply.  So I am trying to figure out in what file should I capture the event.  I tried in LL.js file and nothing happened.  Any ideas?

Thanks,

Mona

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mona,

   Are you talking about the code to add scale dependency to the LayerList widget? Sorry I provide so much code on GeoNet I loose track.

0 Kudos
MonaBrisco
New Contributor III

Yes Robert.

The code you contributed has a zoom-end event and calls checkScale.  I created another function to

check on zoom-start or zoom to try and capture the zoom events on the map "before" clicking on the

widget so that when user clicks on widget the zoom-end has already taken place and the layers should now be visible.  I might be performing in the wrong file.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mona,

   Sounds like you need to add a startup function and in that function call the checkScale function.

0 Kudos