You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

VN2011

Professional

  • "VN2011" started this thread

Posts: 1,336

Location: Duluth MN

  • Send private message

1

Monday, July 11th 2011, 9:36pm

a better way to remove spots

there has to be a better way to remove map spots using the new googlemaps. i have to remove each spot individually. think there is a way to remove all the spots based off the spot styles? this has all the spots being created with the spot style "hotel" how can i remove all "hotel" spots with 1 action?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<action name="dulhotel">
plugin[map].addstylespot(h1,46.783409,-92.096230,0,hotel,false,action(loadplace,The Suites Hotel,duluth/waterfrontsuites),showtext('The Suites Hotel'), shi(duluth/waterfrontsuites), hhi());
plugin[map].addstylespot(h2,46.785751,-92.094383,0,hotel,false,action(loadplace,Canal Park Lodge,duluth/canalparklodge),showtext('Canal Park Lodge'), shi(duluth/canalparklodge), hhi());
plugin[map].addstylespot(h3,46.784309,-92.093620,0,hotel,false,action(loadplace,Hampton Inn,duluth/hamptoninn),showtext('Hampton Inn'), shi(duluth/hamptoninn), hhi());
plugin[map].addstylespot(h4,46.783245,-92.093507,0,hotel,false,action(loadplace,The Inn on Lake Superior,duluth/theinn),showtext('The Inn '), shi(duluth/theinn), hhi());
plugin[map].addstylespot(h5,46.781621,-92.092648,0,hotel,false,action(loadplace,Comfort Suites,duluth/comfortsuites),showtext('Comfort Suites'), shi(duluth/comfortsuites), hhi());
plugin[map].addstylespot(h6,46.777861,-92.092767,0,hotel,false,action(loadplace,The South Pier Inn,duluth/southpierinn),showtext('The South Pier Inn'), shi(duluth/southpierinn), hhi());
plugin[map].addstylespot(h7,46.785015,-92.102013,0,hotel,false,action(loadplace,Holiday Inn,duluth/hi/hotel),showtext('The Holiday Inn'), shi(duluth/hi), hhi());
plugin[map].addstylespot(h8,46.719417,-92.218466,0,hotel,false,action(loadplace,Mountain Villas,duluth/mountainvillas),showtext('Mountain Villas'), shi(duluth/mountainvillas), hhi());
set(hotelcount, 7);
plugin[map].updatespots(); 
</action>

<action name="remdulhotel">
plugin[map].removespot(h1); plugin[map].removespot(h2); plugin[map].removespot(h3); plugin[map].removespot(h4); 
plugin[map].removespot(h5); plugin[map].removespot(h6); plugin[map].removespot(h7); plugin[map].removespot(h8);
plugin[map].updatespots(); 
</action>

2

Thursday, July 14th 2011, 8:23pm

Hi,

this code should work:

Source code

1
2
3
4
5
6
for(set(i,0), i LT plugin[map].spot.count, inc(i),
  if(plugin[map].spot[get(i)].style == hotel,
	plugin[map].removespot(get(plugin[map].spot[get(i)].name));
	dec(i);
  );
);


best regards,
Klaus

VN2011

Professional

  • "VN2011" started this thread

Posts: 1,336

Location: Duluth MN

  • Send private message

3

Thursday, July 14th 2011, 8:52pm

works perfectly thank you!

4

Friday, November 23rd 2012, 9:07am

sorry, for digging out this old thread again.

the code for removing the spots like postet above works like a charme.

but how do i bring the "hotel" spots back again? simply chaning "removespot" to "addspot" doesn't seem to work here - so i guess there's something missing *confused*

can anyone help me with the right code here?

5

Saturday, February 16th 2013, 11:17am

Ya,
I want to know too to add map spot with defined style

because using : addstylespot(name, lat, lng, heading, style, active, onclick, onhover, onover, onout) not works as expected

Source code

1
2
3
4
5
6
for(set(i,0), i LT plugin[map].spot.count, inc(i),
  if(plugin[map].spot[get(i)].style == hotel,
	plugin[map].addstylespot(get(plugin[map].spot[get(i)].name),,,,,,,,);
	
  );
);


i tried also to set up all attributes , but without success :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	for(set(i,0), i LT plugin[maps].spot.count, inc(i),
	  if(plugin[maps].spot[get(i)].style == hotel,
		
		plugin[map].addstylespot(
get(plugin[map].spot[get(i)].name),
get(plugin[map].spot[get(i)].lat),
get(plugin[map].spot[get(i)].lng),
get(plugin[map].spot[get(i)].heading),
get(plugin[map].spot[get(i)].style),
get(plugin[map].spot[get(i)].active),
get(plugin[map].spot[get(i)].onclick),
get(plugin[map].spot[get(i)].onhover),
get(plugin[map].spot[get(i)].onover),
get(plugin[map].spot[get(i)].onout)

	  );
	);


so what's the trick ?

Thanks

Z *smile*

This post has been edited 2 times, last edit by "zadda" (Feb 20th 2013, 9:50pm)


Similar threads