<div dir="ltr">Ok, so if you're adding an image layer programmatically, you <b>don't </b>want to add a .earth XML file.<div><br></div><div><br></div><div>It should probably look something like</div><div><br></div><font face="monospace, monospace">        // Add an imagery layer<br>        {<br>                GDALOptions gdal;<br>                gdal.url() = "br.png";<br>                osg::ref_ptr<ImageLayer> layer = new ImageLayer( "NASA", tms ); <br>                layer->setOpacity(0.5);<br>                printf("\nOpacity: %.2f\n",layer->getOpacity());<br>                map->addLayer( layer );<br>        }  </font><div><font face="monospace, monospace"><br></font></div>The GDAL loader handles almost all local-disk data loading. The TMS loader you were trying to use is for loading data from an Internet Tile Map Server. The GDAL loader loads either elevation or imagery data.<div><br></div><div>Keep in mind, if you are using br.png, there isn't any positional information in a PNG file to tell osgEarth WHERE on the Earth to place that PNG file. Certain file types like TIFF can have extra data (called GeoTIFF) that specify this positioning. So, consider what you're trying to do here -- it may not give you errors but you may not see br.png placed anywhere useful on your map.<br><div><br></div></div></div>