diff options
| author | Zog | 2018-02-23 10:42:23 +0100 |
|---|---|---|
| committer | Zog | 2018-02-23 10:42:23 +0100 |
| commit | 897d0ad6b48f063f40144a1dbb770f4fbc5f96f0 (patch) | |
| tree | 7ab9f59addaab7ead1cd0581ba499a6ba19823e7 /app/javascript/helpers/routes_map.coffee | |
| parent | 2be6e735086d08fd6f7835ce413c92c6978f01bb (diff) | |
| download | chouette-core-897d0ad6b48f063f40144a1dbb770f4fbc5f96f0.tar.bz2 | |
Hide opposite routes
Diffstat (limited to 'app/javascript/helpers/routes_map.coffee')
| -rw-r--r-- | app/javascript/helpers/routes_map.coffee | 12 |
1 files changed, 10 insertions, 2 deletions
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 |
