Subversion Repositories Sites.obs-saisons.fr

Rev

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

<?

if(!@file_exists('car_config.inc.php') ) {
    @include_once 'car_config.inc.php' ;
} else {
   @include_once 'configuration/car_config.inc.php' ;
}
 
if (PARTICIPANT_EST_ADULTE) {
?>

    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAnm2MSMmwsDuoh7THcVDnlBQH9AL26AfEfaraxwo1G6_adyVjPRRQE4Gx2u7MomK9DJWf9kMLJ9y-ZA"
      type="text/javascript"></script>
<?
} 
else {
?>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAFMANWib9GSm7T4W6AN9qzxRmHYqXwt_BUwczny2vFmnHz3sr3BTy_SMRJ-NzWXDUynHHSWQ7_aEZ6Q"
      type="text/javascript"></script>
        
<?
}

include("traitement.php");
?>
    <script type="text/javascript">

    //<![CDATA[
   var latFr = 47;
   var lonFr = 1.7;

   var latFrMin = 34;
   var latFrMax = 58;
   var lonFrMin = -12;
   var lonFrMax = 15;

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(latFr, lonFr), 6);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setMapType(GMapType.G_SATELLITE_MAP);
        //map.addControl(new GSmallZoomControl());
//        window.setTimeout(function() {
        GEvent.addListener(map, "moveend", function() {
          var bounds = map.getBounds();
          var southWest = bounds.getSouthWest();
          var northEast = bounds.getNorthEast();
          if (southWest.lng()<lonFrMin || southWest.lat()<latFrMin
                || northEast.lng()>lonFrMax || northEast.lat()>latFrMax) 
            map.returnToSavedPosition();
          else
            map.savePosition();
        }, 20);

        // Creates a marker at the given point with the given number label
        function createMarker(point, text, licone) {
          var marker = new GMarker(point,licone);
          var html = "<b>" + text + "</b>";
          GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml(html);});
          return marker;
        }
        //On définit les puces 
<?      for ($i=0; $i<=$nbPuces; $i++) { ?>
          var icon<?= $i ?> = new GIcon();
          icon<?= $i ?>.image = "modules/cartes/puces/<?= $i ?>.gif";
          icon<?= $i ?>.shadow = "modules/cartes/puces/ombre.png";
          icon<?= $i ?>.iconSize = new GSize(14,14);
          icon<?= $i ?>.shadowSize = new GSize(20,20);
          icon<?= $i ?>.iconAnchor = new GPoint (6,20);
          icon<?= $i ?>.infoWindowAnchor = new GPoint(5,1);
<?      } ?>
        //On définit les puces phenoclim
<?      for ($i=0; $i<=$nbPuces; $i++) { ?>
          var icon_phenoclim<?= $i ?> = new GIcon();
          icon_phenoclim<?= $i ?>.image = "modules/cartes/puces/phenoclim/<?= $i ?>.gif";
          icon_phenoclim<?= $i ?>.shadow = "modules/cartes/puces/phenoclim/ombre.png";
          icon_phenoclim<?= $i ?>.iconSize = new GSize(14,14);
          icon_phenoclim<?= $i ?>.shadowSize = new GSize(20,20);
          icon_phenoclim<?= $i ?>.iconAnchor = new GPoint (6,20);
          icon_phenoclim<?= $i ?>.infoWindowAnchor = new GPoint(5,1);
<?      } ?>
        //on va poser les points des villes
<? 
include ("modules/connect.php");
$req_communes = mysql_query("SELECT DISTINCT STATION_LATITUDE, STATION_LONGITUDE, STATION_ID FROM STATION");
while ($commune = mysql_fetch_row($req_communes)) {
  if (is_numeric($dates[$commune[2]])) {
?>
          var point = new GLatLng(<?= $commune[0] ?>, <?= $commune[1] ?>);
          map.addOverlay(createMarker(point, <?= "'".date('d/m/Y',$dates[$commune[2]])."'" ?>, 
                icon<?= ($commune[3] ? "_phenoclim".$puces[$commune[2]] : $puces[$commune[2]]) ?>));
<? } } ?>
      }
    }



    //]]>
    </script>