1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
<!DOCTYPE html>
<html>
<head>
<META http-equiv="Cache-Control" content="no-cache">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Expires" content="0">
<meta charset="utf-8">
<title>Ground Overlays</title>
<style>
html, body, #maCarte {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
var historicalOverlay;
function initialize() {
var France = new google.maps.LatLng(48,-0.7);
var imageBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(45.4389,-14.9515),
new google.maps.LatLng(59.9934,20.4106));
var mapOptions = {
'Zoom': 6,
'minZoom' : 4,
'maxZoom' :11,
center: France
};
var map = new google.maps.Map(document.getElementById('maCarte'),
mapOptions);
historicalOverlay = new google.maps.GroundOverlay('http://www.xxxxxx.fr/COPY/toto.gif?<?php echo time(); ?>',
imageBounds);
historicalOverlay.setMap(map);
/////////////////////////////////////////////////////////////////////// Loribac ///////////////////////////////////////////////////////////////////////
<?php
$fp = fopen("http://www.xxxxxxx.fr/format/zzz.txt", "r");
$coord=fread($fp,2000);fclose($fp);
$tab = split("x",$coord);
// On identifie les valeurs intéressantes
$cor1 = $tab[2];
$cor2 = $tab[3];
$stamp= $tab[4];
$stamp = substr("$stamp", 0,10); // ici le timestamp
$time=time();
$diff = ($time- $stamp)/60/60;
$hours = '0.30';
if ($hours > $diff)
{
$color=("red");
}
else
{
$color=("black");
}
?>
// création d'une infobulle et affichage
var oInfo = new google.maps.InfoWindow({
'content' : '<small><small><a href="http://www.ddddddd.fr/format/fffff.php/"><FONT COLOR="<?php echo"$color";?>" ><span style="font-weight: bold;">Moxxxxxorm</span></FONT></a></small></small>', // contenu qui sera affiché
'map' : maCarte, // carte sur laquelle est affichée l'InfoWindow
'position' : new google.maps.LatLng(<?php echo "$cor1,$cor2";?>) // position d'affichage de l'InfoWindow
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="maCarte"></div>
</body>
</html> |
Partager