Too slow when I add a modellayer from shapefile in iconsymbol style

classic Classic list List threaded Threaded
1 message Options
justjane justjane
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Too slow when I add a modellayer from shapefile in iconsymbol style

I try to add a point shapfile as a modellayer to the map, when I run the code below . it takes more than 10 seconds to add the layer succesfully . the problem is the iconsymbol  ,it seems takes too much memory.(ps:there are about 400 points)

        Style style;
        osg::ref_ptr<IconSymbol> ls = style.getOrCreateSymbol<IconSymbol>();
        ls->url()->setLiteral("C:/Users/Administrator/Desktop/face.png");
        osg::ref_ptr<osgEarth::ModelLayer> layer;

        OGRFeatureOptions opt;
        opt.url() = nodeName;
        FeatureGeomModelOptions geomOptions;
        geomOptions.compilerOptions().clustering() = false;
        geomOptions.featureOptions() = opt;
        geomOptions.styles() = new StyleSheet();
        geomOptions.styles()->addStyle(style);
        geomOptions.enableLighting() = false;

        ModelLayerOptions* options = new ModelLayerOptions(nodeName, geomOptions);
        layer = new ModelLayer(*options);


I want to kown if there is an effective way to achive my goal.
thanks!

face.png
Loading...