aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilli <willi@jups42.de>2012-12-01 21:00:51 +0100
committerWilli <willi@jups42.de>2012-12-01 21:12:52 +0100
commit050b682b63097b930a0fcda2413b5e60b1adcb0e (patch)
tree8f642e29621c6f1a2bf332a3bbb092dca9e87bdd
parentb972c93beebc5a63cfd314977742806469e17183 (diff)
downloadhealth-map-050b682b63097b930a0fcda2413b5e60b1adcb0e.tar
health-map-050b682b63097b930a0fcda2413b5e60b1adcb0e.tar.gz
template renders address correctly
-rw-r--r--resources/map.js10
1 files changed, 10 insertions, 0 deletions
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('<dl> <% _.each(properties, function(val, key) { %>\
+ <% if (/\:/.exec(key)) { %> \
+ <dl> \
+ <% console.log(key.split(":")); %>\
+ <% console.log(val); %>\
+ <dt><%= key.split(":")[1] %> </dt> \
+ <dd><%= val %> </dd> \
+ </dl> \
+ <% } else {%> \
<dt><%= key %> </dt>\
<dd><%= val %> </dd>\
+ <% } %> \
<% }); %>\
</dl>');
@@ -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 }));
}
});