aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/journey_pattern.coffee
blob: 0f203397b1cb7ffb0f55135ec167578aaf3ff52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
jQuery ->
  select_stop_on_map = (event) ->
    if (event.type == 'mouseenter') 
      if event.target.id.match(/^stop_point_(\w+)$/)
        stopAreaId = $("#"+event.target.id+" a").attr('href').match(/\d+$/)[0]
        console.log(stopAreaId)
        placeMark = selectFeature.layer.getFeatureByFid( stopAreaId)
        selectFeature.unselectAll()
        selectFeature.select( placeMark)
    else
      selectFeature.unselectAll()

  $(document).on("hover", '.journey_patterns.show div.stop_points .stop_point', select_stop_on_map)