summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2015-03-21 12:34:11 +0000
committerChristopher Baines <cb15g11@soton.ac.uk>2015-03-21 12:34:11 +0000
commitfc567391a5420d84ccb1004dc37cbfae3f60a01e (patch)
tree343b7494f6d779acfc964d718a2587702a5e35a7 /src
parent255e2e3a55f59e40397bde2ed3cc387bc07a6836 (diff)
downloadleaflet-soton-fc567391a5420d84ccb1004dc37cbfae3f60a01e.tar
leaflet-soton-fc567391a5420d84ccb1004dc37cbfae3f60a01e.tar.gz
Allow for toggling which routes are highlighted
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js7
1 files changed, 6 insertions, 1 deletions
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));