@@ -198,7 +198,7 @@ async function fitMap() {
198198 loadingBounds .value = false ;
199199}
200200
201- async function takeScreenshot() {
201+ async function takeScreenshot(showSidebars : boolean ) {
202202 copyMenuShown .value = false ;
203203 const screenshotTarget = document .getElementById (" app" );
204204 if (screenshotTarget ) {
@@ -207,7 +207,7 @@ async function takeScreenshot() {
207207 return (
208208 element .id === " controls-bar" ||
209209 element .classList .contains (" control-menu" ) ||
210- (mapOnly . value && element .classList .contains (" v-navigation-drawer" ))
210+ (! showSidebars && element .classList .contains (" v-navigation-drawer" ))
211211 );
212212 },
213213 });
@@ -219,7 +219,7 @@ async function takeScreenshot() {
219219}
220220
221221async function copyScreenshot() {
222- const blob = await takeScreenshot ();
222+ const blob = await takeScreenshot (! mapOnly . value );
223223 if (blob ) {
224224 const clipboardItem = new ClipboardItem ({ " image/png" : blob });
225225 navigator .clipboard .write ([clipboardItem ]);
@@ -228,7 +228,7 @@ async function copyScreenshot() {
228228}
229229
230230async function saveScreenshot() {
231- const blob = await takeScreenshot ();
231+ const blob = await takeScreenshot (! mapOnly . value );
232232 if (blob ) {
233233 const link = document .createElement (" a" );
234234 link .href = URL .createObjectURL (blob );
@@ -251,7 +251,7 @@ function animateCameraFlash() {
251251}
252252
253253function showViewStateDialog() {
254- takeScreenshot ().then ((blob ) => {
254+ takeScreenshot (true ).then ((blob ) => {
255255 newViewStateThumbnail .value = blob ;
256256 });
257257 showViewStateCreation .value = true ;
0 commit comments