Subversion Repositories eFlore/Applications.cel

Rev

Rev 507 | Rev 518 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 507 Rev 515
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
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">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
	<head>
3
	<head>
4
		<title>Observations publiques du CEL - Tela Botanica</title>
4
		<title>Observations publiques du CEL - Tela Botanica</title>
5
		
5
		
6
		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
6
		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
7
		<meta http-equiv="Content-style-type" content="text/css" />
7
		<meta http-equiv="Content-style-type" content="text/css" />
8
		<meta http-equiv="Content-script-type" content="text/javascript" />
8
		<meta http-equiv="Content-script-type" content="text/javascript" />
9
		<meta http-equiv="Content-language" content="fr" />
9
		<meta http-equiv="Content-language" content="fr" />
10
		
10
		
11
		<meta name="revisit-after" content="15 days" />
11
		<meta name="revisit-after" content="15 days" />
12
        <meta name="robots" content="index,follow" />
12
        <meta name="robots" content="index,follow" />
13
        <meta name="author" content="Delphine CAUQUIL, Jean-Pascal MILCENT" />
13
        <meta name="author" content="Delphine CAUQUIL, Jean-Pascal MILCENT" />
14
        <meta name="keywords" content="Tela Botanica, cartographie, CEL" />
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)" />
15
        <meta name="description" content="Widget de cartographie des observations publiques de plantes saisies dans le Carnet en Ligne (CEL)" />
16
 
16
 
17
		<!-- Spécial mobile -->
17
		<!-- Spécial mobile -->
18
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
18
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
19
						
19
						
20
		<!-- Favicones -->
20
		<!-- Favicones -->
21
		<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" />
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" />
22
		<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.ico" />
23
		
23
		
24
		<!-- Javascript : bibliothèques -->
24
		<!-- Javascript : bibliothèques -->
25
		<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.2&amp;sensor=false"></script>
25
		<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.2&amp;sensor=false"></script>
26
		<script type="text/javascript" src="<?=$url_base?>modules/carto/squelettes/markerclusterer_compiled.js"></script>
26
		<script type="text/javascript" src="<?=$url_base?>modules/carto/squelettes/markerclusterer_compiled.js"></script>
27
		<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/<?=$jquery_version?>/jquery-<?=$jquery_version?>.min.js"></script>
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>
28
		<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
29
		
29
		
30
		<!-- Javascript : données -->
30
		<!-- Javascript : données -->
31
		<script src="<?=$url_json?>" type="text/javascript"></script>
31
		<script src="<?=$url_json?>" type="text/javascript"></script>
32
		
32
		
33
		<!-- Javascript : appli carto -->
33
		<!-- Javascript : appli carto -->
34
		<script type="text/javascript">
34
		<script type="text/javascript">
35
		//<![CDATA[
35
		//<![CDATA[
36
			var pointImageUrl = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png';
36
			var pointImageUrl = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png';
37
			var pointsOrigine = null;
37
			var pointsOrigine = null;
38
			var boundsOrigine = null;
38
			var boundsOrigine = null;
39
			var markerClusterer = null;
39
			var markerClusterer = null;
40
			var map = null;
40
			var map = null;
41
			var nt = '<?=$num_taxon?>';
41
			var nt = '<?=$num_taxon?>';
42
			var infoBulle = new google.maps.InfoWindow();
42
			var infoBulle = new google.maps.InfoWindow();
43
			google.maps.event.addListener(infoBulle, 'domready', function() {
43
			google.maps.event.addListener(infoBulle, 'domready', function() {
44
				if ($("#observations table").get() != 'undefined') {
44
				if ($("#observations table").get() != 'undefined') {
45
					$("#observations table").tablesorter();
45
					$("#observations table").tablesorter();
46
				}
46
				}
47
			});
47
			});
48
			var carteCentre = new google.maps.LatLng(46.4, 3.10);
48
			var carteCentre = new google.maps.LatLng(46.4, 3.10);
49
			var carteOptions = {
49
			var carteOptions = {
50
				zoom: 6,
50
				zoom: 6,
51
				mapTypeId: google.maps.MapTypeId.ROADMAP
51
				mapTypeId: google.maps.MapTypeId.ROADMAP,
-
 
52
				mapTypeControlOptions: {
-
 
53
			        style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}
52
			};
54
			};
53
			var ctaLayer = null;
55
			var ctaLayer = null;
54
			
56
			
55
			function refreshMap() {
57
			function refreshMap() {
56
				var points = [];
58
				var points = [];
57
				var bounds = new google.maps.LatLngBounds();
59
				var bounds = new google.maps.LatLngBounds();
58
				for (var i = 0; i < obs.nombre; ++i) {
60
				for (var i = 0; i < obs.nombre; ++i) {
59
					var maLatLng = new google.maps.LatLng(obs.points[i].coord_x, obs.points[i].coord_y);
61
					var maLatLng = new google.maps.LatLng(obs.points[i].coord_x, obs.points[i].coord_y);
60
					var pointImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(24, 32));
62
					var pointImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(24, 32));
61
					var point = new google.maps.Marker({
63
					var point = new google.maps.Marker({
62
						position: maLatLng,
64
						position: maLatLng,
63
						map: map,
65
						map: map,
64
						icon: pointImage,
66
						icon: pointImage,
65
						stationId: obs.points[i].id
67
						stationId: obs.points[i].id
66
					});
68
					});
67
 
69
 
68
					bounds.extend(maLatLng);
70
					bounds.extend(maLatLng);
69
					
71
					
70
					google.maps.event.addListener(point, 'click', function() {
72
					google.maps.event.addListener(point, 'click', function() {
71
						afficherMsgChargement();
73
						afficherMsgChargement();
72
						infoBulle.open(map, this);
74
						infoBulle.open(map, this);
73
						chargerFormatObs(this.stationId, '*');
75
						chargerFormatObs(this.stationId, '*');
74
					});
76
					});
75
					
77
					
76
					points.push(point);
78
					points.push(point);
77
				}
79
				}
78
 
80
 
79
				if (pointsOrigine == null && boundsOrigine == null) {
81
				if (pointsOrigine == null && boundsOrigine == null) {
80
					pointsOrigine = points;
82
					pointsOrigine = points;
81
					boundsOrigine = bounds;
83
					boundsOrigine = bounds;
82
				}
84
				}
83
				
85
				
84
				executerMarkerClusterer(points, bounds);
86
				executerMarkerClusterer(points, bounds);
85
			}
87
			}
86
 
88
 
87
			function executerMarkerClusterer(points, bounds) {
89
			function executerMarkerClusterer(points, bounds) {
88
				if (markerClusterer) {
90
				if (markerClusterer) {
89
					markerClusterer.clearMarkers();
91
					markerClusterer.clearMarkers();
90
				}
92
				}
91
				markerClusterer = new MarkerClusterer(map, points);
93
				markerClusterer = new MarkerClusterer(map, points);
92
				map.fitBounds(bounds);
94
				map.fitBounds(bounds);
93
			}
95
			}
94
 
96
 
95
			function afficherMsgChargement() {
97
			function afficherMsgChargement() {
96
				var chargement = document.getElementById('chargement').cloneNode(true);
98
				var chargement = document.getElementById('chargement').cloneNode(true);
97
				chargement.setAttribute('id', 'chargement-copie');
99
				chargement.setAttribute('id', 'chargement-copie');
98
				infoBulle.setContent(chargement);
100
				infoBulle.setContent(chargement);
99
			}
101
			}
100
 
102
 
101
			function chargerFormatObs(stationId, format) {
103
			function chargerFormatObs(stationId, format) {
102
				var url = '<?=$url_base?>carto?carte=observations'+
104
				var url = '<?=$url_base?>carto?carte=observations'+
103
					'&utilisateur=<?=$utilisateur?>'+
105
					'&utilisateur=<?=$utilisateur?>'+
104
					'&projet=<?=$projet?>'+
106
					'&projet=<?=$projet?>'+
105
					'&num_taxon='+nt+
107
					'&num_taxon='+nt+
106
					'&dept=<?=$dept?>'+
108
					'&dept=<?=$dept?>'+
107
					'&format='+format+'&station='+stationId;
109
					'&format='+format+'&station='+stationId;
108
				$.get(url, function(observations){
110
				$.get(url, function(observations){
109
					infoBulle.setContent(observations);
111
					infoBulle.setContent(observations);
110
				});
112
				});
111
			}
113
			}
112
 
114
 
113
			function arreter(event) {
115
			function arreter(event) {
114
				if (event.stopPropagation) {
116
				if (event.stopPropagation) {
115
					event.stopPropagation();
117
					event.stopPropagation();
116
				}
118
				}
117
				return false;
119
				return false;
118
			}
120
			}
119
			
121
			
120
			function afficher() {
122
			function afficher() {
121
				document.getElementById('panneau-lateral').style.display = 'block';
123
				document.getElementById('panneau-lateral').style.display = 'block';
122
				document.getElementById('pl-ouverture').style.display = 'none';
124
				document.getElementById('pl-ouverture').style.display = 'none';
123
				google.maps.event.trigger(map, 'resize');
125
				google.maps.event.trigger(map, 'resize');
124
			};
126
			};
125
			
127
			
126
			function cacher() {
128
			function cacher() {
127
				document.getElementById('panneau-lateral').style.display = 'none';
129
				document.getElementById('panneau-lateral').style.display = 'none';
128
				document.getElementById('pl-ouverture').style.display = 'block';
130
				document.getElementById('pl-ouverture').style.display = 'block';
129
				google.maps.event.trigger(map, 'resize');
131
				google.maps.event.trigger(map, 'resize');
130
			};
132
			};
131
 
133
 
132
			function ouvrirPopUp(url, nom) {
134
			function ouvrirPopUp(url, nom) {
133
				window.open(url, nom, 'directories=no, location=no, menubar=no, scrollbars=yes, status=no, toolbar=no, width=650,height=600');
135
				window.open(url, nom, 'directories=no, location=no, menubar=no, scrollbars=yes, status=no, toolbar=no, width=650,height=600');
134
			};
136
			};
135
			
137
			
136
			function filtrerParTaxon(ntAFiltrer) {
138
			function filtrerParTaxon(ntAFiltrer) {
137
				infoBulle.close();
139
				infoBulle.close();
138
				$('#taxon-'+nt).removeClass('taxon-actif');
140
				$('#taxon-'+nt).removeClass('taxon-actif');
139
				if (nt == ntAFiltrer) {
141
				if (nt == ntAFiltrer) {
140
					nt = '*';
142
					nt = '*';
141
					executerMarkerClusterer(pointsOrigine, boundsOrigine);
143
					executerMarkerClusterer(pointsOrigine, boundsOrigine);
142
				} else {
144
				} else {
143
					var url = '<?=$url_cel_carto?>/carte-defaut-json/<?=$utilisateur?>/<?=$projet?>/<?=$dept?>/'+ntAFiltrer+'?formatRetour=jsonp&callback=?';
145
					var url = '<?=$url_cel_carto?>/carte-defaut-json/<?=$utilisateur?>/<?=$projet?>/<?=$dept?>/'+ntAFiltrer+'?formatRetour=jsonp&callback=?';
144
					$.getJSON(url, function (observations) {
146
					$.getJSON(url, function (observations) {
145
						obs = observations;
147
						obs = observations;
146
						nt = ntAFiltrer;
148
						nt = ntAFiltrer;
147
						$('#taxon-'+nt).addClass('taxon-actif');
149
						$('#taxon-'+nt).addClass('taxon-actif');
148
						refreshMap();
150
						refreshMap();
149
					});
151
					});
150
				}
152
				}
151
			};
153
			};
152
			
154
			
153
			function initialize() {
155
			function initialize() {
154
				map = new google.maps.Map(document.getElementById('carte'), carteOptions);
156
				map = new google.maps.Map(document.getElementById('carte'), carteOptions);
155
 
157
 
156
				// Ajout des limites communales sur la carte
158
				// Ajout des limites communales sur la carte
157
				<? if (isset($url_limites_communales)) : ?>
159
				<? if (isset($url_limites_communales)) : ?>
158
					<? foreach ($url_limites_communales as $url) : ?>
160
					<? foreach ($url_limites_communales as $url) : ?>
159
						ctaLayer = new google.maps.KmlLayer('<?=$url?>');
161
						ctaLayer = new google.maps.KmlLayer('<?=$url?>');
160
						ctaLayer.setMap(map);
162
						ctaLayer.setMap(map);
161
					<? endforeach; ?>
163
					<? endforeach; ?>
162
				<? endif; ?>
164
				<? endif; ?>
163
				
165
				
164
				// Create the DIV to hold the control and call the HomeControl()
166
				// Create the DIV to hold the control and call the HomeControl()
165
				// constructor passing in this DIV.
167
				// constructor passing in this DIV.
166
				
168
				
167
				var panneauDiv = document.getElementById('panneau-lateral');
169
				var panneauDiv = document.getElementById('panneau-lateral');
168
				panneauDiv.index = 0;
170
				panneauDiv.index = 0;
169
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(panneauDiv);
171
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(panneauDiv);
170
 
172
 
171
				var ouverturePanneauDiv = document.getElementById('pl-ouverture');
173
				var ouverturePanneauDiv = document.getElementById('pl-ouverture');
172
				ouverturePanneauDiv.index = 0;
174
				ouverturePanneauDiv.index = 0;
173
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(ouverturePanneauDiv);
175
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(ouverturePanneauDiv);
174
 
176
 
175
				
177
				
176
				var ouvertureDiv = document.getElementById('pl-ouverture');
178
				var ouvertureDiv = document.getElementById('pl-ouverture');
177
				google.maps.event.addDomListener(ouvertureDiv, 'click', afficher);
179
				google.maps.event.addDomListener(ouvertureDiv, 'click', afficher);
178
 
180
 
179
				var fermetureDiv = document.getElementById('pl-fermeture');
181
				var fermetureDiv = document.getElementById('pl-fermeture');
180
				google.maps.event.addDomListener(fermetureDiv, 'click', cacher);
182
				google.maps.event.addDomListener(fermetureDiv, 'click', cacher);
181
				
183
				
182
				cacher();
184
				cacher();
183
				refreshMap();
185
				refreshMap();
184
			}
186
			}
185
		//]]>
187
		//]]>
186
		</script>
188
		</script>
187
		
189
		
188
		<!-- CSS -->
190
		<!-- CSS -->
189
		<link href="<?=$url_base?>modules/carto/squelettes/css/carto.css" rel="stylesheet" type="text/css" media="screen" />
191
		<link href="<?=$url_base?>modules/carto/squelettes/css/carto.css" rel="stylesheet" type="text/css" media="screen" />
190
	</head>
192
	</head>
191
 
193
 
192
	<body onload="initialize()">
194
	<body onload="initialize()">
193
		<div id="zone-titre">
195
		<div id="zone-titre">
194
			<h1 id="carte-titre">
196
			<h1 id="carte-titre">
195
				Observations issues des membres de <a href="http://www.tela-botanica.org/" onclick="window.open(this.href); arreter(event); return false;">Tela Botanica</a>
197
				Observations issues des membres de <a href="http://www.tela-botanica.org/" onclick="window.open(this.href); arreter(event); return false;">Tela Botanica</a>
196
			</h1>
198
			</h1>
197
			<div id="zone-info">
199
			<div id="zone-info">
198
				<a href="<?=$url_base?>carto?carte=avertissement" onClick="ouvrirPopUp('<?=$url_base?>carto?carte=avertissement', 'Avertissement'); arreter(event); return false;">
200
				<a href="<?=$url_base?>carto?carte=avertissement" onClick="ouvrirPopUp('<?=$url_base?>carto?carte=avertissement', 'Avertissement'); arreter(event); return false;">
199
					<img src="<?=$url_base?>modules/carto/squelettes/images/information.png" 
201
					<img src="<?=$url_base?>modules/carto/squelettes/images/information.png" 
200
						alt="Avertissements" title="Avertissements &amp; informations" />
202
						alt="Avertissements" title="Avertissements &amp; informations" />
201
				</a>
203
				</a>
202
			</div>
204
			</div>
203
		</div>
205
		</div>
204
		<div id="panneau-lateral">
206
		<div id="panneau-lateral">
205
			<div id="pl-ouverture" title="Ouvrir le panneau latéral"><span>Panneau >></span></div>
207
			<div id="pl-ouverture" title="Ouvrir le panneau latéral"><span>Panneau >></span></div>
206
			<div id="pl-fermeture" title="Fermer le panneau latéral"><span><< Fermer [x]</span></div>
208
			<div id="pl-fermeture" title="Fermer le panneau latéral"><span><< Fermer [x]</span></div>
207
			<div id="pl-entete">
209
			<div id="pl-entete">
208
				<h2>Filtre par plante</h2>	
210
				<h2>Filtre par plante</h2>	
209
				<p>
211
				<p>
210
					Cliquez sur un nom de plante pour filtrer les observations sur la carte.<br /> 
212
					Cliquez sur un nom de plante pour filtrer les observations sur la carte.<br /> 
211
					Pour revenir à l'état initial, cliquez à nouveau sur le nom sélectionné.
213
					Pour revenir à l'état initial, cliquez à nouveau sur le nom sélectionné.
212
				</p>
214
				</p>
213
			</div>
215
			</div>
214
			<div id="pl-corps" onMouseOver="map.setOptions({'scrollwheel':false});" onMouseOut="map.setOptions({'scrollwheel':true});">
216
			<div id="pl-corps" onMouseOver="map.setOptions({'scrollwheel':false});" onMouseOut="map.setOptions({'scrollwheel':true});">
215
				<ol id="taxons">
217
				<ol id="taxons">
216
				<? foreach ($taxons as $taxon) : ?>
218
				<? foreach ($taxons as $taxon) : ?>
217
					<li id="taxon-<?=$taxon['nt']?>">
219
					<li id="taxon-<?=$taxon['nt']?>">
218
						<a href="#" onclick="filtrerParTaxon(<?=$taxon['nt']?>);" title="<?=$taxon['famille']?>">
220
						<a href="#" onclick="filtrerParTaxon(<?=$taxon['nt']?>);" title="<?=$taxon['famille']?>">
219
							<?=$taxon['nom']?> 
221
							<?=$taxon['nom']?> 
220
						</a>
222
						</a>
221
					</li>
223
					</li>
222
				<? endforeach; ?>
224
				<? endforeach; ?>
223
				</ol>
225
				</ol>
224
			</div>
226
			</div>
225
		</div>
227
		</div>
226
		<div id="carte"></div>
228
		<div id="carte"></div>
227
		
229
		
228
		<!-- Blocs chargés à la demande : par défaut avec un style display à none -->
230
		<!-- Blocs chargés à la demande : par défaut avec un style display à none -->
229
		<div id="chargement">
231
		<div id="chargement">
230
			<img src="<?=$url_base?>modules/carto/squelettes/images/chargement.gif" alt="Chargement en cours..." />
232
			<img src="<?=$url_base?>modules/carto/squelettes/images/chargement.gif" alt="Chargement en cours..." />
231
			<p>Chargement des observations en cours...</p>
233
			<p>Chargement des observations en cours...</p>
232
		</div>
234
		</div>
233
	</body>
235
	</body>
234
</html>
236
</html>