var myOptions = {
zoom: 2,
center: **Your LatLng object**,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID]
}, // here´s the array of controls
disableDefaultUI: true, // a way to quickly hide all controls
mapTypeControl: true,
scaleControl: true,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); // displays in <article id="map_canvas"></article>
//map.mapTypeControl = false; // OPTIONAL: hides the map control
Configuración MapTypeControl a falso se desvanece definitivamente el control, pero ¿cómo puedo personalizarlo para que MapTypeControl sólo contiene botones SATÉLITE y el terreno? –
Eso es lo que debe hacer mapTypeControlOptions. Tiene una matriz donde puede especificar que SATELLITE y TERRAIN son las opciones que el usuario debería ver. –
No sé si es una cosa v3, pero si alguien desea ocultar completamente este control, establecer 'mapTypeControl' en' false' no funciona. En cambio, lo que funcionó para mí (en v3) fue establecer: 'mapTypeControlOptions: {mapTypeIds: []}' – OrPo