Skip to content

Instantly share code, notes, and snippets.

@anjalbinayak
Created September 26, 2020 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anjalbinayak/39896186d4dabe436721c7532f6ae85c to your computer and use it in GitHub Desktop.
Save anjalbinayak/39896186d4dabe436721c7532f6ae85c to your computer and use it in GitHub Desktop.
This gist just serves as a part of a code in medium article
<!DOCTYPE html>
<html>
<head>
<title>Simple Map Embed</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<script
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap&libraries=&v=weekly"
defer
></script>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script src="./simple-map-embed.js"></script>
</head>
<body>
<div id="map"></div>
</body>
</html>
let map;
function initMap() {
map = new google.maps.Map(document.getElementById("map"), {
center: { lat: -34.397, lng: 150.644 },
zoom: 8,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment