Skip to content

Instantly share code, notes, and snippets.

@inuvalogic
Created August 27, 2020 18:57
Show Gist options
  • Save inuvalogic/6a65e30c0097775e8b3e02fc68530601 to your computer and use it in GitHub Desktop.
Save inuvalogic/6a65e30c0097775e8b3e02fc68530601 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gmap Test</title>
<style>
#map {
width: 600px;
height: 300px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
let map;
let office = { lat: -6.9432431, lng: 107.6662958 };
let address = 'Jalan Taman Merkuri Timur VI No. 15';
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 16,
center: office,
zoomControl: false,
streetViewControl: false,
scrollwheel: false,
fullscreen: false,
});
var marker = new google.maps.Marker({
position: office,
map: map,
title: 'testing'
});
// klo ga salah ini bayar
// var geocoder = new google.maps.Geocoder();
// geocoder.geocode({'address': address}, function(results, status) {
// if (status === 'OK') {
// map.setCenter(results[0].geometry.location);
// var marker = new google.maps.Marker({
// map: map,
// position: results[0].geometry.location
// });
// } else {
// alert('Geocode was not successful for the following reason: ' + status);
// }
// });
}
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=API_KEYS&callback=initMap&libraries=&v=weekly"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment