 
   setTime: (time) ->
     @time = (new Date time).getTime()
+    @doSetTime(time)
+    @fire 'change'
+
+  doSetTime: (time) ->
     ranges = @ranges.lookup time
     # inline the JS below because messing with indices
     # and that's ugly in CS

    L.GeoJSON.prototype.initialize.call this, undefined, options
    L.extend @options, options
    @ranges = new IntervalTree()
    @process timedGeoJSON

  process: (data) ->
    earliestStart = Infinity
    latestEnd = -Infinity
    data.features.forEach (feature) =>
      start = ( new Date feature.properties.start ).getTime()
      end = ( new Date feature.properties.end ).getTime()
      @ranges.insert start, end, feature
      @times.push start
      @times.push end
      if start < earliestStart then earliestStart = start
      if end > latestEnd then latestEnd = end
    @times = @times.sort()
    if not @options.start then @options.start = earliestStart
    if not @options.end then @options.end = latestEnd

    `
    for range in ranges
      @addData range

  onAdd: (map) ->
    L.GeoJSON.prototype.onAdd.call this, map
