1

Running getGetFeatureInfoUrl() against a TileWms source returns: Either no layer was queryable, or no layers were specified using QUERY_LAYERS

My URL is:

https://geoserver.xxx.com/geoserver/yyy/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&format=image%2Fpng&version=1.1.1&layers=yyy%3Aboundaryline&tiled=true&INFO_FORMAT=application%2Fjson&I=219&J=208&WIDTH=256&HEIGHT=256&CRS=EPSG%3A3857&STYLES=&BBOX=-508764.86026613414%2C6966165.009797823%2C-469629.1017841239%2C7005300.768279833

GeoServer docs say: If application/vnd.ogc.gml is supported the request should be successful. All of the layers in question have GML as an available output format in the layer preview options in GeoServer.

OpenLayers docs say: If QUERY_LAYERS is not provided then the layers specified in the LAYERS parameter will be used. LAYERS params is set on all these layers upon configuration.

10
  • what is the exact url you are trying?
    – Ian Turton
    Aug 20, 2019 at 11:39
  • getFeatureInfoUrl returns geoserver.xxx.com/geoserver/yyy/…
    – Ryan
    Aug 20, 2019 at 12:14
  • 1
    Please edit your question with any additional info, don't put it in comments.
    – TomazicM
    Aug 20, 2019 at 12:40
  • try this --> geoserver.xxx.com/geoserver/yyy/…
    – pavlos
    Aug 20, 2019 at 12:47
  • @pavlos that might be useful for debugging but overriding the url returned by OpenLayers is unlikely to be a practical long term option
    – Mike
    Aug 20, 2019 at 13:00

1 Answer 1

2

You have several problems with that URL.

  1. Two versions specified: You can't use version=1.3 and version=1.1.1 in the same request as the format of the request changed between those versions (X,Y vs I,J).

  2. Missing QUERY_LAYERS: If you look at the GeoServer documentation you will see that QUERY_LAYERS is a required parameter (it can be a subset or all of LAYERS as required).

  3. INFO_FORMAT=application/json: If you want GML output then you will need to set INFO_FORMAT=application/vnd.ogc.gml.

2
  • QUERY_LAYERS doesn't have to be a list of any of any of layers from the GetMap request, just available in the service.
    – nmtoken
    Aug 21, 2019 at 7:11
  • I think geoserver at least will not find a feature that has not been drawn on the map.
    – Ian Turton
    Aug 21, 2019 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.