How to group image layers

classic Classic list List threaded Threaded
2 messages Options
bclay bclay
Reply | Threaded
Open this post in threaded view
|

How to group image layers

I am trying to group several weather images layers under a single node to be able to control them with a single call such as turn them off or on.

If I add the images to my main mMapNode they all show and the base layers (BlueMarble) show but turning weather off or on or any other function requires iterating over each layer individually.

I tried to create a new MapNode and add the images to that node and it does work but the base layers of the earth no longer show

The code I used to do this is shown below

osgEarth::MapNode *wxNode = new osgEarth::MapNode;

wxNode->setNodeMask(1);

osg::Group *wxGroup = new osg::Group;
wxGroup->addChild(wxNode);
wxGroup->setNodeMask(1);

wxGroup->setName("wxGroup");

with the following line in the weather images show up and sequence properly but the base layer no longer shows.  With the line out the base layer shows but the weather images do not.

 mAnnotationGroup->addChild(wxGroup);

Is there anything in osgEarth that works the same a a QGis layer group?

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: How to group image layers

Bruce,
No: osgEarth does not contain any layer group types.

Glenn Waldron


On Thu, Sep 6, 2018 at 3:57 PM bclay [via osgEarth] <[hidden email]> wrote:
I am trying to group several weather images layers under a single node to be able to control them with a single call such as turn them off or on.

If I add the images to my main mMapNode they all show and the base layers (BlueMarble) show but turning weather off or on or any other function requires iterating over each layer individually.

I tried to create a new MapNode and add the images to that node and it does work but the base layers of the earth no longer show

The code I used to do this is shown below

osgEarth::MapNode *wxNode = new osgEarth::MapNode;

wxNode->setNodeMask(1);

osg::Group *wxGroup = new osg::Group;
wxGroup->addChild(wxNode);
wxGroup->setNodeMask(1);

wxGroup->setName("wxGroup");

with the following line in the weather images show up and sequence properly but the base layer no longer shows.  With the line out the base layer shows but the weather images do not.

 mAnnotationGroup->addChild(wxGroup);

Is there anything in osgEarth that works the same a a QGis layer group?




If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/How-to-group-image-layers-tp7591999.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
Glenn Waldron / Pelican Mapping