Subversion Repositories Sites.obs-saisons.fr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 aurelien 1
<?
2
 
3
if(!@file_exists('car_config.inc.php') ) {
4
    @include_once 'car_config.inc.php' ;
5
} else {
6
   @include_once 'configuration/car_config.inc.php' ;
7
}
8
 
9
if (PARTICIPANT_EST_ADULTE) {
10
?>
11
 
12
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAnm2MSMmwsDuoh7THcVDnlBQH9AL26AfEfaraxwo1G6_adyVjPRRQE4Gx2u7MomK9DJWf9kMLJ9y-ZA"
13
      type="text/javascript"></script>
14
<?
15
}
16
else {
17
?>
18
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAFMANWib9GSm7T4W6AN9qzxRmHYqXwt_BUwczny2vFmnHz3sr3BTy_SMRJ-NzWXDUynHHSWQ7_aEZ6Q"
19
      type="text/javascript"></script>
20
 
21
<?
22
}
23
 
24
include("traitement.php");
25
?>
26
    <script type="text/javascript">
27
 
28
    //<![CDATA[
29
   var latFr = 47;
30
   var lonFr = 1.7;
31
 
32
   var latFrMin = 34;
33
   var latFrMax = 58;
34
   var lonFrMin = -12;
35
   var lonFrMax = 15;
36
 
37
    function load() {
38
      if (GBrowserIsCompatible()) {
39
        var map = new GMap2(document.getElementById("map"));
40
        map.setCenter(new GLatLng(latFr, lonFr), 6);
41
	map.addControl(new GSmallMapControl());
42
	map.addControl(new GMapTypeControl());
43
	map.setMapType(GMapType.G_SATELLITE_MAP);
44
	//map.addControl(new GSmallZoomControl());
45
//        window.setTimeout(function() {
46
	GEvent.addListener(map, "moveend", function() {
47
	  var bounds = map.getBounds();
48
  	  var southWest = bounds.getSouthWest();
49
	  var northEast = bounds.getNorthEast();
50
	  if (southWest.lng()<lonFrMin || southWest.lat()<latFrMin
51
		|| northEast.lng()>lonFrMax || northEast.lat()>latFrMax)
52
	    map.returnToSavedPosition();
53
	  else
54
	    map.savePosition();
55
	}, 20);
56
 
57
	// Creates a marker at the given point with the given number label
58
	function createMarker(point, text, licone) {
59
	  var marker = new GMarker(point,licone);
60
	  var html = "<b>" + text + "</b>";
61
	  GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml(html);});
62
	  return marker;
63
	}
64
	//On définit les puces
65
<?	for ($i=0; $i<=$nbPuces; $i++) { ?>
66
	  var icon<?= $i ?> = new GIcon();
67
	  icon<?= $i ?>.image = "modules/cartes/puces/<?= $i ?>.gif";
68
	  icon<?= $i ?>.shadow = "modules/cartes/puces/ombre.png";
69
	  icon<?= $i ?>.iconSize = new GSize(14,14);
70
	  icon<?= $i ?>.shadowSize = new GSize(20,20);
71
	  icon<?= $i ?>.iconAnchor = new GPoint (6,20);
72
	  icon<?= $i ?>.infoWindowAnchor = new GPoint(5,1);
73
<?	} ?>
74
	//On définit les puces phenoclim
75
<?      for ($i=0; $i<=$nbPuces; $i++) { ?>
76
          var icon_phenoclim<?= $i ?> = new GIcon();
77
          icon_phenoclim<?= $i ?>.image = "modules/cartes/puces/phenoclim/<?= $i ?>.gif";
78
          icon_phenoclim<?= $i ?>.shadow = "modules/cartes/puces/phenoclim/ombre.png";
79
          icon_phenoclim<?= $i ?>.iconSize = new GSize(14,14);
80
          icon_phenoclim<?= $i ?>.shadowSize = new GSize(20,20);
81
          icon_phenoclim<?= $i ?>.iconAnchor = new GPoint (6,20);
82
          icon_phenoclim<?= $i ?>.infoWindowAnchor = new GPoint(5,1);
83
<?      } ?>
84
        //on va poser les points des villes
85
<?
86
include ("modules/connect.php");
87
$req_communes = mysql_query("SELECT DISTINCT STATION_LATITUDE, STATION_LONGITUDE, STATION_ID FROM STATION");
88
while ($commune = mysql_fetch_row($req_communes)) {
89
  if (is_numeric($dates[$commune[2]])) {
90
?>
91
	  var point = new GLatLng(<?= $commune[0] ?>, <?= $commune[1] ?>);
92
	  map.addOverlay(createMarker(point, <?= "'".date('d/m/Y',$dates[$commune[2]])."'" ?>,
93
		icon<?= ($commune[3] ? "_phenoclim".$puces[$commune[2]] : $puces[$commune[2]]) ?>));
94
<? } } ?>
95
      }
96
    }
97
 
98
 
99
 
100
    //]]>
101
    </script>