195,9 → 195,9 |
// Lorsque la carte est chargée, on vérifie si on peut précharger des données |
google.maps.event.addListenerOnce(this.map, 'idle', function(){ |
// Initialisation du marker de début de rue |
lthis.initialiserMarkerDeb(); |
if (this.obsId == '') { |
if (!lthis.obsId) { |
// Tentative de geocalisation si aucune obs à précharger |
lthis.initialiserMarkerDeb(); |
lthis.tenterGeolocalisation(); |
} |
}); |
224,8 → 224,6 |
var pos = new google.maps.LatLng(data.latitude, data.longitude); |
|
if(data.hasOwnProperty("extension")) { |
this.initialiserMarkerFin(); |
|
// cas des obs florilèges qui apparaissent aussi comme des obs sauvages |
// mais qui n'ont pas de coté de rue |
if(data.extension.hasOwnProperty("coteRue")) { |
234,12 → 232,16 |
|
var deb = new google.maps.LatLng(data.extension.latitudeDebutRue.valeur, data.extension.longitudeDebutRue.valeur); |
var fin = new google.maps.LatLng(data.extension.latitudeFinRue.valeur, data.extension.longitudeFinRue.valeur); |
|
|
this.mettreAJourMarkerPosition(pos); |
|
this.deplacerMarkerDeb(deb); |
this.deplacerMarkerFin(fin); |
this.afficherEtapeGeolocalisation(4); |
this.latLngDeb = deb; |
this.initialiserMarkerDebSimple(); |
|
this.latLngFin = fin; |
this.initialiserMarkerFin(fin); |
|
this.rechercherRue(); |
|
var latlngbounds = new google.maps.LatLngBounds(); |
latlngbounds.extend(deb); |
251,6 → 253,22 |
} |
}; |
|
WidgetSaisieSauvages.prototype.initialiserMarkerDebSimple = function() { |
this.premierDeplacement = true; |
if (this.markerDeb == undefined) { |
// Marqueur de début de Rue |
this.markerDeb = new google.maps.Marker({ |
map: this.map, |
draggable: true, |
title: 'Début de la portion de rue étudiée', |
icon: this.googleMapMarqueurDebutUrl, |
position: this.latLngDeb |
}); |
google.maps.event.addListener(this.markerDeb, 'dragend', this.surDeplacementMarkerDeb.bind(this)); |
} |
} |
|
|
WidgetSaisieSauvages.prototype.initialiserMarkerDeb = function() { |
this.premierDeplacement = true; |
if (this.markerDeb == undefined) { |
276,6 → 294,8 |
}; |
|
WidgetSaisieSauvages.prototype.surDeplacementMarkerDeb = function() { |
// Annulation d'une éventuelle recherche de rue déjà en cours |
this.annulerRechercherRue(); |
this.latLngDeb = this.markerDeb.getPosition(); |
this.deplacerMarkerDeb(this.latLngDeb); |
}; |
282,10 → 302,18 |
|
WidgetSaisieSauvages.prototype.deplacerMarkerDeb = function(nouvellePosition) { |
|
// Annulation d'une éventuelle recherche de rue déjà en cours |
this.annulerRechercherRue(); |
|
this.latLngDeb = nouvellePosition; |
if (this.markerDeb == undefined) { |
// Marqueur de début de Rue |
this.markerDeb = new google.maps.Marker({ |
map: this.map, |
draggable: true, |
title: 'Début de la portion de rue étudiée', |
icon: this.googleMapMarqueurDebutUrl, |
position: this.latLngDeb |
}); |
google.maps.event.addListener(this.markerDeb, 'dragend', this.surDeplacementMarkerDeb.bind(this)); |
} |
this.markerDeb.setPosition(this.latLngDeb); |
this.map.setCenter(this.latLngDeb); |
this.mettreAJourMarkerPosition(this.latLngDeb); |
293,7 → 321,7 |
|
var nouvellePositionFin = new google.maps.LatLng(this.latLngDeb.lat(), this.latLngDeb.lng() + 0.0010); |
this.initialiserMarkerFin(); |
this.deplacerMarkerFin(nouvellePositionFin) |
this.deplacerMarkerFin(nouvellePositionFin); |
this.afficherEtapeGeolocalisation(3); |
}; |
|
307,8 → 335,6 |
position: this.latLngFin |
}); |
google.maps.event.addListener(this.markerFin, 'dragend', this.surDeplacementMarkerFin.bind(this)); |
} else { |
this.markerFin.setMap(null); |
} |
}; |
|
336,7 → 362,9 |
} |
|
WidgetSaisieSauvages.prototype.afficherChargementRechercheRue = function() { |
this.ligneRue.setMap(null); |
if(!!this.ligneRue) { |
this.ligneRue.setMap(null); |
} |
var img = '<img src="'+this.chargementImageIconeUrl+'" />'; |
$('#indication-nom-rue-nom').html(img+" Recherche de la rue en cours"); |
$('#indication-nom-rue').css('visibility','visible'); |
460,6 → 488,8 |
lthis.deplacerMarkerDeb(nouvellePosition); |
lthis.map.setZoom(16); |
}); |
} else { |
lthis.initialiserMarkerDeb(); |
} |
}; |
|