700,20 → 700,16 |
// Gestion des points |
|
function ajouterPoint(feature) { |
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, { |
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, { |
icon : icone, |
titre : properties.nom |
titre : feature.properties.nom |
}); |
console.log(marker); |
marker.typeSite = feature.properties.typeSite.toLowerCase(); |
marker.source = feature.properties.source; |
marker.on('click', surClicMarqueur); |
marker.on('mouseover', function() { |
afficherTooltip(marker.options.titre, map.latLngToContainerPoint(marker.getLatLng())); |
721,7 → 717,7 |
marker.on('mouseout', function() { |
$("#tooltip").css('display', 'none'); |
}); |
return marker; |
coucheSites.ajouterPoint(marker); |
} |
|
function construireContenuHtmlLegendePoints() { |
747,7 → 743,7 |
|
|
function surClicMarqueur(event) { |
var nombreMarkers = event.target.obtenirNombrePoints(); |
var nombreMarkers = event.target.recupererMarkers().length; |
if (nombreMarkers == 1 || map.getZoom() == map.getMaxZoom()) { |
recupererObservations(event.target); |
} else { |
776,7 → 772,7 |
} |
|
function recupererSourcesCluster(cluster) { |
var markers = cluster.recupererPoints(); |
var markers = cluster.recupererMarkers(); |
var sourcesCluster = []; |
for (var index = 0; index < markers.length; index ++) { |
if (sourcesCluster.indexOf(markers[index].source) == -1) { |