Different ways to add Google Map in website

Published by Codonist

HTML

<div id="map"></div>

JavaScript

var map;
function initMap() {
    map = new 
    google.maps.Map(document.getElementById('map'), {
       center: {lat: -34.397, lng: 150.644},
       zoom: 8
    });
}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBEx***************ehtcTrkk0&callback=initMap"
        async defer></script>

 

Leave a Reply

Your email address will not be published. Required fields are marked *