Subversion Repositories eFlore/Applications.cel

Rev

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

Rev Author Line No. Line
424 jpm 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
	<head>
440 jpm 4
		<title>Observations publiques du CEL - Tela Botanica</title>
424 jpm 5
 
6
		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
440 jpm 7
		<meta http-equiv="Content-style-type" content="text/css" />
8
		<meta http-equiv="Content-script-type" content="text/javascript" />
9
		<meta http-equiv="Content-language" content="fr" />
10
 
11
		<meta name="revisit-after" content="15 days" />
12
        <meta name="robots" content="index,follow" />
13
        <meta name="author" content="Delphine CAUQUIL, Jean-Pascal MILCENT" />
14
        <meta name="keywords" content="Tela Botanica, cartographie, CEL" />
15
        <meta name="description" content="Widget de cartographie des observations publiques de plantes saisies dans le Carnet en Ligne (CEL)" />
16
 
17
		<!-- Spécial mobile -->
424 jpm 18
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
440 jpm 19
 
20
		<!-- Favicones -->
21
		<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" />
22
		<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.ico" />
424 jpm 23
 
440 jpm 24
		<!-- Javascript : bibliothèques -->
469 jpm 25
		<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.2&amp;sensor=false"></script>
427 jpm 26
		<script type="text/javascript" src="<?=$url_base?>modules/carto/squelettes/markerclusterer_compiled.js"></script>
469 jpm 27
		<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/<?=$jquery_version?>/jquery-<?=$jquery_version?>.min.js"></script>
28
		<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
424 jpm 29
 
440 jpm 30
		<!-- Javascript : données -->
424 jpm 31
		<script src="<?=$url_json?>" type="text/javascript"></script>
440 jpm 32
 
33
		<!-- Javascript : appli carto -->
424 jpm 34
		<script type="text/javascript">
35
		//<![CDATA[
36
			var markerClusterer = null;
37
			var map = null;
469 jpm 38
			var infoBulle = new google.maps.InfoWindow();
479 jpm 39
			google.maps.event.addListener(infoBulle, 'domready', function() {
40
				if ($("#observations table").get() != 'undefined') {
41
					$("#observations table").tablesorter();
42
				}
43
			});
439 jpm 44
			var pointImageUrl = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png';
424 jpm 45
			var carteCentre = new google.maps.LatLng(46.4, 3.10);
46
			var carteOptions = {
47
				zoom: 6,
48
				center: carteCentre,
49
				mapTypeId: google.maps.MapTypeId.ROADMAP
50
			};
463 delphine 51
			var ctaLayer = null;
469 jpm 52
 
424 jpm 53
			function refreshMap() {
54
				if (markerClusterer) {
55
					markerClusterer.clearMarkers();
56
				}
57
 
439 jpm 58
				var points = [];
59
				var pointImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(24, 32));
424 jpm 60
				for (var i = 0; i < obs.nombre; ++i) {
439 jpm 61
					var maLatLng = new google.maps.LatLng(obs.points[i].coord_x, obs.points[i].coord_y);
62
					var point = new google.maps.Marker({
63
						position: maLatLng,
435 jpm 64
						map: map,
439 jpm 65
						icon: pointImage,
469 jpm 66
						stationId: obs.points[i].id
424 jpm 67
					});
435 jpm 68
 
439 jpm 69
					google.maps.event.addListener(point, 'click', function() {
469 jpm 70
						afficherMsgChargement();
439 jpm 71
						infoBulle.open(map, this);
479 jpm 72
						chargerFormatObs(this.stationId, '*');
435 jpm 73
					});
74
 
439 jpm 75
					points.push(point);
424 jpm 76
				}
77
 
439 jpm 78
				markerClusterer = new MarkerClusterer(map, points);
469 jpm 79
			}
463 delphine 80
 
469 jpm 81
			function afficherMsgChargement() {
82
				var chargement = document.getElementById('chargement').cloneNode(true);
83
				chargement.setAttribute('id', 'chargement-copie');
84
				infoBulle.setContent(chargement);
85
			}
463 delphine 86
 
469 jpm 87
			function chargerFormatObs(stationId, format) {
479 jpm 88
				var url = '<?=$url_base?>carto?carte=observations&utilisateur=<?=$utilisateur?>&format='+format+'&station='+stationId;
469 jpm 89
				$.get(url, function(observations){
90
					infoBulle.setContent(observations);
91
				});
424 jpm 92
			}
93
 
469 jpm 94
			function arreter(event) {
95
				if (event.stopPropagation) {
96
					event.stopPropagation();
97
				}
98
				return false;
99
			}
100
 
435 jpm 101
			function afficher() {
102
				document.getElementById('panneau-lateral').style.display = 'block';
103
				document.getElementById('pl-corps').innerHTML = 'Afficher';
104
				document.getElementById('pl-ouverture').style.display = 'none';
105
				google.maps.event.trigger(map, 'resize');
106
			};
469 jpm 107
 
435 jpm 108
			function cacher() {
109
				document.getElementById('panneau-lateral').style.display = 'none';
110
				document.getElementById('pl-corps').innerHTML = 'Cacher';
111
				document.getElementById('pl-ouverture').style.display = 'block';
112
				google.maps.event.trigger(map, 'resize');
113
			};
114
 
424 jpm 115
			function initialize() {
116
				map = new google.maps.Map(document.getElementById('carte'), carteOptions);
463 delphine 117
 
118
				// Ajout des limites communales sur la carte
465 delphine 119
				<? if (isset($url_limites_communales)) : ?>
120
					<? foreach ($url_limites_communales as $url) : ?>
121
						ctaLayer = new google.maps.KmlLayer('<?=$url?>');
122
						ctaLayer.setMap(map);
123
					<? endforeach; ?>
124
				<? endif; ?>
435 jpm 125
 
126
				// Create the DIV to hold the control and call the HomeControl()
127
				// constructor passing in this DIV.
128
				var panneauDiv = document.getElementById('panneau-lateral');
129
				panneauDiv.index = 0;
130
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(panneauDiv);
131
 
132
				var ouverturePanneauDiv = document.getElementById('pl-ouverture');
133
				ouverturePanneauDiv.index = 0;
134
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(ouverturePanneauDiv);
135
 
136
				var ouvertureDiv = document.getElementById('pl-ouverture');
137
				google.maps.event.addDomListener(ouvertureDiv, 'click', afficher);
138
 
139
				var fermetureDiv = document.getElementById('pl-fermeture');
140
				google.maps.event.addDomListener(fermetureDiv, 'click', cacher);
141
 
142
				cacher();
424 jpm 143
				refreshMap();
144
			}
145
		//]]>
146
		</script>
440 jpm 147
 
148
		<!-- CSS -->
479 jpm 149
		<link href="<?=$url_base?>modules/carto/squelettes/css/carto.css" rel="stylesheet" type="text/css" media="screen" />
424 jpm 150
	</head>
151
 
152
	<body onload="initialize()">
435 jpm 153
		<div id="panneau-lateral">
154
			<div id="pl-entete">
155
				<div id="pl-ouverture">Panneau >></div>
156
				<div id="pl-fermeture"><< Fermer [x]</div>
157
			</div>
158
			<div id="pl-corps"></div>
159
		</div>
424 jpm 160
		<div id="carte"></div>
469 jpm 161
 
162
		<!-- Blocs chargés à la demande : par défaut avec un style display à none -->
163
		<div id="chargement">
164
			<img src="<?=$url_base?>modules/carto/squelettes/images/chargement.gif" alt="Chargement en cours..." />
165
			<p>Chargement des observations en cours...</p>
166
		</div>
424 jpm 167
	</body>
168
</html>