Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #565
This integrates server-side pin clustering into the front end.
It also decouples the api calls so that the map data requests and the visualizations data requests don't block each other. So if the user is on the Map tab, they will see pin clusters even if the visualizations data isn't back from the server yet (and vice versa if they are on the Visualizations tab). The main logic for that is in the root saga in
sagas/data.js
:The
getMapData
function makes two api calls in sequence:/pin-clusters
-- only the data necessary to render the pin clusters given current zoom and bounds/heatmap
-- returns an array of lat/longs necessary to generate the heatmapThese are done in sequence rather than in parallel because the
/pin-clusters
request warms up the redis cache for the/heatmap
request, which will ease the load on the database.dev
branch