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

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

Closed
1 task done
ale-cristofori opened this issue Oct 24, 2022 · 1 comment
Closed
1 task done

Comments

@ale-cristofori
Copy link
Contributor

ale-cristofori commented Oct 24, 2022

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

alex-fko added a commit to alex-fko/MapStore2 that referenced this issue Oct 24, 2022
offtherailz pushed a commit that referenced this issue Oct 26, 2022
@ElenaGallo ElenaGallo self-assigned this Oct 26, 2022
@tdipisa tdipisa added this to the 2022.02.01 milestone Oct 26, 2022
alex-fko added a commit to alex-fko/MapStore2 that referenced this issue Oct 26, 2022
…on` parameter; geosolutions-it#8724 WMTS request identify flow fixes (geosolutions-it#8725)

(cherry picked from commit 88c7ad8)
alex-fko added a commit to alex-fko/MapStore2 that referenced this issue Oct 26, 2022
…on` parameter; geosolutions-it#8724 WMTS request identify flow fixes (geosolutions-it#8725)

(cherry picked from commit 88c7ad8)
offtherailz pushed a commit that referenced this issue Nov 2, 2022
offtherailz pushed a commit that referenced this issue Nov 2, 2022
…8724 WMTS request identify flow fixes (#8725) (#8733)

(cherry picked from commit 88c7ad8)
@ale-cristofori
Copy link
Contributor Author

The associated PR and backport for this issue have been merged, this issue can be closed

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

No branches or pull requests

4 participants