summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-03-28 22:45:39 +0000
committerChristopher Baines <cb15g11@soton.ac.uk>2014-03-28 22:45:39 +0000
commit18c5740c3aa4d4f89c8cb5fef1111016b130ad37 (patch)
tree4ed4164b93a6ca1c0d51c49853b9d148f982a31a /src
parentfba03f4f3829438d697eed21928e2b7876d517a1 (diff)
downloadleaflet-soton-18c5740c3aa4d4f89c8cb5fef1111016b130ad37.tar
leaflet-soton-18c5740c3aa4d4f89c8cb5fef1111016b130ad37.tar.gz
Crude route list and times for bus stops
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index 08f29b2..c70a12a 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -1159,30 +1159,25 @@ SELECT * WHERE {\
function busStopTemplate(properties) {
return getTemplateWrapper(properties, function(content) {
- /*<tr><td>Routes: \
- <% each(properties.routes, function(route) { %>\
- <font color="<%= route.colour %>"><%= route.ref %></font>\
- <% }); %>\
- </td></tr>\
- <tr>\
- <td colspan=2><iframe width="400px" height="100%" style="border: solid 1px #000" src="<%\
- var parts = properties.uri.split("/");\
- var id = parts[parts.length - 1].split(".")[0];\
- print("http://data.southampton.ac.uk/bus-stop/" + id + ".html?view=iframe");\
- %>" frameBorder="0"></iframe></td>\
- </tr>\*/
-
- /*var parts = properties.uri.split("/");
- var id = parts[parts.length - 1].split(".")[0];
- var src = "http://data.southampton.ac.uk/bus-stop/" + id + ".html?view=iframe";
+ var routeList = document.createElement("ul");
- var energyIFrame = document.createElement('iframe');
- energyIFrame.setAttribute('src', src);
- energyIFrame.setAttribute('frameBorder', '0');
- energyIFrame.setAttribute('style', 'width: 100%; height 100%;');
+ properties.routes.forEach(function(route) {
+ var routeLi = document.createElement("li");
+ routeLi.textContent = route;
+
+ routeList.appendChild(routeLi);
+ });
+
+ content.appendChild(routeList);
+
+ var IFrame = document.createElement('iframe');
+ IFrame.setAttribute('src', 'http://bus.southampton.ac.uk/bus-stop-iframe/' + properties.uri.slice(42) + ".html")
+ IFrame.setAttribute('frameBorder', '0');
+ IFrame.setAttribute('style', 'width: 100%; height 100%;');
- content.appendChild(energyIFrame);*/
+ content.appendChild(IFrame);
+ console.log(properties);
});
}