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'm using Leaflet Marker Cluster and I need to show five different lines in a popup. But when I write this, they are all in the same line. Can someone help me to be one under another?

var a = addressPoints[i];
            var title = a[2];
            var univ = a[3];
            var direct = a[4];
            var city = a[5];
            var state = a[6];
            var marker = new L.Marker(new L.LatLng(a[0], a[1]), { title: title } );
            marker.bindPopup("Student: " + title + "University: " + univ + "Direction: " + direct + "City: " + city + "State: " + state);

share|improve this question
up vote 10 down vote accepted

As the Leaflet documentation states, Marker#bindPopup takes an HTML string as first parameter.

If you want your lines to appear on different lines, you need to add the proper HTML markup. In your case, a definition list seems the most relevant.


var list = "<dl><dt>Student</dt>"
           + "<dd>" + title + "</dd>"
           + "<dt>University</dt>"
           + "<dd>" + univ + "</dd>"
           + …

share|improve this answer
Thank you so much! – againstflow Aug 21 '12 at 16:50

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.