这样行了吧
private
GoalFeature : array of Feature;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
i : Integer;
Bitmaps: BitmapSymbols;
StyleBitmap : Style;
pt
oint;
fNewSymbol: Variant;
fMapSymbol: Feature;
lyrLayer :Layer;
begin
Bitmaps := CoBitmapSymbols.Create;
//Bitmaps.Count
StyleBitmap := coStyle.Create;
with StyleBitmapdo
begin
SymbolType := miSymbolTypeBitmap;
SymbolBitmapTransparent := True;
SymbolBitmapSize := 24;
end;
//显示目标图标
pt:=CoPoint.Create;
pt.Set_(0, 0);
SetLength(GoalFeature, 10);//你车的数量
for i:=0 to Length(GoalFeature)-1do
begin
StyleBitmap.SymbolBitmapName := Bitmaps.Item(2).Name;
//你选的图标
fNewSymbol := Map1.FeatureFactory.CreateSymbol(pt, StyleBitmap);
fNewSymbol.KeyValue := '你的文本';
// fNewSymbol := lyrLayer.AddFeature(fNewSymbol, EmptyParam);
//你可以重复往里面加你的Feature
GoalFeature
:= lyrLayer.AddFeature(fNewSymbol, EmptyParam);
end;
VarClear(fNewSymbol);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
i : Integer;
begin
for i:=0 to Length(GoalFeature)-1do
begin
GoalFeature.Point.Set_(Lon, Lat);// Lon, Lat是你的位置
GoalFeature.Update(EmptyParam, EmptyParam);
end;
end;