slowe / Chromoscope

Chromoscope lets you explore our Galaxy (the Milky Way) and the distant Universe in a range of wavelengths from X-rays to the longest radio waves.
http://www.chromoscope.net/
38 stars 8 forks source link

Chromoscope event listener #17

Closed ebressert closed 13 years ago

ebressert commented 13 years ago

Add a listener that catches multiple events from Chromoscope.

slowe commented 13 years ago

I've made a start by defining a bind() function that behaves a little like jQuery's bind(). At the moment it accepts 3 possibilities: "move" (any move, not just a mouse drop), "slide" (whenever a wavelength changes) and "zoom" (any zoom). These will call your function using the chromoscope object as the "this" context. e.g.

chromo.bind("slide",function(){ console.log('Slid '+this.lambda); }).bind("zoom",function(){ console.log('Zoomed'); }).bind("move",function(){ console.log('Moved map'); })

slowe commented 13 years ago

I've added a "wcsupdate" event that fires when the coordinate label is updated (regardless of if it is being shown).