You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, September 14th 2013, 2:19pm

The krpano javascript interface functions is not defined

I am trying to access the krpano javascript interface functions, but get gets an exception that they are not defined. The pano shows up in the browser. The source code is part of a MVC 4.0 View. Anyone know why this is happen?


<script src="~/Scripts/swfkrpano.js"></script>

<script>
$(function () {

var viewer = createPanoViewer({ swf: "../../projects/Bridge/vtour/tour.swf", id: "krpanoObject", html5: "auto", passQueryParameters: true, consolelog: true });
viewer.addVariable("xml", "../../projects/Bridge/vtour/tour.xml");
viewer.embed("panoDiv");

var fov = Number(krpano().get("view.fov"));
fov += 10.0;
krpano().set("view.fov", fov);

function krpano() {
return document.getElementById("krpanoObject");
}

});
</script>

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

2

Saturday, September 14th 2013, 7:05pm

Hi!
read this carefuly
http://krpano.com/docu/js/#top


Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

3

Tuesday, September 17th 2013, 3:11pm

Hi,

it needs some time until krpano is loaded and embedded!

That means the krpano object and the Javascript interface aren't instantly there after calling the embed() function.

Try to use the 'onready' callback to get noticed when krpano is ready to use:
http://krpano.com/docu/html/#onready

Best regards,
Klaus

4

Saturday, September 21st 2013, 9:57pm

*smile* Thanks, that solved the problem!