/trunk/src/org/tela_botanica/client/modeles/dao/InformationCommuneDAO.java |
---|
20,6 → 20,10 |
private final String NOM_SERVICE = "CoordSearch"; |
private final String CODE_PAYS = "FR"; |
// Ce DAO peut être fréquemment sollicité lors de l'utilisation de la carte |
// et peut empiler beaucoup de longues requête, ceci permet donc de les annuler facilement |
private static Request requeteEnCours = null; |
Rafraichissable r = null; |
28,7 → 32,9 |
} |
public void obtenirCommunePlusProche(final Rafraichissable r, final double lng, |
final double lat) { |
final double lat) { |
annulerRequeteEnCours(); |
String adresseAppel = Configuration.getServiceBaseUrl() + "/" |
+ NOM_SERVICE + "/" + URL.encode("" + lat) + "/" |
36,11 → 42,12 |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, adresseAppel); |
try { |
rb.sendRequest(null, new RequestCallback() { |
requeteEnCours = rb.sendRequest(null, new RequestCallback() { |
@Override |
public void onError(Request request, Throwable exception) { |
Window.alert(exception.getMessage()); |
requeteEnCours = null; |
} |
@Override |
50,6 → 57,7 |
EntiteGeographiqueObservation infos; |
String idLocalite = ""; |
String nomCommune = ""; |
String pays = ""; |
if (response.getStatusCode() == Response.SC_BAD_REQUEST) { |
Window.alert("Requete mal formée"); |
75,9 → 83,13 |
nomCommune = objectRetour.get("nom").isString().stringValue(); |
} |
if(objectRetour.get("code_insee").isString() != null) { |
idLocalite = objectRetour.get("code_insee").isString().stringValue().substring(0, 2); |
if(objectRetour.get("code_zone").isString() != null) { |
idLocalite = objectRetour.get("code_zone").isString().stringValue().substring(0, 2); |
} |
if(objectRetour.get("code_pays").isString() != null) { |
pays = objectRetour.get("code_pays").isString().stringValue(); |
} |
} |
} |
84,6 → 96,7 |
infos = new EntiteGeographiqueObservation(idLocalite, nomCommune, null, null); |
infos.setLat(""+lat); |
infos.setLon(""+lng); |
infos.setPays(pays); |
r.rafraichir(infos, false); |
} |
94,11 → 107,13 |
} |
public void obtenirInfosCommune(final Rafraichissable r, |
String valeurCommune, String codePostal) { |
String valeurCommune, String codeLoc) { |
codePostal = codePostal.replaceAll("000null", "*"); |
codePostal = codePostal.replaceAll("\"", ""); |
annulerRequeteEnCours(); |
codeLoc = codeLoc.replaceAll("000null", "*"); |
codeLoc = codeLoc.replaceAll("\"", ""); |
valeurCommune = valeurCommune.split(" \\([0-9][0-9]\\)")[0]; |
valeurCommune = valeurCommune.replaceAll("000null", "*"); |
valeurCommune = valeurCommune.replaceAll("\"", ""); |
105,13 → 120,23 |
String adresseAppel = Configuration.getServiceBaseUrl() + "/" |
+ NOM_SERVICE + "/*/*/" + URL.encode(valeurCommune) + "/" |
+ URL.encode(codePostal) + "/" |
+ URL.encode(CODE_PAYS); |
+ NOM_SERVICE + "/*/*/" + URL.encode(valeurCommune) + "/"; |
if(!codeLoc.trim().isEmpty()) { |
// Cas du code de département ou postal |
if(Util.estUnNombre(codeLoc)) { |
adresseAppel += URL.encode(codeLoc)+"/"+URL.encode(CODE_PAYS); |
} else { |
//cas du code pays |
adresseAppel += "*/"+URL.encode(codeLoc); |
} |
} |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, adresseAppel); |
try { |
rb.sendRequest(null, new RequestCallback() { |
requeteEnCours = rb.sendRequest(null, new RequestCallback() { |
@Override |
public void onError(Request request, Throwable exception) { |
137,13 → 162,15 |
JSONObject objectRetour = responseValue.isObject(); |
String nomCommune = Util.getValeurJsonOuVide(objectRetour, "nom"); |
String idLocalite = Util.getValeurJsonOuVide(objectRetour, "code_insee"); |
String idLocalite = Util.getValeurJsonOuVide(objectRetour, "code_zone"); |
lat = Util.jsonNonNull(objectRetour,"lat") ? objectRetour.get("lat").isNumber().doubleValue(): 0.0; |
lng = Util.jsonNonNull(objectRetour,"lng") ? objectRetour.get("lng").isNumber().doubleValue(): 0.0; |
String pays = Util.getValeurJsonOuVide(objectRetour, "code_pays"); |
infos = new EntiteGeographiqueObservation(idLocalite, nomCommune, null, null); |
infos.setLat(""+lat); |
infos.setLon(""+lng); |
infos.setPays(pays); |
r.rafraichir(infos, false); |
} else { |
164,4 → 191,11 |
Window.alert(e.getMessage()); |
} |
} |
public static void annulerRequeteEnCours() { |
if(requeteEnCours != null) { |
requeteEnCours.cancel(); |
requeteEnCours = null; |
} |
} |
} |
/trunk/src/org/tela_botanica/client/modeles/objets/EntiteGeographiqueObservation.java |
---|
14,6 → 14,7 |
private String station=null; |
private String lat=null; |
private String lon=null; |
private String pays=null; |
private int zoom = 0; // si zoom <= 0, on l'ignore lors du rafraîchissement |
public EntiteGeographiqueObservation() { |
35,6 → 36,14 |
this.lieuDit = lieuDit; |
this.station = station; |
} |
public void setPays(String pays) { |
this.pays = pays; |
} |
public String getPays() { |
return pays; |
} |
public void setLat(String la) { |
lat = la; |
/trunk/src/org/tela_botanica/client/observation/ObservationMediateur.java |
---|
8,6 → 8,7 |
import org.tela_botanica.client.CarnetEnLigneMediateur; |
import org.tela_botanica.client.cel2; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.modeles.dao.InformationCommuneDAO; |
import org.tela_botanica.client.modeles.objets.Configuration; |
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation; |
import org.tela_botanica.client.modeles.objets.InfosReferentielNom; |
1140,14 → 1141,19 |
public void obtenirInformationCoord(double lat, double lng, boolean zoomer) { |
cartoObservationVue.setDoitZoomerSurRetour(true); |
// @TODO faire patienter l'utilisateur le temps de trouver la zone (long si hors France) |
Util.curseurAttente(); |
// Les requêtes hors France sont longues, on veille donc à ne pas les empiler |
// inutilement pour ne pas les traiter au retour |
InformationCommuneDAO.annulerRequeteEnCours(); |
// Pour faire patienter l'utilisateur le temps de trouver la zone |
//Util.curseurAttente(); |
afficherFenetreCarto(); |
cartoObservationVue.afficherCarteEnAttenteAvecMarker(lat, lng); |
observationModele.obtenirInformationCoord(cartoObservationVue, lat, lng); |
} |
public void obtenirInformationCommune(String nomCommune, |
String codePostal) { |
observationModele.obtenirInformationCommune(cartoObservationVue,nomCommune, codePostal); |
String codeLoc) { |
observationModele.obtenirInformationCommune(cartoObservationVue, nomCommune, codeLoc); |
} |
/** |
1160,6 → 1166,7 |
} |
public void rafraichirSaisieCommuneObservation(EntiteGeographiqueObservation infosCommune) { |
InformationCommuneDAO.annulerRequeteEnCours(); |
formulaireSaisieObservationVue.rafraichir(infosCommune, false); |
cacherFenetreCarto(); |
} |
/trunk/src/org/tela_botanica/client/util/Util.java |
---|
1,5 → 1,7 |
package org.tela_botanica.client.util; |
import java.text.NumberFormat; |
import java.text.ParsePosition; |
import java.util.ArrayList; |
import java.util.Collections; |
import java.util.Comparator; |
126,54 → 128,49 |
return lieuModele; |
} |
public static String obtenirDepartementAPartirChaineCommune(String departement, String commune) { |
public static String obtenirIdLocAPartirChaineCommune(String commune) { |
String dep = ""; |
if(departement == null) { |
departement = ""; |
} |
if(departement.equals("000null") || departement.equals("")) { |
String[] depCom = commune.split(" "); |
if(depCom.length > 1) { |
dep = depCom[1].replace('(', ' '); |
} else { |
dep = ""; |
} |
String idLoc = ""; |
String[] depCom = commune.split(" "); |
if(depCom.length > 1) { |
idLoc = depCom[1].replace('(', ' '); |
} else { |
dep = departement; |
idLoc = ""; |
} |
dep = dep.replace(')', ' '); |
dep = dep.trim(); |
dep = dep.replace('\\',' '); |
dep = dep.trim(); |
idLoc = idLoc.replace(')', ' '); |
idLoc = idLoc.trim(); |
idLoc = idLoc.replace('\\',' '); |
idLoc = idLoc.trim(); |
return idLoc; |
} |
public static String formaterDepartement(String depAFormater) { |
String dep = ""; |
try |
{ |
int nDep = Integer.parseInt(dep); |
int nDep = Integer.parseInt(depAFormater); |
if(nDep > 0 && nDep < 110) { |
departement = dep ; |
dep = depAFormater ; |
} |
if(departement.length() == 4) { |
departement = "0"+departement; |
if(depAFormater.length() == 4) { |
dep = "0"+depAFormater; |
} |
departement = departement.substring(0,2); |
dep = depAFormater.substring(0,2); |
} |
catch(NumberFormatException e) |
{ |
departement = "" ; |
// rien à faire |
} |
return departement; |
return dep; |
} |
public static String supprimerNumDepartementChaineLocalite(String chaineLocaliteComplete) { |
return chaineLocaliteComplete.replaceAll(" \\([0-9]*\\)", ""); |
public static String supprimerChaineIdLocalite(String chaineLocaliteComplete) { |
return chaineLocaliteComplete.replaceAll(" \\([a-zA-Z0-9]*\\)", ""); |
} |
public static String convertirChaineZoneGeoVersDepartement(String chaineZoneGeo) { |
303,6 → 300,16 |
return estZero; |
} |
public static boolean estUnNombre(String s) { |
//http://stackoverflow.com/questions/1102891/how-to-check-if-a-string-is-a-numeric-type-in-java |
try { |
double d = Double.parseDouble(s); |
} catch(NumberFormatException nfe) { |
return false; |
} |
return true; |
} |
public static String formaterNombre(String s) { |
s = s.indexOf(".") < 0 ? s : s.replaceAll("0*$", "").replaceAll("\\.$", ""); |
return s; |
431,5 → 438,4 |
public static void curseurParDefaut() { |
RootPanel.getBodyElement().getStyle().setProperty("cursor", "default"); |
} |
} |
/trunk/src/org/tela_botanica/client/vues/observation/FormulaireSaisieObservationVue.java |
---|
97,11 → 97,13 |
private ComboBox milieu = null; |
private TextField comment = null; |
private ComboBox commune = null; |
private String departement = null; |
private ComboBox espece = null; |
private String numeroNom = null; |
private String numeroOrdre = null; |
private String codeInseeCommune = null; |
private String codeLoc = null; |
private String referentielTaxo = null; |
private String referentielGeo = null; |
335,7 → 337,9 |
commune.setHideTrigger(true); |
//création du lien "Accès carto" dans le formulaire |
basculerverscarto = new HTML(" <a id=\"lien_carto\" href=\"#\" tabindex=\"2\">Localiser la commune</a>"); |
String aideLienLocaliser = "Vous pouvez entrer une nom sous la forme commune (departement) ou bien commune (pays) "+ |
"avec un numéro de département sur 2 chiffres ou un code de pays àdeux lettres "; |
basculerverscarto = new HTML(" <a id=\"lien_carto\" title=\""+aideLienLocaliser+"\" href=\"#\" tabindex=\"2\">Localiser la zone</a>"); |
basculerverscarto.addStyleName("lien_actif"); |
//création info bulle sur le lien "accès carto" |
772,10 → 776,9 |
@Override |
public void execute(EventObject e) { |
if(commune.getValue() != null && !commune.getValue().equals("") && !getDepartement().equals("")) { |
if(commune.getValue() != null && !commune.getValue().equals("")) { |
obtenirInformationCommune(); |
longlatAjoutee = true; |
} else { |
Window.alert("Veuillez renseigner une commune et un numéro de département sous la forme : Commune (departement)"); |
} |
898,7 → 901,7 |
public void onSelect(ComboBox comboBox, Record record, int index) { |
commune.setValue(record.getAsString("commune")); |
departement=record.getAsString("departement"); |
codeInseeCommune=record.getAsString("codeInsee"); |
codeLoc=record.getAsString("codeInsee"); |
selectionCommune=true; |
commune.collapse(); |
} |
1284,10 → 1287,15 |
final EntiteGeographiqueObservation infosCom) { |
String nCommune = ""; |
if(infosCom != null && !infosCom.getZoneGeo().trim().equals("")){ |
if(infosCom != null && infosCom.getZoneGeo() != null && !infosCom.getZoneGeo().trim().isEmpty()){ |
nCommune += infosCom.getZoneGeo(); |
if(!infosCom.getIdZoneGeo().trim().equals("")) |
nCommune += " ("+Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo())+")"; |
if(!infosCom.getIdZoneGeo().trim().isEmpty()) { |
if(Util.estUnNombre(infosCom.getIdZoneGeo())) { |
nCommune += " ("+Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo())+")"; |
} else if(infosCom.getPays() != null && infosCom.getPays().trim().isEmpty()) { |
nCommune += " ("+infosCom.getPays()+")"; |
} |
} |
lienSelectionCommune.setHtml("<a id=\"lien_selection_commune\" tabindex=\"9\">"+nCommune+"</a>"); |
lienSelectionCommune.setStyleName("img-curseur-depl"); |
1340,12 → 1348,15 |
if(infosCom.getZoneGeo() != null && !infosCom.getZoneGeo().equals("")) { |
nCommune += infosCom.getZoneGeo(); |
} |
if(infosCom.getIdZoneGeo() != null && !infosCom.getIdZoneGeo().equals("")) { |
if(Util.estUnNombre(infosCom.getIdZoneGeo())) { |
String codeGeoFormate = Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo()); |
nCommune += " ("+codeGeoFormate+")"; |
departement = Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo()); |
} else if(infosCom.getPays() != null && infosCom.getPays().trim().isEmpty()) { |
nCommune += " ("+infosCom.getPays()+")"; |
} |
if (! nCommune.equals("")) { |
commune.setValue(nCommune); |
communeModifiee = true; |
1354,7 → 1365,7 |
// Se déclenche au retour de la "localisation sur la carte" |
private void rafraichirCommuneEtCoord(EntiteGeographiqueObservation infosCom) { |
rafraichirCommune(infosCom); |
if(infosCom.getLat() != null && !infosCom.getLat().equals("")) { |
latitude.setValue(Util.tronquerNombrePourAffichage("" + infosCom.getLat(), 5)); |
2159,6 → 2170,11 |
lon = -61.08334; |
zoom = 7; |
break; |
case "lbf" : |
lat = 33.53; |
lon = 35.30; |
zoom = 7; |
break; |
case "bdtfx" : |
default: |
lat = 47.0504; |
2180,11 → 2196,19 |
} |
private void obtenirInformationCommune() { |
observationMediateur.obtenirInformationCommune(getCommuneSansDepartement(), Util.obtenirDepartementAPartirChaineCommune(departement, commune.getText())); |
String idLoc = ""; |
if(departement != null && !departement.isEmpty()) { |
idLoc = departement; |
} else { |
idLoc = Util.obtenirIdLocAPartirChaineCommune(commune.getText()); |
if(Util.estUnNombre(idLoc)) { |
idLoc = Util.formaterDepartement(idLoc); |
} |
} |
observationMediateur.obtenirInformationCommune(getCommuneSansIdLoc(), idLoc); |
} |
public double[] coordonneesValides() { |
try { |
double lat = Double.parseDouble(latitude.getValueAsString().replaceAll(",", ".")); |
2220,14 → 2244,10 |
return valeurCommune; |
} |
public String getDepartement() { |
return Util.obtenirDepartementAPartirChaineCommune(departement, commune.getText()); |
public String getCommuneSansIdLoc() { |
return Util.supprimerChaineIdLocalite(getCommune()); |
} |
public String getCommuneSansDepartement() { |
return Util.supprimerNumDepartementChaineLocalite(getCommune()); |
} |
private String getValeurChampListeLibre(ComboBox champ) { |
String valeurChamp = champ.getValue(); |
String valeurChampBrute = champ.getRawValue(); |
/trunk/src/org/tela_botanica/client/vues/observation/CartographieObservationVue.java |
---|
46,7 → 46,7 |
String valeurCommune = "Bourges"; // j'aurais préféré Bort-les-Orgues |
LatLng centreFrance = null; |
LatLng pointCommune = null; |
String codeCommune = ""; |
String codeLoc = ""; |
int niveauZoom = 6; |
97,18 → 97,22 |
} |
public void obtenirInfosCommunes(LatLng coord) { |
// Remise à zéro des infos restantes d'une ancienne requete |
valeurCommune = ""; |
codeLoc = ""; |
oMediateur.obtenirInformationCoord(this, coord.lat(), coord.lng()); |
} |
public void mettreAJourInfos(final LatLng pointNouvelleCommune, String infosComplementaires, int zoom) { |
public void mettreAJourInfos(final LatLng pointNouvelleCommune, int zoom) { |
GoogleMap mapNulle = null; |
if(nmk != null) { |
nmk.setMap(mapNulle); |
} |
pointCommune = pointNouvelleCommune; |
nmk = fabriquerMarqueur(pointCommune, infosComplementaires); |
nmk = fabriquerMarqueur(pointCommune); |
nmk.setMap(map); |
afficherInfoMarker(nmk); |
afficherInfoMarker(nmk, construireContenuInfoMarker(nmk)); |
recentrerCarte(nmk.getPosition()); |
map.setZoom(zoom); |
} |
171,7 → 175,7 |
if(nmk != null) { |
nmk.setMap(mapNulle); |
} |
nmk = fabriquerMarqueur(pointCommune,""); |
nmk = fabriquerMarqueur(pointCommune); |
nmk.setMap(map); |
info.setContent("<div id=\"info_contenu\">"+ |
"Déplacez ce marqueur pour localiser votre observation (commune et coordonnées)<br />" |
183,7 → 187,7 |
} |
public void AfficherMessageAucuneInfos() { |
mettreAJourInfos(centreFrance,"", niveauZoom); |
mettreAJourInfos(centreFrance, niveauZoom); |
Window.alert("Aucune information pour le nom donné"); |
} |
207,7 → 211,8 |
bouton.addListener("click", new EventCallback() { |
@Override |
public void execute(EventObject e) { |
EntiteGeographiqueObservation infosCommune = new EntiteGeographiqueObservation(codeCommune,valeurCommune,null,null); |
EntiteGeographiqueObservation infosCommune = new EntiteGeographiqueObservation(codeLoc,valeurCommune,null,null); |
// TODO: ajouter pays à tout Ceci |
infosCommune.setLat(pointCommune.lat()+""); |
infosCommune.setLon(pointCommune.lng()+""); |
oMediateur.rafraichirSaisieCommuneObservation(infosCommune); |
254,20 → 259,23 |
String nouvelleValeurCommune = infos.getZoneGeo(); |
valeurCommune = nouvelleValeurCommune; |
if (infos.getIdZoneGeo() != null) { |
codeCommune = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo()); |
} else { |
codeCommune = ""; |
codeLoc = ""; |
if(infos.getIdZoneGeo() != null) { |
if (infos.getPays().equals("FR")) { |
codeLoc = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo()); |
} else { |
codeLoc = infos.getPays(); |
} |
} |
pointCommune = coord; |
mettreAJourInfos(coord, "", niveauZoom); |
mettreAJourInfos(coord, niveauZoom); |
} |
masquerChargement(false); |
} |
public Marker fabriquerMarqueur(LatLng pointMarqueur, final String texte) { |
public Marker fabriquerMarqueur(LatLng pointMarqueur) { |
// ajout de marqueurs déplacables, qui affichent une bulle d'information |
MarkerOptions options = MarkerOptions.create(); |
options.setDraggable(true); |
278,6 → 286,7 |
@Override |
public void handle(MouseEvent event) { |
afficherInfoMarker(marker, construireContenuPartielInfoMarker(marker)); |
obtenirInfosCommunes(event.getLatLng()); |
} |
}); |
298,7 → 307,7 |
info.close(); |
infoOuverte = false; |
} else { |
afficherInfoMarker(marker); |
afficherInfoMarker(marker, construireContenuPartielInfoMarker(marker)); |
infoOuverte = true; |
} |
} |
328,7 → 337,7 |
return carteAjoutee; |
} |
public void afficherInfoMarker(Marker marker) { |
public String construireContenuInfoMarker(Marker marker) { |
final String htmlBoutonOk = "<br /><button id=\"okMap\" class=\"x-btn-text\" type=\"button\">OK</button>"; |
String contenuMarker = ""; |
339,23 → 348,58 |
marker.setPosition(point); |
niveauZoom = 6; |
} |
contenuMarker = "<div id=\"info_contenu\">"+ |
"Aucun nom de lieu trouvé à cet emplacement <br />" |
+"Déplacez ce marqueur pour localiser votre observation (nom de lieu et coordonnées)<br />" |
+"longitude=" |
+ Util.tronquerNombrePourAffichage("" + marker.getPosition().lng(), 5) + "<br />latitude=" |
+ Util.tronquerNombrePourAffichage("" + marker.getPosition().lat(), 5) + "</div>"; |
contenuMarker = |
"<div id=\"info_contenu\">"+ |
"Aucun nom de lieu trouvé à cet emplacement <br />" |
+"Déplacez ce marqueur pour localiser votre observation (nom de lieu et coordonnées)<br />" |
+"longitude="+Util.tronquerNombrePourAffichage(""+marker.getPosition().lng(), 5)+"<br />" |
+"latitude="+Util.tronquerNombrePourAffichage(""+marker.getPosition().lat(), 5)+ |
"</div>"; |
} else { |
contenuMarker = "" |
+valeurCommune+" ("+codeCommune+")<br />" |
+"longitude=" |
+ Util.tronquerNombrePourAffichage("" + marker.getPosition().lng(), 5) + "<br />latitude=" |
+ Util.tronquerNombrePourAffichage("" + marker.getPosition().lat(), 5) ; |
String chaineCommune = valeurCommune + ((codeLoc.isEmpty()) ? "" : " ("+codeLoc+")"); |
contenuMarker = |
"<div id=\"info_contenu\">"+ |
chaineCommune+"<br />" |
+"longitude="+Util.tronquerNombrePourAffichage(""+marker.getPosition().lng(), 5)+"<br />" |
+"latitude="+Util.tronquerNombrePourAffichage(""+marker.getPosition().lat(), 5)+ |
"</div>"; |
} |
info.setContent(contenuMarker+ htmlBoutonOk); |
info.open(map, marker); |
return contenuMarker+ htmlBoutonOk; |
} |
public String construireContenuPartielInfoMarker(Marker marker) { |
final String htmlBoutonOk = "<br /><button id=\"okMap\" class=\"x-btn-text\" type=\"button\">OK</button>"; |
String contenuMarker = ""; |
contenuMarker = |
"<div id=\"info_contenu\">"+ |
"<div class=\"recherche_infos_zone_geo\">"+ |
"<div class=\"recherche_infos_zone_geo_en_cours\">"+ |
"<img src=\"chargement_carte.gif\" />"+ |
"<div>"+ |
"Recherche du nom de lieu en cours... <br />"+ |
"Cela peut prendre un moment"+ |
"</div>"+ |
"<hr class=\"nettoyage\" />"+ |
"</div>"+ |
"Si vous ne désirez que les coordonnées, vous pouvez cliquer dès maintenant sur OK"+ |
"</div>"+ |
"longitude="+Util.tronquerNombrePourAffichage("" + marker.getPosition().lng(), 5)+"<br />"+ |
"latitude="+Util.tronquerNombrePourAffichage("" + marker.getPosition().lat(), 5)+ |
"</div>"; |
return contenuMarker+ htmlBoutonOk; |
} |
public void afficherInfoMarker(Marker marker, String contenuInfo) { |
info.setContent(contenuInfo); |
info.open(map, marker); |
pointCommune = marker.getPosition(); |
info.addDomReadyListenerOnce(new InfoWindow.DomReadyHandler() { |
@Override |
public void handle() { |
365,6 → 409,12 |
recentrerCarte(marker.getPosition()); |
} |
public void afficherCarteEnAttenteAvecMarker(double lat, double lon) { |
pointCommune = LatLng.create(lat, lon); |
nmk.setPosition(pointCommune); |
afficherInfoMarker(nmk, construireContenuPartielInfoMarker(nmk)); |
} |
public double[] getCoordsCentreFrance() { |
double[] coords = {47.0504, 2.2347}; |