airplanejs icon indicating copy to clipboard operation
airplanejs copied to clipboard

Find better default map center

Open watson opened this issue 7 years ago • 7 comments
trafficstars

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.

watson avatar Dec 11 '17 11:12 watson

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

jwcnewton avatar Dec 11 '17 16:12 jwcnewton

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?

watson avatar Dec 11 '17 20:12 watson

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

jwcnewton avatar Dec 12 '17 09:12 jwcnewton

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

drom avatar Dec 12 '17 17:12 drom

@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 😄

watson avatar Dec 12 '17 17:12 watson

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

drom avatar Dec 12 '17 18:12 drom

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.

digitalica avatar May 28 '19 19:05 digitalica