Sure...
Instead of loading all the panos in my tour I want to load only the panos connected to my current pano. This is to decrease overall load time. So after the first scene is loaded, I execute this JavaScript code...
|
Source code
|
1
2
3
4
|
$.ajax({ type: "GET", url: "next_scene.xml", dataType: "text", context: { krpanoObject: krpanoObject }, error: function(xhr, status, error) { console.log("ERROR: "); }, success: function(result, status, xhr) { var action = "loadxml('" + htmlEscape(result) + "', null, MERGE | KEEPSCENES | KEEPHOTSPOTS | KEEPPLUGINS, BLEND(2))";
console.log("KrPano: " + action); this.context.krpanoObject.call(action); }
});
var htmlEscape = function(str) { return String(str) .replace(/&/g, '&') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/</g, '<') .replace(/>/g, '>'); };
|
...before this code is executed, I can see the scene ok. Once onxmlcomplete fires, the scene goes black, leaving the hotspots behind.
The thought then is that when I'm going to transition to the next pano after clicking on a hotspot, that pano's code is already loaded and all I have to do is call loadscene.
BTW calling loadpano instead of loadxml has similar behavior.
Some other questions arise:
- Do I have to call loadscene after loadpano and loadxml?
- Does loadxml have the same effect as loadpano?
Thanks again for the quick response...you rock!