summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2015-03-20 12:58:28 +0000
committerChristopher Baines <cb15g11@soton.ac.uk>2015-03-20 12:58:28 +0000
commitf12d3a185fa3e6ce6fd1d222cb6e44565440554e (patch)
tree61886a4c7974e03f75047ebd3b35b0204f3d3e14
parent058466e15d3ce800cad7e6b4034fb887c335c6f2 (diff)
downloadleaflet-soton-f12d3a185fa3e6ce6fd1d222cb6e44565440554e.tar
leaflet-soton-f12d3a185fa3e6ce6fd1d222cb6e44565440554e.tar.gz
Fix selecting routes
Just a simple loop callback issue.
-rw-r--r--resources/leaflet-route/leaflet-route.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/resources/leaflet-route/leaflet-route.js b/resources/leaflet-route/leaflet-route.js
index 4d78148..a202492 100644
--- a/resources/leaflet-route/leaflet-route.js
+++ b/resources/leaflet-route/leaflet-route.js
@@ -205,9 +205,11 @@ L.Control.Route.createRouteList = function(routeMaster, routeSelected) {
var li = L.DomUtil.create('li', '', ul);
- li.appendChild(L.Control.Route.createRouteLink(route, function() {
- routeSelected(route.properties.name);
- }));
+ li.appendChild(L.Control.Route.createRouteLink(route, (function(name) {
+ return function() {
+ routeSelected(name);
+ };
+ })(route.properties.name)));
}
return ul;