umap icon indicating copy to clipboard operation
umap copied to clipboard

Allow the user to print the current viewed map

Open davidbgk opened this issue 2 years ago • 8 comments

Refs #88

davidbgk avatar May 03 '23 01:05 davidbgk

Refs https://github.com/1904labs/dom-to-image-more/issues/50 too.

davidbgk avatar May 03 '23 02:05 davidbgk

Exciting!

Two first comments:

  • I'd put the print button on the left/white bar, which the one for reading the map, while the right/black one is dedicated to editing it
  • I'd hide all the map controls

yohanboniface avatar May 03 '23 08:05 yohanboniface

Ah, bug, while using a map with a lot of objects, not sure if it's related:

image

yohanboniface avatar May 03 '23 08:05 yohanboniface

Same with "a lot" of points:

image

yohanboniface avatar May 03 '23 09:05 yohanboniface

I'd put the print button on the left/white bar, which the one for reading the map, while the right/black one is dedicated to editing it

I tried at first but it was a bit too complicated for a first time, let's adapt that together.

I'd hide all the map controls

There is a mechanism to filter out elements but I didn't try it yet!

Ah, bug, while using a map with a lot of objects, not sure if it's related:

The two errors are different, we might hit some limitations at some point, the dom-to-image tool is actually re-rendering the whole page to be able to convert it.

Also https://github.com/1904labs/dom-to-image-more has probably more bugs fixed but we have to retrieve the fix for iframes (see comments at the top of the copied file).

davidbgk avatar May 03 '23 13:05 davidbgk

There is a mechanism to filter out elements but I didn't try it yet!

Can't we use a print css ?

yohanboniface avatar May 03 '23 14:05 yohanboniface

See also https://leafletjs.com/plugins.html#printexport

davidbgk avatar May 12 '23 16:05 davidbgk

We tried https://html2canvas.hertzen.com/ but:

If you wish to load images that reside outside of your pages origin, you can use a proxy to load the images. — https://html2canvas.hertzen.com/faq

So we do not have background tiles in the preview of the map.

davidbgk avatar Dec 22 '23 16:12 davidbgk