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

[Print] Ability to print image legend with an appropriate scale #682

Closed
catmorales opened this issue Dec 6, 2023 · 4 comments · Fixed by geosolutions-it/MapStore2#9847, geosolutions-it/MapStore2#9864, #691 or #694
Assignees
Labels
Accepted enhancement New feature or request

Comments

@catmorales
Copy link
Collaborator

catmorales commented Dec 6, 2023

Describe the bug
When printing an image legend with the map, the size of the legend doesn't match with the size configured in the layer properties

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://portail-test.sig.rennesmetropole.fr'
  2. Add the map template "PLUi : plans thématiques"
  3. Make visible the layer "Orientations d'aménagement et de programmation (OAP)" (zoom in and activate it)
  4. Look at the legend and its size in the property of the layer (Largeur 300, hauteur 12)
  5. Print the map with the legend in other sheet
  6. Legend is not visible

Expected behavior
Legend be visible like in the layer properties

Screenshots

legende_light

Desktop (please complete the following information):

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

mapstore-print (11).pdf

@dsuren1
Copy link
Collaborator

dsuren1 commented Dec 14, 2023

@catmorales
The legend is visible but very small.

Currently the mapfish uses the iconSize of the legend options in print tool to set width and height of the legend
Screenshot 2023-12-14 at 12 16 26 PM

Example: with internal layer

iconSize: 20 iconSize: 40
Screenshot 2023-12-14 at 12 15 10 PM Screenshot 2023-12-14 at 12 14 05 PM

@tdipisa
To use the configured scale (i.e width and height) of the legend in layer settings, we can replace the Icon Size with Width and Height fields in the Legend Options of the print tool and use legend sizes configured in the layer settings as these field values respectively

image

Kindly let me know your thoughts. Thanks!

@landryb
Copy link
Member

landryb commented Dec 14, 2023

and to avoid strange results, if the user changes one of width or height, automatically adjust the other so that the aspect ratio is kept ? i doubt anyone would want to resize a legend in a stretched/compressed way....

@dsuren1
Copy link
Collaborator

dsuren1 commented Dec 14, 2023

No, we won't adjust the size automatically.
The user can visualize this change when modifying the width/height in the layer settings, so the user can know if the image is stretched/compressed and can enter a value that appears to fit best

@dsuren1
Copy link
Collaborator

dsuren1 commented Dec 22, 2023

Updated behavior

The print tool's Legend Options will be modified to have two fields called Width and Height replacing the Icon Size field along with a new checkbox field called Override icon size. These new fields will hold the current default size of 24px.
This override option will allow user to override legend's configured scale (width and height) set for the layer in the layer options and when more than one layer is present, this option will be applied for the all the applicable layers.

By default, this option will be unchecked, meaning the legend's width and height configured in layer will be used per layer

Reason: Print tool has a common option for all the layers selected for printing and cannot be made available per layer, hence a common option will be used for all layer when user prefer to override the icon size

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted enhancement New feature or request
5 participants