-
Notifications
You must be signed in to change notification settings - Fork 77
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
Implement changes to fractracker mobile layer #330
Implement changes to fractracker mobile layer #330
Conversation
@jywarren, I have set the maximum number of results per page which is 250. I was thinking users would zoom in to get detailed information which would trigger a request resulting in loading markers they may have missed before. But some views may still have more than 250 results. How do you think we should implement this? Should I loop through the pages to load all the markers for the map view the user is on? The current layer setup won't allow the user to access the layer for zoom levels that are less than 5. |
var polygon = left + ' ' + top + ',' + right + ' ' + top + ',' + right + ' ' + bottom + ',' + left + ' ' + bottom + ',' + left + ' ' + top; | ||
|
||
var $ = window.jQuery; | ||
var fractrackerMobile_url = 'https://cors-anywhere.herokuapp.com/https://api.fractracker.org/v1/data/report?page=1&results_per_page=250&q={"filters":[{"name":"geometry","op":"intersects","val":"SRID=4326;POLYGON((' + polygon +'))"}],"order_by":[{"field":"report_date","direction":"desc"},{"field":"id","direction":"desc"}]}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
What is this url cors-anywhere.herokuapp.com ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to remove the cors policy issue. Jeff had suggested using it in the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it doesn't fetch the results if this is not prepended. But I am planning to look into it more tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows us to fetch it despite CORS restrictions. We've confirmed this is OK with the FracTracker team. Thanks!
Hey @crisner , In the URL you have used: page=1&results_per_page=250 |
It depends on your map view. But it would fetch the same results for the same map view. To put it simply it depends on the map's current bounds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just assume people will keep zooming in to find more. 250 is a lot! It sounds good for now! Thanks!!!
I think this looks good to go! Shall we merge it? |
I need to go over the popup information to make sure I haven't missed anything. It will be ready today (Jan 8). Thanks! :) |
Also, noting it here to remind myself to update the leafletEnvironmentalLayers.js file with the change. |
Changes done:
|
I've also added a simple test to check if the layer gets added to the map. I tried to check for markers but because of the delay in response, the data doesn't become available when the test runs. There should be a better way to check this. I'll work on this later this week or when we are adding missing tests. For now, this PR is ready. Thanks! |
This is awesome! Thanks so much. Shall we bump the version number in package.json and also get the latest gh-pages branch pushed up so the main demo is live? |
Sure. But if I'm not wrong, we had already bumped it once from |
well, in theory only the commits up until the version change in package.json should be included, i think... i guess it's kind of an ambiguity though. I think I can just publish this as |
Yes, sounds good. :) |
publishing!! |
Sorry, do we need to do any |
Yes, I guess. We have git ignored the build file. So I think we have to run |
Sounds good. |
ok, no prob - 2.1.7 coming up. I can release it fast enough that it'll supercede 2.1.6 |
done! |
now doing gh-pages |
It's live! Let's test it out, then let's watch at |
In the demo, how should I test this layer out? AHa! https://publiclab.github.io/leaflet-environmental-layers/example/#lat=41.531&lon=-96.542&zoom=6&layers=Standard,fracTrackerMobile,Power |
This is so great. I'm finding some things I'd like to make follow-ups for; is there a place to put these for now?
This looks great! |
I am getting a |
Some really nice side-by-side of reports and SkyTruth alerts for what's probably the same site here! |
Hmm. Would spinner be an npm req? I included all new npm modules, i think! |
Yes. Looks like it is not included in the node modules.
|
I'll hold on bumping dependabot until we're sure here, so give me a heads up! Thanks for everything, this is so exciting :-) Oh, one more idea! (sorry to dump them here, let's find a place to put them, and we don't have to act on all of these, they're just inspirations while I'm using it) - OK i'll try to include it in gh-pages and republish that. |
Looks like blurred location and blurredlocationDisplay are also missing. |
Hm. That spin file is not present here: https://github.com/publiclab/leaflet-environmental-layers/tree/gh-pages/node_modules/leaflet-spin/example/spin is it supposed to be part of the npm package as pulled in? Is it being gitignored? |
I have a few ideas myself. 😅 I was planning to note them all in a planning issue to discuss it first thing tomorrow morning. Maybe you could open a planning issue and put them there? and then I could add on to it?
Awesome idea. |
Let me check |
OK awesome -- would you mind opening this list issue? That'd be super - and isn't our meeting Friday morning, not tomorrow? |
Yes. Friday morning, your time. |
Yes. Shall do it. Btw, the dist file exists in the node modules in the local repo and node modules are git ignored in other branches anyway. |
Sorry in the local machine. The file exists in my local copy. |
And the file exists in the gh-pages branch of my copy https://github.com/crisner/leaflet-environmental-layers/tree/gh-pages/node_modules/leaflet-spin/example/spin/dist The branch is not updated with the latest commits though. May be running |
I have opened an issue, #334 as a place to add and discuss new ideas. Shall edit the post with a few of my ideas and description tomorrow. |
You're right, I had missed some modules! Pushing them now. |
And regarding layers, it now appears to load all layers! Maybe it was the missing modules that stopped it. |
I guess this resolves this comment? I'd like to note that unearthing layer is not included. Shall we include that too in the demo? |
Oh, that would be great. And yes! Thanks!
…On Thu, Jan 9, 2020, 1:05 AM Renisha Christie. A ***@***.***> wrote:
I guess this resolves this comment
<#320 (comment)>?
I'd like to note that unearthing layer is not included. Shall we include
that too in the demo?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#330?email_source=notifications&email_token=AAAF6JZIBSBZTI3VVD7K76LQ425CNA5CNFSM4KD3UZ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIPDFXQ#issuecomment-572404446>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J2SSIJZLMNECU6VOPDQ425CNANCNFSM4KD3UZ3A>
.
|
Fixes #87 (<=== Add issue number here)
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!