Skip to content

Fix #10734 Fix print tms layers with 4326#10738

Open
MV88 wants to merge 6 commits intogeosolutions-it:masterfrom
MV88:10734_print_tms
Open

Fix #10734 Fix print tms layers with 4326#10738
MV88 wants to merge 6 commits intogeosolutions-it:masterfrom
MV88:10734_print_tms

Conversation

@MV88
Copy link
Contributor

@MV88 MV88 commented Jan 7, 2025

Description

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

Fix #10734

What is the new behavior?

it prints also tms layers in 4326

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@MV88 MV88 added the bug label Jan 7, 2025
@MV88 MV88 added this to the 2025.01.00 milestone Jan 7, 2025
@MV88 MV88 self-assigned this Jan 7, 2025
Copy link
Member

@tdipisa tdipisa left a comment

Choose a reason for hiding this comment

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

@MV88 please fix ESlint failing checks

@tdipisa tdipisa requested a review from dsuren1 January 7, 2025 17:02
Copy link
Contributor

@dsuren1 dsuren1 left a comment

Choose a reason for hiding this comment

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

@MV88 as discussed earlier, I'm highlighting the issues that I observed with TMS & print tool

  • With the TMS layer, the layers are not always included in the output. While the spec appears fine, the resulting output sometimes misses the layer. This issue occurs with both 3857 and 4326 projections. Perhaps it would provide some insight into why TMS layers were skipped when the projection was set to something other than the default 3857
  • In certain cases, the layer is not previewed or displayed correctly in the print tool. This issue occurs when changing the CRS or opening the print tool with EPSG:4326, among other scenarios
  • Using the OSM provider for TMS, the layer prints correctly when the CRS is 3857 but fails to print when it is set to 4326

#5292

Testing
I have used this map to test

Catalog services used
https://gs-stable.geo-solutions.it/geoserver/gwc/service/tms/1.0.0 (Layer: States of US)
https://public.sig.rennesmetropole.fr/geowebcache/service/tms/1.0.0 (Layer: Cadastre Rennes Métropole)

@MV88
Copy link
Contributor Author

MV88 commented Jan 10, 2025

@MV88 as discussed earlier, I'm highlighting the issues that I observed with TMS & print tool

  • With the TMS layer, the layers are not always included in the output. While the spec appears fine, the resulting output sometimes misses the layer. This issue occurs with both 3857 and 4326 projections. Perhaps it would provide some insight into why TMS layers were skipped when the projection was set to something other than the default 3857
  • In certain cases, the layer is not previewed or displayed correctly in the print tool. This issue occurs when changing the CRS or opening the print tool with EPSG:4326, among other scenarios
  • Using the OSM provider for TMS, the layer prints correctly when the CRS is 3857 but fails to print when it is set to 4326

#5292

Testing I have used this map to test

Catalog services used https://gs-stable.geo-solutions.it/geoserver/gwc/service/tms/1.0.0 (Layer: States of US) https://public.sig.rennesmetropole.fr/geowebcache/service/tms/1.0.0 (Layer: Cadastre Rennes Métropole)

I imagined that one issue was related to the fact that resolutions and mapextent are not aligned to 4326, but changing them did not make any difference. So the issue of printing tms is not resolvable FE side only. We need to investigate deeply on mapfish side if this is possible also considering what reported here #5292

I also did another test and it turns out that maps in 4326 does not render tms layers
https://dev-mapstore.geosolutionsgroup.com/mapstore/#/context/0108-save-test/52142

this may be indicative of the issue that happens in mapfish, a debug session on the backend is needed imho

@tdipisa tdipisa added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Mar 10, 2025
@tdipisa tdipisa modified the milestones: 2025.01.00, 2025.01.01 Apr 4, 2025
@offtherailz
Copy link
Member

Doing some tests with TMS i noticed the following issues:

  • Print do not work on TMS at all (This looks to be due to the TMS layer name extraction. Something like this in PrintUtils.js should solve the problem
    tms: {
            map: (layer) => {
                // layer.tileMapService is like tileMapUrl, but with the layer name in the tail.
                // e.g. "https://server.org/gwc/service/tms/1.0.0" - "https://server.org/gwc/service/tms/1.0.0/workspace%3Alayer@EPSG%3A3857@png"
                const layerName = decodeURIComponent(layer.tileMapUrl.split(layer.tileMapService + "/")[1]);
                return {
                    type: 'tms',
    
  • Save / restore of TMS do not work (probably we are not saving the tms additional data.
Video.del.2025-04-08.14-30-25.mp4
  • TMS Layers looks to work only in 3857 to me
Video.del.2025-04-08.14-37-45.mp4

So some bugs for sure are present in MapStore. I didn't tested printing in 4326, but I'm assuming it works (as other layers work).

Do you have a different experience from me.

By the way, this fix is applied on the old UI. Does it makes sense? Maybe is better to merge with master.

@tdipisa tdipisa requested review from tdipisa and removed request for tdipisa April 11, 2025 09:00
@MV88
Copy link
Contributor Author

MV88 commented Apr 11, 2025

Doing some tests with TMS i noticed the following issues:

  • Print do not work on TMS at all (This looks to be due to the TMS layer name extraction. Something like this in PrintUtils.js should solve the problem
    tms: {
            map: (layer) => {
                // layer.tileMapService is like tileMapUrl, but with the layer name in the tail.
                // e.g. "https://server.org/gwc/service/tms/1.0.0" - "https://server.org/gwc/service/tms/1.0.0/workspace%3Alayer@EPSG%3A3857@png"
                const layerName = decodeURIComponent(layer.tileMapUrl.split(layer.tileMapService + "/")[1]);
                return {
                    type: 'tms',
    

I will include this in current PR

  • Save / restore of TMS do not work (probably we are not saving the tms additional data.

Video.del.2025-04-08.14-30-25.mp4

  • TMS Layers looks to work only in 3857 to me

i've opened this for it #11012

@MV88
Copy link
Contributor Author

MV88 commented Apr 11, 2025

@tdipisa @offtherailz pr updated

Review again please

@MV88 MV88 requested review from offtherailz and tdipisa April 11, 2025 14:18
@tdipisa tdipisa modified the milestones: 2025.01.01, 2025.01.02 Jul 10, 2025
@offtherailz
Copy link
Member

@tdipisa JFI this PR is still failing, so for my point of view, still need to wait for the review

@tdipisa tdipisa modified the milestones: 2025.01.02, 2025.02.00 Sep 5, 2025
@tdipisa tdipisa requested review from tdipisa and removed request for tdipisa October 9, 2025 07:43
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 10, 2025
@tdipisa tdipisa modified the milestones: 2025.02.00, 2025.02.01 Oct 10, 2025
@offtherailz offtherailz self-requested a review October 16, 2025 15:22
@offtherailz
Copy link
Member

The unit test fails @MV88

@tdipisa
Copy link
Member

tdipisa commented Oct 16, 2025

The unit test fails @MV88

@MV88 please while doing the fix for the test failure, also retest on the light of https://github.com/geosolutions-it/support/issues/3908#issuecomment-3306335329

@offtherailz offtherailz requested review from dsuren1 and removed request for dsuren1 October 16, 2025 15:51
@tdipisa tdipisa modified the milestones: 2025.02.01, 2026.01.00 Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TMS background layer not being displayed in print preview for EPSG:4326

4 participants