Login
Your Email
Pasword
Home
Write
Trending
History
Liked
Earning

How to display HTML Google Maps?

Google Maps allows to display maps on web page.

Do you have similar website/ Product?
Show in this page just for only $2 (for a month)
Create an Ad
0/60
0/180

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">

CONTINUE READING
Google Map
HTML Graphics
Ayesha
Tech writer at newsandstory