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

feature request: marker clustering #54

Open
ariovistus opened this issue Dec 27, 2016 · 8 comments
Open

feature request: marker clustering #54

ariovistus opened this issue Dec 27, 2016 · 8 comments

Comments

@ariovistus
Copy link
Contributor

it might make the map a bit less unwieldy

@ErikBoesen
Copy link
Member

What do you mean by this exactly?

@ariovistus
Copy link
Contributor Author

your map starts out scrolled out far enough that all X thousand teams are drawn on it, and it feels sluggish because of it. Marker clustering would decrease the number of things that need to get drawn initially.

here's an example: https://www.easymapmaker.com/map/e13fffaa6927e3ca755d8646ed5e1de2

@ErikBoesen
Copy link
Member

Hmm, interesting idea.

@PsKramer
Copy link

+1, would make the map much more readable

@GeeII
Copy link
Member

GeeII commented Oct 13, 2017

Google Maps has a clustering algorithm available, at https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js
It does not appear to scale up to the sizes needed for this App, even if you were to work out how to turn the various classes on and off. It works fairly (but not well) with both districts and regionals, but the size of the teamMarkers causes several strange looking issues.

@GeeII
Copy link
Member

GeeII commented Oct 13, 2017

It also never de-clusters two items at the same location (e.g. Heartland and Greater KC regionals).

@GeeII
Copy link
Member

GeeII commented Oct 14, 2017

I don't see what the problems are with googles clusterer, plus it does not appear to behave well on mass additions/removals as would happen with the toggles on FIRSTmap. My idea for a simplest solution would be to include clustering tree construction in the scraper, to be read as an additional .js file. Implementation of that tree would be in the application. This would also potentially enable shutting clustering off if a user desired it.

@GeeII
Copy link
Member

GeeII commented Jun 24, 2018

Thinking about this one again. The big issue which makes this one different than just using most stock clusterers is the ability to turn on/off four classes of items (2 championships, 63 Regionals, 142 District events, 3645 teams). Additionally, there are district teams vs non-district teams, though this info isn't explicit in the TBA download, but implicit by state. Given all this, I still think that pre-clustering in the scraper makes the most sense, with events and teams belonging to the same clusters. I think a good initial clustering would be by state, which would inherently gather districts into a few clusters. Then, force-gather multi-state districts. Finally, build clusters geographically above and below these forced clusters. Outside the U.S., forced clusters would be by nation for nations with no more than a dozen or so teams, by state/province/district for those with more. Each cluster (whether forced or geographic) would already know how many items of each of the four icon types it holds.

Data structure: I'm imagining that each marker (whether atomic or cluster) would know its parent cluster in the .js file, and "check in" with its parent as it is created. Each cluster should also know its "radius" so it knows when to break into its subclusters. TBD if this is calculated during construction (taking more time) or in the scraper/post-scraper (needing to store more data). I'll likely do the calculation during the scraper, and save both versions of the files to determine the data impact; then the code can go either way.

Any feedback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants