You are not logged in.

1

Monday, May 20th 2013, 1:32pm

changing the name (or id whichever is identity) of hotspot

Greetings,

I want to change the id of hotspot with another id. I use this code (in javascript):

krpano().set("hotspot[" + hotspotIdToBeChanged + "].name", "spot"+newUniqueId);


A hotspot with newUniqueId can be created but It doesn't have the same properties of original hotspot, plus original hotspot stands still, therefore, I guess I am not successful to change the name of the hotspot. Is there a way to clone hotspot with another id/name or can I change the hotspot's name programmatically?

Best Regards,

2

Tuesday, May 21st 2013, 1:51pm

Hi,

your code is correct and should work.
Is your krpano version up-to-date?

Best regards,
Klaus

3

Wednesday, May 22nd 2013, 4:50pm

Hello, I changed from 1.16.1 to 1.16.3


I tryed once more and it works correctly now. I am not sure actually if it was because of version or my mistake to be honest. But if anyone finds time to try in 1.16.1 my test is:


var originalAth=krpano().get("hotspot[spot783d78f7-f3ca-44f4-adf7-e63e1a5727dc].point[0].ath");
console.log(originalAth);
krpano().set("hotspot[spot783d78f7-f3ca-44f4-adf7-e63e1a5727dc].name", "spottestcase");
setTimeout(function(){checkTheChange();},2500);

function checkTheChange(){
var nameChanged= krpano().get("hotspot[spottestcase].point[0].ath");
console.log(nameChanged);
}