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

[BUG] Maps miscalculates WMS BBOX #600

Open
lonnyj opened this issue Mar 17, 2024 · 3 comments
Open

[BUG] Maps miscalculates WMS BBOX #600

lonnyj opened this issue Mar 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@lonnyj
Copy link

lonnyj commented Mar 17, 2024

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 lonnyj added bug Something isn't working untriaged labels Mar 17, 2024
@ashwin-pc
Copy link
Member

@opensearch-project/admin can you move this to the dashboard maps plugin repo?

@bbarani bbarani transferred this issue from opensearch-project/OpenSearch-Dashboards Mar 19, 2024
@dblock dblock removed the untriaged label Jun 17, 2024
@dblock
Copy link
Member

dblock commented Jun 17, 2024

Catch All Triage - 1 2 3 4 5

@qugu2427
Copy link
Contributor

qugu2427 commented Jul 9, 2024

It seems like the bbox is always calculated for EPSG:3857. When I test with a local geoserver, I have to explicitly specify EPSG:3857 as the crs. Additionally the query url has bbox={bbox-epsg-3857} hardcoded.

EDIT:
Per https://maplibre.org/maplibre-native/docs/book/design/archictural-problems-and-recommendations.html

MapLibre Native supports Web Mercator (EPSG:3857) as its only supported projection

and the bbox is hardcoded to use EPSG:3857. Therefore, I'm not quite sure why "WMS CRS" is even an input in the ui. Perhaps, it is best to lock the custom wms into using EPSG:3857.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants