From 59fe51f28f39abc5289c3a326b5a42460a9bff86 Mon Sep 17 00:00:00 2001 From: James R Sconfitto Date: Mon, 28 Oct 2013 21:50:49 -0400 Subject: [PATCH] Bind marker `popUp`s earlier This should take care of issue #6. --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 99fdf21..40425d3 100644 --- a/index.html +++ b/index.html @@ -191,6 +191,10 @@ // design the popups to have the content and // interactions that we want function addPopups(map, markerLayer) { + markerLayer.eachLayer(function(marker) { + var popupContent = '

' + marker.feature.opts.name + '

' + marker.bindPopup(popupContent, {closeButton: false,}) + }) markerLayer.on('click', function(e) { // clear any selected rows $('.spotRow').removeClass("selectedRow") @@ -211,9 +215,6 @@ }) $('#latestSpot').css("display", "none") $('#selectedSpot').html(selectedSpot).css("display", "inline") - var feature = e.layer.feature - var popupContent = '

' + feature.opts.name + '

' - e.layer.bindPopup(popupContent, {closeButton: false,}) }) }