Identify Features

12-17-2014 02:05 PM
New Contributor III

Has anyone else experienced that identify still brings up a pop up for layers that aren't even turned on in the map? I am using a map published with Server and placed on ArcGIS Online.

0 Kudos
21 Replies
Occasional Contributor

I've noticed that. Perhaps more troubling, I've also noticed that popups don't work for layers that are off initially.

I have a web app that has multiple services from our ArcGIS Server. Most of the layers in each service are "off" (not visible) by default. They are also off in the web map. Popups for all layers are enabled. When I publish as a Web AppBuilder application, the popups for layers that are "off" do not show up, even after the end user turns the layer on in the Table of Contents widget.

My first work around is to turn all layers on in the web map. Now popups work, but as you've found, all layers in each service popup on every identify, even if some of the layers are off in the Table of Contents.

0 Kudos
New Contributor III

It is almost as if WebApp Builder does not correctly recognize when layers are on or off. Simply shows popups for anything you enabled in the web map. I had not noticed your further issue, but it would make sense if it can't correctly recognize settings from the actual map.

Hope Esri is looking into this. Kind of a deal breaker especially considering there isn't an actual identify tool you can control.

New Contributor III

I'm experiencing the same problem. Any luck?

I'm using WAB on ArcGIS Online, not the Dev version.

0 Kudos
Occasional Contributor

The solution posted by Stan McShinsky‌ seems to work (at least the first half - I haven't tested the second half) but it isn't available for the AGOL version. As Julia Guard‌ noted, ESRI is aware of the issue, but hasn't committed to fixing it within any specific timeframe.

Occasional Contributor III

I have found that in the developer version you can go into the \jimu.js\MapManager.js file and make this change:

var webMapOptions = {

          mapOptions: mapOptions,

          bingMapsKey: appConfig.bingMapsKey,

          usePopupManager: true


By adding the usePopupManager option it fixes the issue with identifying layers, but I find that it semi breaks other widgets like measure and draw because now when you click on the map to measure you get the measure tool and the identify popup comes up.

Esri Frequent Contributor


I'm not familiar with the WAB code but you should be able to disable the popups when the measurement widget is active by setting map.showInfoWindowOnClick(false). Then when you deactivate the measure tool you can turn popups back on using map.showInfoWindowOnClick(true).

You may see that they already have code in the WAB that does this by enabling/disabling the clickEventHandler and clickEvent Listener. Once you set usePopupManager to true those no longer work and you have to switch to the showInfoWindowOnClick approach.

Hope this helps.

Occasional Contributor III


Thanks for the help. After you mentioned using map.showInfoWindowOnClick I tried to look it up but there was not much out there for that. All I found was this link esri/arcgis/utils | API Reference | ArcGIS API for JavaScript  that has this When using usePopupManager: true in the options parameter in the createMap method, the clickEventHandle and clickEventListener will be undefined. Instead use the Map.setInfoWindowOnClick to control visibility of the popup. It did not give any examples on how to do that. I tried a few things and I think I found one that works. From what I can tell it looks good to me.

For the measurement widget I opened \widgets\Measurement\Widget.js and commented out two lines and added two new ones right around line 69.

aspect.after(this.measurement, 'setTool', lang.hitch(this, function() {
    if (this.measurement.activeTool) {
      //this.disableWebMapPopup();;   //added this
    } else {
      //this.enableWebMapPopup();;   //added this

It looks like you need to add these lines of code to other widgets that need map clicks like draw.

Occasional Contributor III

OK I did some more digging and found the place to fix the draw widget.


around line 165

Comment out this.enableWebMapPopup(); and add in;

  //this.enableWebMapPopup();;    //Added this

around line 245

Comment out this.disableWebMapPopup(); and add in;

  var target =||event.srcElement;
  var items = query('.draw-item',this.domNode);
  var geotype = target.getAttribute('data-geotype');
  var commontype = target.getAttribute('data-commontype');
  var tool = Draw[geotype];
  //this.disableWebMapPopup();;    // added this
Occasional Contributor

Thanks Stan,

This worked for the measure tool. I didn't have quite as much luck with the draw widget. I tried switching setInfoWindowOnClick in the startup and destroy functions of the draw widget. startup seemed to work, but destroy did not give the popup back to Identify. Here's my code starting on line 371 of the Widget.js of the Draw Widget. (I don't seem to have access to the syntax highlighter in my forum window here.)

      destroy: function() {



          this.drawBox = null;




          this.pointSymChooser = null;




          this.lineSymChooser = null;




          this.fillSymChooser = null;




          this.textSymChooser = null;


        this.inherited(arguments);;  //<<ADDED THIS LINE


      startup: function() {; //<<ADDED THIS LINE //<<ADDED THIS LINE