How to make a default hybrid map in the Google Maps API?

Google Maps just did the API just like the real thing. So now I want the map to display the hybrid map by default, I have looked through all the Google Documentation , but I cannot find a way to do this.

Thanks in advance!

+3
source share
4 answers

Have you tried the constructor?

map = new GMap2(document.getElementById("map_canvas"), { mapTypes:[G_HYBRID_MAP] });
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
+5
source

you can also pass card type with

map.setCenter(point, zoom, G_HYBRID_MAP);
+3
source

V3 API :

map.setOptions({
      mapTypeId: google.maps.MapTypeId.HYBRID
});
+3

, :

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

Here's the documentation .

+1
source

Source: https://habr.com/ru/post/1706630/


All Articles