Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 253 Rev 258
Line 24... Line 24...
24
 
24
 
25
	public InformationCommuneDAO(Rafraichissable r) {
25
	public InformationCommuneDAO(Rafraichissable r) {
26
		this.r = r;
26
		this.r = r;
Line 27... Line 27...
27
	}
27
	}
28
 
28
 
Line 29... Line 29...
29
	public void obtenirCommunePlusProche(final Rafraichissable r, double lng,
29
	public void obtenirCommunePlusProche(final Rafraichissable r, final double lng,
30
			double lat) {
30
			final double lat) {
31
 
31
 
32
		String adresseAppel = Configuration.getServiceBaseUrl() + "/"
32
		String adresseAppel = Configuration.getServiceBaseUrl() + "/"
Line 67... Line 67...
67
							if(!pays.equals("France")){
67
							if(!pays.equals("France")){
68
								r.rafraichir("Aucune commune française n'a été trouvée à cet emplacement", false);
68
								r.rafraichir("Aucune commune française n'a été trouvée à cet emplacement", false);
69
								return;
69
								return;
70
							}
70
							}
Line 71... Line 71...
71
								
71
								
72
							Double lng = objetCommune.get("lng").isNumber()
72
							Double newLng = objetCommune.get("lng").isNumber()
73
							.doubleValue();
73
							.doubleValue();
74
							Double lat = objetCommune.get("lat").isNumber()
74
							Double newLat = objetCommune.get("lat").isNumber()
75
									.doubleValue();
75
									.doubleValue();
76
							String nomCommune = objetCommune.get(
76
							String nomCommune = objetCommune.get(
Line 77... Line 77...
77
									"name").isString().stringValue();
77
									"name").isString().stringValue();
78
							
78
							
Line 79... Line 79...
79
							String idLocalite = objetCommune.get(
79
							String idLocalite = objetCommune.get(
Line 80... Line 80...
80
							"adminCode2").isString().stringValue();
80
							"adminCode2").isString().stringValue();
81
		
81
		
82
							Object[] infos = { lat, lng, idLocalite, nomCommune};
82
							Object[] infos = { lat, lng, idLocalite, nomCommune, newLat, newLng};
83
		
83
		
Line 94... Line 94...
94
	public void obtenirInfosCommune(final Rafraichissable r,
94
	public void obtenirInfosCommune(final Rafraichissable r,
95
			String valeurCommune, String codePostal) {
95
			String valeurCommune, String codePostal) {
Line 96... Line 96...
96
		
96
		
97
		codePostal = codePostal.replaceAll("000null", "*");
97
		codePostal = codePostal.replaceAll("000null", "*");
-
 
98
		codePostal = codePostal.replaceAll("\"", "");
-
 
99
		
98
		codePostal = codePostal.replaceAll("\"", "");
100
		valeurCommune = valeurCommune.split(" \\([0-9][0-9]\\)")[0];
99
		valeurCommune = valeurCommune.replaceAll("000null", "*");
101
		valeurCommune = valeurCommune.replaceAll("000null", "*");
Line 100... Line 102...
100
		valeurCommune = valeurCommune.replaceAll("\"", "");
102
		valeurCommune = valeurCommune.replaceAll("\"", "");