dashboards-maps icon indicating copy to clipboard operation
dashboards-maps copied to clipboard

[BUG] Maps miscalculates WMS BBOX

Open lonnyj opened this issue 11 months ago • 3 comments

Describe the bug

After loading a WMS layer in Maps, the BBOX parameter appears to be off by five decimal places and is 100,000 larger than it should be. This effectively makes custom WMS layers unusable in Maps.

To Reproduce Steps to reproduce the behavior:

  1. Go to Maps in Dashboards.
  2. Using the Default map, zoom to Iowa with Des Moines in the center of the map.
  3. Click on Add layer.
  4. Click on Custom map.
  5. Populate the fields (WMS URL: https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi, WMS layers: mrms_p72h, WMS version: 1.1.1, WMS format: image/png, WMS CRS: EPSG:4326).
  6. Open the Developer Tools for your browser and select the Network tab
  7. Click the Update button.
  8. In the Developer Tools, the URLs should look something like this: https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi?service=WMS&version=1.1.1&request=GetMap&format=image/png&transparent=true&layers=mrms_p72h&styles=&srs=EPSG:4326&width=256&height=256&bbox=-10644926.307106785,5009377.085697312,-10331840.239250705,5322463.153553393
  9. Notice that the bbox parameter values are well outside of +/-180 longitude and +/-90 latitude.

Expected behavior The bbox values should fall within the EPSG:4326/WGS 84 bounds of (longitude, latitude) -180, -90 and 180, 90. The result would be that WMS tiles should appear on the map according to what's in view at the time.

OpenSearch Version 2.12.0

Dashboards Version 2.12.0

Plugins

None. The Security plugin is also disabled.

Screenshots

None

Host/Environment (please complete the following information):

  • OS: macOS 14.4 (23E214)
  • Browser and version: Chrome 122.0.6261.129 (arm64)
  • I followed the Docker Compose instructions here.

Additional context

Using the URL provided above, if I divide the BBOX values by 100,000, it produces a usable image.

https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi?service=WMS&version=1.1.1&request=GetMap&format=image/png&transparent=true&layers=mrms_p72h&styles=&srs=EPSG:4326&width=256&height=256&bbox=-106.44926307106785,50.09377085697312,-103.31840239250705,53.22463153553393

image

I also tested with WMS 1.3.0 and it appears to use the same, incorrect calculations.

lonnyj avatar Mar 17 '24 16:03 lonnyj