Pop-up not enabled for layer not visible in web map

783
4
Jump to solution
04-24-2019 07:00 AM
ArchanaVenkataraman
New Contributor III

We have an application built with 3.24 API based on a web map in Portal for ArcGIS. Some of the layers are not visible in the web map initially (parent group layer visible but not sub layer), but the pop-up has been configured and enabled for all layers. This works as expected within the Portal.

With a layer list widget configured to the web map, layer visibility is toggled within the application. For layers that were not visible within the web map, pop-up does not appear.

Here is a screenshot of a web map within the sample app for layer list. It shows the pop up for a layer that is set as visible within the web map.

When I toggle the other layer on and zoom-in, I still get the pop-up of previous layer.

Even when I turn the layer's visibility off, I still don't get the pop-up of the now visible layer.

Whereas in the web-map, once the pop-up seems to be working as expected. It shows both the layer's pop-up, but it considers all visible layers.

The screenshots are from a sample app that uses the 3.28 version of the API.

Is this a limitation of the API? Is there any way to enable the pop-up set in the web map when the layer visibility is toggled on?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Archana,

   Then make this change to that sample:

arcgisUtils.createMap("939c5b8285844d129ecb3aae29f02581", "map",{usePopupManager: true}).then(function(response){
        var myWidget = new LayerList({
           map: response.map,
           layers: arcgisUtils.getLayerList(response)
        },"layerList");
        myWidget.startup();
    });

The important part is usePopupManager.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Archana,

  So you just took this sample and replaced the webmap id?

https://developers.arcgis.com/javascript/3/jssamples/widget_layerlist_basic.html

What is your webmap id? If you provide it I can do some testing for you.

0 Kudos
ArchanaVenkataraman
New Contributor III

Hello Robert,

Yes I used the sample and just changed the web map ID.

This is the link to the web map:

https://arcg.is/1fmqmu 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Archana,

   Then make this change to that sample:

arcgisUtils.createMap("939c5b8285844d129ecb3aae29f02581", "map",{usePopupManager: true}).then(function(response){
        var myWidget = new LayerList({
           map: response.map,
           layers: arcgisUtils.getLayerList(response)
        },"layerList");
        myWidget.startup();
    });

The important part is usePopupManager.

ArchanaVenkataraman
New Contributor III

Thanks a lot! That has been very helpful.

0 Kudos