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

[Map-Printing][Map] API for Map Export State #274

Open
mbeckem opened this issue Feb 13, 2024 · 0 comments
Open

[Map-Printing][Map] API for Map Export State #274

mbeckem opened this issue Feb 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mbeckem
Copy link
Contributor

mbeckem commented Feb 13, 2024

Currently, the printing package creates a "screenshot" of the open layers map to print it (using the html2canvas library).

Some UI elements (such as help tooltips, or draw indicators) should not be shown when creating the screenshot.

Currently, two methods are used by the printing package:

  • It provides a css class (printing-hide) that can be attached to arbitrary DOM-Elements. These (and their children) will be ignored during screenshot creation. This approach is good and can be kept.
  • It manually hides active draw interactions to get rid of the indicator. This is not future proof (or well maintainable) and should be replaced by a better system (see below).

The idea is as follows:

  • When an interaction (selection, measurement, ...) is created, it registers itself on the map model (or some sub-interface)
  • The registration includes callback methods to destroy and to temporarily disable the interaction
  • When the printing package (or some other package) wants to print the map, it temporarily disables interactions (which in turn hide the appropriate screen elements) and enables them again later
@antoniave antoniave changed the title [Printing][Map] API for Map Export State [Map-Printing][Map] API for Map Export State Feb 13, 2024
@mbeckem mbeckem added the enhancement New feature or request label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant