Select to view content in your preferred language

View.takeScreenShot does not include scalebar

628
1
12-03-2023 08:46 PM
YangJin
New Contributor II

Hi everyone, 

in my case, I added the scalebar to the mapview.ui. However, when I use MapView.takeScreenshot to export the current view, it doesn't include the scalebar.  

Does anyone know how to add scalebar to the screenshot? 

current_mapview.pngexported_screenshot.png

 

0 Kudos
1 Reply
ReneRubalcava
Frequent Contributor II

The takeScreenshot method only includes map elements, not widgets or other DOM elements.

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot

Some people have reported using html2canvas to capture DOM elements, but I haven't tried it with the Maps SDK.

0 Kudos