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
|
<meta name="description" content="test" />
<meta name="keywords" content="test"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-store"/>
<meta name="resource-type" content="document"/>
<meta name="distribution" content="global"/>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw79QL_0aBSimRfjs_xGGoxR78JChdwdCCIjpkR5fuJMACslOeA" type="text/javascript">
</script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(53.6184, -3.0128), 5);
map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10, 10)));
map.addMapType(G_PHYSICAL_MAP);
map.addControl(new GLargeMapControl3D(), new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(2, 65)));
map.setMapType(G_HYBRID_MAP);
// ground overlay
var boundaries = new GLatLngBounds(new GLatLng(41.4389,-14.9515), new GLatLng(59.9934,20.4106));
var oldmap = new GGroundOverlay("http://www.xxxxxxxxx.fr/COPY/image.gif", boundaries);
map.addOverlay(oldmap);
/////////////////////////////////////////////////////////////////////// test ///////////////////////////////////////////////////////////////////////
<?php
$fp = fopen("http://www.xxxxxxx.fr/TEST/bloc.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 = '2';
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.xxxxxxx.fr/rr.php"><FONT COLOR="<?php echo"$color";?>" ><span style="font-weight: bold;">TEST</span></FONT></a></small></small>', // contenu qui sera affiché
'map' : map_canvas, // carte sur laquelle est affichée l'InfoWindow
'position' : new google.maps.LatLng(<?php echo "$cor1,$cor2";?>) // position d'affichage de l'InfoWindow
});
}
}
</script>
</head>
<body style="margin:0px;" onload="initialize();" onunload="GUnload()">
<div id="map_canvas" style="width: 530px; height: 530px"></div>
</body>
</html> |
Partager