Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 719 Rev 744
Line 28... Line 28...
28
			courriel_confirmation : {
28
			courriel_confirmation : {
29
				required : true,
29
				required : true,
30
				equalTo: "#courriel"
30
				equalTo: "#courriel"
31
			},
31
			},
32
			milieu : "required",
32
			milieu : "required",
33
			latitude : "required",
33
			latitude : {
-
 
34
				required: true,
-
 
35
				range: [-90, 90]},
-
 
36
			longitude : {
-
 
37
				required: true,
-
 
38
				range: [-180, 180]},
-
 
39
			date : {
-
 
40
				required: true,
-
 
41
				date: true},
34
			longitude : "required"
42
			taxon : "required"
35
		}
43
		}
36
	});
44
	});
Line 37... Line 45...
37
	
45
	
Line 38... Line 46...
38
	$("#date").datepicker($.datepicker.regional['fr']);
46
	$("#date").datepicker($.datepicker.regional['fr']);
39
	
47
	
40
	$("#courriel-confirmation").bind('paste', function(e) {
48
	$("#courriel_confirmation").bind('paste', function(e) {
41
		$("#dialogue-bloquer-copier-coller").dialog();
49
		$("#dialogue-bloquer-copier-coller").dialog();
Line 42... Line 50...
42
		return false;
50
		return false;
Line 50... Line 58...
50
		    $("#gg-map").hide();
58
		    $("#gg-map").hide();
51
		},
59
		},
52
		'onStart'		: function(e) {
60
		'onStart'		: function(e) {
53
			arreter(e);
61
			arreter(e);
54
			$("#gg-map-localisation").height($(window).height() - 100);
62
			$("#gg-map-localisation").height($(window).height() - 100);
55
			$("#gg-map-carte").height($(window).height() - 230);
63
			$("#gg-map-carte").height($(window).height() - 200);
56
			$("#gg-map-localisation").width($(window).width() - 100);
64
			$("#gg-map-localisation").width($(window).width() - 100);
57
		},
65
		},
58
		'onComplete'	: function() {
66
		'onComplete'	: function() {
59
			initialiserCarte();
67
			initialiserCarte();
60
		}
68
		}
Line 256... Line 264...
256
			latLng: pos
264
			latLng: pos
257
		}, function(responses, status) {
265
		}, function(responses, status) {
258
			if (status == google.maps.GeocoderStatus.OK) {
266
			if (status == google.maps.GeocoderStatus.OK) {
259
				if (responses && responses.length > 0) {
267
				if (responses && responses.length > 0) {
260
					mettreAJourMarkerAdresse(responses[0].formatted_address);
268
					mettreAJourMarkerAdresse(responses[0].formatted_address);
261
					console.log(responses);
-
 
262
				} else {
269
				} else {
263
					mettreAJourMarkerAdresse("Impossible de trouver d'adresse pour cette position.");
270
					mettreAJourMarkerAdresse("Impossible de trouver d'adresse pour cette position.");
264
				}
271
				}
265
			} else {
272
			} else {
266
				mettreAJourMarkerAdresse("Un problème de géolocalisation est survenu : "+status+".");
273
				mettreAJourMarkerAdresse("Un problème de géolocalisation est survenu : "+status+".");
Line 272... Line 279...
272
function mettreAJourMarkerStatut(str) {
279
function mettreAJourMarkerStatut(str) {
273
	document.getElementById('marqueur-statut').innerHTML = str;
280
	document.getElementById('marqueur-statut').innerHTML = str;
274
}
281
}
Line 275... Line 282...
275
 
282
 
276
function mettreAJourMarkerPosition(latLng) {
-
 
277
	document.getElementById('marqueur-coordonnees').innerHTML = [
283
function mettreAJourMarkerPosition(latLng) {
278
		latLng.lat().toFixed(5),
284
	var lat = latLng.lat().toFixed(5);
279
		latLng.lng().toFixed(5)
285
	var lon = latLng.lng().toFixed(5); 
280
	].join(', ');
286
	document.getElementById('marqueur-wgs84').innerHTML = [lat, lon].join(', ');
-
 
287
	$("#marqueur-coordonnees").data('latLon', {'lat' : lat, 'lon' : lon});
-
 
288
	
-
 
289
	Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
-
 
290
	Proj4js.defs["EPSG:2154"]="+title=RGF93 / Lambert-93 +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ";
-
 
291
	var source = new Proj4js.Proj('EPSG:4326');// Coordonnées source : WGS 84
-
 
292
	var dest = new Proj4js.Proj('EPSG:2154');// Coordonnées destination  : Lambert 93
-
 
293
	var p = new Proj4js.Point(lon+','+lat);//lon+','+lat any object will do as long as it has 'x' and 'y' properties
-
 
294
	Proj4js.transform(source, dest, p);
-
 
295
	//Proj4js.reportError = function(msg) {alert(msg);}
-
 
296
	//console.log(p.toString());
281
	$("#marqueur-coordonnees").data('latLon', {'lat' : latLng.lat().toFixed(5), 'lon' : latLng.lng().toFixed(5)});
297
	document.getElementById('marqueur-lambert93').innerHTML = [p.x.toFixed(0)+' '+dest.units, p.y.toFixed(0)+' '+dest.units].join(', ');
Line 282... Line 298...
282
}
298
}
283
 
299
 
284
function mettreAJourMarkerAdresse(str) {
300
function mettreAJourMarkerAdresse(str) {