Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I built a map using Leaflet and markercluster.js, and I'm having a strange issue where after I click on the first popup, I'm unable to open any other popup. This happens whether you close the first popup manually or not.

When I don't use markercluster.js, the popups appear as normal, so I know it has something to do with that library. This is the second time I have used this library; the first time I had no issues. I'm getting no errors in the console.

Also, I had this issue regardless of if the .openPopup() method was attached to the marker variable.

Code below:

var puetrasList = new L.MarkerClusterGroup();

          for (i=0 ; i < dataStore.length ; i++){
              var a, point;
              a = dataStore[i];
              lat = parseFloat(dataStore[i][0]);
              lng = parseFloat(dataStore[i][1]);
              title = "<strong><h2>" + dataStore[i][2] + "</strong></h2>" +
                                  "<p>" + >dataStore[i][3] + "</p>" +
                                  "<p>" + >dataStore[i][4] + ", " + dataStore[i][5] + "</p>" +
                                  "<p>" + >dataStore[i][6] + "</p>";
              marker = new L.Marker(new L.LatLng(lat, lng));

          //----- Summon Map ---->
share|improve this question
map.addLayer(layer); what is layer? – LSA Jun 4 '13 at 20:53

Use marker on click in the for loop.It will shows the popup

 marker.on('click', function (e) {              

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.