Sie sind nicht angemeldet.

1

Sonntag, 22. Mai 2022, 18:04

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

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

2

Dienstag, 31. Mai 2022, 14:13

Yes, it is possible

you can do like this :

Quellcode

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

Freitag, 10. Juni 2022, 13:27

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:

Quellcode

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