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 - Expose all settings as config options #1172

Conversation

MattiasSp
Copy link
Contributor

@MattiasSp MattiasSp commented Feb 25, 2021

The first PR relating to #1119. Also related to #785.

All current print settings are exposed as config options, letting their default values (and in some cases which values should be allowed) be controlled in the config.

Two maps for testing:

I made the choice to move the default values for most variables out of their respective print controls, the print settings and the print component and put them in the index file. That way all the defaults can be seen and changed in one place instead.

Additionally, the rotation of the map is now reset after closing the print control, so that rotating a map for printing doesn't affect the regular map.

@MattiasSp
Copy link
Contributor Author

An example config with all the new options:

{
  "name": "print",
  "options": {
    "headerText": "print-expose-all-settings-as-config-options",
    "headerPlaceholderText": "Här kan du skriva din rubrik",
    "headerAlignment": "right",
    "headerSizes": ["h1", "h2", "h3", "h4", "h5"],
    "headerSize": "h5",
    "headerFormatIsVisible": true,
    "descriptionText": "Karta med alla utskriftsinställningar ändrade.",
    "descriptionPlaceholderText": "Här kan du skriva din beskrivning",
    "descriptionAlignment": "right",
    "descriptionSizes": ["h3", "h4", "h5", "h6"],
    "descriptionSize": "h6",
    "descriptionFormatIsVisible": true,
    "sizes": {
      "a2": [594, 420],
      "a3": [420, 297],
      "a4": [297, 210],
      "a5": [210, 148],
      "custom": [100, 100]
    },
    "sizeInitial": "a5",
    "sizeCustomMinHeight": 20,
    "sizeCustomMaxHeight": 1189,
    "sizeCustomMinWidth": 20,
    "sizeCustomMaxWidth": 841,
    "orientation": "landscape",
    "resolutions": [ {"label": "Låg", "value": 72}, {"label": "Standard", "value": 90.7}, {"label": "Mellan", "value": 150}, {"label": "Hög", "value": 300} ],
    "resolution": 90.7,
    "scales": ["1:250 000", "1:100 000", "1:50 000", "1:25 000", "1:10 000", "1:5000", "1:2500", "1:1 000", "1:500", "1:400"],
    "scaleInitial": "1:100 000",
    "showMargins": false,
    "showCreated": false,
    "createdPrefix": "Skapad ",
    "showScale": false,
    "showNorthArrow": false,
    "rotation": 180,
    "rotationStep": 30
  }
},

@jokd
Copy link
Contributor

jokd commented Feb 26, 2021

Works well except resolution integers cast to strings and therefore the initial state is not active:
image

Besides that, LGTM

@MattiasSp
Copy link
Contributor Author

Thanks @jokd, good catch! :)

@jokd jokd merged commit 5722d94 into origo-map:master Mar 3, 2021
@MattiasSp MattiasSp deleted the print-expose-all-settings-as-config-options branch March 3, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants