Converting screen coordinates into lat/lon with a 2D plate-carre map and infinite scroll #2601
Replies: 3 comments 3 replies
-
From what I can see, in version 2.8 the screenToWorld() computation ignores any transforms above the terrain. I am pretty sure this was addressed in later versions (specifically 3.4): Version 2.8 is really old so the amount of support we can give you is somewhat limited. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. Version 2.8 is definitely quite ancient, but that's the version integrated into a 3rd party mapping product that we use. I'll see if there's any way to upgrade it. |
Beta Was this translation helpful? Give feedback.
-
Upgrading to the 3.x series is non-trivial; if you decide to go that route there's a quick guide here: And of course, we are always here to answer questions :) |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using code similar to the example here to show a 2D map that wraps around as the user pans east and west.
https://github.com/gwaldron/osgearth/blob/master/src/applications/osgearth_infinitescroll/osgearth_infinitescroll.cpp
It's working very well, but I'm having trouble converting client screen coordinates in the view to lat/lon coordinates. This is an overview of my conversion code, and it works correctly when the map is shown in 3D mode. In 2D infinite scroll mode, screenToWorld is returning true, dLat is either far out of range or 0, and dLon is 0. I'm guessing that something about the clever way the infinite scroll uses three matrices requires a more complex conversion. Any suggestions would be greatly appreciated. If it makes a difference, I'm using osgearth 2.8 on Windows.
Beta Was this translation helpful? Give feedback.
All reactions