leaflet-environmental-layers
leaflet-environmental-layers copied to clipboard
bug: ToxicReleaseLayer does not stop loading at times
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 :
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.
if when I view the program locally it shows up like this (spotty) as opposed to the entire map, is that a problem with how I am looking at the program on my machine (i.e. I don't have something installed) or does it have to do with the error we are dealing with?
if when I view the program locally it shows up like this (spotty) as opposed to the entire map, is that a problem with how I am looking at the program on my machine (i.e. I don't have something installed) or does it have to do with the error we are dealing with?
It must be due to some uninstalled dependencies. Try installing the dependencies again. Thanks :)
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?
Does it make sense to then program a badly handled get request as an error and tell stop the loading?
I think this will work.
This issue in LEL is reserved for GCI students. Thanks !!
Uploaded to GCI dashboard.
Linked to #46 and #43 as well!
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 [email protected] 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 https://github.com/publiclab/leaflet-environmental-layers/issues/146?email_source=notifications&email_token=AAAF6J3X72TOSZIQYIGN2PLQY664RA5CNFSM4G6SK4SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG7RYKI#issuecomment-566172713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6JZB3KUTCP4TLKLDKGDQY664RANCNFSM4G6SK4SA .