Google Maps | Types

To customize the Google map, there are four types of maps provide.

  • ROADMAP: This type of map shows the street view of the specific area. It is the default type map.
  • SATELLITE: This type of map shows the satellite images of the specific area.
  • HYBRID: This type of map shows the major streets of the specific area.
  • TERRAIN: This type of map shows the terrain and vegetation.

Syntax:

var CustomOp= {
   mapTypeId:google.maps.MapTypeId.ROADMAP | SATELLITE | HYBRID | TERRAIN
};

Example 1: ROADMAP

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        Google Maps | Types
    </title>
  
    <!-- Add Google map API source -->
    <script src
    </script>
         
    <script>
        function GFG() {
            var CustomOp = {
                center:new google.maps.LatLng(
                        28.502212, 77.405603), 
                zoom:17, 
                mapTypeId:google.maps.MapTypeId.ROADMAP
            };
               
            // Map object
            var map = new google.maps.Map(
                document.getElementById("DivID"),
                CustomOp
            );
        }
    </script>
</head>
  
<!-- Function that execute when page load -->
<body onload = "GFG()">
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
          
        <h3>Google Maps</h3>
          
        <!-- Basic Container -->
        <div id = "DivID" style
            "width:400px; height:300px;">
        </div>
    </center>
</body>
      
</html>

chevron_right


Output:

Example 2: SATELLITE



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        Google Maps | Types
    </title>
  
    <!-- Add Google map API source -->
    <script src
    </script>
         
    <script>
        function GFG() {
            var CustomOp = {
                center:new google.maps.LatLng(
                        28.502212, 77.405603), 
                zoom:17, 
                mapTypeId:google.maps.MapTypeId.SATELLITE
            };
               
            // Map object
            var map = new google.maps.Map(
                document.getElementById("DivID"),
                CustomOp
            );
        }
    </script>
</head>
  
<!-- Function that execute when page load -->
<body onload = "GFG()">
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
          
        <h3>Google Maps</h3>
          
        <!-- Basic Container -->
        <div id = "DivID" style
            "width:400px; height:300px;">
        </div>
    </center>
</body>
      
</html>

chevron_right


Output:

Example 3: HYBRID

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        Google Maps | Types
    </title>
  
    <!-- Add Google map API source -->
    <script src
    </script>
         
    <script>
        function GFG() {
            var CustomOp = {
                center:new google.maps.LatLng(
                        28.502212, 77.405603), 
                zoom:17, 
                mapTypeId:google.maps.MapTypeId.HYBRID
            };
               
            // Map object
            var map = new google.maps.Map(
                document.getElementById("DivID"),
                CustomOp
            );
        }
    </script>
</head>
  
<!-- Function that execute when page load -->
<body onload = "GFG()">
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
          
        <h3>Google Maps</h3>
          
        <!-- Basic Container -->
        <div id = "DivID" style
            "width:400px; height:300px;">
        </div>
    </center>
</body>
      
</html>

chevron_right


Output:

Example 4: TERRAIN

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        Google Maps | Types
    </title>
  
    <!-- Add Google map API source -->
    <script src
    </script>
         
    <script>
        function GFG() {
            var CustomOp = {
                center:new google.maps.LatLng(
                        28.502212, 77.405603), 
                zoom:17, 
                mapTypeId:google.maps.MapTypeId.TERRAIN
            };
               
            // Map object
            var map = new google.maps.Map(
                document.getElementById("DivID"),
                CustomOp
            );
        }
    </script>
</head>
  
<!-- Function that execute when page load -->
<body onload = "GFG()">
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
          
        <h3>Google Maps</h3>
          
        <!-- Basic Container -->
        <div id = "DivID" style
            "width:400px; height:300px;">
        </div>
    </center>
</body>
      
</html>

chevron_right


Output:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.