diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2015-03-20 12:58:28 +0000 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2015-03-20 12:58:28 +0000 |
commit | f12d3a185fa3e6ce6fd1d222cb6e44565440554e (patch) | |
tree | 61886a4c7974e03f75047ebd3b35b0204f3d3e14 | |
parent | 058466e15d3ce800cad7e6b4034fb887c335c6f2 (diff) | |
download | leaflet-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.js | 8 |
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; |