Viewing file: x.php (1.39 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
// Tek lokasyon bilgisi
$location = [
"name" => "Liam Dumster",
"address" => "111 8th Avenue, New York, NY 10011",
"latitude" => "40.7411",
"longitude" => "-74.0039"
];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tek Harita</title>
<style>
#map {
height: 500px;
width: 100%;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>
<script>
function initMap() {
var location = {
lat: parseFloat("<?php echo $location['latitude']; ?>"),
lng: parseFloat("<?php echo $location['longitude']; ?>")
};
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 14,
center: location
});
var marker = new google.maps.Marker({
position: location,
map: map,
title: "<?php echo $location['name']; ?>"
});
var info = new google.maps.InfoWindow({
content: "<b><?php echo $location['name']; ?></b><br><?php echo $location['address']; ?>"
});
marker.addListener("click", function() {
info.open(map, marker);
});
}
</script>
</head>
<body onload="initMap()">
<h2>Şube Konumu</h2>
<div id="map"></div>
</body>
</html>
|