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 Features) 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:

  1. Set up a search layer from QGIS Server in Hajk admin and activate it in a map
  2. Search for a value that should give a hit
  3. See that no value populates the search bar
  4. 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

Most upvoted comments

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.