Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Model by FeatureModelLayer #2299

Closed
x1244 opened this issue Jun 23, 2023 · 2 comments
Closed

Add Model by FeatureModelLayer #2299

x1244 opened this issue Jun 23, 2023 · 2 comments
Assignees
Labels
defect It's busted

Comments

@x1244
Copy link

x1244 commented Jun 23, 2023

When adding a model by FeatureModelLayer, set the Style of the model by url() displays the model correctly, but using setModel() method does not display the model. Any ideas?

void addFeature(osg::Node* model,osgEarth::Map* themap)
{
    using namespace osg;
    using namespace osgEarth;
    OGRFeatureSource* features = new OGRFeatureSource;
    features->setName("vector-data");
    osgEarth::Point* p = new osgEarth::Point;
    p->set(osg::Vec3d(-90.35, 1.32, 0.0));
    features->setGeometry(p);
    themap->addLayer(features);

    Style style;
    ModelSymbol* ms = style.getOrCreateSymbol<ModelSymbol>();
#if 0
    ms->setModel(model);    //can not display the model
#else
    ms->url()->setLiteral("axes.osgt.500000.scale"); //It's OK
#endif
    StyleSheet* sheet = new StyleSheet;
    sheet->addStyle(style);

    FeatureModelLayer* fml = new FeatureModelLayer;
    fml->setName("models");
    fml->setFeatureSource(features);
    fml->setStyleSheet(sheet);
    themap->addLayer(fml);
}

There is a similar issues about setURL() and setModel() #2298

@gwaldron gwaldron added the defect It's busted label Jun 26, 2023
@gwaldron
Copy link
Owner

gwaldron commented Jul 5, 2023

I pushed a fix for this issue. Let me know if you have any problems. Thanks :)

@x1244
Copy link
Author

x1244 commented Jul 10, 2023

It was fixed by 61a9555.A commit follow 01e8738.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect It's busted
Projects
None yet
Development

No branches or pull requests

3 participants