Skip to content

Feature: Let the user set custom scales when printing#2254

Merged
Grammostola merged 5 commits intoorigo-map:masterfrom
sweco-seguro:user_defined_scale
Dec 8, 2025
Merged

Feature: Let the user set custom scales when printing#2254
Grammostola merged 5 commits intoorigo-map:masterfrom
sweco-seguro:user_defined_scale

Conversation

@sweco-seguro
Copy link
Contributor

Added the feature described in #2239

If the print control option "userDefinedScale" is true a user can now input any scale they wish, with the constraint that it's within the min-max resolution of the map (similar to #1938)

Copy link
Collaborator

@johnnyblasta johnnyblasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, but crashes opening print when "userDefinedScale": true option isn't set in config:

set-scale-control.js:96 Uncaught TypeError: Cannot read properties of undefined (reading 'render')
    at Object.render (set-scale-control.js:96:1)
    at printTemplate (print-settings.template.js:33:1)
    at Object.render (print-settings.js:203:1)
    at Object.render (collapse.js:135:1)
    at Object.render (print-settings.js:268:1)
    at Object.render (print-component.js:728:1)
    at Object.click (index.js:162:1)
    at eval (eventer.js:20:1)
    at Array.forEach (<anonymous>)
    at Object.dispatch (eventer.js:20:1)

Copy link
Collaborator

@johnnyblasta johnnyblasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really like the swedish language for "userDefinedScale": "Mata in egen skala" would prefer for example "userDefinedScale": "Ange din egen skala:"

@Flodkvist Flodkvist added the Awaiting documentation Docs needs to be provided before approval label Dec 2, 2025
@Flodkvist Flodkvist linked an issue Dec 2, 2025 that may be closed by this pull request
@sweco-seguro
Copy link
Contributor Author

Changed the text to JohnnyBlasta's suggestion and added documentation here

@johnnyblasta johnnyblasta removed the Awaiting documentation Docs needs to be provided before approval label Dec 8, 2025
Copy link
Collaborator

@johnnyblasta johnnyblasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnnyblasta johnnyblasta added the PR approved To highlight approved PR:s as it is not shown in list which are approved. label Dec 8, 2025
@Grammostola Grammostola merged commit 5181507 into origo-map:master Dec 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR approved To highlight approved PR:s as it is not shown in list which are approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the user set custom scales when printing

4 participants