Enter your email id to get regular update free
Login
Your Email
Pasword

How to display HTML Google Maps?

Google Maps allows to display maps on web page.

To demonstrate how to add a Google Map to a web page use basic HTML page.
<body>
<h1>First Google Map</h1>
<div id="map">google map</div>
</body>



Set  Size of Map
<div id="map" style="width:400px;height:400px">

Creating a Function to Set The Map Properties
function myMap()
{
 var mapOptions = {
center: new google.maps.LatLng(51.5, -0.12),
 zoom: 10,
 mapTypeId: google.maps.MapTypeId.HYBRID
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
}
mapOptions variable defines the properties for the map. 
center property specifies where to center the map.
zoom property specifies the zoom level for the map .
Add the Google Maps API
<script src="https://maps.googleapis.com/maps/api/js?callback=myMap">
Google Map
HTML Graphics
Ayesha
Tech writer at newsandstory
Total 68 views