How to locate layers and display them to my screen?

classic Classic list List threaded Threaded
3 messages Options
vigos lee vigos lee
Reply | Threaded
Open this post in threaded view
|

How to locate layers and display them to my screen?

Hi, I have a problem when I want to display my layers.I don't know how to locate layers and display them to my screen.
The range of layers I get is in the form of latitude and longitude.:layer->getExtent();
And I don't know how to set it up viewpoint.  like:vp.range();
Do I need to calculate the distance myself?
Thanks!
vigos
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: How to locate layers and display them to my screen?

Vigos,
Look for the class called osgEarth::Util::ViewFitter. This will generate a Viewpoint from a set of GeoPoints.

osgearth_toc uses it when you click on a Layer name:

https://github.com/gwaldron/osgearth/blob/master/src/applications/osgearth_toc/osgearth_toc.cpp#L412

Hope this helps.
Glenn Waldron / Pelican Mapping
vigos lee vigos lee
Reply | Threaded
Open this post in threaded view
|

Re: How to locate layers and display them to my screen?

Thank you very much. It helped me a lot.
vigos