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

Mouse pointer position in latitude and longitude #55

Open
shujaatak opened this issue Sep 18, 2019 · 2 comments
Open

Mouse pointer position in latitude and longitude #55

shujaatak opened this issue Sep 18, 2019 · 2 comments

Comments

@shujaatak
Copy link

Can you please tell me how to print the mouse pointer position in latitude and longitude in the console when I move mouse over the globe?
Actually I can't work out the inverse transformation properly and you might help in this regard please.

@green-anger
Copy link
Owner

It's an abandoned project that I haven't touch for almost a year now and it's really difficult to quickly give you an exact answer. I've had a look at this and can provide only the following guidance:

  • inverse transformation is done in Projector:
    bool Projector::projectInv( double x, double y, double& lon, double& lat ) const
  • there's no API method to get lon/lat at the current cursor position, you'll have to use this:
    std::shared_ptr<Projector> projector; //!< Projects the globe to plane.
    Since it's in GlobeViewer.cpp you can add an API method sending {x, y} and getting {lon, lat} pair in return using projector. Just don't forget to check return value for projectInv, false means you're out of the Globe (check the docs).

Hope that helps.

@shujaatak
Copy link
Author

Thank you so much for these pointers, I am going to try these pointers and hopefully will achieve what I want.
You are the best!

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

2 participants