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: WMS FeatureInfo does not work on tilted map #102

Closed
JakobMiksch opened this issue Apr 26, 2023 · 1 comment · Fixed by #111
Closed

Bug: WMS FeatureInfo does not work on tilted map #102

JakobMiksch opened this issue Apr 26, 2023 · 1 comment · Fixed by #111

Comments

@JakobMiksch
Copy link

@mapcomponents/react-maplibre version: The deployed version on 2023-04-26

Steps To Reproduce

  1. Open https://catalogue.mapcomponents.org/en/demo/AppWebGis/dashboard
  2. Activate the layer "Metadaten"
  3. Perform a WMS GetFeatureInfo Request when it is tilted.

The current behavior

The Request either fails or returns information of a wrong feature. In the screenshot below, I clicked on the tile "32296_5592" (lowest rectangle) but the response is "32312_5600" and apparently wrong

image

The expected behavior

The request also takes into account the tilted map.

Maybe this thread helps: https://gis.stackexchange.com/questions/307407/how-to-query-features-of-raster-layers-hosted-on-geoserver-that-are-added-to-map

@cioddi
Copy link
Member

cioddi commented May 5, 2023

Thank you for raising the issue and the screenshot.
The current implementation only works with the unpitched map.

https://github.com/mapcomponents/react-map-components-maplibre/blob/main/src/components/MlWmsLoader/MlWmsLoader.tsx#L166

We will have to get tile dimensions as bbox and then determine the pixel position of the click event relative to that bbox to make a valid getfeatureinfo request in this map state.

I am documenting my ideas on solving this here, one of my colleagues will take a look at fixing it.

  1. Use unproject to turn click events x and y into coordinates.
    https://maplibre.org/maplibre-gl-js-docs/api/map/#map#unproject
  2. Use the coordinates from step 1 to as the bbox north-west coordinates and construct the south-east coordinates from that.
  3. Use fixed width and height that matches the aspect ratio of the bbox from step 2. I/Y or X/Y coordinates can be 0,0.

@cioddi cioddi linked a pull request May 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants