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

Dynamic initial frame #7

Open
samwhite opened this issue Mar 18, 2020 · 7 comments
Open

Dynamic initial frame #7

samwhite opened this issue Mar 18, 2020 · 7 comments
Labels
good first issue Good for newcomers

Comments

@samwhite
Copy link
Member

map = new google.maps.Map(main, {

It could be cool to take the data from the spreadsheet, figure out the outermost locations, then open the map with the zoom/centre such that all pins are visible

@charypar
Copy link
Member

It would, but maybe it needs to be a bit probabilistic, otherwise trolls like Chris Baron, who place themselves into Zanzibar will make the initial frame unusable.

Maybe what we could do is do an estimate a 2D Gaussian over all the points and then cover 2 or 3 sigma of the space...? That can in fact be done in the spreadsheet probably 🤔

@charypar
Copy link
Member

Upon some experiments, using percentiles will do the trick. But even simpler, given the zoom levels are discreet, it might be better to estimate the centre and guess a more appropriate zoom level...

@charypar
Copy link
Member

The current centre point is Charing Cross - 51.507, -0.128. The median of all the data points at the moment is 51.527, -0.081.

Only very slightly different, i.e. good estimate, so that may be worth doing to make the map a bit more universal.

@charypar
Copy link
Member

charypar commented Mar 23, 2020

Bounds fitting can be done with https://developers.google.com/maps/documentation/javascript/reference/map#Map.fitBounds

A good bounds approximation seems to be from somewhere around 1.8 percentile to about 98.2 percentile in both coordinates. Due to the zoom level fun, I imagine anything between 1 and 2, and 98 and 99 will probably do ok.

This looks like a sensible way of calculating the percentiles: https://groups.google.com/d/msg/microsoft.public.excel/DPVw83CE0r8/4hfzQKbuav8J

@charypar charypar added the good first issue Good for newcomers label Mar 23, 2020
@BadgerBaron
Copy link

You can't pinpoint Randy Mclovin - he's everywhere

@robbiemccorkell
Copy link

Could just delete the shit data

@charypar
Copy link
Member

charypar commented May 8, 2020

Possibly made obsolete by #17, which zooms on current location, if geolocation is allowed.

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

No branches or pull requests

4 participants