Subversion Repositories eFlore/Applications.cel

Rev

Rev 989 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 989 Rev 1292
1
package org.tela_botanica.client.vues.observation;
1
package org.tela_botanica.client.vues.observation;
2
 
2
 
3
import org.tela_botanica.client.interfaces.Rafraichissable;
3
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.modeles.objets.Configuration;
4
import org.tela_botanica.client.modeles.objets.Configuration;
5
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
5
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
6
import org.tela_botanica.client.observation.ObservationMediateur;
6
import org.tela_botanica.client.observation.ObservationMediateur;
7
import org.tela_botanica.client.util.Util;
7
import org.tela_botanica.client.util.Util;
8
 
-
 
9
import com.google.gwt.core.client.JavaScriptObject;
8
 
10
import com.google.gwt.maps.client.InfoWindow;
9
import com.google.gwt.maps.client.InfoWindow;
11
import com.google.gwt.maps.client.InfoWindowContent;
10
import com.google.gwt.maps.client.InfoWindowContent;
12
import com.google.gwt.maps.client.MapType;
11
import com.google.gwt.maps.client.MapType;
13
import com.google.gwt.maps.client.MapWidget;
12
import com.google.gwt.maps.client.MapWidget;
14
import com.google.gwt.maps.client.Maps;
13
import com.google.gwt.maps.client.Maps;
15
import com.google.gwt.maps.client.control.LargeMapControl;
14
import com.google.gwt.maps.client.control.LargeMapControl;
16
import com.google.gwt.maps.client.event.MapClickHandler;
15
import com.google.gwt.maps.client.event.MapClickHandler;
17
import com.google.gwt.maps.client.event.MapZoomEndHandler;
16
import com.google.gwt.maps.client.event.MapZoomEndHandler;
18
import com.google.gwt.maps.client.event.MarkerClickHandler;
17
import com.google.gwt.maps.client.event.MarkerClickHandler;
19
import com.google.gwt.maps.client.event.MarkerDragEndHandler;
18
import com.google.gwt.maps.client.event.MarkerDragEndHandler;
20
import com.google.gwt.maps.client.event.MarkerDragStartHandler;
19
import com.google.gwt.maps.client.event.MarkerDragStartHandler;
21
import com.google.gwt.maps.client.geom.LatLng;
20
import com.google.gwt.maps.client.geom.LatLng;
22
import com.google.gwt.maps.client.overlay.Marker;
21
import com.google.gwt.maps.client.overlay.Marker;
23
import com.google.gwt.maps.client.overlay.MarkerOptions;
22
import com.google.gwt.maps.client.overlay.MarkerOptions;
24
import com.google.gwt.user.client.Timer;
23
import com.google.gwt.user.client.Timer;
25
import com.google.gwt.user.client.Window;
24
import com.google.gwt.user.client.Window;
26
import com.gwtext.client.core.EventCallback;
25
import com.gwtext.client.core.EventCallback;
27
import com.gwtext.client.core.EventObject;
26
import com.gwtext.client.core.EventObject;
28
import com.gwtext.client.core.Ext;
27
import com.gwtext.client.core.Ext;
29
import com.gwtext.client.core.ExtElement;
28
import com.gwtext.client.core.ExtElement;
30
import com.gwtext.client.widgets.BoxComponent;
-
 
31
import com.gwtext.client.widgets.Component;
-
 
32
import com.gwtext.client.widgets.Container;
29
import com.gwtext.client.widgets.Container;
33
import com.gwtext.client.widgets.Panel;
30
import com.gwtext.client.widgets.Panel;
34
import com.gwtext.client.widgets.event.ContainerListener;
-
 
35
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
31
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
36
import com.gwtext.client.widgets.form.Label;
32
import com.gwtext.client.widgets.form.Label;
37
import com.gwtext.client.widgets.layout.FitLayout;
33
import com.gwtext.client.widgets.layout.FitLayout;
38
import com.gwtext.client.widgets.layout.RowLayout;
34
import com.gwtext.client.widgets.layout.RowLayout;
39
import com.gwtext.client.widgets.layout.RowLayoutData;
35
import com.gwtext.client.widgets.layout.RowLayoutData;
40
 
36
 
41
public class CartographieObservationVue extends Panel implements Rafraichissable {
37
public class CartographieObservationVue extends Panel implements Rafraichissable {
42
 
38
 
43
	private String id = "cartographie_observation";
39
	private String id = "cartographie_observation";
44
	
40
	
45
	private ObservationMediateur oMediateur = null;
41
	private ObservationMediateur oMediateur = null;
46
	
42
	
47
	Panel panneauCarto = null;
43
	Panel panneauCarto = null;
48
	private MapWidget map;
44
	private MapWidget map;
49
	
45
	
50
	private boolean carteAjoutee = false;
46
	private boolean carteAjoutee = false;
51
	private boolean requeteEnCours = false;
47
	private boolean requeteEnCours = false;
52
	
48
	
53
	String valeurCommune = "Bourges";
49
	String valeurCommune = "Bourges";
54
	LatLng centreFrance = null;
50
	LatLng centreFrance = null;
55
	LatLng pointCommune = null;
51
	LatLng pointCommune = null;
56
	String codeCommune = "";
52
	String codeCommune = "";
57
	
53
	
58
	int niveauZoom = 6;
54
	int niveauZoom = 6;
59
 
55
 
60
	Label panneauExplication = new Label(
56
	Label panneauExplication = new Label(
61
			"Précisez le lieu de votre observation et cliquez sur OK. Les coordonnées sont données en degrés décimaux, comptés positivement vers le Nord pour la latitude, et vers l'Est pour la longitude");
57
			"Précisez le lieu de votre observation et cliquez sur OK. Les coordonnées sont données en degrés décimaux, comptés positivement vers le Nord pour la latitude, et vers l'Est pour la longitude");
62
 
58
 
63
	private InfoWindow info;
59
	private InfoWindow info;
64
 
60
 
65
	private boolean listenerInitialise = false;
61
	private boolean listenerInitialise = false;
66
 
62
 
67
	public CartographieObservationVue(ObservationMediateur om) {
63
	public CartographieObservationVue(ObservationMediateur om) {
68
		
64
		
69
		oMediateur = om;
65
		oMediateur = om;
70
		
66
		
71
		setHeader(false);
67
		setHeader(false);
72
		setAutoWidth(true);
68
		setAutoWidth(true);
73
		setPaddings(10);
69
		setPaddings(10);
74
 
70
 
75
		panneauCarto = new Panel();
71
		panneauCarto = new Panel();
76
		panneauCarto.setLayout(new FitLayout());
72
		panneauCarto.setLayout(new FitLayout());
77
 
73
 
78
		setLayout(new RowLayout());
74
		setLayout(new RowLayout());
79
		
75
		
80
 
76
 
81
		add(panneauExplication, new RowLayoutData(12));
77
		add(panneauExplication, new RowLayoutData(12));
82
		add(panneauCarto, new RowLayoutData());
78
		add(panneauCarto, new RowLayoutData());
83
		
79
		
84
		if(!carteAjoutee) {
80
		if(!carteAjoutee) {
85
			
81
			
86
			Maps.loadMapsApi(Configuration.getCleGoogleMaps(), "2", false, new Runnable() {
82
			Maps.loadMapsApi(Configuration.getCleGoogleMaps(), "2", false, new Runnable() {
-
 
83
				@Override
87
				public void run() {
84
				public void run() {
88
					initialiserCarte(false);
85
					initialiserCarte(false);
89
				}
86
				}
90
			});
87
			});
91
		}
88
		}
92
				
89
				
93
		addListener(new ContainerListenerAdapter() {
90
		addListener(new ContainerListenerAdapter() {
-
 
91
			
94
			
92
			@Override
95
			public void onAfterLayout(Container c) {
93
			public void onAfterLayout(Container c) {
96
				
94
				
97
				if(carteAjoutee) {
95
				if(carteAjoutee) {
98
					panneauCarto.setHeight("100%");
96
					panneauCarto.setHeight("100%");
99
					if((panneauCarto.getHeight() - 20) > map.getSize().getHeight()) {
97
					if((panneauCarto.getHeight() - 20) > map.getSize().getHeight()) {
100
						map.setSize(map.getSize().getWidth()+"px", (panneauCarto.getHeight() - 20)+"px");
98
						map.setSize(map.getSize().getWidth()+"px", (panneauCarto.getHeight() - 20)+"px");
101
					}
99
					}
102
					panneauCarto.doLayout();
100
					panneauCarto.doLayout();
103
					panneauCarto.expand();
101
					panneauCarto.expand();
104
				}
102
				}
105
			}
103
			}
106
		});
104
		});
107
		
105
		
108
		panneauCarto.setAutoHeight(true);
106
		panneauCarto.setAutoHeight(true);
109
	}
107
	}
110
	
108
	
111
	public void setTailleCarte(int hauteur, int largeur) {
109
	public void setTailleCarte(int hauteur, int largeur) {
112
		map.setSize(largeur+"px", (hauteur+"px"));
110
		map.setSize(largeur+"px", (hauteur+"px"));
113
	}
111
	}
114
	
112
	
115
	public void masquerChargement(boolean masquer) {
113
	public void masquerChargement(boolean masquer) {
116
		
114
		
117
		if(panneauCarto.isVisible()) {
115
		if(panneauCarto.isVisible()) {
118
			if(masquer) {
116
			if(masquer) {
119
				panneauCarto.getEl().mask("Recherche des coordonnées et de la commune, veuillez patienter");
117
				panneauCarto.getEl().mask("Recherche des coordonnées et de la commune, veuillez patienter");
120
			} else {
118
			} else {
121
				panneauCarto.getEl().unmask();
119
				panneauCarto.getEl().unmask();
122
			}
120
			}
123
		}
121
		}
124
	}
122
	}
125
	
123
	
126
	public void obtenirInfosCommunes(LatLng coord) {
124
	public void obtenirInfosCommunes(LatLng coord) {
127
		oMediateur.obtenirInformationCoord(this, coord);
125
		oMediateur.obtenirInformationCoord(this, coord);
128
	}
126
	}
129
 
127
 
130
	public void mettreAJourInfos(final LatLng pointNouvelleCommune, String infosComplementaires, int zoom) {
128
	public void mettreAJourInfos(final LatLng pointNouvelleCommune, String infosComplementaires, int zoom) {
131
 
129
 
132
		if (!carteAjoutee) {
130
		if (!carteAjoutee) {
133
			initialiserCarte(true);
131
			initialiserCarte(true);
134
		}
132
		}
135
 
133
 
136
		pointCommune = pointNouvelleCommune;
134
		pointCommune = pointNouvelleCommune;
137
		map.clearOverlays();
135
		map.clearOverlays();
138
		Marker nmk = fabriquerMarqueur(pointCommune, infosComplementaires);
136
		Marker nmk = fabriquerMarqueur(pointCommune, infosComplementaires);
139
		map.addOverlay(nmk);
137
		map.addOverlay(nmk);
140
		afficherInfoMarker(nmk);
138
		afficherInfoMarker(nmk);
141
		recentrerCarte();
139
		recentrerCarte();
142
	}
140
	}
143
 
141
 
144
	public void initialiserCarte(boolean commune) {
142
	public void initialiserCarte(boolean commune) {
145
		
143
		
146
		centreFrance = LatLng.newInstance(47.0504, 2.2347);
144
		centreFrance = LatLng.newInstance(47.0504, 2.2347);
147
		pointCommune = centreFrance;
145
		pointCommune = centreFrance;
148
		
146
		
149
		map = new MapWidget(pointCommune, niveauZoom);
147
		map = new MapWidget(pointCommune, niveauZoom);
150
		panneauCarto.add(map);
148
		panneauCarto.add(map);
151
		panneauCarto.doLayout();
149
		panneauCarto.doLayout();
152
		info = map.getInfoWindow();
150
		info = map.getInfoWindow();
153
		if(!commune) {
151
		if(!commune) {
154
			fabriquerMarqueurIndication();
152
			fabriquerMarqueurIndication();
155
		}
153
		}
156
		
154
		
157
		map.setZoomLevel(6);
155
		map.setZoomLevel(6);
158
		map.checkResizeAndCenter();
156
		map.checkResizeAndCenter();
159
		map.setUIToDefault();
157
		map.setUIToDefault();
160
		map.addControl(new LargeMapControl());
158
		map.addControl(new LargeMapControl());
161
		map.setCurrentMapType(MapType.getHybridMap());
159
		map.setCurrentMapType(MapType.getHybridMap());
162
		carteAjoutee = true;
160
		carteAjoutee = true;
163
		panneauCarto.doLayout();
161
		panneauCarto.doLayout();
164
		
162
		
165
		map.addMapClickHandler(new MapClickHandler() {
163
		map.addMapClickHandler(new MapClickHandler() {
-
 
164
 
166
 
165
			@Override
167
			public void onClick(MapClickEvent event) {
166
			public void onClick(MapClickEvent event) {
168
				//TODO : quoi faire du double clic ?
167
				//TODO : quoi faire du double clic ?
169
				obtenirInfosCommunes(event.getLatLng());
168
				obtenirInfosCommunes(event.getLatLng());
170
			}
169
			}
171
			
170
			
172
		});
171
		});
173
		
172
		
174
		map.addMapZoomEndHandler(new MapZoomEndHandler() {
173
		map.addMapZoomEndHandler(new MapZoomEndHandler() {
-
 
174
 
175
 
175
			@Override
176
			public void onZoomEnd(MapZoomEndEvent event) {
176
			public void onZoomEnd(MapZoomEndEvent event) {
177
				niveauZoom = event.getNewZoomLevel();
177
				niveauZoom = event.getNewZoomLevel();
178
			}
178
			}
179
			
179
			
180
		});
180
		});
181
	}
181
	}
182
	
182
	
183
	public void fabriquerMarqueurIndication() {
183
	public void fabriquerMarqueurIndication() {
184
		Marker marker = fabriquerMarqueur(pointCommune,"");
184
		Marker marker = fabriquerMarqueur(pointCommune,"");
185
		map.addOverlay(marker);		
185
		map.addOverlay(marker);		
186
		info.open(marker, new InfoWindowContent("<div id=\"info_contenu\">"+
186
		info.open(marker, new InfoWindowContent("<div id=\"info_contenu\">"+
187
				"Déplacez ce marqueur pour localiser votre observation (commune et coordonnées)<br />"
187
				"Déplacez ce marqueur pour localiser votre observation (commune et coordonnées)<br />"
188
				+"longitude="
188
				+"longitude="
189
				+ marker.getLatLng().getLongitude() + "<br />latitude="
189
				+ marker.getLatLng().getLongitude() + "<br />latitude="
190
				+ marker.getLatLng().getLatitude() + "</div>"));
190
				+ marker.getLatLng().getLatitude() + "</div>"));
191
	}
191
	}
192
 
192
 
193
	public void AfficherMessageAucuneInfos() {
193
	public void AfficherMessageAucuneInfos() {
194
		mettreAJourInfos(centreFrance,"", niveauZoom);
194
		mettreAJourInfos(centreFrance,"", niveauZoom);
195
		Window.alert("Aucune information pour le nom donné");
195
		Window.alert("Aucune information pour le nom donné");
196
	}
196
	}
197
 
197
 
198
	public int getNiveauZoom() {
198
	public int getNiveauZoom() {
199
		return niveauZoom;
199
		return niveauZoom;
200
	}
200
	}
201
	
201
	
202
	private void ajouterListenerBouton(final String idBouton) {
202
	private void ajouterListenerBouton(final String idBouton) {
203
		
203
		
204
		final ExtElement bouton = Ext.get(idBouton);
204
		final ExtElement bouton = Ext.get(idBouton);
205
		
205
		
206
		if(bouton == null) {
206
		if(bouton == null) {
207
			Timer t = new Timer() {
207
			Timer t = new Timer() {
-
 
208
				@Override
208
				public void run() {
209
				public void run() {
209
					ajouterListenerBouton(idBouton);
210
					ajouterListenerBouton(idBouton);
210
				}
211
				}
211
				
212
				
212
			};
213
			};
213
			t.schedule(500);
214
			t.schedule(500);
214
			return;
215
			return;
215
		}
216
		}
216
		
217
		
217
		bouton.addListener("click", new EventCallback() {
218
		bouton.addListener("click", new EventCallback() {
-
 
219
			@Override
218
			public void execute(EventObject e) {
220
			public void execute(EventObject e) {
219
				EntiteGeographiqueObservation infosCommune = new EntiteGeographiqueObservation(codeCommune,valeurCommune,null,null);
221
				EntiteGeographiqueObservation infosCommune = new EntiteGeographiqueObservation(codeCommune,valeurCommune,null,null);
220
				infosCommune.setLat(pointCommune.getLatitude()+"");
222
				infosCommune.setLat(pointCommune.getLatitude()+"");
221
				infosCommune.setLon(pointCommune.getLongitude()+"");
223
				infosCommune.setLon(pointCommune.getLongitude()+"");
222
				oMediateur.rafraichirSaisieCommuneObservation(infosCommune);
224
				oMediateur.rafraichirSaisieCommuneObservation(infosCommune);
223
			}
225
			}
224
		});	
226
		});	
225
		
227
		
226
		bouton.focus();
228
		bouton.focus();
227
	}
229
	}
-
 
230
 
228
 
231
	@Override
229
	public void rafraichir(Object nouvelleDonnees,
232
	public void rafraichir(Object nouvelleDonnees,
230
			boolean repandreRaffraichissement) {
233
			boolean repandreRaffraichissement) {
231
		if (nouvelleDonnees instanceof String) {
234
		if (nouvelleDonnees instanceof String) {
232
			
235
			
233
			if(isVisible()) {
236
			if(isVisible()) {
234
				Window.alert((String)nouvelleDonnees);
237
				Window.alert((String)nouvelleDonnees);
235
			}
238
			}
236
		}
239
		}
237
 
240
 
238
		if (nouvelleDonnees instanceof EntiteGeographiqueObservation) {
241
		if (nouvelleDonnees instanceof EntiteGeographiqueObservation) {
239
			
242
			
240
			oMediateur.afficherFenetreCarto();
243
			oMediateur.afficherFenetreCarto();
241
			
244
			
242
			EntiteGeographiqueObservation infos = (EntiteGeographiqueObservation) nouvelleDonnees;
245
			EntiteGeographiqueObservation infos = (EntiteGeographiqueObservation) nouvelleDonnees;
243
			
246
			
244
			Double lat = 0.0;
247
			Double lat = 0.0;
245
			Double lon = 0.0;
248
			Double lon = 0.0;
246
			
249
			
247
			try {
250
			try {
248
				lat = Double.parseDouble(infos.getLat());
251
				lat = Double.parseDouble(infos.getLat());
249
				lon = Double.parseDouble(infos.getLon());
252
				lon = Double.parseDouble(infos.getLon());
250
			} catch (NumberFormatException nbe) {
253
			} catch (NumberFormatException nbe) {
251
				
254
				
252
			}
255
			}
253
			
256
			
254
			LatLng coord = LatLng.newInstance(lat, lon);
257
			LatLng coord = LatLng.newInstance(lat, lon);
255
			
258
			
256
			valeurCommune = infos.getZoneGeo();
259
			valeurCommune = infos.getZoneGeo();
257
			codeCommune = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo());
260
			codeCommune = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo());
258
			pointCommune = coord;
261
			pointCommune = coord;
259
			
262
			
260
			mettreAJourInfos(coord, "", niveauZoom);
263
			mettreAJourInfos(coord, "", niveauZoom);
261
		}
264
		}
262
		
265
		
263
		masquerChargement(false);
266
		masquerChargement(false);
264
	}
267
	}
265
	
268
	
266
	public Marker fabriquerMarqueur(LatLng pointMarqueur, final String texte) {
269
	public Marker fabriquerMarqueur(LatLng pointMarqueur, final String texte) {
267
		// ajout de marqueurs déplacables, qui affichent une bulle d'information
270
		// ajout de marqueurs déplacables, qui affichent une bulle d'information
268
		MarkerOptions options = MarkerOptions.newInstance();
271
		MarkerOptions options = MarkerOptions.newInstance();
269
		options.setDraggable(true);
272
		options.setDraggable(true);
270
		final Marker marker = new Marker(pointMarqueur, options);
273
		final Marker marker = new Marker(pointMarqueur, options);
271
		
274
		
272
		marker.addMarkerDragEndHandler(new MarkerDragEndHandler() {
275
		marker.addMarkerDragEndHandler(new MarkerDragEndHandler() {
-
 
276
			@Override
273
			public void onDragEnd(MarkerDragEndEvent event) {
277
			public void onDragEnd(MarkerDragEndEvent event) {
274
				masquerChargement(true);
278
				masquerChargement(true);
275
				obtenirInfosCommunes(marker.getLatLng());
279
				obtenirInfosCommunes(marker.getLatLng());
276
			}
280
			}
277
 
281
 
278
		});
282
		});
279
 
283
 
280
		marker.addMarkerDragStartHandler(new MarkerDragStartHandler() {
284
		marker.addMarkerDragStartHandler(new MarkerDragStartHandler() {
-
 
285
			@Override
281
			public void onDragStart(MarkerDragStartEvent event) {
286
			public void onDragStart(MarkerDragStartEvent event) {
282
				info.setVisible(false);
287
				info.setVisible(false);
283
			}
288
			}
284
		});
289
		});
285
		
290
		
286
		marker.addMarkerClickHandler(new MarkerClickHandler() {
291
		marker.addMarkerClickHandler(new MarkerClickHandler() {
-
 
292
 
287
 
293
			@Override
288
			public void onClick(MarkerClickEvent event) {
294
			public void onClick(MarkerClickEvent event) {
289
				if(info.isVisible()) {
295
				if(info.isVisible()) {
290
					info.close();
296
					info.close();
291
				} else {
297
				} else {
292
					afficherInfoMarker(marker);
298
					afficherInfoMarker(marker);
293
				}
299
				}
294
			}	
300
			}	
295
		});
301
		});
296
		
302
		
297
		return marker;
303
		return marker;
298
	}
304
	}
299
 
305
 
300
	public void recentrerCarte() {
306
	public void recentrerCarte() {
301
		
307
		
302
		if(this.getWidth() > 12 && this.getHeight() > 24) {
308
		if(this.getWidth() > 12 && this.getHeight() > 24) {
303
			map.setSize((this.getWidth() - 12)+"px" , (this.getHeight() - 24)+"px");
309
			map.setSize((this.getWidth() - 12)+"px" , (this.getHeight() - 24)+"px");
304
			panneauCarto.setSize((this.getWidth() - 12)+"px" , (this.getHeight() - 12)+"px");
310
			panneauCarto.setSize((this.getWidth() - 12)+"px" , (this.getHeight() - 12)+"px");
305
		}
311
		}
306
		map.setCenter(pointCommune, niveauZoom);
312
		map.setCenter(pointCommune, niveauZoom);
307
		map.checkResizeAndCenter();
313
		map.checkResizeAndCenter();
308
	}
314
	}
309
 
315
 
310
	public boolean isCarteAjoutee() {
316
	public boolean isCarteAjoutee() {
311
		return carteAjoutee;
317
		return carteAjoutee;
312
	}
318
	}
313
	
319
	
314
	public void afficherInfoMarker(Marker marker) {
320
	public void afficherInfoMarker(Marker marker) {
315
		
321
		
316
		final String htmlBoutonOk = "<br /><button id=\"okMap\" class=\"x-btn-text\" type=\"button\">OK</button>";
322
		final String htmlBoutonOk = "<br /><button id=\"okMap\" class=\"x-btn-text\" type=\"button\">OK</button>";
317
 
323
 
318
		String contenuMarker = "";
324
		String contenuMarker = "";
319
		
325
		
320
		if(valeurCommune == null || valeurCommune.trim().equals("")) {
326
		if(valeurCommune == null || valeurCommune.trim().equals("")) {
321
			if(marker.getLatLng().getLongitude() == 0 && marker.getLatLng().getLatitude() == 0) {
327
			if(marker.getLatLng().getLongitude() == 0 && marker.getLatLng().getLatitude() == 0) {
322
				LatLng point = centreFrance;
328
				LatLng point = centreFrance;
323
				marker.setLatLng(point);
329
				marker.setLatLng(point);
324
				niveauZoom = 6;
330
				niveauZoom = 6;
325
			}
331
			}
326
			contenuMarker = "<div id=\"info_contenu\">"+
332
			contenuMarker = "<div id=\"info_contenu\">"+
327
			"Aucune commune française trouvée à cet emplacement <br />"
333
			"Aucune commune française trouvée à cet emplacement <br />"
328
			+"Déplacez ce marqueur pour localiser votre observation (commune et coordonnées)<br />"
334
			+"Déplacez ce marqueur pour localiser votre observation (commune et coordonnées)<br />"
329
			+"longitude="
335
			+"longitude="
330
			+ marker.getLatLng().getLongitude() + "<br />latitude="
336
			+ marker.getLatLng().getLongitude() + "<br />latitude="
331
			+ marker.getLatLng().getLatitude() + "</div>";
337
			+ marker.getLatLng().getLatitude() + "</div>";
332
		} else {
338
		} else {
333
			contenuMarker = ""
339
			contenuMarker = ""
334
			+valeurCommune+" ("+codeCommune+")<br />"
340
			+valeurCommune+" ("+codeCommune+")<br />"
335
			+"longitude="
341
			+"longitude="
336
			+ marker.getLatLng().getLongitude() + "<br />latitude="
342
			+ marker.getLatLng().getLongitude() + "<br />latitude="
337
			+ marker.getLatLng().getLatitude() ;
343
			+ marker.getLatLng().getLatitude() ;
338
		}
344
		}
339
		
345
		
340
		info.open(marker, new InfoWindowContent(""
346
		info.open(marker, new InfoWindowContent(""
341
				+ contenuMarker
347
				+ contenuMarker
342
				+ htmlBoutonOk));
348
				+ htmlBoutonOk));
343
		
349
		
344
		recentrerCarte();
350
		recentrerCarte();
345
		ajouterListenerBouton("okMap");
351
		ajouterListenerBouton("okMap");
346
	}
352
	}
347
	
353
	
348
	public LatLng getCentreFrance() {
354
	public LatLng getCentreFrance() {
349
		return LatLng.newInstance(47.0504, 2.2347);
355
		return LatLng.newInstance(47.0504, 2.2347);
350
	}
356
	}
351
 
357
 
352
}
358
}