Sie sind nicht angemeldet.

1

Dienstag, 16. August 2016, 13:12

How to embed additional xml contents dynamically?

Hello krpano friends~

I think same question was posted long time ago but I couldn't find the right answer.

- dynamic includes



What I want is to add xml content dynamically to certain scene. I know there is "addlayer()" and "addhotspot()"

actions which let me add layer, hotspot objects dynamically but when xml content gets too big or when I need

to add xml objects other than layer or hotspot, I need another solution.


"loadpano()", "loadscene()", "loadxml()" -> all these actions is for loading new panorama(scene), which means

old panorama(scene) is unloaded when calling these actions.


Anybody have an idea?


Best Regards,
hyung

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Dienstag, 16. August 2016, 16:11

Hi

Have you tried loadpano function() but with KEEPSCENES flag *question*


Quellcode

1
2
loadpano(xmlpath_to_included, null, KEEPSCENES); 
updatescreen();



Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Mittwoch, 17. August 2016, 09:14

Hi Piotr,

Thanks for your reply. Even using loadpano() and "KEEPSCENES", the previous panorama disappears and I
get black panorama.

I think "KEEPSCENES" keeps scene objects so that I can (re)load scenes after I load new panorama from new
xml.

Even by using loadxml() action, previous panorama is gone.

I think I should just refresh the html so that it loads a new xml file. :(


Best Regards,
hyung


Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

4

Mittwoch, 17. August 2016, 10:43

Hi

This should work, but not in project based on 'scene' tag. In this situation, I have no clu.

Maybe javascript?

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

Taurus

Schüler

Beiträge: 140

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

5

Mittwoch, 17. August 2016, 20:18

Hi,
that you want to add to an existing tour, what objects?
in the case of additional scenes - use

Quellcode

1
set(scene[new_scene].content, '.......')

in the case of additionsl action

Quellcode

1
set(new_action, '........')
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.20

6

Donnerstag, 18. August 2016, 04:50

@Piotr,


I will share if I find any workaround :)


----------------------------------------------------------------


@Taurus,


Maybe "scene.content" is what I am looking for. What I want to do is to add additional
information to the current scene on the fly (hopefully simply by including xml dynamically,
which seems impossible at the moment).

Refering to your code, I have tried to change the content of the current scene and but
old content is showing in the panorama. However when I trace the scene.content, new
content is printed to the console. I have called "updatedscreen()" function but it's the
same.

Maybe there is additional action I have to apply after I change the scene.content?

Taurus

Schüler

Beiträge: 140

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

8

Donnerstag, 18. August 2016, 11:27

Maybe there is additional action I have to apply after I change the scene.content?

Unfortunately, I do not know about such opportunities
you must ask Klaus directly
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.20

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

9

Donnerstag, 18. August 2016, 12:41

Each xml is parsed before virtual tour is started. It seems to me that you need to focus on dynamic loading.

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

Taurus

Schüler

Beiträge: 140

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

10

Donnerstag, 18. August 2016, 13:07

Each xml is parsed before virtual tour is started


Piotr, maybe you're right, but I have been successfully using to add scenes including image and view tags, change event handlers and action content during a tour of work
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.20

Mael B.

Schüler

Beiträge: 157

Wohnort: France, Montpellier

  • Nachricht senden

11

Donnerstag, 4. Juli 2019, 15:06

Hello everybody,

I found that loadpano() with the following combination of flags seems to do the job :)

Quellcode

1
    loadpano(new.xml,null,KEEPIMAGE|MERGE|KEEPHOTSPOTS|KEEPALL|KEEPSCENES,NOBLEND);


The only issue that I see is that it triggers the onnewpano event but no the onloadcomplete event, so if a temporary layer or message (e.g. loading... message) is displayed by the onnewpano event, it is not removed by the onloadcomplete event *sad*

Mael B.

Schüler

Beiträge: 157

Wohnort: France, Montpellier

  • Nachricht senden

12

Donnerstag, 4. Juli 2019, 16:52

Another issue with the solution of using loadpano() is that the xml.scene variable does not contain the name of currently loaded scene anymore *sad*