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: ToxicReleaseLayer does not stop loading at times #146

Open
rkpattnaik780 opened this issue Mar 14, 2019 · 16 comments
Open

bug: ToxicReleaseLayer does not stop loading at times #146

rkpattnaik780 opened this issue Mar 14, 2019 · 16 comments
Labels
bug Something isn't working gci-candidate hard

Comments

@rkpattnaik780
Copy link
Collaborator

rkpattnaik780 commented Mar 14, 2019

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 :

image

@jensiner
Copy link

As a first-time contributor I am interested in working on this, can I do it?

@rkpattnaik780
Copy link
Collaborator Author

@jensiner sure, go ahead. Thanks!

@jensiner
Copy link

jensiner commented Apr 1, 2019

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?

@rkpattnaik780
Copy link
Collaborator Author

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.

@jensiner
Copy link

jensiner commented Apr 1, 2019

image
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?

@rkpattnaik780
Copy link
Collaborator Author

image
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 :)

@jensiner
Copy link

jensiner commented Apr 6, 2019

Does it make sense to then program a badly handled get request as an error and tell stop the loading?

@jensiner
Copy link

jensiner commented Apr 6, 2019

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?

@rkpattnaik780
Copy link
Collaborator Author

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.

@ananyaarun
Copy link
Member

This issue in LEL is reserved for GCI students.
Thanks !!

@ananyaarun ananyaarun added hard bug Something isn't working and removed first-timer-only labels Nov 13, 2019
@SidharthBansal
Copy link
Member

Uploaded to GCI dashboard.

@jywarren
Copy link
Member

jywarren commented Dec 3, 2019

Linked to #46 and #43 as well!

@VladimirMikulic
Copy link

Error not reproducible. It works fine in both, production and development.

@jywarren
Copy link
Member

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!

@sagarpreet-chadha
Copy link
Collaborator

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.

@jywarren
Copy link
Member

jywarren commented Dec 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gci-candidate hard
Projects
None yet
Development

No branches or pull requests

8 participants