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: ToxicReleaseLayer does not stop loading at times #146
Comments
As a first-time contributor I am interested in working on this, can I do it? |
@jensiner sure, go ahead. Thanks! |
I am confused-- when I try to look up the link: https://publiclab.github.io/leaflet-environmental-layers/example/index.html#3/43.00/-9.87/BL2-ToxicR it does not show an errors. It is the URL for the coordinates 43.00 and -9.87 that is causing the error, right? |
I guess the latest commits haven't been deployed, check it locally, the loader doesn't stop. The error is from the API end, at coordinates 43.00,-9.87 a call is made to https://iaspub.epa.gov/enviro/efservice/tri_facility/pref_latitude/BEGINNING/43/PREF_LONGITUDE/BEGINNING/9/rows/0:300/JSON. This is where you get the error message. |
Does it make sense to then program a badly handled get request as an error and tell stop the loading? |
The error happens when a latitude and longitude gets converted to an integer and then it just continues loading because it's a bad URL. I tried in toxicReleaseLayer changing the parseInt that is currently written around the selected longitude and latitude to parseFloat to preserve the decimal instead of converting to an integer when the function links to this https://iaspub.epa.gov/enviro/efservice/tri_facility/pref_latitude/BEGINNING/43/PREF_LONGITUDE/BEGINNING/9/rows/0:300/JSON but it did not work and I wonder if it's possible to somehow check if it is not a valid URL and tell the script to understand that as an exception. Does that make sense? |
I think this will work. |
This issue in LEL is reserved for GCI students. |
Uploaded to GCI dashboard. |
Error not reproducible. It works fine in both, production and development. |
Can you try doing it a lot, like zooming out, dragging, etc? I think it might be load-based; like their server can't handle it sometimes. It'd be nice to know if this is the issue? Thanks! |
In LEL, in each layer we stop the spinner when we have 200 status code in response only. I think we should stop the spinner when we get the response irrespective of response status code. |
Ah I like this idea. We could develop some better per-layer error handling!
…On Mon, Dec 16, 2019, 1:00 PM Sagarpreet Chadha ***@***.***> wrote:
In LEL, in each layer we stop the spinner when we have 200 status code in
response only. I think we should stop the spinner when we get the response
irrespective of response status code.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#146?email_source=notifications&email_token=AAAF6J3X72TOSZIQYIGN2PLQY664RA5CNFSM4G6SK4SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG7RYKI#issuecomment-566172713>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6JZB3KUTCP4TLKLDKGDQY664RANCNFSM4G6SK4SA>
.
|
We are preparing to participate in Google Code-in, and have reserved this issue for participants in GCI - but we'd love to have your help with another one! Please check out https://code.publiclab.org to see more.
Issue
The ToxicReleaseLayer doesn't stop loading at certain coordinates. For example in [43.00,-9.87] url :
leaflet-environmental-layers/example/index.html#3/43.00/-9.87/BL2-ToxicR)
. A possible explanation can be that the get request isn't handled properly.For coordinates [43.00,-9.87], a get request is being made with url : https://iaspub.epa.gov/enviro/efservice/tri_facility/pref_latitude/BEGINNING/43/PREF_LONGITUDE/BEGINNING/9/rows/0:300/JSON which gives the following error message :
The text was updated successfully, but these errors were encountered: