Panning the map

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

There is currently no option to get the center coordinate (we have to release an update first). After the update is available you could use a timer that refreshes the marker based on the center coordinate of the map:


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;

Included now in V1.0.1.0.I will test this.
Thanks Pieter.

Your welcome, please keep us updated.