summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2015-03-12 15:07:42 +0000
committerChristopher Baines <cb15g11@soton.ac.uk>2015-03-13 19:28:00 +0000
commit058466e15d3ce800cad7e6b4034fb887c335c6f2 (patch)
tree61e29fa7975e7b1f684d8e962c48ede3a6a13557 /resources
parent3d4e61b9bf577b1af1edb87721f8d6a3ce39ac35 (diff)
downloadleaflet-soton-058466e15d3ce800cad7e6b4034fb887c335c6f2.tar
leaflet-soton-058466e15d3ce800cad7e6b4034fb887c335c6f2.tar.gz
Use the uos-live.js library for the bus stop popups
This replaces the bus.southampton.ac.uk iframe, which improves performance, responsiveness, and the integration of the user interface.
Diffstat (limited to 'resources')
-rw-r--r--resources/leaflet-route/leaflet-route.js37
m---------resources/uos-live.js0
2 files changed, 24 insertions, 13 deletions
diff --git a/resources/leaflet-route/leaflet-route.js b/resources/leaflet-route/leaflet-route.js
index dbce204..4d78148 100644
--- a/resources/leaflet-route/leaflet-route.js
+++ b/resources/leaflet-route/leaflet-route.js
@@ -159,6 +159,8 @@ L.Control.Route.createRouteMasterList = function(routeMasters, routeSelected, so
var li = L.DomUtil.create('li', '', ul);
var a = L.DomUtil.create('a', null, li);
+ a.className = "ls-route-master-link";
+
a.style.background = routeMaster.routes[0].properties.colour;
a.textContent = "U";
@@ -176,6 +178,25 @@ L.Control.Route.createRouteMasterList = function(routeMasters, routeSelected, so
return ul;
};
+L.Control.Route.createRouteLink = function(route, routeSelected) {
+ var a = document.createElement("a");
+
+ a.className = "ls-route-link";
+
+ a.style.background = route.properties.colour;
+
+ a.textContent = "U";
+ var strong = document.createElement("strong");
+ strong.textContent = route.properties.ref.slice(1);
+ a.appendChild(strong);
+
+ a.onclick = function() {
+ routeSelected();
+ };
+
+ return a;
+};
+
L.Control.Route.createRouteList = function(routeMaster, routeSelected) {
var ul = L.DomUtil.create('ul', 'ls-route-list');
@@ -183,20 +204,10 @@ L.Control.Route.createRouteList = function(routeMaster, routeSelected) {
var route = routeMaster.routes[i];
var li = L.DomUtil.create('li', '', ul);
- var a = L.DomUtil.create('a', null, li);
- a.style.background = route.properties.colour;
-
- a.textContent = "U";
- var strong = document.createElement("strong");
- strong.textContent = route.properties.ref.slice(1);
- a.appendChild(strong);
-
- a.onclick = (function(routeName) {
- return function() {
- routeSelected(routeName);
- };
- })(route.properties.name);
+ li.appendChild(L.Control.Route.createRouteLink(route, function() {
+ routeSelected(route.properties.name);
+ }));
}
return ul;
diff --git a/resources/uos-live.js b/resources/uos-live.js
new file mode 160000
+Subproject ddba621bb02ef18cf180194a46f6f267b7f626e