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

Export Map to PNG #49

Closed
euangordon opened this issue Nov 9, 2018 · 3 comments
Closed

Export Map to PNG #49

euangordon opened this issue Nov 9, 2018 · 3 comments
Labels

Comments

@euangordon
Copy link

Is there any way to export to png instead of printing? Would be a nice feature to add to a Print / Export menu.

@Igor-Vladyka
Copy link
Owner

Please use other plugin to export it as PNG, this plugin can only call browser print action for now.

@euangordon
Copy link
Author

Please use other plugin to export it as PNG, this plugin can only call browser print action for now.

Thanks @Igor-Vladyka, I have used easyPrint.js to get a PNG of the map in the browser for the moment.

One thing I quite like about Browser Print is that I can print a different base map from the one being viewed by the user. At the moment we normally display a simple basemap, but on print we are printing a high quality Sea Map from Transas.

My ideal solution is going to be for the user to select that he wants to print a "Route Report" from the browser, this will send his route (waypoints on the map) to the API controller. The controller will render the map in a headless brower, plot the waypoints on the map and zoom the map so that all waypoints are in view. Create a png of this image and then sent it to jsReports to be included in a PDF report which will be viewed / downloaded by the user.

@Igor-Vladyka
Copy link
Owner

Current plugin prepares map to print and uses in-browser action for actual printing. You can override actual browser behavior.
Here is more details: download-map-as-image
And full example with added custom action to export image in AUTO mode.

Regards,
Igor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants