Select to view content in your preferred language

Does MapView.takeScreenshot include the scalebar? (using the Scalebar web component)

125
1
a week ago
JonathanTiu
Occasional Contributor

Hi,

I am using the Scale bar web component (not the Scalebar widget anymore).

We have a feature where we export our map so we use the  mapview.takescreenshot() API.

we do some CSS styling customization to the scalebar (via the scalebar.shadowroot.adoptedStyleSheets)

but i notice the image generated by the API sort of shows an attempt to render the scale bar but without our CSS customization. it's very strange. it's supposed to be the lower right hand corner and the bar itself is completely missing. Please see attached screenshots.

JonathanTiu_0-1766169112414.png

 

 

0 Kudos
1 Reply
ReneRubalcava
Esri Frequent Contributor

Do you have a sample on how you are taking the screenshot? I'm guessing you are writing your own screenshot code or using a third-party lib?

The takeScreenshot method doesn't include UI elements.

0 Kudos