Sie sind nicht angemeldet.

1

Donnerstag, 10. Juli 2014, 13:50

Get Entire xml String.

Hi,

I am making an editor for creating, editing hotspots, as I needed the tooltip and more functionality than the normal editor.

Now I have added the hotspots on the pano and want to see the modified xml with the hotspot code.
If I can see that, it would be amazing, if not then I am ready to do some XML DOM modification and add that code but I would require the original loaded XML

I tried krpano.get("xml.content") but that gave me xml for just the current scene and not all scenes.

I tried krpano.get("xml.url") but that gave me empty string.

Any help would be greatly appreciated. Thanks in advance.

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Freitag, 11. Juli 2014, 05:17

Your editor should use krpano.call to build the new hotspots and all attributes or describe more your workflow. A lot of us have made our own editors.
Otherwise, plugins, hotspots, events, actions are all there. Just loop through the xml structure and collect your data.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Freitag, 11. Juli 2014, 08:06

Well I am making use of krpano.call to add new hotspots.
So I have the data of the hotspots that I have added and the scenes in which I have added them.

Going through the krpano.get("xml.content") does not give me the modified xml with the hotspots i have added to that scene.

The only part remaining is giving the modified xml to the user so he can save it.

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

4

Freitag, 11. Juli 2014, 15:52

OH that's not too bad. I wish I knew an easier way too though.. Something like this works. You just need to grab the attributes you want.
This particular bit builds a textfield.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
	set(plugin[xml].html,'');
	for(sub(i,hotspot.count,1), i GE 0, dec(i), 
			txtadd(plugin[xml].html,get(plugin[xml].html),				'<hotspot 
			name="',get(hotspot[get(i)].name),'" 
			ath="',get(hotspot[get(i)].ath),'" 
			atv="',get(hotspot[get(i)].atv),'" 
			rotate="',get(hotspot[get(i)].rotate),'" 
			ondown="fade_hotspots(get(name),0,1,default,WAIT);looktohotspot(get(name),42);loadscene(get(scene%%5Bget(goto)%%5D.name),null,MERGE,ZOOMBLEND(1,10));" 
			style="" 
 /&gt;<br />');

	);
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour