From 050b682b63097b930a0fcda2413b5e60b1adcb0e Mon Sep 17 00:00:00 2001 From: Willi Date: Sat, 1 Dec 2012 21:00:51 +0100 Subject: template renders address correctly --- resources/map.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'resources') diff --git a/resources/map.js b/resources/map.js index 3b98003..a6828a6 100644 --- a/resources/map.js +++ b/resources/map.js @@ -3,8 +3,17 @@ $(document).ready(function() { var self = this; self.template = _.template('
<% _.each(properties, function(val, key) { %>\ + <% if (/\:/.exec(key)) { %> \ +
\ + <% console.log(key.split(":")); %>\ + <% console.log(val); %>\ +
<%= key.split(":")[1] %>
\ +
<%= val %>
\ +
\ + <% } else {%> \
<%= key %>
\
<%= val %>
\ + <% } %> \ <% }); %>\
'); @@ -43,6 +52,7 @@ $(document).ready(function() { console.log(data); layer = L.geoJson(data, { onEachFeature: function(feature, layer) { + debugger; layer.bindPopup(self.template({ properties: feature.properties })); } }); -- cgit v1.2.3