     setHash: ->
       param = if @modal then {modal: @modal, dep: @dep, dest: @dest} else {}
       location.hash = toURLParameter($.extend(param, @periodObj()))
-    restoreHash: ->
-      param = fromURLParameter(location.hash.replace(/^\#/, ''))
+    restoreHash: (param) ->
       if param.from?
         @period = true
         @from = param.from
         @to = param.to ? @to
+    restoreModal: (param) ->
       if param.modal?
         @modal = true
         @dep = param.dep ? @dep

    routes: []
    cellInfo: []
    counts: []
    area: 0
    info: 0
    period: false

  methods:
    getJSON: () ->
      $.getJSON "/rest/v1/route/#{@area}/#{@info}", @periodObj(), (data) =>
        sum = 0
        sumCounts = []
        data.forEach (d) ->
          sumCounts[d.dep] ?= 0
          sumCounts[d.dep] += d.count
          sum += d.count
        @counts = sumCounts
        @sum = sum
        @routes = data.filter (d) =>
          (d.count * 1000) > @sum
      $.getJSON "/rest/v1/cell_info", {area: @area, info: @info}, (data) =>
        @cellInfo = data
      @setHash({})
