Skip to content
Related Articles

Related Articles

How to add Google map inside html page without using API key ?
  • Last Updated : 16 Apr, 2020

There are two ways to add google maps inside HTML page:

  1. Using API key
  2. Without using API key

To learn first case you can follow the article while to learn other one follow this article.

To insert google map inside the HTML page, follow the steps:

  1. Go to the google maps and search your desired location.

  2. Now, you will see share option, click on it.



  3. Now, a dialog box will appear go to embed a map option.

  4. A new option will be seen inside the dialog box to copy html. And you can also select the size of the map you want to embed inside your page.

  5. Now paste it inside your html page.

Example: How to add Google Map inside HTML page without using API key.




<!DOCTYPE html>
<html>
  
<head>
    <meta charset="utf-8">
    <title>Customize the scroll-bar</title>
  
    <style media="screen">
        body {
            background-image: linear-gradient(
                to right, dodgerblue, darkblue);
        }
    </style>
</head>
  
<body>
    <center>
        <h1 style="color:lawngreen;">
            Geeks For Geeks
        </h1>
          
        <div>
            <!-- Google Map Copied Code -->
            <iframe src=
"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3506.2233913121413!2d77.4051603706222!3d28.50292593193056!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x390ce626851f7009%3A0x621185133cfd1ad1!2sGeeksforGeeks!5e0!3m2!1sen!2sin!4v1585040658255!5m2!1sen!2sin"
                    width="400"
                    height="300"
                    frameborder="0"
                    style="border:0;"
                    allowfullscreen=""
                    aria-hidden="false"
                    tabindex="0">
            </iframe>
        </div>
    </center>
</body>
  
</html>

Output:

Note: The issue of this technique is it doesn’t use API so map is not auto updated, so each time you have to manually update the map by changing the HTML code of map.

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :