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

Sunday, September 22nd 2013, 11:07am

How to list scene attributes from javascript

I want to list all the scenes and scene attributes like scene name, latitude and longitude position etc from javascript. Is that possible?

Posts: 1,081

Location: Russia, Kaliningrad

  • Send private message

2

Sunday, September 22nd 2013, 10:22pm

Hi!
docu - great usefull thing ;)
If I understand right then
http://krpano.com/docu/plugininterface/#getattributes


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

jordi

Intermediate

Posts: 485

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

3

Monday, September 23rd 2013, 12:08pm

If you don't want to use a plugin for that task you can just write a function to read those attributes


Source code

1
2
3
4
5
function yourfunction(){
var krpano = document.getElementById("krpanoSWFObject");
var latitude= Number( krpano.get("scene[get(xml.scene)].latitude") );

}
everpano.com step beyond 360

4

Sunday, September 29th 2013, 10:54pm

List scenes in a tour from javascript

Thanks *smile* , now i know how to read scene attributes. But how can I list all the scenes in a tour from javascript?

Posts: 1,081

Location: Russia, Kaliningrad

  • Send private message

5

Sunday, September 29th 2013, 11:39pm

Hi! aslak@viatech.no

you don't want to use my advice, sad.

var krpano = document.getElementById('krpanoSWFObject');

// get scene object (list of scenes)
var scenesList = krpano.get("scene");

//get one scene
var scene = scenesList.getItem(0);

// direct access to attribute
alert(scene.name);

// geting all attributes names
var arrayOfAttributes = Object.keys(scene); //standard javascript object method

and so on....

as I said READ DOCU ;-)

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

This post has been edited 1 times, last edit by "Sudarchikov Andrey" (Sep 29th 2013, 11:53pm)