Hajk: Search plugin not working for QGIS Server
Edit
This became quite big as we realised that what we really want to do is rewrite how search results are handled inside Hajk. Currently the entire search result flow is built around – and expects – GeoJSON objects. A better, and more format independent solution, would be to accept any standard geo format as response and convert that to a common ground (i.e. OpenLayer’s Feature
s) before going further down the flow.
So what we’ll be doing now is exactly that. Search will be rewritten to work around OpenLayer’s features, and it will accept both GML and JSON responses.
As it is a quite substantial rewrite, I’m creating a separate feature branch from here: https://github.com/hajkmap/Hajk/tree/feature/882-search-uses-ol-features.
Original issue
Describe the bug When using the search plugin with a QGIS Server layer there is no result shown in the search bar. The response from the server is in gml-format but it seems Hajk expects json-format. We have tried to add outputFormat=application/vnd.geo+json to the request URL but the response is still in gml-format.
To Reproduce Steps to reproduce the behavior:
- Set up a search layer from QGIS Server in Hajk admin and activate it in a map
- Search for a value that should give a hit
- See that no value populates the search bar
- If you look at the response you can see a hit in gml-format
Expected behavior The search bar should be populated with the expected values.
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Any
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (14 by maintainers)
Commits related to this issue
- Changed requested output format for GetFeature to a value that both QGIS Server and GeoServer accept. Part of #882. — committed to hajkmap/Hajk by jacobwod 3 years ago
- Got spatial search to work with QGIS Server layers: - This works both for WFS search sources added in Admin UI, as well as WMS layers selected as search sources in Admin UI->Map settings->Search tool ... — committed to hajkmap/Hajk by jacobwod 3 years ago
- Fix for #882: - OpenLayer's Feature's properties do contain objects that React can't render. We do a little check now to avoid crash. — committed to hajkmap/Hajk by jacobwod 3 years ago
Fantastic work getting the search working for QGIS-server-data! @jacobwod
Hi! If this can wait a week or so, I would be happy to provide access to a public QGIS 3.20 server that I set up yesterday. I need to populate the server with some open data and services first, which will happen early next week at the earliest. I am out of office over the weekend.