一、代码
#include <osg/Notify>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgEarth/MapNode>
#include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/MouseCoordsTool>
#include <osgEarthUtil/MGRSFormatter>
#include <osgEarthUtil/LatLongFormatter>
#include <osgEarthUtil/GeodeticGraticule>
#include <osgEarthUtil/MGRSGraticule>
#include <osgEarthUtil/UTMGraticule>
#include <osgEarthUtil/GraticuleNode>
using namespace osgEarth::Util;
int main(int argc, char** argv)
{
osgViewer::Viewer viewer;
// load the .earth file from the command line.
osg::ref_ptr<osg::Node>node = osgDB::readNodeFile("clear_terrain_boundary.earth");
MapNode* mapNode = dynamic_cast<MapNode*>(node.get());
// install our manipulator:
viewer.setCameraManipulator( new Ear