Sie sind nicht angemeldet.

1

Sonntag, 22. September 2013, 11:07

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?

2

Sonntag, 22. September 2013, 22:22

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

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

3

Montag, 23. September 2013, 12:08

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


Quellcode

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

Sonntag, 29. September 2013, 22:54

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?

5

Sonntag, 29. September 2013, 23:39

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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Sudarchikov Andrey« (29. September 2013, 23:53)