caller addspot onclik !

  • Hello,

    Sorry if this question have be alredy posted, i see nothing like my case.
    I make my own xml for bing map. map is the layer caller.


    I dont see what this return "null" for onclick action in caller.addspot (i dont use the vtouskin.xml)
    for me onclick="loadscene(get(scene[get(i)].name))" ? no ?


    Code
    <action name="addMapSpots" scope="local">
    for(set(i,0), i LT scene.count, inc(i),
    if(scene[get(i)].lat,
    showlog();
    trace ('my scene title = ', 'get(scene[get(i)].title)'); // return good
    trace ('my scene name = ','get(scene[get(i)].name)'); // return very good
    caller.addspot(get(scene[get(i)].title), get(scene[get(i)].lat), get(scene[get(i)].lng), null, true, loadscene(get(scene[get(i)].name)), null);
    </action>


    Thanks a lot
    Damien

  • Hi

    You have not closed the for and if function.


    Code
    <action name="addMapSpots" scope="local">
     for(set(i,0), i LT scene.count, inc(i),
      if(scene[get(i)].lat,
      showlog();
      trace ('my scene title = ', 'get(scene[get(i)].title)'); // return good
      trace ('my scene name = ','get(scene[get(i)].name)'); // return very good
      caller.addspot(get(scene[get(i)].title), get(scene[get(i)].lat), get(scene[get(i)].lng), null, true, loadscene(get(scene[get(i)].name)), null);
      );
     );
    </action>


    p.s. Your "addMapSpots" action is called on "onmapready"?

    regards
    piotr

  • I find.
    we must do like this before the caller.addspot:
    calc(spotclickevent, 'activatespot(' + spotname + '); delayedcall(0.5,loadscene(' + scene[get(i)].name + ', null, MERGE, BLEND(1)));');
    and
    caller.addspot(get(spotname), get(scene[get(i)].lat), get(scene[get(i)].lng), get(scene[get(i)].heading), false, get(spotclickevent) );
    Good night

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!