views:

1200

answers:

4

Google Maps just made the API exactly like the real thing. So now I want the map to display the hybrid map by default, I looked all over Google's Documentation, but I can't seem to find a way to do this.

Thanks in advance!

+3  A: 

Did you try the constructor?

map = new GMap2(document.getElementById("map_canvas"), { mapTypes:[G_HYBRID_MAP] });
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
Crescent Fresh
This does work, but it will make the hybrid map the only option.
Chris B
@Chris: no it won't.
Crescent Fresh
Ah I see... using the mapTypes option like that would normally make the hybrid map the only option, but setUIToDefault overrides it.
Chris B
A: 

setMapType() allows you to change the map type. You call it immediately after creating the google map object.

Salman A
A: 

To make hybrid the default map, try this:

map = new GMap2(document.getElementById("map_canvas"));
map.setUIToDefault();
map.setMapType(G_HYBRID_MAP);

Here's the documentation.

Chris B
+1  A: 

you can also pass the map-type with

map.setCenter(point, zoom, G_HYBRID_MAP);