Correction pour avoir un markercluster fonctionnel

This commit is contained in:
echarp 2014-10-26 17:48:20 +01:00
parent 8d8c732504
commit ca688e0786

View File

@ -12,14 +12,12 @@ $(document).ready ->
# Does this feature have a property named popupContent? # Does this feature have a property named popupContent?
if (feature.properties && feature.properties.popupContent) if (feature.properties && feature.properties.popupContent)
layer.bindPopup feature.properties.popupContent layer.bindPopup feature.properties.popupContent
).addTo map )
# Automatic focus to all displayed events # Automatic focus to all displayed events
map.fitBounds layer.getBounds() map.fitBounds layer.getBounds()
markers = L.markerClusterGroup() map.addLayer L.markerClusterGroup().addLayer layer
markers.addLayer layer
map.addLayer markers
$('.events #map, .moderations #map').each -> $('.events #map, .moderations #map').each ->
coord = [$(this).attr('latitude'), $(this).attr('longitude')] coord = [$(this).attr('latitude'), $(this).attr('longitude')]
@ -36,10 +34,8 @@ $(document).ready ->
# Does this feature have a property named popupContent? # Does this feature have a property named popupContent?
if (feature.properties && feature.properties.popupContent) if (feature.properties && feature.properties.popupContent)
layer.bindPopup(feature.properties.popupContent) layer.bindPopup(feature.properties.popupContent)
).addTo map )
markers = L.markerClusterGroup() map.addLayer L.markerClusterGroup().addLayer layer
markers.addLayer layer
map.addLayer markers
marker = L.marker([coord[0], coord[1]]).addTo map marker = L.marker([coord[0], coord[1]]).addTo map