There are two ways to add google maps inside HTML page:
- Using API key
- 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:
- Go to the google maps and search your desired location.
- Now, you will see share option, click on it.
- Now, a dialog box will appear go to embed a map option.
- 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.
- 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.
Recommended Posts:
- How to add custom google search bar inside your web-page?
- How to add API function to a simple PHP Page ?
- How to redirect a page to another page in HTML ?
- How to display search result of another page on same page using ajax in JSP?
- How to add Google map and Marker to your Application using AngularJS ?
- CSS | page-break-inside Property
- How to show Page Loading div until the page has finished loading?
- How to pass form variables from one page to other page in PHP ?
- How to create an area inside an image-map using HTML5 ?
- JavaScript | Check if a key exists inside a JSON object
- How to make a key fire when key is pressed using JavaScript ?
- Index inside map() Function
- How to modify URL without reloading the page using JavaScript ?
- How to reload CSS without reloading the page using JavaScript ?
- Difference between REST API and SOAP API
- How to add tooltip to HTML table cell without using JavaScript ?
- Add the slug field inside Django Model
- How to Add Dynamic Options for Multiple Selects Inside ng-repeat Directive ?
- How to add innerHTML to print page?
- How to add a PHP page to WordPress?
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.


