53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?php
|
|
// création @Gilux 2019 pour ZwiiCMS
|
|
$lat = $_GET['lat'];
|
|
$lon = $_GET['lon'];
|
|
$altitude = $_GET['alt'];
|
|
if ($altitude > 0) { $alt = $altitude; }
|
|
else {
|
|
$alt = "'indéterminée ou 0'";
|
|
}
|
|
$zoom = $_GET['zoom'];
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Mapop</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<link rel="stylesheet" href="leaflet/leaflet.css">
|
|
<script src="leaflet/leaflet.js"></script>
|
|
<style>
|
|
html, body{
|
|
width: 100vw;
|
|
height: 100%;
|
|
}
|
|
body {
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
#mapid {
|
|
width: 100%;
|
|
height: 95vh;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="mapid"> </div>
|
|
<script>
|
|
var mymap = L.map('mapid').setView([<?=$lat?>, <?=$lon?>], <?=$zoom?>);
|
|
L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
|
|
maxZoom: 17,
|
|
attribution: 'map data: © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors, ' +
|
|
'<a href="http://viewfinderpanoramas.org">SRTM</a> | ' +
|
|
'map style: © <a href="https://opentopomap.org">OpenTopoMap</a> ' +
|
|
'(<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
|
|
}).addTo(mymap);
|
|
var marker = L.marker([<?=$lat?>, <?=$lon?>]).addTo(mymap)
|
|
.bindPopup('altitude = '+ <?=$alt?> +' m')
|
|
.openPopup();
|
|
</script>
|
|
</body>
|
|
</html>
|