|
Style style;
LineSymbol* ls=style.getOrCreateSymbol<LineSymbol>();
ls->stroke()->color()=color;
ls->stroke()->width()=3.0f;
TextSymbol* text=style.getOrCreateSymbol<TextSymbol>();
text->content()=StringExpression("[NAME]");
text->priority()=NumericExpression("[pop_cntry]");
text->removeDuplicateLabels()=true;
text->size()=16.0f;
text->alignment()=TextSymbol::ALIGN_CENTER_CENTER;
text->fill()->color()=Color::White;
text->halo()->color()=Color:arkGray;
text->provider()="annotation";
OGRFeatureOptions featureOptions;
std::string featurepath="E:/data/chinashp.shp"
featureOptions.url()=featurepath;
FeatureGeomModelOptions geomOptions;
geomOptions.featureOptions()=featureOptions;
geomOptions.styles()=new StyleSheet();
geomOptions.styles()->addStyle(style);
geomOptions.enableLighting()=false;
ModelLayerOptions layerOptions(layerName,geomOptions);
layerOptions.overlay()=true;
map->addModelLayer(new ModelLayer(layerOptions));
加上text->encoding()=TextSymbol::ENCODING_UTF8;
text->font()=std::string("E:/simhei.ttf");
这两句也没用,请问各位大佬怎么解决啊? |
|