Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1825 → Rev 1826

/trunk/widget/modules/carto/squelettes/scripts/carto.js
22,7 → 22,9
nombreCollections = 0,
collections = new Array(),
structures = new Array(),
coucheStructures = new L.FeatureGroup(),
coucheStructures = new L.MarkerClusterGroup({
disableClusteringAtZoom : 10
}),
infoBulle = null,
chargementEnCours = false;
 
32,8 → 34,6
initialiserCarte();
initialiserPanneauControle();
 
// obtenirNombreCollections
// $.getJSON(urlWebService + "CoelRecherche/Nombre/*/*/*/*/*/*/*/" + departement + "/*/", {async:false}).complete(function() { recupererValeurNombreCollections(); });
$.ajax({
dataType: "json",
url: urlWebService + "CoelRecherche/Nombre/*/*/*/*/*/*/*/" + departement + "/*/",
176,20 → 176,27
function creerMarqueur(structure) {
var latlng = new L.LatLng(structure.latitude, structure.longitude);
var marqueur = new L.Marker(latlng, {
title : structure.nom,
structures : [structure]
//title : structure.nom,
structures : [structure],
structuresNom : structure.nom
});
marqueur.on('click', surClickMarqueur);
marqueur.on('mouseover', construireToolTipMarqueur);
coucheStructures.addLayer(marqueur);
}
 
function ajouterStructureAMarqueur(marqueur, structure) {
marqueur.options.structures.push(structure);
function construireToolTipMarqueur(event) {
// changer la propriété title du marqueur ne fonctionne pas
// en dehors du constructeur (mais cette méthode est-elle pérenne ?)
marqueur._icon.title += "\n"+structure.nom;
// le clustering n'affichant pas tous les marqueurs, on doit remplir le tooltip
event.target._icon.title = event.target.options.structuresNom;
}
 
function ajouterStructureAMarqueur(marqueur, structure) {
marqueur.options.structures.push(structure);
marqueur.options.structuresNom += "\n"+structure.nom;
}
 
function surClickMarqueur(event) {
var latlng = event.target.getLatLng();
var structures = event.target.options.structures;