Canadian-Geospatial-Platform / geoview

Canadian Geospatial Platform Viewer / Visualiseur de la Plateforme Géospatiale Canadienne
Other
22 stars 31 forks source link

[BUG] Data table failing to fetch features for some esriDynamic layers #2200

Closed jaredkinger closed 1 month ago

jaredkinger commented 1 month ago

Is there an existing issue for this?

Current Behavior

When attempting to load the data table for some esriDynamic layers they will fail to query the service and not return any features. The message "Layer has an error..." is displayed and the following error can be seen in the console:

esri-dynamic.getAllFeatureInfo()
 Error: Error querying service. No features were returned.
    at t.<anonymous> (esri-dynamic.ts:344:13)
    at f (regeneratorRuntime.js:45:16)
    at Generator.<anonymous> (regeneratorRuntime.js:133:17)
    at Generator.next (regeneratorRuntime.js:74:21)
    at r (asyncToGenerator.js:3:20)
    at s (asyncToGenerator.js:22:9)

Expected Behavior

The data table should load all the features without error.

Steps To Reproduce

  1. Go here: https://wordpress.dev.geo.ca/wp-content/geoview/examples/esri-dynamic-data-table.html
  2. Go to the data table tab and try to load the data table for the "Protected and conserved area" layer.
  3. The layer with eventually produce the message "Layer has an error..." and the data table won't load

Anything else?

Example config: esri-dynamic-data-table.json

For the query here: https://maps-cartes.ec.gc.ca/arcgis/rest/services/CWS_SCF/CPCAD/MapServer/0/query?where=1=1&outFields=*&f=json&returnGeometry=true The map server is returning the following json: {"error":{"code":500,"message":"Error performing query operation","details":[]}}

When I compared the query being performed by geoview to the query being performed in RAMP I noticed that the returnGeometry parameter was set to false for RAMP. Trying the query with this parameter set to false does return results without an error: https://maps-cartes.ec.gc.ca/arcgis/rest/services/CWS_SCF/CPCAD/MapServer/0/query?where=1=1&outFields=*&f=json&returnGeometry=false

I did a brief test using a local build of geoview by updating the query to use false in esri-dynamic.ts and this did allow the data table to load properly. This particular layer has 15140 entries in it's data table so it still does take some time. It was however unclear to me whether it is necessary to load the geometry here or not.

I'm seeing this error for several other layers and can update the example with additional layers if that would be helpful.