-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maps done Co-Authored-By: litesh1123 <[email protected]> Co-Authored-By: Shivani <[email protected]>
- Loading branch information
1 parent
94cb263
commit 91f7e6f
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<title>Simple Map</title> | ||
|
||
<link rel="stylesheet" type="text/css" href="maps.css" /> | ||
<script async | ||
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&loading=async&callback=initMap" | ||
|
||
defer> | ||
</script> | ||
</head> | ||
<body> | ||
<div id="map"></div> | ||
|
||
<!-- prettier-ignore --> | ||
|
||
</body> | ||
<script type="module" src="maps.js"></script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Always set the map height explicitly to define the size of the div element | ||
* that contains the map. | ||
*/ | ||
#map { | ||
height: 100%; | ||
} | ||
|
||
/* | ||
* Optional: Makes the sample page fill the window. | ||
*/ | ||
html, | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let map; | ||
|
||
async function initMap() { | ||
const { Map } = await google.maps.importLibrary("maps"); | ||
|
||
map = new Map(document.getElementById("map"), { | ||
center: { lat: -34.397, lng: 150.644 }, | ||
zoom: 8, | ||
}); | ||
} | ||
|
||
initMap(); |