Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 465 Rev 469
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&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>
-
 
28
		<!-- <script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/jsquery-ui/<?=$jquery-ui_version?>/js/jquery-ui-<?=$jquery-ui_version?>.custom.min.js"></script> -->
-
 
29
		<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
27
		
30
		
28
		<!-- Javascript : données -->
31
		<!-- Javascript : données -->
29
		<script src="<?=$url_json?>" type="text/javascript"></script>
32
		<script src="<?=$url_json?>" type="text/javascript"></script>
30
		
33
		
31
		<!-- Javascript : appli carto -->
34
		<!-- Javascript : appli carto -->
32
		<script type="text/javascript">
35
		<script type="text/javascript">
33
		//<![CDATA[
36
		//<![CDATA[
34
			var markerClusterer = null;
37
			var markerClusterer = null;
35
			var map = null;
38
			var map = null;
-
 
39
			var infoBulle = new google.maps.InfoWindow();
36
			var pointImageUrl = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png';
40
			var pointImageUrl = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png';
37
			var carteCentre = new google.maps.LatLng(46.4, 3.10);
41
			var carteCentre = new google.maps.LatLng(46.4, 3.10);
38
			var carteOptions = {
42
			var carteOptions = {
39
				zoom: 6,
43
				zoom: 6,
40
				center: carteCentre,
44
				center: carteCentre,
41
				mapTypeId: google.maps.MapTypeId.ROADMAP
45
				mapTypeId: google.maps.MapTypeId.ROADMAP
42
			};
46
			};
43
			var ctaLayer = null;
47
			var ctaLayer = null;
44
			
48
 
45
			function refreshMap() {
49
			function refreshMap() {
46
				if (markerClusterer) {
50
				if (markerClusterer) {
47
					markerClusterer.clearMarkers();
51
					markerClusterer.clearMarkers();
48
				}
52
				}
49
 
53
 
50
				var points = [];
54
				var points = [];
51
				var pointImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(24, 32));
55
				var pointImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(24, 32));
52
				var infoBulle = new google.maps.InfoWindow();
-
 
53
				for (var i = 0; i < obs.nombre; ++i) {
56
				for (var i = 0; i < obs.nombre; ++i) {
54
					var maLatLng = new google.maps.LatLng(obs.points[i].coord_x, obs.points[i].coord_y);
57
					var maLatLng = new google.maps.LatLng(obs.points[i].coord_x, obs.points[i].coord_y);
55
					var point = new google.maps.Marker({
58
					var point = new google.maps.Marker({
56
						position: maLatLng,
59
						position: maLatLng,
57
						map: map,
60
						map: map,
58
						icon: pointImage,
61
						icon: pointImage,
59
						title: 'test'
62
						stationId: obs.points[i].id
60
					});
63
					});
61
 
64
 
62
					google.maps.event.addListener(point, 'click', function() {
65
					google.maps.event.addListener(point, 'click', function() {
63
						var contenu = this.getPosition().toString();
-
 
64
						infoBulle.setContent(contenu);
66
						afficherMsgChargement();
65
						infoBulle.open(map, this);
67
						infoBulle.open(map, this);
-
 
68
 
-
 
69
						var station = this.stationId;
-
 
70
						var urlObs = 'http://localhost/cel-widget/carto?carte=observations&station='+station;
-
 
71
						
-
 
72
						$.get(urlObs, function(observations){
-
 
73
							infoBulle.setContent(observations);
-
 
74
						 });
66
					});
75
					});
67
					
76
					
68
					points.push(point);
77
					points.push(point);
69
				}
78
				}
70
 
79
 
71
				markerClusterer = new MarkerClusterer(map, points);
80
				markerClusterer = new MarkerClusterer(map, points);
72
 
-
 
73
 
-
 
74
				
-
 
75
			}
81
			}
-
 
82
 
-
 
83
			function afficherMsgChargement() {
-
 
84
				var chargement = document.getElementById('chargement').cloneNode(true);
-
 
85
				chargement.setAttribute('id', 'chargement-copie');
-
 
86
				infoBulle.setContent(chargement);
-
 
87
			}
-
 
88
 
-
 
89
			function chargerFormatObs(stationId, format) {
-
 
90
				var url = 'http://localhost/cel-widget/carto?carte=observations&format='+format+'&station='+stationId;
-
 
91
				$.get(url, function(observations){
-
 
92
					infoBulle.setContent(observations);
-
 
93
				});
-
 
94
			}
-
 
95
 
-
 
96
			function arreter(event) {
-
 
97
				if (event.stopPropagation) {
-
 
98
					event.stopPropagation();
-
 
99
				}
-
 
100
				return false;
-
 
101
			}
76
 
102
			
77
			function afficher() {
103
			function afficher() {
78
				document.getElementById('panneau-lateral').style.display = 'block';
104
				document.getElementById('panneau-lateral').style.display = 'block';
79
				document.getElementById('pl-corps').innerHTML = 'Afficher';
105
				document.getElementById('pl-corps').innerHTML = 'Afficher';
80
				document.getElementById('pl-ouverture').style.display = 'none';
106
				document.getElementById('pl-ouverture').style.display = 'none';
81
				google.maps.event.trigger(map, 'resize');
107
				google.maps.event.trigger(map, 'resize');
82
			};
108
			};
-
 
109
			
83
			function cacher() {
110
			function cacher() {
84
				document.getElementById('panneau-lateral').style.display = 'none';
111
				document.getElementById('panneau-lateral').style.display = 'none';
85
				document.getElementById('pl-corps').innerHTML = 'Cacher';
112
				document.getElementById('pl-corps').innerHTML = 'Cacher';
86
				document.getElementById('pl-ouverture').style.display = 'block';
113
				document.getElementById('pl-ouverture').style.display = 'block';
87
				google.maps.event.trigger(map, 'resize');
114
				google.maps.event.trigger(map, 'resize');
88
			};
115
			};
89
			
116
			
90
			function initialize() {
117
			function initialize() {
91
				map = new google.maps.Map(document.getElementById('carte'), carteOptions);
118
				map = new google.maps.Map(document.getElementById('carte'), carteOptions);
92
 
119
 
93
				// Ajout des limites communales sur la carte
120
				// Ajout des limites communales sur la carte
94
				<? if (isset($url_limites_communales)) : ?>
121
				<? if (isset($url_limites_communales)) : ?>
95
					<? foreach ($url_limites_communales as $url) : ?>
122
					<? foreach ($url_limites_communales as $url) : ?>
96
						ctaLayer = new google.maps.KmlLayer('<?=$url?>');
123
						ctaLayer = new google.maps.KmlLayer('<?=$url?>');
97
						ctaLayer.setMap(map);
124
						ctaLayer.setMap(map);
98
					<? endforeach; ?>
125
					<? endforeach; ?>
99
				<? endif; ?>
126
				<? endif; ?>
100
				
127
				
101
				// Create the DIV to hold the control and call the HomeControl()
128
				// Create the DIV to hold the control and call the HomeControl()
102
				// constructor passing in this DIV.
129
				// constructor passing in this DIV.
103
				var panneauDiv = document.getElementById('panneau-lateral');
130
				var panneauDiv = document.getElementById('panneau-lateral');
104
				panneauDiv.index = 0;
131
				panneauDiv.index = 0;
105
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(panneauDiv);
132
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(panneauDiv);
106
 
133
 
107
				var ouverturePanneauDiv = document.getElementById('pl-ouverture');
134
				var ouverturePanneauDiv = document.getElementById('pl-ouverture');
108
				ouverturePanneauDiv.index = 0;
135
				ouverturePanneauDiv.index = 0;
109
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(ouverturePanneauDiv);
136
				map.controls[google.maps.ControlPosition.TOP_LEFT].push(ouverturePanneauDiv);
110
 
137
 
111
				var ouvertureDiv = document.getElementById('pl-ouverture');
138
				var ouvertureDiv = document.getElementById('pl-ouverture');
112
				google.maps.event.addDomListener(ouvertureDiv, 'click', afficher);
139
				google.maps.event.addDomListener(ouvertureDiv, 'click', afficher);
113
 
140
 
114
				var fermetureDiv = document.getElementById('pl-fermeture');
141
				var fermetureDiv = document.getElementById('pl-fermeture');
115
				google.maps.event.addDomListener(fermetureDiv, 'click', cacher);
142
				google.maps.event.addDomListener(fermetureDiv, 'click', cacher);
116
				
143
				
117
				cacher();
144
				cacher();
118
				refreshMap();
145
				refreshMap();
119
			}
146
			}
120
		//]]>
147
		//]]>
121
		</script>
148
		</script>
122
		
149
		
123
		<!-- CSS -->
150
		<!-- CSS -->
124
		<style type="text/css">
151
		<style type="text/css">
125
			html, body {
152
			html, body {
126
				margin:0;
153
				margin:0;
127
				padding:0;
154
				padding:0;
128
				height: 100%;
155
				height: 100%;
129
				font-family:Arial;
156
				font-family:Arial;
130
				font-size:12px;
157
				font-size:12px;
131
			}
158
			}
132
			#carte {
159
			#carte {
133
				width:100%;
160
				width:100%;
134
				height:100%;
161
				height:100%;
135
			}
162
			}
136
			.bouton {
163
			.bouton {
137
				background-color:white;
164
				background-color:white;
138
				border:2px solid black;
165
				border:2px solid black;
139
				cursoir:pointer;
166
				cursor:pointer;
140
				text-align:center;
167
				text-align:center;
141
			}
168
			}
-
 
169
			#chargement {
-
 
170
				display:none;
-
 
171
			}
-
 
172
			#chargement-copie img{
-
 
173
				display:block;
-
 
174
				margin:auto;
-
 
175
			}
142
			#panneau-lateral {
176
			#panneau-lateral {
143
				width:300px;
177
				width:300px;
144
				height:100%;
178
				height:100%;
145
				padding:0;
179
				padding:0;
146
				display:none;
180
				display:none;
147
				background-color:white;
181
				background-color:white;
148
				border-right:1px solid grey;
182
				border-right:1px solid grey;
149
				box-shadow:2px 2px 6px #979797;-webkit-box-shadow:2px 2px 6px #979797;-moz-box-shadow:2px 2px 6px #979797;
183
				box-shadow:2px 2px 6px #979797;-webkit-box-shadow:2px 2px 6px #979797;-moz-box-shadow:2px 2px 6px #979797;
150
			}
184
			}
151
			#pl-entete {
185
			#pl-entete {
152
				text-align:right;
186
				text-align:right;
153
			}
187
			}
154
			#pl-corps {
188
			#pl-corps {
155
				height:86%;
189
				height:86%;
156
				overflow:auto;
190
				overflow:auto;
157
				padding:5px;
191
				padding:5px;
158
			}
192
			}
159
			#pl-ouverture, #pl-fermeture {
193
			#pl-ouverture, #pl-fermeture {
160
				position:relative;
194
				position:relative;
161
				top:0;
195
				top:0;
162
				width:95px;
196
				width:95px;
163
				background-color:#FFF;
197
				background-color:#FFF;
164
				text-align:center;
198
				text-align:center;
165
				border:1px solid black;
199
				border:1px solid black;
166
				cursor:pointer;
200
				cursor:pointer;
167
			}
201
			}
168
			#pl-ouverture {
202
			#pl-ouverture {
169
				border-left:0;
203
				border-left:0;
170
			}
204
			}
171
			#pl-fermeture {
205
			#pl-fermeture {
172
				border-right:0;
206
				border-right:0;
173
				float:right;
207
				float:right;
174
			}
208
			}
175
		</style>
209
		</style>
176
	</head>
210
	</head>
177
 
211
 
178
	<body onload="initialize()">
212
	<body onload="initialize()">
179
		<div id="panneau-lateral">
213
		<div id="panneau-lateral">
180
			<div id="pl-entete">
214
			<div id="pl-entete">
181
				<div id="pl-ouverture">Panneau >></div>
215
				<div id="pl-ouverture">Panneau >></div>
182
				<div id="pl-fermeture"><< Fermer [x]</div>
216
				<div id="pl-fermeture"><< Fermer [x]</div>
183
			</div>
217
			</div>
184
			<div id="pl-corps"></div>
218
			<div id="pl-corps"></div>
185
		</div>
219
		</div>
186
		<div id="carte"></div>
220
		<div id="carte"></div>
-
 
221
		
-
 
222
		<!-- Blocs chargés à la demande : par défaut avec un style display à none -->
-
 
223
		<div id="chargement">
-
 
224
			<img src="<?=$url_base?>modules/carto/squelettes/images/chargement.gif" alt="Chargement en cours..." />
-
 
225
			<p>Chargement des observations en cours...</p>
-
 
226
		</div>
187
	</body>
227
	</body>
188
</html>
228
</html>