 Spine = require 'Spine'
 Raphael = require 'Raphael'
+
+Marker = require 'controllers/Marker'
+{delay} = require 'util'
 
 template = require 'lib/text!views/MarkerIndicator.html'
 

    @html @template
    @paper = Raphael @points[0], '100%', '100%'

  setSpecies: (@species) =>
    return unless @species

    @image.attr 'src', @helpers[@species].image
    @image.one 'load', =>

      circle.attr cx: coords.x, cy: coords.y, fill: style[@species]
      @circles.push circle

    @step = -1
    @setStep 0

  setStep: (step) =>
    step %= @helpers[@species].points.length
    return if step is @step
    @step = step

    @circles.attr style.helperCircle

    # Flicker the active dot.
    @circles[@step].animate style.helperCircle.active, 100, =>
      @circles[@step].animate style.helperCircle, 100, =>
        @circles[@step].animate style.helperCircle.active, 100

exports = MarkerIndicator
