Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping: Print maps from viewer #669

Open
aislinnpearson opened this issue Jun 5, 2024 · 4 comments
Open

Mapping: Print maps from viewer #669

aislinnpearson opened this issue Jun 5, 2024 · 4 comments
Assignees
Labels
Effort: medium Less than 1 day FarmOS Core Issues relating to FarmOS Core user experience/ HCD Issues related to improving the user experience/ HCD
Milestone

Comments

@aislinnpearson
Copy link
Collaborator

I was talking with one of the farm staff today who wanted to print a map directly from the map viewer (we had to screenshot it and then print it).

It would be great if we could print directly to PDF from the map viewer, if that is possible.

image

@aislinnpearson aislinnpearson added User feedback Feature requests, documentation requests, enhancements, etc requested by Rothamsted Users Map visualisation Feature requests and issues relating to map visualisations user experience/ HCD Issues related to improving the user experience/ HCD labels Jun 5, 2024
@github-project-automation github-project-automation bot moved this to Issues for Triage in FarmOS Feature Requests Jun 5, 2024
@aislinnpearson aislinnpearson moved this from Issues for Triage to Queued in FarmOS Feature Requests Jul 2, 2024
@aislinnpearson aislinnpearson added this to the 2.23.0 milestone Jul 2, 2024
@aislinnpearson aislinnpearson added the Effort: medium Less than 1 day label Jul 2, 2024
@aislinnpearson aislinnpearson modified the milestone: 2.23.0 Jul 2, 2024
@paul121
Copy link
Collaborator

paul121 commented Jul 9, 2024

@paul121
Copy link
Collaborator

paul121 commented Jul 10, 2024

Hey @aislinnpearson we looked into this a bit more today during the monthly call and learned some nice tid-bits... its looking like this won't be too hard! cc @mstenta

Basically the browser itself has some nice features which help us to generate and download images of the map in multiple formats png, jpeg, webp. But then there are few options on how we get to a PDF format... the complexity with generating a PDF is that we need to choose additional PDF settings like paper/page size, orientation, etc. I'll try to lay out the options (all will work with the dashboard or full-screen map):

The simplest option is to just download a simple image file. We can make it easy to generate this image and not need a screenshot or print screen. You should be able to open it in the image viewer on your computer and "Print to PDF" (or even print directly) with configured paper/page settings - likely with better support/features than we could provide generating the PDF ourselves!

Alternatively, I've found a kind of middle-ground solution for this with the printjs library. This library does some tricks and allows us to open the browser's "Print" dialog for any image on the current page, including the generated image from the map. From this print dialog you can "Print to PDF" (if your computer supports it). This will limit some of the PDF settings but still lets you change things before printing. It seems like this should work well!

  1. Image file download (easiest)
    map-normal

  2. Helper to print image file, with option to print as PDF (medium)
    printjs-example

  3. Generate a PDF in browser (like the example above, most complex)
    Screenshot from 2024-07-10 16-15-40

@aislinnpearson
Copy link
Collaborator Author

Hi @paul121,

I think the important thing here is to be able to print the map - the file format isn't as important to us.

All three of those options would work and be an improvement on the current process, but when I spoke to Helen and Tim they said their preference would be for option 2 because (1) it's intuitive (that's pretty much how you print from Google maps or a web page at the moment) and (2) it's easy enough to change the layout settings on the computer. Again, probably actually more intuitive to do it that way, given it's what people are used to.

If anything, option 3 seems to me to be a bit over-engineered, but it is great to know it exists should we find more user requests for that kind of thing in the future,

The one other thing they suggested is that it would be nice to visualize the asset names, but I feel like we have discussed this before and it needs to be a completely separate issue?

@paul121
Copy link
Collaborator

paul121 commented Jul 12, 2024

I've got a PR that adds approach #2 - working quite well I think! :D farmOS/farmOS-map/pull/202

Screenshot from 2024-07-12 13-35-07

@aislinnpearson aislinnpearson modified the milestones: 2.23.0, 2.24.0 Aug 20, 2024
@aislinnpearson aislinnpearson added FarmOS Core Issues relating to FarmOS Core and removed User feedback Feature requests, documentation requests, enhancements, etc requested by Rothamsted Users Map visualisation Feature requests and issues relating to map visualisations labels Aug 22, 2024
@aislinnpearson aislinnpearson modified the milestones: 2.24.0, 2.25.0 Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort: medium Less than 1 day FarmOS Core Issues relating to FarmOS Core user experience/ HCD Issues related to improving the user experience/ HCD
Projects
Status: Queued Issues
Development

No branches or pull requests

3 participants