You are not logged in.

1

Sunday, May 22nd 2022, 6:04pm

Is it possible to not use XML files?

I'm working on a very specific use case for a single pano (at this stage, more panos down the track) and in this use case the XML files are being blocked from loading. I'm wondering if it is possible to put all the XML data (which is pretty minimal) directly into the main HTML file?

jordi

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

2

Tuesday, May 31st 2022, 2:13pm

Yes, it is possible

you can do like this :

Source code

1
2
3
4
5
6
var your_xml = "<krpano><preview type='grid()'/></krpano>';

embedpano({xml:null, target:"pano", onready:function(krpano)
{
	krpano.call("loadxml(" + escape(your_xml) + ")");
}});


from that post
everpano.com step beyond 360

3

Friday, June 10th 2022, 1:27pm

Hi,

yes, and by using the loadpanoimage() action:
https://krpano.com/docu/actions/#loadpanoimage

it's even possible to avoid any xml-file or xml-string usage.

Here an example for loading a multires flat-pano:

Source code

1
2
3
4
5
6
7
8
9
krpano.image.reset();
krpano.image.flat = {
  url : "tile_%l_%v_%h.jpg",
  multires : "512,1024x512,2048x1024,4096x2048"
};
krpano.actions.loadpanoimage('MERGE','BLEND(0.5)',function()
{
  console.log('load call done');
});


Best regards,
Klaus