[GIS] Google Maps API: How to remove terrain from the satellite view

google mapsgoogle-maps-api

(I asked this in SO General – but then thought it might be better here – sorry for the cross-post!)

Using the API, is it possible to turn off the 3D terrain in the Google Maps satellite view? I'd like to get the imagery without it being warped by the 3D surface.

Best Answer

You can set up a basic map using the Google Maps Javascript API like this:

(just dump it in a file named example.html and save it, then double click it)

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script>

var map;
function initMap() {
  map = new google.maps.Map(document.getElementById('map'), {
    center: {lat: -34.397, lng: 150.644},
    zoom: 8,
    mapTypeId: google.maps.MapTypeId.SATELLITE
  });
}

    </script>
    <script src="https://maps.googleapis.com/maps/api/js?callback=initMap"
        async defer></script>
  </body>
</html>

Obviously, you can change the starting zoom and center by changing the options in the initMap function.

You can pan and zoom to your desired start view and load up your web-browser's console (on Chrome type Ctrl + Shift + J) and run the command 'map.getCenter()' and 'map.getZoom()' and use these values.

Google maps in Chrome console