From 897d0ad6b48f063f40144a1dbb770f4fbc5f96f0 Mon Sep 17 00:00:00 2001 From: Zog Date: Fri, 23 Feb 2018 10:42:23 +0100 Subject: Hide opposite routes --- app/javascript/helpers/routes_map.coffee | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/helpers/routes_map.coffee b/app/javascript/helpers/routes_map.coffee index dea916ebd..479169995 100644 --- a/app/javascript/helpers/routes_map.coffee +++ b/app/javascript/helpers/routes_map.coffee @@ -35,7 +35,6 @@ RoutesLayersControl = (routes, routes_map) -> label.innerHTML = route.name element.appendChild label label.addEventListener "click", => - console.log "click" route.active = !route.active $(label).toggleClass "active" route.active @@ -43,7 +42,16 @@ RoutesLayersControl = (routes, routes_map) -> route.vectorEdgesLayer.setStyle routes_map.edgeStyles(route.active) route.vectorLnsLayer.setStyle routes_map.lineStyle(route.active) routes_map.fitZoom() - # + label.addEventListener "mouseenter", => + route.vectorPtsLayer.setStyle routes_map.defaultStyles(true) + route.vectorEdgesLayer.setStyle routes_map.edgeStyles(true) + route.vectorLnsLayer.setStyle routes_map.lineStyle(true) + + label.addEventListener "mouseleave", => + route.vectorPtsLayer.setStyle routes_map.defaultStyles(route.active) + route.vectorEdgesLayer.setStyle routes_map.edgeStyles(route.active) + route.vectorLnsLayer.setStyle routes_map.lineStyle(route.active) + ol.control.Control.call(this, { element -- cgit v1.2.3