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

Update query's "outSr" request parameter to conform with ArcGIS REST API documentation #1167

Closed
agbq opened this issue Oct 4, 2019 · 3 comments

Comments

@agbq
Copy link
Contributor

agbq commented Oct 4, 2019

Browser and version:

Chrome 76

Version of Leaflet (L.version):

Leaflet 1.5.1

Version of esri Leaflet (L.esri.VERSION):

esri Leaflet 2.3.0

Steps to reproduce the error:

Specific to private ArcGIS server

What happens is [X].

After adding a L.esri.FeatureLayer, Leaflet fails to draw the layer. After inspecting the network tab in developer tools, I noticed that the geometry is way off. After a bit of debugging, I realized that the request being sent to the service includes "outSr=4326". Changing it to "outSR=4326" corrects the issue.

According to the ArcGIS REST API documentation for Query (Feature Service/Layer) (https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm), the parameter should be "OutSR".

I was expecting [Y].

I would expect esri Leaflet to request the feature layer using the "OutSR" parameter instead of "OutSr".

I noticed that in esri Leaflet's Query.js task, (https://github.com/Esri/esri-leaflet/blob/1ec2167ed7ea13d67a8536bb62c49a04930a470e/src/Tasks/Query.js), the params object has "OutSr: 4326" hard-coded. Temporarily changing this to "OutSR" corrected the issue I was experiencing.

What surprised me is that it seems most other ArcGIS servers accept "OutSr" or "OutSR". In my case, the server only accepts "OutSR".

@jgravois
Copy link
Contributor

jgravois commented Oct 4, 2019

a pull request with a fix would be welcome.

@agbq
Copy link
Contributor Author

agbq commented Oct 7, 2019

Sure thing.

@jwasilgeo
Copy link
Contributor

Resolved in PR #1168 and approved by @gavinr. Thanks @agbq!

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

No branches or pull requests

3 participants