Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2743 → Rev 2744

/trunk/widget/modules/saisie/squelettes/sauvages/sauvages.tpl.html
116,7 → 116,9
widget.ville = "<?=isset($_GET['ville']) ? $_GET['ville'] : ''?>";
widget.ville = <?= isset($_GET['commune']) ? "'".$_GET['commune']."'" : 'widget.ville' ?>;
// URL de l'icône du bouton supprimer
widget.supprimerIconeUrl = "<?=$url_base?>/modules/saisie/squelettes/sauvages/img/icones/supprimer.png";
widget.supprimerIconeUrl = "<?=$url_base?>/modules/saisie/squelettes/sauvages/img/icones/supprimer.png";
// URL du service de trace des rues
widget.serviceTraceRueUrl = "<?=$url_ws_trace_rue_tpl?>";
// Go bibiche !
widget.init();
319,7 → 321,12
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="indication-nom-rue">
<a href="#" class="navigation-rue navigation-rue-precedent" id="indication-nom-rue-precedent">&#8592;</a>
<div id="indication-nom-rue-nom">Pas de rue selectionnée</div>
<a href="#" class="navigation-rue navigation-rue-suivant" id="indication-nom-rue-suivant">&#8594;</a>
</div>
<div class="span12" id="map-container">
<div id="map-canvas" class="has-tooltip"
title="Vous pouvez cliquer sur la carte pour déplacer le marqueur
représentant votre station ou bien le glisser-déposer sur
/trunk/widget/modules/saisie/squelettes/sauvages/css/sauvages.css
163,8 → 163,13
#map-canvas {
height: 280px;
margin-bottom: 5px;
margin-top: -40px;
}
 
#map-container {
margin-left: 0;
}
 
#map-canvas img {
max-width: none;
}
389,6 → 394,54
color:#118811;
}
 
#indication-nom-rue {
-moz-user-select: none;
background-clip: padding-box;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.15);
border-bottom-left-radius: 2px;
border-top-left-radius: 2px;
box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
color: #565656;
direction: ltr;
font-family: Roboto,Arial,sans-serif;
font-size: 11px;
left: 40px;
width: 370px;
min-width: 25px;
overflow: hidden;
padding: 1px 6px;
position: relative;
text-align: center;
top: -11px;
z-index: 10;
visibility:hidden;
}
 
#indication-nom-rue-nom {
display: inline-block;
}
 
.navigation-rue, .navigation-rue:active {
display: inline-block;
color: black;
font-size: 20px;
margin-top: -4px;
}
 
#indication-nom-rue-precedent {
float: left;
}
 
#indication-nom-rue-suivant {
float: right;
}
 
#indication-nom-rue img {
height: 15px;
margin-bottom: 2px;
}
 
/*-------------------------------------------------------*/
/* Autocomplete */
.valeur-defaut-recherche {
/trunk/widget/modules/saisie/squelettes/sauvages/js/WidgetSaisieSauvages.js
13,7 → 13,10
this.googleMapMarqueurFinUrl = null;
this.ville = null;
this.supprimerIconeUrl = null;
this.serviceTraceRueUrl = null;
this.taxons = {};
this.listeRues = {};
this.indexRueSelectionnee = 0;
}
WidgetSaisieSauvages.prototype = new WidgetSaisie();
 
138,6 → 141,8
$('#fichier').click();
});
$('#geolocaliser').on('click', this.geolocaliser.bind(this));
$('.navigation-rue').on('click', this.surClicRueSuivantPrecedent.bind(this))
};
 
WidgetSaisieSauvages.prototype.montrerFormIdentite = function() {
279,15 → 284,10
this.mettreAJourMarkerPosition(this.latLngDeb);
this.trouverCommune(this.latLngDeb);
 
if (this.premierDeplacement) {
this.initialiserMarkerDeb();
this.premierDeplacement = false;
} else {
var nouvellePositionFin = new google.maps.LatLng(this.latLngDeb.lat(), this.latLngDeb.lng() + 0.0010);
this.initialiserMarkerFin();
this.deplacerMarkerFin(nouvellePositionFin)
this.afficherEtapeGeolocalisation(3);
}
var nouvellePositionFin = new google.maps.LatLng(this.latLngDeb.lat(), this.latLngDeb.lng() + 0.0010);
this.initialiserMarkerFin();
this.deplacerMarkerFin(nouvellePositionFin)
this.afficherEtapeGeolocalisation(3);
};
 
WidgetSaisieSauvages.prototype.initialiserMarkerFin = function() {
313,9 → 313,83
};
 
WidgetSaisieSauvages.prototype.surDeplacementMarkerFin = function() {
this.dessinerLigneRue(this.markerDeb.getPosition(), this.markerFin.getPosition());
this.afficherCentreRue();
this.rechercherRue();
};
 
WidgetSaisieSauvages.prototype.surClicRueSuivantPrecedent = function(event) {
event.preventDefault();
if($(event.target).hasClass("navigation-rue-suivant")) {
this.indexRueSelectionnee = this.indexRueSelectionnee < this.listeRues.length - 1 ? this.indexRueSelectionnee + 1 : 0;
} else {
this.indexRueSelectionnee = this.indexRueSelectionnee > 0 ? this.indexRueSelectionnee - 1 : this.listeRues.length - 1;
}
this.mettreRueEnValeur(this.listeRues[this.indexRueSelectionnee]);
}
 
WidgetSaisieSauvages.prototype.afficherChargementRechercheRue = function() {
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');
$('#indication-nom-rue').effect("highlight", {}, 500);
$(".navigation-rue").toggle(false);
}
 
WidgetSaisieSauvages.prototype.rechercherRue = function() {
this.afficherChargementRechercheRue();
var params = "latitude_debut="+this.markerDeb.getPosition().lat()+"&longitude_debut="+this.markerDeb.getPosition().lng()+
"&latitude_fin="+this.markerFin.getPosition().lat()+"&longitude_fin="+this.markerFin.getPosition().lng();
var lthis = this;
 
$.getJSON(this.serviceTraceRueUrl+'?'+params, function(data) {
$('#indication-nom-rue-nom').html("");
lthis.listeRues = data.elements;
var coordDeb = {"lat" : lthis.markerDeb.getPosition().lat(), "lon" : lthis.markerDeb.getPosition().lng()};
var coordFin = {"lat" : lthis.markerFin.getPosition().lat(), "lon" : lthis.markerFin.getPosition().lng()};
var tags = {"name" : "Aucune rue sélectionnée" };
var pasDeRue = {"geometry" : [coordDeb, coordFin], "tags" : tags};
lthis.listeRues.push(pasDeRue);
lthis.indexRueSelectionnee = 0;
lthis.mettreRueEnValeur(lthis.listeRues[0]);
});
}
 
WidgetSaisieSauvages.prototype.mettreRueEnValeur = function(rue) {
this.afficherIndicationRue(rue['tags']['name']);
this.afficherTraceRue(rue['geometry']);
this.afficherEtapeGeolocalisation(4);
}
 
WidgetSaisieSauvages.prototype.afficherIndicationRue = function(indication) {
indication = !!indication ? indication : "Nom de rue inconnu";
$('#indication-nom-rue-nom').html(indication);
$('#indication-nom-rue').css('visibility','visible');
$('#indication-nom-rue').effect("highlight", {}, 500);
$(".navigation-rue").toggle(this.listeRues.length > 1);
}
 
WidgetSaisieSauvages.prototype.afficherTraceRue = function(rue) {
 
if (this.ligneRue != undefined) {
this.ligneRue.setMap(null);
}
 
var cheminRue = new Array();
if(rue.length > 0) {
$.each(rue, function(index, value) {
cheminRue.push(new google.maps.LatLng(value['lat'], value['lon']));
});
this.ligneRue = new google.maps.Polyline({
path: cheminRue,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 2
});
this.ligneRue.setMap(this.map);
}
};
 
WidgetSaisieSauvages.prototype.dessinerLigneRue = function(pointDebut, pointFin) {