diff --git a/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.cpp b/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.cpp index 530d26ca4..e8a2b5436 100644 --- a/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.cpp +++ b/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.cpp @@ -109,7 +109,7 @@ OsgViewerWidget::OsgViewerWidget(QWidget *parent) : QWidget(parent) osg::Group* root = new osg::Group; osg::Node* earth = osgDB::readNodeFile("/Users/jcotton81/Documents/Programming/osgearth/tests/boston.earth"); - osgEarth::MapNode * mapNode = osgEarth::MapNode::findMapNode( earth ); + mapNode = osgEarth::MapNode::findMapNode( earth ); if (!mapNode) { qDebug() <<"Uhoh"; @@ -174,6 +174,7 @@ QWidget* OsgViewerWidget::createViewWidget( osg::Camera* camera, osg::Node* scen //manip->setHomeViewpoint(Viewpoint("Boston", osg::Vec3d(-71.0763, 42.34425, 0), 24.261, -21.6, 3450.0)); manip->setTetherNode(uavPos); + osgQt::GraphicsWindowQt* gw = dynamic_cast( camera->getGraphicsContext() ); return gw ? gw->getGLWidget() : NULL; } diff --git a/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.h b/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.h index c0a8582e6..cc7e8894c 100644 --- a/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.h +++ b/ground/openpilotgcs/src/plugins/osgearthview/osgviewerwidget.h @@ -109,6 +109,7 @@ private: /* Private variables */ EarthManipulator* manip; osgEarth::Util::ObjectLocatorNode* uavPos; osg::MatrixTransform* uavAttitudeAndScale; + osgEarth::MapNode* mapNode; };