Skip to content

MapStore WMTS layers won't show in leaflet maps with HTML based attribution text #8723

Closed

Description

Description

Related support issue is #2292
With the introduction of the ability to define custom attributions for WMTS layers, it is now possible to include text and HTML in the layers attributions for WMTS.
When an embedded map has Leaflet as viewer and contains a WMTS layer with a custom attribution ( embedded maps use the Leaflet viewer only) the getTile request sends the attribution text as parameter ?ATTRIBUTION=text to the server.
Some requests fail with a 403 if the attribution text is composite of HTML and not just text, apparently.

See the example request below:

https://geoserver-osm.gis.cloud.mow.vlaanderen.be/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=osm%3Asimple_dark&STYLE=&TILEMATRIXSET=WebMercator&FORMAT=image%2Fpng8&HEIGHT=256&WIDTH=256&REQUESTENCODING=KVP&ATTRIBUTION=%3Cp%3E%3Cspan%20style%3D%22color%3A%20rgb(51%2C51%2C51)%3Bbackground-color%3A%20rgb(255%2C255%2C255)%3Bfont-size%3A%2014px%3Bfont-family%3A%20Noto%20Sans%22%2C%20sans-serif%3B%22%3EOSM%20Dark%20%7C%20Rendering%20%3C%2Fspan%3E%3Ca%20href%3D%22https%3A%2F%2Fwww.geo-solutions.it%2F%22%20target%3D%22_blank%22%3E%3Cspan%20style%3D%22color%3A%20var(--ms-link-color%2C%231b7377)%3Bbackground-color%3A%20initial%3Bfont-size%3A%2014px%3Bfont-family%3A%20Noto%20Sans%22%2C%20sans-serif%3B%22%3EGeoSolutions%3C%2Fspan%3E%3C%2Fa%3E%3Cspan%20style%3D%22color%3A%20rgb(51%2C51%2C51)%3Bbackground-color%3A%20rgb(255%2C255%2C255)%3Bfont-size%3A%2014px%3Bfont-family%3A%20Noto%20Sans%22%2C%20sans-serif%3B%22%3E%20%7C%20Data%20%C2%A9%20%3C%2Fspan%3E%3Ca%20href%3D%22http%3A%2F%2Fwww.openstreetmap.org%2F%22%20target%3D%22_blank%22%3E%3Cspan%20style%3D%22color%3A%20var(--ms-link-color%2C%231b7377)%3Bbackground-color%3A%20initial%3Bfont-size%3A%2014px%3Bfont-family%3A%20Noto%20Sans%22%2C%20sans-serif%3B%22%3EOpenStreetMap%3C%2Fspan%3E%3C%2Fa%3E%3Cspan%20style%3D%22color%3A%20rgb(51%2C51%2C51)%3Bbackground-color%3A%20rgb(255%2C255%2C255)%3Bfont-size%3A%2014px%3Bfont-family%3A%20Noto%20Sans%22%2C%20sans-serif%3B%22%3E%20contributors%2C%20%3C%2Fspan%3E%3Ca%20href%3D%22http%3A%2F%2Fwww.openstreetmap.org%2Fcopyright%22%20target%3D%22_blank%22%3E%3Cspan%20style%3D%22color%3A%20var(--ms-link-color%2C%231b7377)%3Bbackground-color%3A%20initial%3Bfont-size%3A%2014px%3Bfont-family%3A%20Noto%20Sans%22%2C%20sans-serif%3B%22%3EODbL%3C%2Fspan%3E%3C%2Fa%3E%26nbsp%3B%3C%2Fp%3E%0A&TILESIZE=256&CRS=EPSG%3A3857&MAXZOOM=23&MAXNATIVEZOOM=18&tilematrix=4&tilerow=5&tilecol=8

How to reproduce

An example map with this issue can be found here

  • Open the map and the Chrome dev tool
  • The background layer won't display and the getTile requests for that layer come back with a 403 (Forbidden)

Expected Result

  • Open the map and the Chrome dev tool
  • The background layer will display and the getTile requests for that layer come back with the map tiles.

Current Result
No Background layer will be visualised, if the same layer is imported on the map TOC then the ATTRIBUTION param won't be inserted in the request query string and the request will complete successfully.

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

Once the bug is fixed on desktop maps with Leaflet embedded maps and all other maps using the default Leaflet viewer will have to be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions