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

Find better default map center #3

Open
watson opened this issue Dec 11, 2017 · 7 comments
Open

Find better default map center #3

watson opened this issue Dec 11, 2017 · 7 comments

Comments

@watson
Copy link
Owner

watson commented Dec 11, 2017

Currently the map is hardcoded to default to Paris as this is where I first gave a demo of AirplaneJS. But this results in a weird "blinking" effect where sometimes first Paris is loaded, but then your current position is loaded.

It would be nicer if the map was either zoomed all the way out until it could determine your location, or if there was a better way to choose a default location, or maybe even wait drawing the map until your location had been found.

Gotchas

  • It have to be taken into account that the first time someone starts the map, they have not yet approved the browser to know their current location.
  • Some browsers (e.g. Safari) will not allow the user to share their current location when running on localhost.
@jwcnewton
Copy link

Hey @watson are you set on using Google maps, would you consider ESRI js api?

@watson
Copy link
Owner Author

watson commented Dec 11, 2017

Not really, I'm totally open to suggestions. Google Maps was just the one I knew, so I defaulted to it. As long as it's nice looking, have the required features, and doesn't cost money, then I'm open to other ideas 😃

I've never heard of ESRI - what's the benefits?

@jwcnewton
Copy link

It's free and looks really nice 😄 it has stream layers, popups and great 3D support...

https://developers.arcgis.com/javascript/

Example
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=scene-elevationinfo

@drom
Copy link

drom commented Dec 12, 2017

Once you received couple airplane beacons you know the location of observer +- 50km

@watson
Copy link
Owner Author

watson commented Dec 12, 2017

@drom ah, very good point! I can of course just center the map around where the planes are. Why didn't I think of that 🤦‍♂️ It might not solve the "blinking" issue though as I might not have received any signals by the time the map tries to load (at least how it's implemented today), but it will solve the issue of Safari and other browsers not allowing me to get the users location on localhost 😄

@drom
Copy link

drom commented Dec 12, 2017

@watson it is like you designed location device and asking how to find location ;)

@digitalica
Copy link

Once you received couple airplane beacons you know the location of observer +- 50km

This is a good idea, except if all aircraft fly high in the same direction from the antenna. That is unlikely, and if it happens, centering the map there might be nice. I suggest not averaging all data points, but look for a bounding box, and using the center of that box.

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

No branches or pull requests

4 participants