Added logic for moving objects
parent
3d3838943b
commit
7a40e7a6d1
|
@ -55,8 +55,7 @@ function updateStreetView(loc){
|
|||
pano.setPano(data.location.pano);
|
||||
pano.setPov({
|
||||
pitch: 0,
|
||||
// Point towards users's location from street
|
||||
heading: Math.atan((loc.lon-data.location.latLng.lng())/(loc.lat-data.location.latLng.lat()))*(180/Math.PI)
|
||||
heading: (loc.spd>1)?loc.dir:Math.atan((loc.lon-data.location.latLng.lng())/(loc.lat-data.location.latLng.lat()))*(180/Math.PI)
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -73,6 +72,8 @@ else { navigator.geolocation.watchPosition(
|
|||
newLoc = {
|
||||
lat: pos.coords.latitude,
|
||||
lon: pos.coords.longitude,
|
||||
spd: pos.coords.speed,
|
||||
dir: pos.coords.heading,
|
||||
tim: new Date()
|
||||
};
|
||||
updateStreetView(newLoc,10);
|
||||
|
|
Loading…
Reference in New Issue