-
Notifications
You must be signed in to change notification settings - Fork 9
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
There is no possibility to get canvas coordinates of some geographic location #28
Comments
I am using this geographicToScreenPoint function but I am trying to get the screen coords for a point that I think is getting clipped by the near clip plane. Is there any way to ignore the clip plane to get the x,y anyway? Or translate it to the x,y coord on the near plane? Maybe using a ray? Havent worked that out yet. I'm drawing a line on a canvas representing the same view as my viewport. Using the lat, lon end points of the line, I grab the screen x,y from geographicToScreenPoint and render the lines (though the line ends are off the canvas...) it all lines up and works well... until I tilt the viewport and zoom in. It works to a point, then the lat, lon point of one end is behind the eye position enough that I think it's being clipped and the function returns false. Any thoughts or way to support this in this function? |
@monkeytroy geographicToScreenPoint function uses cartesianToScreenPoint function which has following description: So the only way is to override cartesianToScreenPoint logic to be able to calculate points outside frustum. I think those people who write cartesianToScreenPoint function faced issue with universal calculation and that's why added boolean result. |
Ok. I was able to get what I needed by:
Just posting in case someone else runs into this. |
There is no possibility to get canvas coordinates of some geographic location - oposite procedure to picking of some location by canvas coordinates.
This functionality is required when somebody requires to move some HTML UI elements according to Position on globe determining its pixel coordinates.
Android version has this functionality. So I propose to port it on JS in the following way...
The text was updated successfully, but these errors were encountered: