33,7 → 33,6 |
public class CartographieObservationVue extends Panel implements Rafraichissable { |
|
private String id = "cartographie_observation"; |
|
private ObservationMediateur oMediateur = null; |
|
Panel panneauCarto = null; |
54,9 → 53,10 |
"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"); |
|
private InfoWindow info; |
private boolean zoomerSurRetour = false; |
|
public CartographieObservationVue(ObservationMediateur om) { |
|
|
oMediateur = om; |
|
setHeader(false); |
110,25 → 110,26 |
nmk.setMap(map); |
afficherInfoMarker(nmk); |
recentrerCarte(nmk.getPosition()); |
map.setZoom(zoom); |
} |
|
private void initialiserCarte(boolean commune) { |
|
|
panneauCarto.clear(); |
|
|
centreFrance = LatLng.create(47.0504, 2.2347); |
pointCommune = centreFrance; |
|
MapOptions options = MapOptions.create(); |
options.setCenter(centreFrance); |
options.setZoom(6) ; |
|
MapOptions options = MapOptions.create(); |
options.setCenter(centreFrance); |
options.setZoom(6); |
options.setMapTypeId(MapTypeId.HYBRID); |
options.setDraggable(true); |
options.setMapTypeControl(true); |
options.setScaleControl(true) ; |
options.setScrollwheel(true) ; |
|
map = GoogleMap.create(panneauCarto.getElement(), options ) ; |
options.setScaleControl(true); |
options.setScrollwheel(true); |
|
map = GoogleMap.create(panneauCarto.getElement(), options ); |
|
InfoWindowOptions infopts = InfoWindowOptions.create(); |
info = InfoWindow.create(); |
218,8 → 219,8 |
} |
|
@Override |
public void rafraichir(Object nouvelleDonnees, |
boolean repandreRaffraichissement) { |
public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) { |
|
if (nouvelleDonnees instanceof String) { |
|
if(isVisible()) { |
230,9 → 231,7 |
if (nouvelleDonnees instanceof EntiteGeographiqueObservation) { |
|
oMediateur.afficherFenetreCarto(); |
|
EntiteGeographiqueObservation infos = (EntiteGeographiqueObservation) nouvelleDonnees; |
|
Double lat = 0.0; |
Double lon = 0.0; |
|
242,8 → 241,12 |
} catch (NumberFormatException nbe) { |
|
} |
|
LatLng coord = LatLng.create(lat, lon); |
// si on a un point, on zoome fort dès le début |
if (zoomerSurRetour) { |
niveauZoom = 16; |
zoomerSurRetour = false; |
} |
|
String nouvelleValeurCommune = infos.getZoneGeo(); |
valeurCommune = nouvelleValeurCommune; |
359,4 → 362,8 |
double[] coords = {47.0504, 2.2347}; |
return coords; |
} |
|
public void setDoitZoomerSurRetour(boolean b) { |
zoomerSurRetour = b; |
} |
} |