0

Using GMLib on Delphi XE-7, I'm trying to move existing marker to new position, I have created only one marker on the map and tried using code below as a test to move it.

procedure TfrmMapClient.GMMap1Click(Sender: TObject; LatLng: TLatLng; X, Y:   Double);
begin

mcnt := gmmarker1.count;
gmmarker1.Items[0].Position:= LatLng;

end;

but getting Exception Access Violation. Any help much appreciated

RRUZ
  • 134,889
  • 20
  • 356
  • 483
dawam
  • 3
  • 1

1 Answers1

0

Try with

gmmarker1.Items[0].Position.Assign(LatLng);

or assigning individual properties

gmmarker1.Items[0].Position.Lat := LatLng.Lat;
gmmarker1.Items[0].Position.Lng := LatLng.Lng;
cadetill
  • 1,552
  • 16
  • 24