Add amap
by HcJanni
HTML
<!DOCTYPE html>
<html>
<head>
<title>Add Map</title>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBIwzALxUPNbatRBj3Xi1Uhp0fFzwWNBkE&callback=initMap&libraries=&v=weekly"
defer
></script>
<!-- jsFiddle will insert css and js -->
</head>
<body>
<h3>My Google Maps Demo</h3>
<!--The div element for the map -->
<div id="map"></div>
</body>
</html>
CSS
/* Set the size of the div element that contains the map */
#map {
height: 400px;
/* The height is 400 pixels */
width: 100%;
/* The width is the width of the web page */
}
JavaScript
// Initialize and add the map
function initMap() {
// The location of Uluru
const vreden = { lat: -25.344, lng: 131.036 };
// The map, centered at Uluru
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 4,
center: vreden,
});
// The marker, positioned at Uluru
const marker = new google.maps.Marker({
position: vreden,
map: map,
});
}