From 59fe51f28f39abc5289c3a326b5a42460a9bff86 Mon Sep 17 00:00:00 2001 From: James R Sconfitto Date: Mon, 28 Oct 2013 21:50:49 -0400 Subject: [PATCH 1/2] 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,}) }) } From caf109e21b518106f6d34fb643b5a303310ce3ba Mon Sep 17 00:00:00 2001 From: James R Sconfitto Date: Mon, 28 Oct 2013 21:58:43 -0400 Subject: [PATCH 2/2] Use a template for popUps --- index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 40425d3..6f3ff52 100644 --- a/index.html +++ b/index.html @@ -94,6 +94,10 @@

{{numberOfSpots}} hack spots strong!

+ +