Sie sind nicht angemeldet.

1

Dienstag, 23. Mai 2017, 08:57

Add sth and save xml

can i add sth like hotspot from js and save the xml?


str += "addhotspot(" + spotname + ");";
str += "set(hotspot[" + spotname + "].url,skin/hotspot.png);";
str += "set(hotspot[" + spotname + "].ath,"+ h_center +");";
str += "set(hotspot[" + spotname + "].atv,"+ v_center +");";
str += "set(hotspot[" + spotname + "].scale,0.3);";
str += "set(hotspot[" + spotname + "].zoom,true);";

krpano().call(str);


i have done the add hotspot in js.
but i don't know how to save it.

Have anyone know how to do it? thanks

3

Dienstag, 23. Mai 2017, 09:38

what *question* i want to save the hotspot that i added in js to xml

4

Dienstag, 23. Mai 2017, 11:07

Well, if you want to save something to your xml file, you have to do it in your js functions. This is because - as the documentation clearly states - after parsing it, there is no xml file internally in krpano.

5

Dienstag, 23. Mai 2017, 11:42

Well, if you want to save something to your xml file, you have to do it in your js functions. This is because - as the documentation clearly states - after parsing it, there is no xml file internally in krpano.
i see, that's mean i can use js to read and modify it.

thanks a lot!

6

Dienstag, 23. Mai 2017, 12:56

You have to remember though, that your xml file is on your web server, and the javascript may be running in a browser on a computer on the other side of the earth. Then it can't access your file system without sending the data to an application running on your server.

Tommy

7

Mittwoch, 24. Mai 2017, 09:28

You have to remember though, that your xml file is on your web server, and the javascript may be running in a browser on a computer on the other side of the earth. Then it can't access your file system without sending the data to an application running on your server.

Tommy
if i read the xml from amazon S3, can i edit and overwrite it in S3?

8

Donnerstag, 25. Mai 2017, 10:40

I'm not familiar with Amazon S3, but in my case the xml files are stored in my web hotel server. If I want to update one of them from a javascript function, it has to send the data to a php (or similar) application. And that application has to be intelligent enough to know what to do with that data.

Tommy

9

Dienstag, 6. Juni 2017, 16:16

Hello, i'm looking to do the same, I can add hotspot via JS, but now I'm looking for a function similar to the "save XML" in tour_editor so I can directly save the xml on the webserver
Any ideas?

10

Mittwoch, 21. Juni 2017, 11:53

you got the js object and then send to server by ajax,the server code parse the xml and add hotspot