sde连接时的标注问题(50分)

  • 主题发起人 主题发起人 SeaGod1
  • 开始时间 开始时间
S

SeaGod1

Unregistered / Unconfirmed
GUEST, unregistred user!
下面代码基于sde连接时图层标注标不上,但基于文件可以标注上去,请用过sde的兄弟帮我看看:

Layer := IMoMapLayer(CreateOleObject('MapObjects2.MapLayer'));
Layer.GeoDataset := IMoGeoDataset(dc.FindGeoDataset('SDE.G1W_ANN_GAJG.SHAPE.MultiPoints'));
Ft := TFont.Create;
Ft.name := 'Wingdings';
Ft.size := 20;
OleFt := FontToOleFont(Ft);
Layer.Symbol.Style := 4;
Layer.Symbol.Font := IFontDisp(IDispatch(OleFt));
Layer.Symbol.CharacterIndex:=62;
Layer.Symbol.Color:=RGB(128,128, 255);
Layer.Symbol.Size:=5;
Ft.Free;
Lys := Map1.Layers;
Lys.Add(Layer);

Ft := TFont.Create;
Ft.name := '仿宋_GB2312';
Ft.size := 10;
oleFt := FontToOleFont(Ft);
font.name :='Times';
lyrs := IMoLayers(Map1.layers);
ly := IMoMapLayer(CreateOleObject('MapObjects2.MapLayer'));
lblren := IMoLabelPlacer(CreateOleObject('MapObjects2.LabelPlacer'));
lblren.field :='NAME';
lblren.defaultsymbol.font := IFontDisp(IDispatch(oleFt));
lblren.DefaultSymbol.Color := RGB(0,0,0);;
lblren.AllowDuplicates :=false;
ly := IMoMapLayer(lyrs.item('SDE.G1W_ANN_GAJG.SHAPE.MultiPoints'));
ly.Renderer := lblren;
Map1.refresh;
Ft.Free;
 
后退
顶部