Ring geometry not saving to JSON

classic Classic list List threaded Threaded
1 message Options
krzysief krzysief
Reply | Threaded
Open this post in threaded view
|

Ring geometry not saving to JSON

Hi, im trying to make a polygon in osgearth with this code:

ref_ptr<osgEarth::Symbology::Ring> geometry = new Symbology::Ring;
        geometry->push_back(start_p.vec3d());
        geometry->push_back(help_point1.vec3d());
        geometry->push_back(end_p.vec3d());
        geometry->push_back(help_point2.vec3d());
        geometry->push_back(help_point3.vec3d());
        geometry->close();

ref_ptr<Features::Feature> feature = new osgEarth::Features::Feature(geometry, mapNode->getMapSRS());
//more code here/
ref_ptr<Annotation::FeatureNode> featureNode = new osgEarth::Annotation::FeatureNode(mapNode, feature);

and my problem is that when run std::cout << featureNode->getConfig().toJSON() << std::endl;
the JSON config doesn't contain any information about position in my polygon, it looks like that:

{"feature":{"geometry":"","name":{},"srs":"+proj=longlat +datum=WGS84 +no_defs ","style":{"name":{},"symbols":{"line":{"stroke":{"color":"#cc0000ff","width":"4","width_units":"px"},"tessellation":"3"},"polygon":{"fill":{"color":"#cc00007f"}}}}}}

Is there anything i can do to fix it?