Hello
I have a problem when I add additional XML code via <include> in the basic XML passed to the player in Javascript. When the basic XML <krpano> code contains the <include>, subsequent calls to the player in Javascript, such as adding hotspots, are no longer processed. However, the panorama is displayed perfectly. If I remove the include, the instructions are processed without any problem.
This happens even with the inclusion of the simplest possible external XML code, such as '<krpano></krpano>'.
Has anyone experienced this problem before? As the Javascript console returns absolutely no errors, I don't see how to isolate what is going on. Moreover, if I make a 'krpano.get("hotspot.count")' call, the result is correct. In other words, the krpano declares the hotspots well but does not draw them ...
Here are my calls in javascript. As you can see, I use a variable to establish the URL of the included XML, but the problem is strictly the same if I pass the complete URL in the base XML.
The as() function, which calls all other functions to draw the hotspots or orientate the view, is placed in an external js file.
Thank you for your help and your ideas.
Sylvain
Update : the console throwed an Unhandled Promise Rejection… See capture
-- WITHOUT <include … /> - WORKS FINE
<script>
var settings = {};
settings['pnopath'] = 'http://local.server/content/panoramas/the_panorama' ;
settings["onstart"] = "loadxml('<krpano><view hlookat=\"0\" vlookat=\"0\" maxpixelzoom=\"1.0\" fovmax=\"150\" limitview=\"auto\" /><image><cube url=\"%$PNOPATH%/the_panorama.tiles/%s/l%l/%0v/l%l_%s_%0v_%0h.jpg\" multires=\"512,768,1536,3072,6144\" /></image></krpano>');"
embedpano({id:"kr-2f9c6f5d1c9a",xml:"",target:"kr-2f9c6f5d1c9a-pano",html5:"auto",vars:settings,onready:krpano_onready_callback});
function krpano_onready_callback(krpano_interface){
as("kr-2f9c6f5d1c9a");
}
</script>
-- WITH <include … /> - BROKEN
<script>
var settings = {};
settings['thmpath'] = 'http://local.server/content/skin' ;
settings['pnopath'] = 'http://local.server/content/panoramas/the_panorama' ;
settings["onstart"] = "loadxml('<krpano><include url=\"%$THMPATH%/av_panorama.xml\" /><view hlookat=\"0\" vlookat=\"0\" maxpixelzoom=\"1.0\" fovmax=\"150\" limitview=\"auto\" /><image><cube url=\"%$PNOPATH%/the_panorama.tiles/%s/l%l/%0v/l%l_%s_%0v_%0h.jpg\" multires=\"512,768,1536,3072,6144\" /></image></krpano>');"
embedpano({id:"kr-2f9c6f5d1c9a",xml:"",target:"kr-2f9c6f5d1c9a-pano",html5:"auto",vars:settings,onready:krpano_onready_callback});
function krpano_onready_callback(krpano_interface){
as("kr-2f9c6f5d1c9a");
}
</script>
-- EXTERNAL JS FILE
// closure
var as;
(function($) {
as = applyskin ;
function applyskin(pano_uuid) {
krpano_go_to_view(pano_uuid,pano_uuid + '-pano');
krpano_display_hotspots(pano_uuid,pano_uuid + '-pano');
krpano_set_autorotation(pano_uuid,pano_uuid + '-pano') ;
krpano_set_title(pano_uuid,pano_uuid + '-pano');
}
… functions …
})(jQuery);
-- EXTERNAL XML FILE (av_panorama.xml)
<krpano></krpano>