I have an HTML page with embedded JavaScript. This shows an interactive 360 panoramic image, and the JavaScript is used in that to return the current view parameters (horizontal and vertical direction and zoom level). This is the JavaScript:
Code: Select all
function get_current_view()
{
if (krpano)
{
var hlookat = krpano.get("view.hlookat");
var vlookat = krpano.get("view.vlookat");
var fov = krpano.get("view.fov");
var distortion = krpano.get("view.distortion");
document.getElementById("currentview").innerHTML =
'hlookat="' + hlookat.toFixed(2) + '" '+
'vlookat="' + vlookat.toFixed(2) + '" '+
'fov="' + fov.toFixed(2) + '" '+
'distortion="' + distortion.toFixed(2) + '"';
}
}
k