| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/konzalta/gikuyu.online/incidents/ |
Upload File : |
<!DOCTYPE html>
<html>
<head>
<title>Google Maps</title>
<style>
#map {
height: 400px;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
// Create a map object and specify the DOM element for display
var map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 0, lng: 0},
zoom: 2
});
// Retrieve GPS coordinates from PHP script
fetch('get_coordinates.php')
.then(response => response.json())
.then(data => {
// Loop through coordinates and add markers to the map
data.forEach(coord => {
var marker = new google.maps.Marker({
position: {lat: parseFloat(coord.latitude), lng: parseFloat(coord.longitude)},
map: map
});
});
})
.catch(error => console.error('Error:', error));
}
</script>
<script async
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBYHXHuzyyQgLKU7NXczF1XLPaxeDmLJ3o&loading=async&callback=initMap">
</script>
<!--script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBYHXHuzyyQgLKU7NXczF1XLPaxeDmLJ3o&callback=initMap" async defer></script-->
</body>
</html>