1
私のDelphiアプリケーションでは、GMlibを初めて使用しました。航空路線とすべてのマーカーを含む地図を正常に表示しました。 私はGMMap、GMMarker、GMPolylineコンポーネントを使用しています。マーカーアイコンを小さな円に変更したい
しかし、通常のマーカーアイコンを赤い丸で囲みます(半径3〜4ピクセル)。
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:ここに は、私はマップとルートをプロットするために使用するコードはありますか? ありがとう Pierre
おかげで、ウェブ上またはローカルPC内にある必要があり
を表示する画像を設定するためのIconプロパティを持っています。 素晴らしいGMlibにもありがとうございます。 –