Bing Maps , Grouping of spots ?

  • Hello i need to figure out who to group spots in bing maps and then turn a group of spots on/off .

    Right now i don't know how to get the values of the spots . like witch parent="xxx" they belong to. Soo a can remove or add them.


    Code
    for(set(i,0), i LT plugin[bingmap].spot.count,inc(i),
    	         	set(mapspots[get(i)].value,get(plugin[bingmap].spot[get(i)])  );
    	         );
    	      		
    	         for(set(i,0), i LT mapspots.count,inc(i),
    				
    				trace(get(mapspots[get(i)].value));
    	          );


    trace code gives:

    Code
    INFO: [object Kinterface_dynamicitem]
     
    INFO: [object Kinterface_dynamicitem]
     
    INFO: [object Kinterface_dynamicitem]


    the same output as this function gives:

    Code
    for(set(i,0), i LT plugin[bingmap].spot.count,inc(i),
    		
    		  		if(plugin[bingmap].spot[get(i)].parent == gora,
    		  			
    		  			trace(get(plugin[bingmap].spot[get(i)]));
    		  			plugin[bingmap].removespot( get(plugin[bingmap].spot[get(i)].name) );
    		  			
    		  		);
    		  );


    BTW.. that function only removes 2 out of 3 spots..

    Please help me out here!

  • Hi,

    after a remove you would need to adjust your i variable (e.g. simply dec(i) ), because after the remove the the i variable points already to the next item.

    e.g.

    Code
    for(set(i,0), i LT plugin[bingmap].spot.count, inc(i),
      if(plugin[bingmap].spot[get(i)].parent == gora,
    	trace(get(plugin[bingmap].spot[get(i)]));
    	plugin[bingmap].removespot( get(plugin[bingmap].spot[get(i)].name) );
    	dec(i);
      );
    );

    Best regards,
    Klaus

Participate now!

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