Exporting Info Pop-up Data

642
4
01-14-2019 01:39 PM
RobertJensen1
New Contributor II

I am in need of exporting the data in the info box of several featured layers. eg SAWPA Dev 

Currently I am using WebMap through js api 4.1. 

I tried using the export widget but only the map gets exported. The documentation for this widget is very limited. Can it be customized to export info box data of all the layers? If not, any ideas on the best implementation for this? 

Thanks for any help

0 Kudos
4 Replies
Noah-Sager
Esri Regular Contributor

Robert Jensen I'm not totally sure what you are trying to do. Are you wanting to print the pop-ups with the map? If so, you can do this with the MapView.takeScreenshot() method:

MapView | API Reference | ArcGIS API for JavaScript 4.10 

Or if you just want more control over the printing (exporting) process in general, I would refer to the PrintTask documentation:

PrintTask | API Reference | ArcGIS API for JavaScript 4.10 

Here is also a handy blog post about working with screenshots:

https://community.esri.com/people/RLibed-esristaff/blog/2018/12/20/screenshots-with-the-arcgis-api-f... 

-Noah

0 Kudos
RobertJensen1
New Contributor II

Are you wanting to print the pop-ups with the map? If so, you can do this with the MapView.takeScreenshot() method:

YES. Though it says: "...but excludes overlayed DOM elements (UI, popups, measurement labels, etc.)."

 

Is it not possible at all to print the info in the pop-up window?

Does not seem like the export widget is much use other than exporting the map and also a list of the layers. Is this true? 

0 Kudos
Noah-Sager
Esri Regular Contributor

In the blog post I referenced, Ryan included a sample that allows you to print popups as well, here is the direct link to that sample:

ArcGISJSAPI_html2canvas-legend-popup 

The Print widget is useful for printing, maps, layers, legends, and graphics/measurements (with labels as far as I know).

0 Kudos
RobertJensen1
New Contributor II

Essentially, I am trying to print out all the pop ups. So when a user selects a point on the map, they have the option to export(print) all the feature layer data from the layers they have selected. 

The screenshot will only get a single pop-up. I guess a way to resolve this would be to remove pagination from the pop ups but not sure this is possible. 

Maybe there is a way to console log the pop-up data from all layers? I can then put info into a legend instead of paginated pop-ups. At that point a screenshot will work, or simply a print button to print locally. 

0 Kudos