Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2406 Rev 2408
Line 130... Line 130...
130
function initialiserAutocompleteCommune() {
130
function initialiserAutocompleteCommune() {
131
	var geocoderOptions = {
131
	var geocoderOptions = {
132
	};
132
	};
133
	var addressSuffix = '';
133
	var addressSuffix = '';
Line 134... Line 134...
134
 
134
 
135
	switch(NOM_SCI_PROJET) {
135
	switch(NOM_SCI_REFERENTIEL) {
136
		case 'isfan':
136
		case 'isfan':
137
			// Si des résultats se trouvent dans ce rectangle, ils apparaîtront en premier.
137
			// Si des résultats se trouvent dans ce rectangle, ils apparaîtront en premier.
138
			// Ça marche moyen...
138
			// Ça marche moyen...
139
			geocoderOptions.bounds = new google.maps.LatLngBounds(
139
			geocoderOptions.bounds = new google.maps.LatLngBounds(
Line 233... Line 233...
233
	deplacerMarker(latLng);
233
	deplacerMarker(latLng);
234
}
234
}
Line 235... Line 235...
235
 
235
 
236
function initialiserGoogleMap(){
236
function initialiserGoogleMap(){
237
	// Carte
237
	// Carte
238
	if(NOM_SCI_PROJET == 'bdtxa') {
238
	if(NOM_SCI_REFERENTIEL == 'bdtxa') {
239
		var latLng = new google.maps.LatLng(14.6, -61.08334);// Fort-De-France
239
		var latLng = new google.maps.LatLng(14.6, -61.08334);// Fort-De-France
240
		var zoomDefaut = 8;
240
		var zoomDefaut = 8;
241
	} else if(NOM_SCI_PROJET == 'isfan') {
241
	} else if(NOM_SCI_REFERENTIEL == 'isfan') {
242
		var latLng = new google.maps.LatLng(29.28358, 10.21884);// Afrique du Nord
242
		var latLng = new google.maps.LatLng(29.28358, 10.21884);// Afrique du Nord
243
		var zoomDefaut = 4;
243
		var zoomDefaut = 4;
244
	} else if(NOM_SCI_PROJET == 'apd') {
244
	} else if(NOM_SCI_REFERENTIEL == 'apd') {
245
		var latLng = new google.maps.LatLng(8.75624, 1.80176);// Afrique de l'Ouest et du Centre
245
		var latLng = new google.maps.LatLng(8.75624, 1.80176);// Afrique de l'Ouest et du Centre
246
		var zoomDefaut = 4;
246
		var zoomDefaut = 4;
247
	} else {
247
	} else {
248
		var latLng = new google.maps.LatLng(46.30871, 2.54395);// Centre de la France
248
		var latLng = new google.maps.LatLng(46.30871, 2.54395);// Centre de la France
Line 778... Line 778...
778
		'num_nom_sel' : $("#taxon").data("numNomSel"),
778
		'num_nom_sel' : $("#taxon").data("numNomSel"),
779
		'nom_ret' : $("#taxon").data("nomRet"),
779
		'nom_ret' : $("#taxon").data("nomRet"),
780
		'num_nom_ret' : $("#taxon").data("numNomRet"),
780
		'num_nom_ret' : $("#taxon").data("numNomRet"),
781
		'num_taxon' : $("#taxon").data("nt"),
781
		'num_taxon' : $("#taxon").data("nt"),
782
		'famille' : $("#taxon").data("famille"),
782
		'famille' : $("#taxon").data("famille"),
783
		'referentiel' : ($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_PROJET),
783
		'referentiel' : ($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_REFERENTIEL),
Line 784... Line 784...
784
 
784
 
785
		'latitude' : $("#latitude").val(),
785
		'latitude' : $("#latitude").val(),
786
		'longitude' : $("#longitude").val(),
786
		'longitude' : $("#longitude").val(),
787
		'commune_nom' : $("#commune-nom").text(),
787
		'commune_nom' : $("#commune-nom").text(),
Line 813... Line 813...
813
	});
813
	});
814
	return champs;
814
	return champs;
815
}
815
}
Line 816... Line 816...
816
 
816
 
817
function surChangementReferentiel() {
817
function surChangementReferentiel() {
818
	NOM_SCI_PROJET = $('#referentiel').val();
-
 
819
	NOM_SCI_REFERENTIEL = NOM_SCI_PROJET+':'+PROJETS_VERSIONS[NOM_SCI_PROJET];
818
	NOM_SCI_REFERENTIEL = $('#referentiel').val();
820
	$('#taxon').val('');
819
	$('#taxon').val('');
821
	initialiserAutocompleteCommune();
820
	initialiserAutocompleteCommune();
822
	initialiserGoogleMap();
821
	initialiserGoogleMap();
Line 1104... Line 1103...
1104
	var nn = '';
1103
	var nn = '';
1105
	if ($("#taxon").data("numNomSel") == undefined) {
1104
	if ($("#taxon").data("numNomSel") == undefined) {
1106
		nn = '<span class="alert-error">[non lié au référentiel]</span>';
1105
		nn = '<span class="alert-error">[non lié au référentiel]</span>';
1107
	} else {
1106
	} else {
1108
		nn = '<span class="nn">['+
1107
		nn = '<span class="nn">['+
1109
			'<span class="referentiel-obs">'+($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_PROJET+'-')+'</span>'+
1108
			'<span class="referentiel-obs">'+($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_REFERENTIEL+'-')+'</span>'+
1110
			'nn'+$("#taxon").data("numNomSel")+
1109
			'nn'+$("#taxon").data("numNomSel")+
1111
			']</span>';
1110
			']</span>';
1112
	}
1111
	}
1113
	return nn;
1112
	return nn;
1114
}
1113
}
Line 1140... Line 1139...
1140
	});
1139
	});
1141
}
1140
}
Line 1142... Line 1141...
1142
 
1141
 
1143
function getUrlAutocompletionNomsSci() {
1142
function getUrlAutocompletionNomsSci() {
1144
	var mots = $('#taxon').val();
1143
	var mots = $('#taxon').val();
1145
	var url = SERVICE_AUTOCOMPLETION_NOM_SCI_URL_TPL.replace('{referentiel}',NOM_SCI_PROJET);
1144
	var url = SERVICE_AUTOCOMPLETION_NOM_SCI_URL_TPL.replace('{referentiel}',NOM_SCI_REFERENTIEL);
1146
	url = url.replace('{masque}', mots);
1145
	url = url.replace('{masque}', mots);
1147
	return url;
1146
	return url;
Line 1148... Line 1147...
1148
}
1147
}