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
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:
Or if you just want more control over the printing (exporting) process in general, I would refer to the PrintTask documentation:
Here is also a handy blog post about working with screenshots:
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?
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:
The Print widget is useful for printing, maps, layers, legends, and graphics/measurements (with labels as far as I know).
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.