Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2359 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
-
 
238
	if(NOM_SCI_PROJET == 'bdtxa') {
-
 
239
		var latLng = new google.maps.LatLng(14.6, -61.08334);// Fort-De-France
-
 
240
		var zoomDefaut = 8;
-
 
241
	} else if(NOM_SCI_PROJET == 'isfan') {
-
 
242
		var latLng = new google.maps.LatLng(29.28358, 10.21884);// Afrique du Nord
-
 
243
		var zoomDefaut = 4;
-
 
244
	} else if(NOM_SCI_PROJET == 'apd') {
-
 
245
		var latLng = new google.maps.LatLng(8.75624, 1.80176);// Afrique de l'Ouest et du Centre
-
 
246
		var zoomDefaut = 4;
-
 
247
	} else {
237
	// Carte
248
		var latLng = new google.maps.LatLng(46.30871, 2.54395);// Centre de la France
238
	var latLng = new google.maps.LatLng(46.30871, 2.54395);// Centre de la France
249
		var zoomDefaut = 5;
-
 
Line 250... Line 239...
250
	}
239
	var zoomDefaut = 5;
251
 
240
 
252
	var options = {
241
	var options = {
253
		zoom: zoomDefaut,
242
		zoom: zoomDefaut,
Line 778... Line 767...
778
		'num_nom_sel' : $("#taxon").data("numNomSel"),
767
		'num_nom_sel' : $("#taxon").data("numNomSel"),
779
		'nom_ret' : $("#taxon").data("nomRet"),
768
		'nom_ret' : $("#taxon").data("nomRet"),
780
		'num_nom_ret' : $("#taxon").data("numNomRet"),
769
		'num_nom_ret' : $("#taxon").data("numNomRet"),
781
		'num_taxon' : $("#taxon").data("nt"),
770
		'num_taxon' : $("#taxon").data("nt"),
782
		'famille' : $("#taxon").data("famille"),
771
		'famille' : $("#taxon").data("famille"),
783
		'referentiel' : ($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_PROJET),
772
		'referentiel' : ($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_REFERENTIEL),
Line 784... Line 773...
784
 
773
 
785
		'latitude' : $("#latitude").val(),
774
		'latitude' : $("#latitude").val(),
786
		'longitude' : $("#longitude").val(),
775
		'longitude' : $("#longitude").val(),
787
		'commune_nom' : $("#commune-nom").text(),
776
		'commune_nom' : $("#commune-nom").text(),
Line 813... Line 802...
813
	});
802
	});
814
	return champs;
803
	return champs;
815
}
804
}
Line 816... Line 805...
816
 
805
 
817
function surChangementReferentiel() {
806
function surChangementReferentiel() {
818
	NOM_SCI_PROJET = $('#referentiel').val();
-
 
819
	NOM_SCI_REFERENTIEL = NOM_SCI_PROJET+':'+PROJETS_VERSIONS[NOM_SCI_PROJET];
807
	NOM_SCI_REFERENTIEL = $('#referentiel').val();
820
	$('#taxon').val('');
808
	$('#taxon').val('');
821
	initialiserAutocompleteCommune();
809
	initialiserAutocompleteCommune();
822
	initialiserGoogleMap();
810
	initialiserGoogleMap();
Line 1104... Line 1092...
1104
	var nn = '';
1092
	var nn = '';
1105
	if ($("#taxon").data("numNomSel") == undefined) {
1093
	if ($("#taxon").data("numNomSel") == undefined) {
1106
		nn = '<span class="alert-error">[non lié au référentiel]</span>';
1094
		nn = '<span class="alert-error">[non lié au référentiel]</span>';
1107
	} else {
1095
	} else {
1108
		nn = '<span class="nn">['+
1096
		nn = '<span class="nn">['+
1109
			'<span class="referentiel-obs">'+($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_PROJET+'-')+'</span>'+
1097
			'<span class="referentiel-obs">'+($("#taxon").data("numNomSel") == undefined ? '' : NOM_SCI_REFERENTIEL+'-')+'</span>'+
1110
			'nn'+$("#taxon").data("numNomSel")+
1098
			'nn'+$("#taxon").data("numNomSel")+
1111
			']</span>';
1099
			']</span>';
1112
	}
1100
	}
1113
	return nn;
1101
	return nn;
1114
}
1102
}
Line 1140... Line 1128...
1140
	});
1128
	});
1141
}
1129
}
Line 1142... Line 1130...
1142
 
1130
 
1143
function getUrlAutocompletionNomsSci() {
1131
function getUrlAutocompletionNomsSci() {
1144
	var mots = $('#taxon').val();
1132
	var mots = $('#taxon').val();
1145
	var url = SERVICE_AUTOCOMPLETION_NOM_SCI_URL_TPL.replace('{referentiel}',NOM_SCI_PROJET);
1133
	var url = SERVICE_AUTOCOMPLETION_NOM_SCI_URL_TPL.replace('{referentiel}',NOM_SCI_REFERENTIEL);
1146
	url = url.replace('{masque}', mots);
1134
	url = url.replace('{masque}', mots);
1147
	return url;
1135
	return url;
Line 1148... Line 1136...
1148
}
1136
}