使用产品:iobject 7c++ 操作系统:win10 x64
数据使用UGTemsTextLabelsImportParams导入
标签图使用以下代码编写:
UGDatasets* dataSets = DataSource->GetDatasets();
int dataSetsNum = dataSets->GetSize();
UGThemeLabel* pThemeLable = new UGThemeLabel;
UGTextStyle textStyle;
textStyle.SetForeColor(UGRGB(115, 0, 74));
textStyle.SetBackColor(UGRGB(231, 227, 231));
textStyle.SetBold(true);
textStyle.SetHalo(true);
textStyle.SetHeight(8);
pThemeLable->SetExpression(_U("Name"));
//设置统一风格
pThemeLable->SetTextDefaultStyle(textStyle);
for (int i = 0; i <dataSetsNum; i++)
{
UGDataset* DataSet = dataSets->GetAt(i);
(SuperMap->GetMap())->m_Layers).AddDataset(DataSet, true, UGLayer::UG_Layer_Normal, _U("pointLayer"));
UGLayer *layer = ((SuperMap->GetMap())->m_Layers).AddDataset(DataSet, true, UGLayer::UG_Layer_Normal, _U("ThemeLayer"), pThemeLable);
layer->SetVisible();
SuperMap->Refresh();
结果什么也不显示。
请问是代码哪里设置出错了吗?