Sie sind nicht angemeldet.

viewinz

Fortgeschrittener

  • »viewinz« ist der Autor dieses Themas

Beiträge: 145

Wohnort: Wellington, New Zealand

Beruf: Trying to build an entire walkthrough of NZ for tourists

  • Nachricht senden

1

Montag, 1. Februar 2010, 20:49

SWFAddress

Has anyone got this working with the panos?

Currently I can access indivdual panos through the URL using the javascript interface to pass xml doc and scene variables, but would be good if I could use this system to set the URL each time the user changes scene. Something like domain.com/group/scene (where group is the scenes doc)

kyle

Schüler

Beiträge: 71

Wohnort: Grand Rapids, Michigan, USA

  • Nachricht senden

2

Montag, 1. Februar 2010, 21:07

HTTP URLs support fragment identifiers that link to a specific part of a web page. A fragment identifier is placed at the end of the URL and is separated by the "#" character. You can use this fragment identifier to specify a particular pano to load.

When loading a new scene, use the following javascript to set the fragment identifier.

Quellcode

1
2
document.location.hash = "#" + pano;
krpano.call("loadscene(" + pano + ");");


When a page first loads, use the following javascript to load the URL-specified scene.

Quellcode

1
2
3
4
if(document.location.hash){
        // hash begins with '#', so remove first char to access pano name
        krpano.call("loadscene(" + document.location.hash.substr(1) + ");");
}

Ähnliche Themen