Hi Team,
I hope you are still going all well. Be safe.
I am wondering what would be the recommended way to keep a moving marker (coordinates) in the centre of map and having the map view panning accordingly?
Thanks
procedure TForm1.DoGetCenterCoordinate(Sender: TObject;
ACoordinate: TTMSFNCMapsCoordinateRec);
begin
if TMSFNCMaps1.Markers.Count > 0 then
TMSFNCMaps1.Markers[0].Coordinate.ToRec := ACoordinate;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFNCMaps1.BeginUpdate;
TMSFNCMaps1.Service := msOpenLayers;
TMSFNCMaps1.ControlAlignment := caClient;
TMSFNCMaps1.OnGetCenterCoordinate := DoGetCenterCoordinate;
TMSFNCMaps1.Markers.Add;
TMSFNCMaps1.EndUpdate;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
TMSFNCMaps1.GetCenterCoordinate;
end;
Your welcome, please keep us updated.