sigrennesmetropole / geor_urbanisme_mapstore

GNU General Public License v3.0
2 stars 5 forks source link

Printing with OSM background is bad #26

Closed catmorales closed 3 years ago

catmorales commented 3 years ago

cf https://github.com/sigrennesmetropole/geor_urbanisme_mapstore/issues/20#issuecomment-833379736

catmorales commented 3 years ago

Is the TMS OpenStreetMap supported ?

offtherailz commented 3 years ago

Hi, accordingly to this discussion, OSM layer was causing issues for different projections, so it is removed if you are using different projections. (the original application didn't support it too, in different projections). I tested in local and it works in 3857, so I suppose you had the missing OSM layer in different projections (looking at this line of code).

catmorales commented 3 years ago

I tested newly and Itdoesn't work in https://portail-test.sig.rennesmetropole.fr/mapstore/#/context/master-cadastre

It is strange because i added OSM from the base layers provided by mapstore2 and this application context ha been created from the new.json configured as :

{
   "map":{
      "center":{
         "x":-186936.00,
         "y":6125395.00,
         "crs":"EPSG:3857"
      },
      "maxExtent":[
         -608948.00,
         5716000.00,
         80820.00,
         6482445.00
      ],
      "projection":"EPSG:3857",
      "units":"m",
      "zoom":10,
      "mapOptions":{
          "view": {
            "resolutions": [
                156543.033928041,
                78271.5169640205,
                39135.75848201025,
                19567.879241005125,
                9783.939620502562,
                4891.969810251281,
                2445.9849051256406,
                1222.9924525628203,
                611.4962262814101,
                305.7481131407051,
                152.87405657035254,
                76.43702828517627,
                38.218514142588134,
                19.109257071294067,
                9.554628535647034,
                4.777314267823517,
                2.3886571339117584,
                1.1943285669558792,
                0.5971642834779396,
                0.2985821417389698,
                0.1492910708694849,
                0.0746455354347424,
                0.0373227677173712
            ]
          }
      },

Perhaps, the definition of resolutions is a problem ?

offtherailz commented 3 years ago

mmm... I don't think, or, at least, it's not only this. I tried to copy the request on our test server and send it to https://portail-test.sig.rennesmetropole.fr/ and I had exactly your result. That pink output lookjs like something get wrong on server side. Maybe the urbanisme print is not able to resolve a.tile.openstreetmap.org ? I'm trying to guess because we didn't worked on server side of this application. Maybe looking at the logs may help to find out the issue (some errors may be logged)

offtherailz commented 3 years ago

Can you look at them? Please let us know if you find something.

catmorales commented 3 years ago

@offtherailz OK i will see this afternoon.

tdipisa commented 3 years ago

Hi @catmorales do you have some news for us about this?

catmorales commented 3 years ago

Good point @offtherailz I've just looked at the logs in the urbanism backend and it's a rights issue for us. So

2021-05-17 13:43:43,980 [ForkJoinPool-1-worker-78] ERROR / - nouser - norole -o.m.print.map.tiled.TileLoaderTask - Error making tile request: http://a.tile.openstreetmap.org/18/129955/90975.png
        Status: 403
        outMessage: Forbidden
2021-05-17 13:43:44,080 [ForkJoinPool-1-worker-78] ERROR / - nouser - norole -o.m.print.map.tiled.TileLoaderTask - Error making tile request: http://a.tile.openstreetmap.org/18/129956/90975.png
        Status: 403
        outMessage: Forbidden
2021-05-17 13:43:44,138 [ForkJoinPool-1-worker-78] ERROR / - nouser - norole -o.m.print.map.tiled.TileLoaderTask - Error making tile request: http://a.tile.openstreetmap.org/18/129955/90974.png
        Status: 403
        outMessage: Forbidden
2021-05-17 13:43:44,196 [ForkJoinPool-1-worker-78] ERROR / - nouser - norole -o.m.print.map.tiled.TileLoaderTask - Error making tile request: http://a.tile.openstreetmap.org/18/129956/90974.png
        Status: 403
        outMessage: Forbidden

So I tested on your qualification platform https://georchestra.geo-solutions.it/mapstore/#/context/urbanisme-proj, with open street map base layer : image

and the OSM background doesn't show in the printout either image

catmorales commented 3 years ago

Ok i saw this application context is in EPSG 2154 ... If i change it for 3857, all is going right . So it's OK for me . You can close this issue.