KwangKung
KwangKung

Reputation: 169

How can I hide map types bar?

How can I hide map types bar on Google Maps?

(hide Ter, and Earth on menu bar)

I create code from http://maps.google.com

Upvotes: 0

Views: 4640

Answers (3)

defau1t
defau1t

Reputation: 10619

Basically you need to set the property mapTypeControl to false like this:

mapTypeControl: true,

here is a live example of a page that offers customization with respect to look and feel.

Upvotes: 0

duncan
duncan

Reputation: 31912

Vahagn's answer will completely hide the bar. But it's not clear from your question if this is what you want to do, or if you only want to hide just the options for Terrain and Earth. If the latter, you could try:

function initialize() {
  var myOptions = {
    zoom: 4,
    center: new google.maps.LatLng(-33, 151),
    mapTypeControlOptions: {
            mapTypeIds: [
                google.maps.MapTypeId.ROADMAP, 
                google.maps.MapTypeId.SATELLITE 
            ]
    },
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"),
       myOptions);
}

Upvotes: 0

Cyberon
Cyberon

Reputation: 289

I suggest you to look at this:

http://code.google.com/apis/maps/documentation/javascript/controls.html

Short:

mapTypeControl: false 

this will hide map types bar.

or here is init function:

function initialize() {
  var myOptions = {
    zoom: 4,
    center: new google.maps.LatLng(-33, 151),
    mapTypeControl: false,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"),
       myOptions);
}

Upvotes: 3

Related Questions