Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fixing layerDefs Encoding in Geoview Identify Requests for ArcGIS Servers #2733

Open
1 task done
mimeault opened this issue Feb 4, 2025 · 0 comments
Open
1 task done

Comments

@mimeault
Copy link

mimeault commented Feb 4, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Issue:
In Geoview, identify requests (clicking on a feature from an ESRI REST layer) using layerDefs fail on ArcGIS Server 10.6.1 with a 400 Bad Request error but work on 10.8.1. The issue is due to characters {} not being encoded as %7B and %7D in the request.

Technical Details:
A request using standard JSON formatting fails on 10.6.1:

https://server/identify?layerDefs={"2":"(1=1)"}

However, encoding {} resolves the issue:

https://server/identify?layerDefs=%7B%222%22%3A%22(1%3D1)%22%7D

Impact:
Requests fail on 10.6.1 but succeed on 10.8.1.

Example request (not working on 10.6, only on 10.8):
https://nronk1awvasp039.nrn.nrcan.gc.ca:6443/arcgis/rest/services/GeoAnalytics/earthquakes/MapServer/identify?f=json&tolerance=7&mapExtent=-166.11964430072757,34.999999999999986,-23.880355699272435,79.06062444403463&imageDisplay=1173,800,96&layers=visible:2&layerDefs={%222%22:%20%22(1=1)%22}&geometryType=esriGeometryPoint&geometry=-90.4527081649151,77.40657435390264&returnGeometry=false&sr=4326&returnFieldName=true

Expected Behavior

Update Geoview to always encode {} as %7B and %7D in layerDefs parameter for all "identify" requests, ensuring compatibility with all ArcGIS Server versions.

This fix will make Geoview more robust and prevent errors when querying different ArcGIS environments.

Example request (working on both 10.6 and 10.8):
https://nronk1awvasp039.nrn.nrcan.gc.ca:6443/arcgis/rest/services/GeoAnalytics/earthquakes/MapServer/identify?f=json&tolerance=7&mapExtent=-166.11964430072757,34.999999999999986,-23.880355699272435,79.06062444403463&imageDisplay=1173,800,96&layers=visible:2&layerDefs=%7B%222%22%3A%22(1%3D1)%22%7D&geometryType=esriGeometryPoint&geometry=-90.4527081649151,77.40657435390264&returnGeometry=false&sr=4326&returnFieldName=true

Steps To Reproduce

  1. Go to this URL with the Chrome inspector opened: https://ftp.maps.canada.ca/pub/fgp_pgf/earthquakes/test.html
  2. Click on a Producing Mine point on the map, you'll see feature information (this request is made to a 10.8 ArcGIS server).
  3. Click on a Earthquake point on the map, you'll get "Layer had an error..." (this request is made to a 10.6 ArcGIS server).

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant