Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial zoom integration #433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions lg_sv/webapps/client/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,17 @@ var initializeRes = function(ros, yawOffset) {

var svService = new google.maps.StreetViewService();

function handlePanoChanged(panoId) {
function handlePanoChanged({panoId, zoom=false}) {
sv.setPano(panoId);
if (shouldTilt) {
var fovFudge = getFovFudge(fieldOfView);
var zoomLevel = getZoomLevel(fieldOfView * scaleFactor * fovFudge);
if (zoom) {
zoomLevel = zoom
} else {
var zoomLevel = getZoomLevel(fieldOfView);
if (shouldTilt) {
var fovFudge = getFovFudge(fieldOfView);
var zoomLevel = getZoomLevel(fieldOfView * scaleFactor * fovFudge);
} else {
var zoomLevel = getZoomLevel(fieldOfView);
}
}
sv.setZoom(zoomLevel);
if (lastPov) {
Expand Down Expand Up @@ -185,13 +189,15 @@ var initializeRes = function(ros, yawOffset) {
pov.z = sv_window['activity_config']['heading'];
if (sv_window['activity_config']['tilt'])
pov.x = sv_window['activity_config']['tilt'];

var zoom = sv_window['activity_config']?.['zoom'] || false;


if (panoid[0] == '-' && panoid.search("%2F") > -1)
panoid = "F:" + panoid;

console.log("Emitting " + panoid + " with pov " + pov);
svClient.emit('pano_changed', panoid);
svClient.emit('pano_changed', {'panoid': panoid, 'zoom': zoom});
svClient.emit('pov_changed', pov);
}
svClient.on('director_message', handleDirectorMessage);
Expand Down