[osg-users] [3rdparty] class osgEarth::Map has no member named 'addImageLayer'

7 views
Skip to first unread message

Rodrigo Dias

unread,
Jan 2, 2019, 11:39:04 AM1/2/19
to osg-...@lists.openscenegraph.org
Hi,

I'm following the example from here (http://docs.osgearth.org/en/latest/developer/maps.html#programmatic-map-creation). This line, however:


Code:
map->addImageLayer( layer );

won't compile. g++ says:


> error: ‘class osgEarth::Map’ has no member named ‘addImageLayer’; did you mean ‘addLayer’?
>


I tried with addLayer, but then the program compiles but hangs on run, and won't execute not even the first line, "cout << 1;".

I'm using version 2.10. I noticed that the documentation (https://updraft.github.io/osgearth-doc/html/classosgEarth_1_1Map.html) is from version 2.1. Even the page where I took the example from is titled "osgEarth 2.4 documentation". Is there an up to date documentation? What am I doing wrong here?

Thank you!

Cheers,
Rodrigo

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75373#75373

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Eran Cohen

unread,
Jan 3, 2019, 4:21:50 AM1/3/19
to osg-...@lists.openscenegraph.org

Rodrigo wrote:
> Hi,
>
> I'm following the example from here (http://docs.osgearth.org/en/latest/developer/maps.html#programmatic-map-creation). This line, however:
>
>
> Code:
> map->addImageLayer( layer );
>
>
>
> won't compile. g++ says:
>
>
> > error: ‘class osgEarth::Map’ has no member named ‘addImageLayer’; did you mean ‘addLayer’?
> >
>
>
> I tried with addLayer, but then the program compiles but hangs on run, and won't execute not even the first line, "cout << 1;".
>
> I'm using version 2.10. I noticed that the documentation (https://updraft.github.io/osgearth-doc/html/classosgEarth_1_1Map.html) is from version 2.1. Even the page where I took the example from is titled "osgEarth 2.4 documentation". Is there an up to date documentation? What am I doing wrong here?
>
> Thank you!
>
> Cheers,
> Rodrigo


Hi Rodrigo,

If I'm not mistaken, the map API was changed in 2.9 to be more generic,
so the different map->add*Type*Layer() were changed to map->addLayer(), so that's the reason for the first error.

I'm not sure why the program hangs when you use the addLayer() method, but you may have better luck asking in the osgEarth forum.

Good luck,
Eran Cohen

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=75377#75377

François Cami

unread,
Jan 3, 2019, 4:50:46 AM1/3/19
to OpenSceneGraph Users
Hi,

On Thu, Jan 3, 2019 at 10:21 AM Eran Cohen <cer...@gmail.com> wrote:
>
>
> Rodrigo wrote:
> > Hi,
> >
> > I'm following the example from here (http://docs.osgearth.org/en/latest/developer/maps.html#programmatic-map-creation). This line, however:
> >
> >
> > Code:
> > map->addImageLayer( layer );
> >
> >
> >
> > won't compile. g++ says:
> >
> >
> > > error: ‘class osgEarth::Map’ has no member named ‘addImageLayer’; did you mean ‘addLayer’?
> > >
> >
> >
> > I tried with addLayer, but then the program compiles but hangs on run, and won't execute not even the first line, "cout << 1;".
> >
> > I'm using version 2.10. I noticed that the documentation (https://updraft.github.io/osgearth-doc/html/classosgEarth_1_1Map.html) is from version 2.1. Even the page where I took the example from is titled "osgEarth 2.4 documentation". Is there an up to date documentation? What am I doing wrong here?
> >
> > Thank you!
> >
> > Cheers,
> > Rodrigo
>
>
> Hi Rodrigo,
>
> If I'm not mistaken, the map API was changed in 2.9 to be more generic,
> so the different map->add*Type*Layer() were changed to map->addLayer(), so that's the reason for the first error.

You could also grep for addLayer in
https://github.com/gwaldron/osgearth/tree/master/src/applications
Both osgearth_minimap and osgearth_map look promising.

Cheers
François

Rodrigo Dias

unread,
Jan 5, 2019, 9:38:11 PM1/5/19
to osg-...@lists.openscenegraph.org
Well, I just formatted my computer and reinstalled everything. Now it runs all lines up to addLayer and then hangs (which is an advance). The provided url, http://labs.metacarta.com/wms-c/Basic.py/1.0.0/satellite/, gives a timeout in the browser, so I think that's why it's hanging now. What other url can I use?

Actually, I want to load a PNG as the texture, while using another PNG as the elevation, but couldn't find any example of that.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75388#75388
Reply all
Reply to author
Forward
0 new messages