Member-only story
Google Maps Add Marker Using Maps Javascript API and HTML
Hi friends, in this tutorial, you will learn the example of Google Maps add marker using maps javascript API and HTML. As we all know a marker is usually a point of something but in this case marker identifies a particular location on the Google map and is also referred to as an icon. A marker is kind of an image of the standard size and object of the Marker constructor.
Nowadays, Google map plays an important role in building websites because everyone wants to track the live locations of their customers to acquire some valuable information about them and target those customers to grow their business.
Also read, Google places autocomplete example using maps JavaScript API
Properties of Google maps add marker using maps javascript API
In order to add a marker to the Google map, we have to pass some parameters in the Marker constructor by creating the marker object with the help of google. maps.Marker.
Below are the required parameters for the construction of the marker
marker.setMap(map);
HTML:-
<!DOCTYPE html>
<html>
<head> <title>Add Map</title>
<link rel="stylesheet" type="text/css">
<style type="text/css">
#map
{ height: 400px;
/* The height is 400 pixels */
width: 60%;
/* The width is the width of the web page */
}
</style>
</head>
<body>
<h3>Google Map Marker for Guwahati Zoo…