3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
261 stars 144 forks source link

[Bug]: Request with invalid bounding box when going over international date line with external baselayer #3686

Open u-cav opened 1 year ago

u-cav commented 1 year ago

What is the bug?

Hi,

I'm experiencing an issue where a Lizmap is making requests with a wrong bounding box when an external/public baselayer is active. It seems to happen when the map includes the international date line.

Points are visible: image Permalink: https://lizmap.faunalia.eu/index.php/view/map?repository=faunalia&project=test_exbasemap&layers=B00TTTTF&bbox=-5253859.298698%2C-4702697.639847%2C19499507.937728%2C7634850.219889&crs=EPSG%3A3857&layerStyles=test%3Adefault

Points are not visible when moving east: image Permalink: https://lizmap.faunalia.eu/index.php/view/map?repository=faunalia&project=test_exbasemap&layers=B00TTTTF&bbox=-1076117.081325%2C-5074487.345375%2C23677250.155101%2C7263060.514362&crs=EPSG%3A3857&layerStyles=test%3Adefault

When the basemap is not external/public, but is setup through QGIS Server, everything works: image Permalink: https://lizmap.faunalia.eu/index.php/view/map?repository=faunalia&project=test_exbasemap&layers=00BTTTTF&bbox=-1076117.081325%2C-5074487.345375%2C23677250.155101%2C7263060.514362&crs=EPSG%3A3857&layerStyles=test%3Adefault

I can see that, depending on the basemap selected (qgis or public), the request to QGIS Server for the remaining layers cointains a different bounding box. These are the urls I get just by switching the basemap, without moving the map:

Working, with qgis-based basemap: https://lizmap.faunalia.eu/index.php/lizmap/service?repository=faunalia&project=test_exbasemap&LAYERS=test&STYLES=default&VERSION=1.3.0&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&DPI=96&TRANSPARENT=TRUE&SERVICE=WMS&REQUEST=GetMap&CRS=EPSG%3A3857&BBOX=-1125036.7794207088,-2648070.319827734,23726169.853196476,4836643.488814845&WIDTH=2540&HEIGHT=765

Not working, with public basemap: https://lizmap.faunalia.eu/index.php/lizmap/service?repository=faunalia&project=test_exbasemap&LAYERS=test&STYLES=default&VERSION=1.3.0&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&DPI=96&TRANSPARENT=TRUE&SERVICE=WMS&REQUEST=GetMap&CRS=EPSG%3A3857&BBOX=-41200053.4594207,-2648070.319827734,-16348846.826803522,4836643.488814845&WIDTH=2540&HEIGHT=765

As you can see, the bounding boxes are different, and in the second case they do not match the area displayed on the map. Because of this, the result seems to be empty.

you can check the demo project here: https://lizmap.faunalia.eu/index.php/view/map?repository=faunalia&project=test_exbasemap

I'm also attaching the zip containing the project and sample data

lizmap_test_exbasemap.zip

Steps to reproduce the issue

  1. Go to https://lizmap.faunalia.eu/index.php/view/map?repository=faunalia&project=test_exbasemap&layers=00BTTTTF&bbox=-1076117.081325%2C-5074487.345375%2C23677250.155101%2C7263060.514362&crs=EPSG%3A3857&layerStyles=test%3Adefault, points are visible
  2. Switch the basemap to the first option "OSM Stamen Toner", points are not visible anymore
  3. Check in the browser console the request urls generated in both instances, and compare the bounding boxes

Versions

Versions :

Also tested with:

Check Lizmap plugin

QGIS server version, only if the section above doesn't mention the QGIS Server version

No response

Operating system

Arch Linux

Browsers

Firefox, Chrome

Browsers version

Chromium 113.0.5672.92, Firefox 112.0.2

Relevant log output

No response

u-cav commented 1 year ago

This seems to be fixed in LWC 3.7, following the changes to the external basemap management. Feel free to close it if necessary, as it will not be relevant once LWC 3.6 reaches EOL.