Subversion Repositories eFlore/Applications.moissonnage

Compare Revisions

Ignore whitespace Rev 42 → Rev 43

/trunk/widget/modules/carto/squelettes/scripts/carto.js
700,16 → 700,20
// Gestion des points
 
function ajouterPoint(feature) {
var iconePoint = new L.Icon({ iconUrl : pointImageUrl, iconSize : [16, 16] }),
iconeCommune = new L.Icon({ iconUrl : communeImageUrl, iconSize : [24, 32] }),
icone = (feature.properties.typeSite == 'STATION') ? iconePoint : iconeCommune,
point = new L.LatLng(feature.geometry.coordinates[0], feature.geometry.coordinates[1]);
var marker = new L.Cluster(point, {
var point = new L.LatLng(feature.geometry.coordinates[0], feature.geometry.coordinates[1]);
feature.properties.typeSite = feature.properties.typeSite.toLowerCase();
coucheSites.ajouterPoint(point, feature.properties);
}
 
function creerMarqueur(point, properties) {
var iconePoint = new L.Icon({ iconUrl : pointImageUrl, iconSize : [16, 16] });
var iconeCommune = new L.Icon({ iconUrl : communeImageUrl, iconSize : [24, 32] });
var icone = (properties.typeSite == 'station') ? iconePoint : iconeCommune;
var marker = new L.Cluster(point, properties, {
icon : icone,
titre : feature.properties.nom
titre : properties.nom
});
marker.typeSite = feature.properties.typeSite.toLowerCase();
marker.source = feature.properties.source;
console.log(marker);
marker.on('click', surClicMarqueur);
marker.on('mouseover', function() {
afficherTooltip(marker.options.titre, map.latLngToContainerPoint(marker.getLatLng()));
717,7 → 721,7
marker.on('mouseout', function() {
$("#tooltip").css('display', 'none');
});
coucheSites.ajouterPoint(marker);
return marker;
}
 
function construireContenuHtmlLegendePoints() {
743,7 → 747,7
 
 
function surClicMarqueur(event) {
var nombreMarkers = event.target.recupererMarkers().length;
var nombreMarkers = event.target.obtenirNombrePoints();
if (nombreMarkers == 1 || map.getZoom() == map.getMaxZoom()) {
recupererObservations(event.target);
} else {
772,7 → 776,7
}
 
function recupererSourcesCluster(cluster) {
var markers = cluster.recupererMarkers();
var markers = cluster.recupererPoints();
var sourcesCluster = [];
for (var index = 0; index < markers.length; index ++) {
if (sourcesCluster.indexOf(markers[index].source) == -1) {