Z
zangqi
Unregistered / Unconfirmed
GUEST, unregistred user!
源代码如下,请大侠们看看:
var
Form1: TForm1;
carlayer:cmapxlayer;
ffeature:cmapxfeature;
implementation
{$R *.dfm}
procedure init;
var
r,r2:variant;
begin
carlayer:=form1.Map1.Layers.CreateLayer('cars','',1,1,form1.map1.NumericCoordSys);
form1.Map1.Layers.AnimationLayer :=carlayer;
carlayer.LabelProperties.Position := miPositionTR;
carlayer.LabelProperties.Style.TextFontShadow := True;
carlayer.LabelProperties.Style.TextFontHalo := True;
r2:= carlayer.Style.textfont;
r2.name:='宋体';
r2.size:=24;
carlayer.LabelProperties.Overlap := True;
carlayer.LabelProperties.Style.TextFontColor := clred;
carlayer.AutoLabel := True;
carlayer.Style.SymbolType := miSymbolTypeTrueTypeFont
r:=carlayer.Style.SymbolFont;
r.name:='MapInfo Transportation'
r.size:=28;
carlayer.Style.SymbolFontColor := clBlue;
carlayer.Style.SymbolFontOpaque := False;
carlayer.Style.SymbolFontHalo := True;
carlayer.Style.SymbolFontShadow := True;
carlayer.Style.SymbolCharacter := 93;
end;
procedure drawcar;
var
fnewsymbol,fmapsymbol:cmapxfeature;
begin
ffeature:=cofeature.Create;
ffeature.Attach(form1.Map1.DefaultDispatch);
ffeature.Type_ := miFeatureTypeSymbol;
ffeature.Style := carlayer.Style;
ffeature.KeyValue:='ABC';
ffeature.Point.Set_(117.1748,39.1401);
ffeature:=carlayer.AddFeature(ffeature,EmptyParam);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
init;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
drawcar;
end;
为什么运行了之后,在117.1748,39.1401位置显示的汽车符号上方只有'A'而不是'ABC'?
var
Form1: TForm1;
carlayer:cmapxlayer;
ffeature:cmapxfeature;
implementation
{$R *.dfm}
procedure init;
var
r,r2:variant;
begin
carlayer:=form1.Map1.Layers.CreateLayer('cars','',1,1,form1.map1.NumericCoordSys);
form1.Map1.Layers.AnimationLayer :=carlayer;
carlayer.LabelProperties.Position := miPositionTR;
carlayer.LabelProperties.Style.TextFontShadow := True;
carlayer.LabelProperties.Style.TextFontHalo := True;
r2:= carlayer.Style.textfont;
r2.name:='宋体';
r2.size:=24;
carlayer.LabelProperties.Overlap := True;
carlayer.LabelProperties.Style.TextFontColor := clred;
carlayer.AutoLabel := True;
carlayer.Style.SymbolType := miSymbolTypeTrueTypeFont
r:=carlayer.Style.SymbolFont;
r.name:='MapInfo Transportation'
r.size:=28;
carlayer.Style.SymbolFontColor := clBlue;
carlayer.Style.SymbolFontOpaque := False;
carlayer.Style.SymbolFontHalo := True;
carlayer.Style.SymbolFontShadow := True;
carlayer.Style.SymbolCharacter := 93;
end;
procedure drawcar;
var
fnewsymbol,fmapsymbol:cmapxfeature;
begin
ffeature:=cofeature.Create;
ffeature.Attach(form1.Map1.DefaultDispatch);
ffeature.Type_ := miFeatureTypeSymbol;
ffeature.Style := carlayer.Style;
ffeature.KeyValue:='ABC';
ffeature.Point.Set_(117.1748,39.1401);
ffeature:=carlayer.AddFeature(ffeature,EmptyParam);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
init;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
drawcar;
end;
为什么运行了之后,在117.1748,39.1401位置显示的汽车符号上方只有'A'而不是'ABC'?