title: Google Maps Terrain View By Default
body: <p>I'm trying to figure out how to make my google maps embed default to the "Terrain View" and disable other options like Satellite view and Street View. Can anyone point me in the right direction? Here's my code...</p>
  
  <p>Here's how it currently renders: <a href="http://img842.imageshack.us/img842/7299/screenshot20111220at125.png" rel="nofollow">http://img842.imageshack.us/img842/7299/screenshot20111220at125.png</a></p>
  
  <pre><code>var map;
  var middle_earth_MORADOR = new google.maps.LatLng(38, 0);
  
      function initialize() {
  
          // Define Styles
          var styles = [ 
              {
                  //featureType: "all", elementType: "all", stylers: [ { visibility: "on" }, { hue: "#e5f5fb" } ]
              }
          ];
  
  
          // Default map options
          var mapOptions = {
              zoom: 2,
              center: middle_earth_MORADOR,
              backgroundColor: "#000"
          };
  
          var locations = [
              &lt;?php foreach ($Projects as $Project) {             
  
                  $oProjectPhotos = new clsProjectPhotos($Project['idProject']);
                  $photos = $oProjectPhotos-&gt;getProjectPhotos();
                  echo '["'.$Project["Name"].'", '.$Project["gmapslat"].', '.$Project["gmapslng"].', "'.$Project["CountryName"].'"],';
                  echo "\n";
                  echo "\t\t";
              }
              ?&gt;  
          ];
  
  
          map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
          var styledMapOptions = {
              map: map,
              name: "map"
          }
          var build =  new google.maps.StyledMapType(styles,styledMapOptions);
          map.mapTypes.set('map', build);
          map.setMapTypeId('map');
  
          var infowindow = new google.maps.InfoWindow();
  
          var marker, i;
  
          for (i = 0; i &lt; locations.length; i++) {  
            marker = new google.maps.Marker({
              position: new google.maps.LatLng(locations[i][1], locations[i][2]),
              map: map
            });
  
            google.maps.event.addListener(marker, 'mouseover', (function(marker, i) {
              return function() {
                infowindow.setContent(
                  '&lt;div&gt;' + locations[i][0] + '&lt;/div&gt;'+
                  '&lt;div&gt;' + locations[i][4] + '&lt;/div&gt;'+
                  '&lt;div&gt;' + locations[i][5] + '&lt;/div&gt;'+
                  '&lt;div&gt;' + locations[i][6] + '&lt;/div&gt;'
                );
                infowindow.open(map, marker);
              }
  
            })(marker, i));
          }
  
      }
  </code></pre>