Subversion Repositories eFlore/Applications.cel

Rev

Rev 833 | Rev 1352 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 833 Rev 1348
Line 1... Line 1...
1
//+---------------------------------------------------------------------------------------------------------+
1
//+---------------------------------------------------------------------------------------------------------+
2
// GÉNÉRAL
2
// GÉNÉRAL
3
// Mettre à true pour afficher les messages de débogage
-
 
4
var DEBUG = false; 
-
 
5
// URL du web service réalisant l'insertion des données dans la base du CEL.
-
 
6
var URL_SERVICE_CEL = "http://www.tela-botanica.org/service:cel:CelWidgetSaisie";
-
 
7
// Squelette d'URL du web service d'eFlore fournissant les noms de communes.
-
 
8
var URL_SERVICE_NOM_COMMUNE = "http://www.tela-botanica.org/service:eflore:osm/0.1/nom-commune?lon={lon}&lat={lat}";
-
 
9
/**
3
/**
10
 * Stope l'évènement courrant quand on clique sur un lien.
4
 * Stope l'évènement courrant quand on clique sur un lien.
11
 * Utile pour Chrome, Safari...
5
 * Utile pour Chrome, Safari...
12
 * @param evenement
6
 * @param evenement
13
 * @return
7
 * @return
Line 157... Line 151...
157
			utilisateur.courriel = $("#courriel").val();
151
			utilisateur.courriel = $("#courriel").val();
158
			observations['utilisateur'] = utilisateur;
152
			observations['utilisateur'] = utilisateur;
Line 159... Line 153...
159
			
153
			
160
			var erreurMsg = "";
154
			var erreurMsg = "";
161
			$.ajax({
155
			$.ajax({
162
				url : URL_SERVICE_CEL,
156
				url : SERVICE_SAISIE_URL,
163
				type : "POST",
157
				type : "POST",
164
				data : observations,
158
				data : observations,
165
				dataType : "json",
159
				dataType : "json",
166
				beforeSend : function() {
160
				beforeSend : function() {
Line 344... Line 338...
344
	}
338
	}
345
}
339
}
Line 346... Line 340...
346
 
340
 
347
function trouverCommune(pos) {
341
function trouverCommune(pos) {
348
	$(function() {
342
	$(function() {
349
		var urlNomCommuneFormatee = URL_SERVICE_NOM_COMMUNE.replace('{lat}', pos.lat()).replace('{lon}', pos.lng());
343
		var urlNomCommuneFormatee = SERVICE_NOM_COMMUNE_URL.replace('{lat}', pos.lat()).replace('{lon}', pos.lng());
350
		$.ajax({
344
		$.ajax({
351
			url : urlNomCommuneFormatee,
345
			url : urlNomCommuneFormatee,
352
			type : "GET",
346
			type : "GET",
353
			dataType : "json",
347
			dataType : "json",