You are not logged in.

Rylee

Beginner

  • "Rylee" started this thread

Posts: 9

Location: Dallas, TX

Occupation: Developer for Devio, LLC

  • Send private message

1

Tuesday, June 23rd 2015, 7:09pm

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.

Source code

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):

Source code

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

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

2

Tuesday, June 23rd 2015, 7:51pm

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

Beginner

  • "Rylee" started this thread

Posts: 9

Location: Dallas, TX

Occupation: Developer for Devio, LLC

  • Send private message

3

Tuesday, June 23rd 2015, 7:52pm

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.

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Tuesday, June 23rd 2015, 10:45pm

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

Beginner

  • "Rylee" started this thread

Posts: 9

Location: Dallas, TX

Occupation: Developer for Devio, LLC

  • Send private message

5

Thursday, June 25th 2015, 10:04pm

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.