Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get ra and dec of clicked body #25

Closed
astroanu opened this issue May 23, 2015 · 8 comments
Closed

get ra and dec of clicked body #25

astroanu opened this issue May 23, 2015 · 8 comments
Assignees
Milestone

Comments

@astroanu
Copy link

How can i get the ra/dec or other info of the clicked body?

@astroanu
Copy link
Author

astroanu commented Jul 4, 2015

anybody?

@slowe
Copy link
Owner

slowe commented Jul 7, 2015

Sorry. I've been cycling from Liverpool to Istanbul for the past two months. I'm not really sure what you mean by "clicked body"? Could you provide a little more context? Thanks.

@astroanu
Copy link
Author

astroanu commented Jul 8, 2015

Oh.. long long journey

By 'body' i meant celestial body (a star or a planet). I want to get the ra and dec values and may be other info regarding the body when the user clicks on it.

@slowe
Copy link
Owner

slowe commented Jul 10, 2015

Not without quite a bit of work is the simple answer. The 'stars' and 'planets' you see on the screen are drawn pixels. There isn't currently a lookup mechanism to go backwards from pixel position to object.

@astroanu
Copy link
Author

oh i see. it's because of the canvas ? If you are planning on something like that it would be really nice/. this is a really good plugin. 🤘

@slowe slowe self-assigned this Oct 15, 2018
@slowe slowe added this to the 0.8.0 milestone Oct 15, 2018
@pludov
Copy link
Contributor

pludov commented Aug 4, 2019

I am in need for this feature ! Are you actively working on it ?

For now, I worded out finding the ra,dec coordinates from mouse/touch coordinates for all projections. I'll open a PR once it's cleaned up

@slowe
Copy link
Owner

slowe commented Aug 6, 2019

There is now a click callback which can be used e.g.

'callback': {
	'click': function(e){
		// The event includes e.x, e.y, e.ra, e.dec.
		// Get the nearest object based on the x/y cursor position
		e.nearest = e.data.sky.nearestObject(e.x,e.y);
		console.log(e.nearest);
	}
}

@slowe slowe closed this as completed Aug 6, 2019
@pludov
Copy link
Contributor

pludov commented Aug 7, 2019

Long press is probably broken :
a43ab23#r34608949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants