Google Maps API — Place A Marker On The Map

Raja Tamil
Aug 2, 2021

The first step is to instantiate the Google Maps map object where you want to place a marker onto.

var map = new google.maps.Map(document.getElementById("map"), {
zoom: 13
center: new google.maps.LatLng(45.424721, -75.695000),
mapTypeId: google.maps.MapTypeId.ROADMAP
});

In this example, the map is centered based on latitude and longitude values of a random place in Ottawa, Canada.

--

--

Raja Tamil

👇click the link and get 80% OFF on the premium web development courses (HTML5, CSS3, JavaScript ES6, Vue JS 3 & Firebase 10 https://softauthor.com