Delphi 要将标记图标更改为小圆圈吗
在我的Delphi应用程序中,我第一次使用GMlib,并成功地显示了一张带有航线和所有标记的地图。 我使用GMMap、GMMarker、GMPolyline组件 然而,我想用小红色圆圈(3-4像素半径)代替普通的标记图标。 以下是我用来绘制地图和路线的代码:Delphi 要将标记图标更改为小圆圈吗,delphi,gmlib,Delphi,Gmlib,在我的Delphi应用程序中,我第一次使用GMlib,并成功地显示了一张带有航线和所有标记的地图。 我使用GMMap、GMMarker、GMPolyline组件 然而,我想用小红色圆圈(3-4像素半径)代替普通的标记图标。 以下是我用来绘制地图和路线的代码: procedure TfrmWebBrowser.PlotMap; var aList1, aList2: TstringList; dLatitude, dLatitude1, dLatD, dLonD, dL
procedure TfrmWebBrowser.PlotMap;
var
aList1,
aList2: TstringList;
dLatitude,
dLatitude1,
dLatD,
dLonD,
dLongitude,
dLongitude1: Single;
i: Integer;
Poly: TPolyline;
begin
Poly:= TPolyline(GMPolyline1.Add);
Poly.StrokeColor:= clRed;
Poly.StrokeWeight:= 1;
aList1:= TstringList.Create;
aList1.StrictDelimiter:= True;
aList1.Delimiter:= ';';
aList2:= TstringList.Create;
aList2.StrictDelimiter:= True;
aList2.Delimiter:= ';';
GMMarker1.Clear;
for i := 0 to GstlMapPoints.Count-1 do
begin
aList1.DelimitedText:= GstlMapPoints.Strings[i];
if i > 0 then
begin
aList2.DelimitedText:= GstlMapPoints.Strings[i - 1];
dLatitude:= StrToFloat(aList2[0]);
dLatitude1:= StrToFloat(aList1[0]);
dLongitude:= StrToFloat(aList2[1]);
dLongitude1:= StrToFloat(aList1[1]);
Poly.AddLinePoint(dLatitude,dLongitude);
Poly.AddLinePoint(dLatitude1,dLongitude1);
Poly.Geodesic:= True;
end
else
begin
dLatD:= StrToFloat(aList1[0]);
dLonD:= StrToFloat(aList1[1]);
end;
dLatitude:= StrToFloat(aList1[0]);
dLongitude:= StrToFloat(aList1[1]);
GMMarker1.Add(dLatitude, dLongitude, aList1[2]);
end;
GMMarker1.ZoomToPoints;
aList1.Free;
aList2.Free;
end;
ypu能帮我吗?
谢谢
PierreTGMMarker类中的Add方法返回一个TMarker对象。此对象具有用于设置要显示的图像的图标属性
var
Marker: TMarker
begin
.....
Marker := GMMarker1.Add(dLatitude, dLongitude, aList1[2]);
Marker.Icon := 'http://www.cadetill.com/imagenes/gallery/gmlib/marker.png'
.....
图像必须在网络上或本地PC上非常感谢,它工作正常。还感谢您提供了非常棒的GMlib。