wegue-oss / wegue

Template and components for webmapping applications with OpenLayers and Vue.js
BSD 2-Clause "Simplified" License
97 stars 42 forks source link

Print module #381

Open enricofer opened 5 months ago

enricofer commented 5 months ago

Hi, I'm submitting a new PR regarding a new print feature that allows to export the current map to pdf. The implementation is adapted from the following Openlayers example: https://openlayers.org/en/latest/examples/print-to-scale.html I hope you find of some interest for the project. In this case please point me out how to develop and integrate continuous testing for this module.

All the best.

chrismayer commented 5 months ago

Thanks for your PR @enricofer!

Your branch has conflicts and it seems there are changes of your previous PRs in the change sets, which makes it hard to review. Could you please rebase your branch to the current master branch of Wegue? I guess your commit c7ce6d5 is the one of relevance. Thanks in advance. Afterwards I'll happily give it a review.

enricofer commented 5 months ago

jspdf is throwing many exceptions in ci-tests but I can't figure how to fix them. sorry.

sronveaux commented 5 months ago

Hi @enricofer and thanks for creating this PR!

I just took half an hour to have a look at the errors you encounter during tests as I was quite surprised that the dev and prod builds were working but not the test one... I unfortunately have not enough time to delve deeper into this for now but what could be done is compare the webpack configurations that are resolved in dev and test mode using, for example, npx vue-cli-service inspect.

In a first time, if you want to go further with your PR, you can just replace the following in the vue.config.js file:

  transpileDependencies: [
    'jspdf'
  ]

With this you'll be able to go on further until the reason why jspdf is correctly transpiled in certain circumstances only is found.

By the way, I can't make your PR run smoothly for now as the wgu-print-win component is not registered properly. There is certainly something missing in the app-starter/WguAppTemplate.vue file...

Thanks again for your interest in this project,

All the best