hajkmap / Hajk

A modern, full-featured OpenLayers based map viewer and editor
MIT License
123 stars 48 forks source link

GetFeatureInfo - text/xml does not work in HAJK #1099

Open lina-sbk-gbg opened 2 years ago

lina-sbk-gbg commented 2 years ago

We have connected a layer with "infoFormat": "text/xml" which should be a working format in HAJK(?) Despite this, we don't get an info click box when we info click on the layer.

https://ext-geodata-lokala.lansstyrelsen.se/arcgis/services/LSTO/lsto_wms_strandskydd/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=0&LAYERS=0&INFO_FORMAT=text%2Fxml&SRS=EPSG%3A3007&TILED=false&STYLES=&FEATURE_COUNT=100&X=50&Y=50&WIDTH=101&HEIGHT=101&BBOX=145698.01606499997%2C6393043.9795699995%2C148526.02515499998%2C6395871.98866

jacobwod commented 2 years ago

This is an ArcGIS WMS implementation. Please compare the format of these results to the format returned by GeoServer and QGIS Server. Make sure to take notice on all differences and report your findings. This would allow the developers to go forward and code whatever's necessary to accommodate for the (probably) slight differences between formats.

lina-sbk-gbg commented 2 years ago

There is quite a difference in the structure between geoserver and Esris xml response. See attached screenshot. Is this enough as a basis? geoserver_vs_esri

lina-sbk-gbg commented 2 years ago

Comparison between geoserver and Esri with text/plain in the image below. textplain_geoserver_vs_esri

jacobwod commented 2 years ago

Thanks! Well the difference is substantial, as you said. The only way to see what's going on is to see how OpenLayers parses the XML response. To do that, we'd need to have a developer look into this.

I can try mimicking your setup, can you please provide layer definition (from layers.json). Feel free to mail if it's confidential.

lina-sbk-gbg commented 2 years ago

I have tried with different values for serverType but the result are the same. Example from layers.json:

{
  "wmtslayers": [],
  "wmslayers": [
    {
      "id": "999690",
      "caption": "LstO_Strandskydd",
      "internalLayerName": "",
      "url": "https://ext-geodata-lokala.lansstyrelsen.se/arcgis/services/LSTO/lsto_wms_strandskydd/MapServer/WMSServer",
      "customGetMapUrl": "",
      "owner": "",
      "date": "1655122119620",
      "content": "",
      "legend": "",
      "legendIcon": "",
      "projection": "EPSG:3007",
      "layers": [
        "0"
      ],
      "layersInfo": [
        {
          "id": "0",
          "caption": "",
          "internalLayerName": null,
          "legend": "",
          "legendIcon": "",
          "infobox": "",
          "style": "",
          "queryable": true,
          "searchDisplayName": null,
          "searchGeometryField": null,
          "searchOutputFormat": null,
          "searchPropertyName": null,
          "searchUrl": null
        }
      ],
      "searchFields": null,
      "displayFields": null,
      "visibleAtStart": false,
      "hideExpandArrow": false,
      "tiled": false,
      "opacity": 1.0,
      "minZoom": -1,
      "maxZoom": -1,
      "minMaxZoomAlertOnToggleOnly": false,
      "singleTile": true,
      "imageFormat": "image/png",
      "serverType": "arcgis",
      "attribution": "",
      "searchUrl": "",
      "customRatio": 1.0,
      "hidpi": false,
      "searchPropertyName": "",
      "searchDisplayName": "",
      "searchOutputFormat": "",
      "searchGeometryField": "",
      "infoVisible": false,
      "infoTitle": "",
      "infoText": "",
      "infoUrl": "",
      "infoUrlText": "",
      "infoOwner": "",
      "infoClickSortType": "string",
      "infoClickSortDesc": true,
      "infoClickSortProperty": "",
      "version": "1.1.1",
      "infoFormat": "text/xml",
      "timeSliderVisible": false,
      "timeSliderStart": "",
      "timeSliderEnd": "",
      "zIndex": null
    }
  ],
  "wfslayers": [],
  "vectorlayers": [],
  "wfstlayers": [],
  "arcgislayers": []
}