class CB : public osg::NodeCallback { virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osgEarth::Annotation::ImageOverlay* overlay = dynamic_cast<osgEarth::Annotation::ImageOverlay*>(node); overlay->getLowerLeft(); overlay->setCorners(overlay->getLowerLeft() + osg::Vec2(0, 0.0001), overlay->getLowerRight() + osg::Vec2(0, 0.0001), overlay->getUpperLeft() + osg::Vec2(0, 0.0001), overlay->getUpperRight() + osg::Vec2(0, 0.0001)); traverse(node, nv); } };
osgEarth::Annotation::ImageOverlay* overlay = new osgEarth::Annotation::ImageOverlay(mapNode); overlay->setImage(image); //overlay->setBounds(Bounds(-100, 30, -90, 40)); overlay->setCorners(lonlat, lonlat+osg::Vec2d(1 * width/height, 0), lonlat + osg::Vec2d(0, 1), lonlat + osg::Vec2d(1* width / height, 1)); overlay->addUpdateCallback(new CB());