From ca688e07861b4aca0a3742428ce0d3a6ea446116 Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 26 Oct 2014 17:48:20 +0100 Subject: [PATCH] Correction pour avoir un markercluster fonctionnel --- app/assets/javascripts/maps.js.coffee | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/maps.js.coffee b/app/assets/javascripts/maps.js.coffee index f6d40a63..f601a443 100644 --- a/app/assets/javascripts/maps.js.coffee +++ b/app/assets/javascripts/maps.js.coffee @@ -12,14 +12,12 @@ $(document).ready -> # Does this feature have a property named popupContent? if (feature.properties && feature.properties.popupContent) layer.bindPopup feature.properties.popupContent - ).addTo map + ) # Automatic focus to all displayed events map.fitBounds layer.getBounds() - markers = L.markerClusterGroup() - markers.addLayer layer - map.addLayer markers + map.addLayer L.markerClusterGroup().addLayer layer $('.events #map, .moderations #map').each -> coord = [$(this).attr('latitude'), $(this).attr('longitude')] @@ -36,10 +34,8 @@ $(document).ready -> # Does this feature have a property named popupContent? if (feature.properties && feature.properties.popupContent) layer.bindPopup(feature.properties.popupContent) - ).addTo map + ) - markers = L.markerClusterGroup() - markers.addLayer layer - map.addLayer markers + map.addLayer L.markerClusterGroup().addLayer layer marker = L.marker([coord[0], coord[1]]).addTo map