Z
zhiqunluo
Unregistered / Unconfirmed
GUEST, unregistred user!
我使用Delphi+MapX开发环境。我在在地图上显示车辆图标和车辆名称。在使用放大工具时
车辆名称也放大,我不想让车辆名称的标注放大该如何做呢?谢谢
代码:
procedure TChildWindow.FormCreate(Sender: TObject);
var
unusedVt: OleVariant;
MyFont: TFont;
begin
TVarData(unusedVt).VType := varError;
TVarData(unusedVt).VError := DISP_E_PARAMNOTFOUND;
// Add car layer and make it an animation layer
lyrMyLayer := Map1.Layers.CreateLayer('cars',unusedVt,unusedVt,1,unusedVt);
map1.Layers.AnimationLayer := map1.Layers.Item(lyrMyLayer.Name);
MyFont := TFont.Create;
OleFontToFont(map1.DefaultStyle.SymbolFont,MyFont);
MyFont.Size := 0;
MyFont.Name := 'MapInfo Transportation';
Map1.DefaultStyle.SymbolCharacter := 66;
Map1.DefaultStyle.SymbolType := miSymbolTypeBitmap;
CarsList := TList.Create;
end;
procedure TChildWindow.AddCarsToMap(CarNo:String;
longitude,latitudeouble);
var
fNewSymbol :Variant;
fFtrFactory :Variant;
pItem :Variant;
begin
//create standAlone feature object
fFtrFactory := Map1.FeatureFactory;
//create point object to pass to createSymbol
pItem := CreateOleObject('MapX.Point.4');
pItem.Set(longitude,latitude);
//use Feature Factory to create new feature
fNewSymbol := fFtrFactory.CreateSymbol(pItem, Map1.DefaultStyle);
//add feature to Lyaer
fMapSymbol := lyrMyLayer.AddFeature(fNewSymbol);
NewCars := new(PCars);
NewCars^.Name := CarNo;
NewCars^.fFeature := fMapSymbol;
pItem.Set(longitude , latitude - 0.002);
//use Feature Factory to create new Feature
fNewSymbol := fFtrFactory.CreateText( pItem , CarNo , miPositionTL , Map1.DefaultStyle );
//add Feature to Lyaer
fMapSymbol := lyrMyLayer.AddFeature(fNewSymbol);
NewCars^.fCapion := fMapSymbol;
CarsList.Add(NewCars);
varClear(FnewSymbol);
end;
车辆名称也放大,我不想让车辆名称的标注放大该如何做呢?谢谢
代码:
procedure TChildWindow.FormCreate(Sender: TObject);
var
unusedVt: OleVariant;
MyFont: TFont;
begin
TVarData(unusedVt).VType := varError;
TVarData(unusedVt).VError := DISP_E_PARAMNOTFOUND;
// Add car layer and make it an animation layer
lyrMyLayer := Map1.Layers.CreateLayer('cars',unusedVt,unusedVt,1,unusedVt);
map1.Layers.AnimationLayer := map1.Layers.Item(lyrMyLayer.Name);
MyFont := TFont.Create;
OleFontToFont(map1.DefaultStyle.SymbolFont,MyFont);
MyFont.Size := 0;
MyFont.Name := 'MapInfo Transportation';
Map1.DefaultStyle.SymbolCharacter := 66;
Map1.DefaultStyle.SymbolType := miSymbolTypeBitmap;
CarsList := TList.Create;
end;
procedure TChildWindow.AddCarsToMap(CarNo:String;
longitude,latitudeouble);
var
fNewSymbol :Variant;
fFtrFactory :Variant;
pItem :Variant;
begin
//create standAlone feature object
fFtrFactory := Map1.FeatureFactory;
//create point object to pass to createSymbol
pItem := CreateOleObject('MapX.Point.4');
pItem.Set(longitude,latitude);
//use Feature Factory to create new feature
fNewSymbol := fFtrFactory.CreateSymbol(pItem, Map1.DefaultStyle);
//add feature to Lyaer
fMapSymbol := lyrMyLayer.AddFeature(fNewSymbol);
NewCars := new(PCars);
NewCars^.Name := CarNo;
NewCars^.fFeature := fMapSymbol;
pItem.Set(longitude , latitude - 0.002);
//use Feature Factory to create new Feature
fNewSymbol := fFtrFactory.CreateText( pItem , CarNo , miPositionTL , Map1.DefaultStyle );
//add Feature to Lyaer
fMapSymbol := lyrMyLayer.AddFeature(fNewSymbol);
NewCars^.fCapion := fMapSymbol;
CarsList.Add(NewCars);
varClear(FnewSymbol);
end;