Revert "Fixed bearing"

This reverts commit 626bf3eecc.
master
Keith Irwin 2017-09-25 22:59:56 +00:00
parent 626bf3eecc
commit 839fd9772d
1 changed files with 4 additions and 4 deletions

View File

@ -246,11 +246,11 @@ loadGoogleMapsAPI({ key:mapKey })
function updateStreetView(loc) {
// Calculate bearing between user and position of streetview image
// https://stackoverflow.com/a/26609687/3006854
function getBearing(userLoc, imageLoc) {
return 90-(
Math.atan2( userLoc.lat-imageLoc.latLng.lat(), userLoc.lon-imageLoc.latLng.lng() )
* (180/Math.PI) ) % 360;
return Math.atan(
(userLoc.lon-imageLoc.latLng.lng())
/ (userLoc.lat-imageLoc.latLng.lat())
) * (180/Math.PI);
}
// Set image