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.

    Einmal editiert, zuletzt von Fernando (27. November 2018 um 17:42)

  • 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.

    Best regards,
    Klaus

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

    Code
    <layer name="test" type="text" html="create 100 hotel hotspot" 
    onclick="creahs_hotel(hotel);"/>
    Code
    <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();"
    />
    Code
    <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>
    Code
    <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

    3 Mal editiert, zuletzt von Fernando (30. November 2018 um 01:41)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!