You are not logged in.

1

Friday, December 24th 2021, 10:58am

RemoveHotspot not working !

Hi I am trying to remove hotspot from array of hotspot based on hotspot name but it is not working. Here is my code.



var name = 'poi-marker';

var countArr = this.krpanoObj.get('hotspot').getArray();
console.log(countArr);

for (let i = 0; i < countArr.length; i++) {
var value = that.krpanoObj.get('hotspot[ ' + i + '].name');
if (value == name) {
console.log('in if');
this.krpanoObj.call('removehotspot(' + value + ')');
console.log('countArr', countArr);
}
}

I want to remove particular hotspot from array which also remove that hotspot from panoroma image also .

P.S I have not saved hotspot in xml yet trying to remove it if someone mistakenly added the hotspot


Any help would be appreciated , thanks. *smile*

2

Friday, January 7th 2022, 11:23am

Hi,

what exactly is not working?

and why not just doing:

Source code

1
this.krpanoObj.removehotspot(name);


Best regards,
Klaus

3

Friday, January 7th 2022, 2:02pm

Source code

1
var value = that.krpanoObj.get('hotspot[ ' + i + '].name');


that? *huh*

This post has been edited 1 times, last edit by "indexofrefraction" (Jan 7th 2022, 7:25pm)