[GIS] How to remove the terrain checkbox from Google Maps

google-maps-apijavascript

I don't mind having the map/satellite options, but I don't need the terrain option for my map. How do I disable just that? I don't see it documented well on

https://developers.google.com/maps/documentation/javascript/controls

Best Answer

Your map object should contain MapTypeControlOptions and MapTypeIds, where you can control what options to show, for example the code below suppresses the terrain:

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 5,
    center: {lat: 40, lng: 30},
    mapTypeControl: true,
    mapTypeControlOptions: {      
      mapTypeIds: [
        google.maps.MapTypeId.ROADMAP,
        google.maps.MapTypeId.SATELLITE
      ]
    }
  });
}