From fc567391a5420d84ccb1004dc37cbfae3f60a01e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 21 Mar 2015 12:34:11 +0000 Subject: Allow for toggling which routes are highlighted --- src/leaflet-soton.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 380249b..0be755b 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -654,8 +654,13 @@ SELECT * WHERE {\ var a = L.Control.Route.createRouteLink(routesInfo[name], (function(name) { return function() { + var wasHighlighted = routeLayer.isRouteHighlighted(name); + routeLayer.resetRoutes(); - routeLayer.highlightRoute(name); + + if (!wasHighlighted) { + routeLayer.highlightRoute(name); + } }; })(routesInfo[name].properties.name)); -- cgit v1.2.3