-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add/remove markers as zoom level change . #18
Comments
Hi @jywarren ! Currently we have hard-coded markers on map , so we can use /people API for now ? Thanks ! |
So i was thinking of doing this by : 1.) Making a function which will get an array of locations as an input and depending upon the current zoom level , will only add markers that have the minimum precision .
2.) Now each time when the map is panned or moved , the API will again fetch the data . So remove ALL markers on map first , pass the new data to the above function again (point 1) . So each time new data is fetched , we call above function . Makes sense ? @jywarren ...what do you think ? |
@icarito can you see about enabling CORS for requests to /api/ on plots2? (@sagarpreet-chadha maybe you can reach out to icarito in chat if he needs more info?) |
Yes, this makes sense - it's like a filter that accepts and outputs an array, and each API call we run the returned markers through it! |
We can write a simple test to show that only the correct precisions are passed through the filter -- very test-able! |
What should be the logic to filter coordinates @jywarren ? Is the one i proposed above makes sense ? Thanks ! |
yes, i think so. It could be a simple conditional if the precision falls
within the specified range. The filter could be configured with
`.filter(top, bottom)` perhaps? or `filter(markers, top, bottom)`?
…On Tue, Feb 5, 2019 at 12:45 PM Sagarpreet Chadha ***@***.***> wrote:
What should be the logic to filter coordinates @jywarren
<https://github.com/jywarren> ? Is the one i proposed above makes sense ?
Thanks !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ3gBdGuSztpTC1FNdqUhwj_s5_fpks5vKcMigaJpZM4ai4FY>
.
|
I went to enable CORS but found - Access-Control-Allow-Origin : * - already present |
maybe you mean to allow CORS in staging? |
Just for consistency and in case it helps I've allowed CORS to our staging instances! Let me know if something more is needed. |
This was the error : It is working now @icarito . Thank you 😄 ! |
Reference : #9 (comment)
The text was updated successfully, but these errors were encountered: