watson / airplanejs

📡 ✈️ App that picks up ADS-B radio signals from airplanes and plots them in real time on a map in your browser
MIT License
685 stars 46 forks source link

Find better default map center #3

Open watson opened 6 years ago

watson commented 6 years ago

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

jwcnewton commented 6 years ago

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

watson commented 6 years ago

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 commented 6 years ago

It's free and looks really nice :smile: 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 commented 6 years ago

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

watson commented 6 years ago

@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 commented 6 years ago

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

digitalica commented 5 years ago

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.