#96 Needed to continue to update panorama

master
Keith Irwin 2017-09-11 03:56:04 +00:00
parent ac7fc10be5
commit 64845b7087
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 9 additions and 5 deletions

View File

@ -266,12 +266,14 @@ loadGoogleMapsAPI({ key:mapKey })
}
// Not moving and pano not set (create panoramic image)
else if (pano==null) {
// Not moving
else {
// Create panorama
$('#pano').empty();
pano = new googlemaps.StreetViewPanorama(panoElem, {
// Pano element not created
if (pano==null) {
// Create panorama
$('#pano').empty();
pano = new googlemaps.StreetViewPanorama(panoElem, {
panControl: false,
zoomControl: false,
addressControl: false,
@ -279,6 +281,7 @@ loadGoogleMapsAPI({ key:mapKey })
motionTracking: false,
motionTrackingControl: false
});
}
// Set panorama
getStreetViewData(loc, 2, function(data){
@ -289,6 +292,7 @@ loadGoogleMapsAPI({ key:mapKey })
heading: Math.atan((loc.lon-data.location.latLng.lng())/(loc.lat-data.location.latLng.lat()))*(180/Math.PI)
});
});
}
}