Sie sind nicht angemeldet.

Rylee

Anfänger

  • »Rylee« ist der Autor dieses Themas

Beiträge: 9

Wohnort: Dallas, TX

Beruf: Developer for Devio, LLC

  • Nachricht senden

1

Dienstag, 23. Juni 2015, 19:09

Deleting a single point in a polygonal hotspot

Hi,

I am writing a tool to draw on a krpano viewer. Part of this is dynamically creating polygonal hotspots, much like the example given in the "addhotspot" documentation.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
addhotspot(polyspot);
set(hotspot[polyspot].fillalpha, 0.25);
set(hotspot[polyspot].borderalpha, 0.50);
set(hotspot[polyspot].onclick, removehotspot(polyspot) );
set(hotspot[polyspot].point[0].ath,-10);
set(hotspot[polyspot].point[0].atv,-10);
set(hotspot[polyspot].point[1].ath,-10);
set(hotspot[polyspot].point[1].atv,+10);
set(hotspot[polyspot].point[2].ath,+10);
set(hotspot[polyspot].point[2].atv,+10);
set(hotspot[polyspot].point[3].ath,+10);
set(hotspot[polyspot].point[3].atv,-10);


The problem is that I cannot delete any of these points — how do I delete a single point? Is this even possible?

EDIT: things I have tried (that do not work):

Quellcode

1
2
3
removehotspot(hotspot[polyspot].point[3])
delete(hotspot[polyspot].point[3])
delete(hotspot[polyspot].point['n3']
Rylee Fowler
Full Stack Developer, Devio, LLC.

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

2

Dienstag, 23. Juni 2015, 19:51

I don't think you can remove a single point of polyhotspot, but I guess there are other options... Like giving the same position as the next or previous point...
everpano.com step beyond 360

Rylee

Anfänger

  • »Rylee« ist der Autor dieses Themas

Beiträge: 9

Wohnort: Dallas, TX

Beruf: Developer for Devio, LLC

  • Nachricht senden

3

Dienstag, 23. Juni 2015, 19:52

That would not help. My goal is to be able to delete any single added point.

Will I simply have to delete the whole hotspot and re-render it? That would be reasonably trivial.
Rylee Fowler
Full Stack Developer, Devio, LLC.

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

4

Dienstag, 23. Juni 2015, 22:45

I remember the "removearrayitem()" action from documentation. And here's the answer to your question, I hope:

programmatically remove points from polygonal hotspot
Regards,

Alexey

Rylee

Anfänger

  • »Rylee« ist der Autor dieses Themas

Beiträge: 9

Wohnort: Dallas, TX

Beruf: Developer for Devio, LLC

  • Nachricht senden

5

Donnerstag, 25. Juni 2015, 22:04

Hi Alexey,

Yes. That works perfectly!

Do note that you must call "updatescreen()" before this change will be graphically represented.
Rylee Fowler
Full Stack Developer, Devio, LLC.