Skip to content

Show credits/attribution text in printed page  #10279

@ale-cristofori

Description

@ale-cristofori

Description

At the moment the textual attribution, credit or copyright statement are not visible on the printed map. The default attribution can be shown in OSM, they can come from WMS or other sources and can be customized for the WMTS bg layers with the MS UI. The text in question appears on the screen and on the map print preview but not on the resulting printed map. See below for an example:

recording_1.mp4

Acceptance criteria

  • As a MapStore USER with a role that allows me to edit a BG layer I edit the attribution text of a WTMS layer, I then click on the print button and open the print dialog window, when clicking on print I should be able to see the edited text appearing on the printed page.
  • As a MapStore USER I Open a map and I visualize as BG layer OSM, the usual OSM attribution as well as any other attribution text appearing on the bottom of the map, when I click on print the text appears on the map print preview and it will also appear on the printed Map.

Attribution can be found not only on BG layers but also on overlays, in that case the text is cumulative (one attributions for each text requiring it)

The solutions found needs to be as dynamic as possible, a solution that could fit all the text in a text box to be shown on the map, without cutting it. Another solution, if the text is too long is to provide it separated from the map, on a separate page.

Other useful information

A possible solution consist of:

  • edit PluginsUtils.getMapfishPrintSpecification in order to provide a list for credits, one credit per layer in the application state (state.layers), as a string separated via a separator character like | ...
  • this "credits" info will be passed to the config.yaml (empty by default)
  • credits in mapstore needs to be parsed removing the <a> tags and | inside, | can be simply removed
  credits: {
    title: 'OSM Simple Light | Rendering <a href="https://www.geo-solutions.it/">GeoSolutions</a> | Data © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://www.openstreetmap.org/copyright">ODbL</a>'
  }
  • edit config.yaml to show this new !text like this example, the positions has to be determined
- !columns
          absoluteX: 30  --> TO_EDIT
          absoluteY: 740 --> TO_EDIT
          width: 395 --> TO_EDIT
          widths: [395] --> TO_EDIT
          items:
            - !text
              align: left
              vertAlign: middle
              fontSize: 14 --> TO_EDIT 9 or 8 
              text: '${credits}'
  • add this for every layout just below the map (a few pixels down if possible) and evaluate if others pieces needs to be moved.
  • add migration guidelines on how to update it since many projects have a dedicated config.yaml (which could be identical to the mapstore one)
  • prepare a map for the test and add the exported json in the related issue (that's for functional tests) [map (11).json]
  • make various tests
    • with many layers 10 or 20
    • with a few layers long credits
    • a mix of previous
    • if the various scenarios are having layout / display issues, move all credits to a dedicated page

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions