gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.48k stars 774 forks source link

How to prevent the map from being dragged outside the view? #2468

Closed shaozhihua closed 5 months ago

shaozhihua commented 6 months ago

I changed the projection of the map through this interface,then I got a 2D map in the viewer; But I found that I can drag the map to any position in the scene,even outside the viewer,which I dont expect. 1 2 we can see the map is outsize from the viewer. so which class should I restrict the map drag... expecting the someone's help, I will appreciate you so much.

gwaldron commented 5 months ago

The map manipulation is controlled by the EarthManipulator class. There is no API function to do what you want - you will need to tackle it yourself. Good luck!

shaozhihua commented 5 months ago

Ok,thanks for your reply,I will try to read the source code of osg/oe,yeah,good luck to me.