Sie sind nicht angemeldet.

Fernando

Fortgeschrittener

  • »Fernando« ist der Autor dieses Themas

Beiträge: 330

Wohnort: Habana, Cuba

Beruf: Architect, Photographer.

  • Nachricht senden

1

Dienstag, 27. November 2018, 01:24

working with 1000+ hotspot [solved]

Hi, please I need a general advice to start a idea:

My project is a plain map with 10 categories, and 100 hotspot each. Total 1000 hs.

What is the most efficient way?

a) To build 10 scenes with 100 hotspot each.
b) Only one scene with 1000 hotspot, only 100 are visibles. (Are the invisible hotspot charged in memory or not?)
c) Dynamically create 100 hotspot (with addhotspot code) when active a category and remove it for other category... then create new 100 hotspot...etc.
d) Other idea?

Please base your answer (Why a), b), c) or another?)


Thanks very much, best regards,
Fernando.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Fernando« (27. November 2018, 17:42)


jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

2

Dienstag, 27. November 2018, 14:39

If what you look is performance go for a good C
everpano.com step beyond 360

3

Mittwoch, 28. November 2018, 12:23

Hi,

I would say a) or c) depending on your needs.

Hotspot related both cases would be the same.

And for the most efficient way do it via type="Javascript" actions,
e.g.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<action name="test_add_and_remove_100_spots" type="Javascript"><![CDATA[

  // remove all current spots
  while ( krpano.hotspot.count > 0 )
  {
    krpano.actions.removehotspot(0);
  }
  
  // add new spots
  for (var i=0; i < 100; i++)
  {
    var hs = krpano.actions.addhotspot("spot" + i);
    hs.type = "text";
    hs.html = "Spot " + (i+1);
    hs.oversampling = 2;
    hs.ath = Math.random() * 360 - 180;
    hs.atv = Math.random() * 180 - 90;
  }

]]></action>


Best regards,
Klaus

Fernando

Fortgeschrittener

  • »Fernando« ist der Autor dieses Themas

Beiträge: 330

Wohnort: Habana, Cuba

Beruf: Architect, Photographer.

  • Nachricht senden

4

Mittwoch, 28. November 2018, 16:05

Thanks, Jordi and Klaus. The "Javascript actions" was comment by Jordi in PV, now with the klaus example it is a little more clear for me.
I was trying the klaus code with 100, 300, 500 until 1000 hotspot... With this useful code I answer my main doubts.

But I would like to know more about action type "javascript", for example: How to convert this xml code to javascript code in order to gain more efficient behavior.
Here my xml code:
This is example for create 100 hs at click "test" button:

Quellcode

1
2
<layer name="test" type="text" html="create 100 hotel hotspot" 
onclick="creahs_hotel(hotel);"/>


Quellcode

1
2
3
4
5
6
7
<style 
name="hotel" 
url="%SWFPATH%/../list/img/hs/hotel.png"
scale.normal="0.6"
onloaded.normal="loadstyle(tooltip);"
onloaded.handheld="add_all_the_time_tooltip();"
/>


Quellcode

1
2
3
4
5
6
7
<action name="creahs">
addhotspot(%1);
assignstyle(hotspot[%1], '%2');
set(hotspot[%1].ath,%3);
set(hotspot[%1].atv,%4);
set(hotspot[%1].tooltip,%5);
</action>


Quellcode

1
2
3
4
5
6
<action name="creahs_hotel">
creahs(ambos,%1,-0.074434,-0.108655,Hotel # 1 Riviera);
creahs(hlibre,%1,-0.138722,-0.109009,Hotel # 2 Capri);
//(...)
creahs(parque1,%1,-0.091118,-0.106737,Hotel # 100 Comodoro);
</actions>


Best regards,
Fernando

Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »Fernando« (30. November 2018, 01:41)