[当我第一次运行我的小软件(使用Delphi XE5创建以尝试并理解该组件)时,地图需要经纬度点,没关系。我创建了一个小窗口,以输入新的纬度和经度点以更改新的中心地图。我尝试了许多更改地图的可能性,但没人能做到,总是出错。
1)SetCenter .....2)Domap .........
我的小问题:如何用第二,第三中心更新地图。...?
有人要这样做吗?在第一个中心转到第二个中心之后如何更新地图。...?
代码:
Procedure TForm1.ConvertDGS_to_DD(Coord : TCoordonnees; Dpt : boolean);
Var newmarker : TMarker;
////////////////////////////////////////////////////////////////////////////////
Function Calcul(PtCoord : TPtCoordonnees) : Currency;
begin
With PtCoord do Result := Degre + (((Seconde / 60) + Minute) / 60);
end;
////////////////////////////////////////////////////////////////////////////////
Begin
With Coord do
case Dpt of
//////////////////////////////////////////////////////////////////////////
// On show - first
//////////////////////////////////////////////////////////////////////////
False : begin
GmMap1.RequiredProp.Center.Lat := Calcul(Latitude);
GmMap1.RequiredProp.Center.Lng := Calcul(Longitude);
end;
else
//////////////////////////////////////////////////////////////////////////
// After enter a new latitude and a new longitude
//////////////////////////////////////////////////////////////////////////
begin
newmarker := GmMarker1.Add(Calcul(Latitude),Calcul(Longitude),'Marqueur 1');
Showmessage(GmMarker1[0].Title + ' / ' + inttostr(newmarker.index) + ' / ' + FloatTostr(newmarker.Position.Lat) + ' - ' + FloatTostr(newmarker.Position.Lng) );
GmMap1.RequiredProp.Center.Lat := newmarker.Position.Lat;
GmMap1.RequiredProp.Center.Lng := newmarker.Position.Lng ;
GMMap1.RequiredProp.Zoom := 13;
newmarker.Visible := True;
GMMap1.PanTo(newmarker.Position.Lat,newmarker.Position.Lng);
//GMMap1.Active := True;
!!! ERROR !!!
end;
end;
end;