Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TMS VCL WebGMaps
Creating moving markers on WebGMaps
Creating moving markers on WebGMaps
After a marker has been added with the method WebGMaps.Markers.Add(), it can be moved at a later time on the map by simply changing its longitude and/or latitude properties.
Example:
Button1 adds a marker on the center of the map.
procedure TForm3.Button1Click(Sender: TObject); begin webgmaps1.Markers.Add(webgmaps1.MapOptions.DefaultLatitude,webgmaps1.MapOptions.DefaultLongitude); end;
From button2, you can make the marker move in latitude direction with following code:
procedure TForm3.Button2Click(Sender: TObject); begin webgmaps1.Markers.BeginUpdate; webgmaps1.Markers[0].Latitude := webgmaps1.Markers[0].Latitude +0.01; webgmaps1.Markers.EndUpdate; end;