WAB Popup Issue

6552
15
12-03-2014 08:33 AM
glennhazelton
Occasional Contributor III

Robert,

one more behavior I am curious about.

if it leave a layer unchecked and publish it as a service and then add the services to a agol webmap and use that webmap in the webappbuilder I can turn the layer on so it is visible but I cannot use the mouse and click on a feature and get a popup. all the layers that are published with the visibility on will show popups.

I have enabled popups in the webmap and configured them.

any ideas why?

15 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Glenn,

  I believe that issue is a bug that needs to be reported.

Try this work around:

MapManager.js:

Add line 4 and a comma to the end of line 3.

        var webMapOptions = {
          mapOptions: mapOptions,
          bingMapsKey: appConfig.bingMapsKey,
          usePopupManager: true
        };

This change will not affect existing apps so create a new one to test.

StanMcShinsky
Regular Contributor

Right now this work around only works for the developer version. You can not access the MapManager.js file for the AGOL web app builder.

0 Kudos
StanMcShinsky
Regular Contributor

When you use the usePopupManager: true it breaks other popups for the map like the measure and draw tools. What happens is when you want to measure something the map will measure but it still thinks that the identify tool is active and identifies things and the popup gets in the way. Here is another chunk of code to add to those widgets to fix that issue. So far it works for me, but not 100% sure it is the best fix.

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();
    this.map.setInfoWindowOnClick(false);   //added this
  } else {
    //this.enableWebMapPopup();
    this.map.setInfoWindowOnClick(true);   //added this
  }
}));

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

also see Identify Features

StanMcShinsky
Regular Contributor

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

\jimu.js\dijit\DrawBox.js

around line 165

Comment out this.enableWebMapPopup(); and add in this.map.setInfoWindowOnClick(true);

deactivate:function(){
  //this.enableWebMapPopup();
  this.map.setInfoWindowOnClick(true);    //Added this
  if(this.drawToolBar){
    this.drawToolBar.deactivate();
  }
  query('.draw-item',this.domNode).removeClass('selected');
},

around line 245

Comment out this.disableWebMapPopup(); and add in this.map.setInfoWindowOnClick(false);

_onItemClick:function(event){
  var target = event.target||event.srcElement;
  var items = query('.draw-item',this.domNode);
  items.removeClass('selected');
  html.addClass(target,'selected');
  var geotype = target.getAttribute('data-geotype');
  var commontype = target.getAttribute('data-commontype');
  var tool = Draw[geotype];
  //this.disableWebMapPopup();
  this.map.setInfoWindowOnClick(false);    // added this
  this.drawToolBar.activate(tool);
  this.onIconSelected(target,geotype,commontype);
},
0 Kudos
MarieCline_Delgado
New Contributor III

I have a question about the work flow for implementing this work around. 

I have configured a web map application using Web App Builder 1.0 (Developer Edition).  I am wondering if I understand the next work flow steps correctly. 

Should I:

  1. Download the zipped web app package from the Web App Builder Developer edition.
  2. Extract and edit the MapManager.js file (and others) as mentioned above.
  3. Recompress the web app package.
  4. In the Web App Builder Developer edition, Export as Template to ArcGIS Online
  5. This is where I become uncertain of the next steps....
  6. ?? Attach the edited & zipped code to the Exported web app Template on ArcGIS online ??

Thanks in advance for any help!

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Marie,

  This work around is for WAB Developer version hosted locally. I don't believe that you can get this workaround back to AGOL.

0 Kudos
MarieCline_Delgado
New Contributor III

So it would only fix the popup problem on the specific computer hosting the web app builder developer edition?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Marie,

   If you make the fix in WAB Dev version then all the apps that you build from that WAB Dev machine are going to contain the fix and those apps can be deployed to your own local web server.

0 Kudos
GeorgeKatsambas
Occasional Contributor III

I have the same issue and working with ESRI they could not replicate the problem with 10.3, however, my services worked in AGOL and WAB with popups on their side. I am still on 10.1 but  I found adding my service from a shapefile and not a fgb or gdb allows the popups in both applications.

0 Kudos