WAB 2.1 Add Data Widget Quirks

2947
16
Jump to solution
08-12-2016 11:24 AM
DavidColey
Frequent Contributor

Hi -  In exploring how to best work with the Add Data widget, I've noticed 2 issues:

Labels: for a feaure service, webmap confgured labels do not seem to load when added.  For example I have a zoning layer in a planning data wab that has labels configured.  The labels do not come over as part of the service when I add to another wab.

Popups: for an image service, the configured popup does not display, only the REST folder/servicename is shown in the popup.  For example, I have a high-resolution local DEM with configured and enabled popup, but it will not display either the

{Raster.ServicePixelValue} or {Raster.ServicePixelValue.Raw} values.

I'm guessing these are issues that would have to be resolved in the next release, just wondering if anyone else has encountered them.

Thanks

David

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ShaunWeston1
New Contributor III
Managed to get the popups working for imagery services by adding in the following code to the Add Data widget - AddData\search\LayerLoader.js
Line 497:
    // Set the popup info
          if (itemData.popupInfo) {
              popInfo = itemData.popupInfo;
              jsonPopInfo = djJson.parse(djJson.stringify(popInfo));
              infoTemplate = new PopupTemplate(jsonPopInfo);
              layer.setInfoTemplate(infoTemplate);
              isCustomTemplate = true;
          }

View solution in original post

16 Replies
DavidColey
Frequent Contributor

Hi so just to provide an update for image servcie popups:  I pushed up an image service from a mosaic dataset configured with the 'pixels' capability enabled, then referenced with my AGOL organizaiton, then configured my popup to display the 'pixelItem' -  still no luck.  That is, when the service is added from my org with the AddData widget, the added layer will still not display any pixel values.  Again, hopefully this issue will be resolved in the next release-

Thanks,

David

0 Kudos
ShaunWeston1
New Contributor III

Did you manage to find an answer/solution to this?

0 Kudos
DavidColey
Frequent Contributor

No I have not.  Referenced image service layers added to a WAB 2.3 app vial the Add Data widget do not display values, only the layer title appears in the popup.  In my case I am adding a DEM, but it could just as easily be NDVI values . . . 

0 Kudos
ShaunWeston1
New Contributor III
Managed to get the popups working for imagery services by adding in the following code to the Add Data widget - AddData\search\LayerLoader.js
Line 497:
    // Set the popup info
          if (itemData.popupInfo) {
              popInfo = itemData.popupInfo;
              jsonPopInfo = djJson.parse(djJson.stringify(popInfo));
              infoTemplate = new PopupTemplate(jsonPopInfo);
              layer.setInfoTemplate(infoTemplate);
              isCustomTemplate = true;
          }
DavidColey
Frequent Contributor

Thanks Shaun, that works.  I'm impressed, at this point I would not have known which module to modify.  Is this something that will be added to the next release?

0 Kudos
ShaunWeston1
New Contributor III

Cool. I'm not sure when it will be pushed into the OOTB Web AppBuilder, I did notice there was some code in there around the popups for imagery services, which had the comment "TO DO", so I would think it would be in the next release or two. I'll follow up though.

0 Kudos
DavidColey
Frequent Contributor

Yeah cool, yeah I saw that as well.  Thanks again

0 Kudos
DavidColey
Frequent Contributor

FYI this little snippet is still needed at WAB 2.4

0 Kudos
by Anonymous User
Not applicable

Hi David! On a related note, adding popup for imageservices and dynamic raster mapservices out-of-the-box will enable this for Esri AGOL hosted sites and out of the box WebApp Builder sites and is down the pipeline for Team AGOL. Useful for DEMs to let users get spot elevations for example.

https://community.esri.com/thread/106869

http://jsfiddle.net/kevinmSAGIS/L834u2nt/4/Edit fiddle - JSFiddle