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.

  • "FlashinnaPano" started this thread

Posts: 29

Location: Orygun, USA

  • Send private message

1

Monday, February 1st 2010, 4:52am

Map Type Selection

Hello,

Well, my license is not quite one day old, so time to start with a couple newbie questions....

It seems that the only way to choose the different Google map types is with a separate button for each type. I would like to make the most of the limited space available in my Google map and use a drop-down menu to select the map type as you can in the Google Maps API with GMenuMapTypeControl. Is this possible?

One map type that I would find really useful is from MyTopo, which is a seamless topographic map coverage for the US and Canada. The last post in this thread has some technical details. I suspect that I would need the plugin source code to implement this extra map type?

Cheers,

Joe

2

Monday, February 1st 2010, 8:53pm

Hi,
It seems that the only way to choose the different Google map types is with a separate button for each type. I would like to make the most of the limited space available in my Google map and use a drop-down menu to select the map type as you can in the Google Maps API with GMenuMapTypeControl. Is this possible?
it is possible to change the map type interactively via the setmaptype() action of the plugin,
see here:
http://krpano.com/plugins/googlemaps/#setmaptype

so it would be also possible to use the combobox plugin and call there this action,
e.g. call:

Source code

1
plugin[maps].setmaptype(SATELLITE);


One map type that I would find really useful is from MyTopo, which is a seamless topographic map coverage for the US and Canada. The last post in this thread has some technical details. I suspect that I would need the plugin source code to implement this extra map type?
yes, for adding a custom map you would need the plugin source code at the moment, but you would also need AS3 coding knowledge,
and one important note - don't mix-up the Javascript and the Flash Google Map API (they are different)

best regards,
Klaus

  • "FlashinnaPano" started this thread

Posts: 29

Location: Orygun, USA

  • Send private message

3

Monday, February 1st 2010, 11:28pm

Hello Klaus,

Thanks for the info
it is possible to change the map type interactively via the setmaptype() action of the plugin,
see here:
http://krpano.com/plugins/googlemaps/#setmaptype
so it would be also possible to use the combobox plugin and call there this action,
OK, I see. The imagerain example looks like a good starting point.

I was hoping it might be possible to avoid this extra complexity and directly use the drop-down control from the Maps API. Perhaps doing something as simple as this for example:

Source code

1
<maptypecontrol  visible="true" anchor="topright" x="15" y="5" buttonalign="m" />
where you could use something like buttonalign="m" to get Google's drop-down menu.

Wishfully,
Joe

  • "FlashinnaPano" started this thread

Posts: 29

Location: Orygun, USA

  • Send private message

4

Tuesday, February 2nd 2010, 6:10am

Hello,

For the general benefit, here's a combobox-based solution to my question:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	<!-- combobox to select Gmap types. Positioned offscreen -->
	<plugin name="combobox" 
	    url="%SWFPATH%/plugins/combobox.swf" 
 	    origin="leftbottom" edge="center"
 	    x="-100" y="-100"
	    width="75" 
	    onloaded="selectitem(Satellite);"
	   />
	
	<action name="combobox:Map">
	    plugin[map].setmaptype(NORMAL);
	</action>
	
	<action name="combobox:Satellite">
	    plugin[map].setmaptype(SATELLITE);
	</action>
	
	<action name="combobox:Hybrid">
	    plugin[map].setmaptype(HYBRID);
	</action>
	
	<action name="combobox:Terrain">
	    plugin[map].setmaptype(PHYSICAL);
	</action>

Note that the combobox is located offscreen (along with my Google Map). I use an action to bring everything into view when needed.

My biggest problem was figuring out where to put selectitem(Satellite); in my xml. I first tried to use

onloaded="plugin[combobox].selectitem(Satellite);"

in the map plugin, which didn't work. It took me a while to realize the obvious solution.

Cheers,
Joe

This post has been edited 1 times, last edit by "FlashinnaPano" (Feb 2nd 2010, 8:18am)