Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS FMX WebGMaps
How to set the map to a different location

The DefaultLatitude and DefaultLongitude needs to be set at designtime, to initialize the map the first time it is loading. When the map is loading the map will load this as the center location.

Afterwards, you can use the TTMSFMXWebGMaps1.MapPanTo(Latitude, Longitude) to set the map to a different location. This function performs a pan to a location set by latitude and longitude coordinates. This is useful to set a certain position in the center of the control canvas. Make sure to call MapPanTo after the map has finished loading. The OnDownloadFinish event is triggered when the map is ready.

Example:

procedure TForm1.TMSFMXWebGMaps1DownloadFinish(Sender: TObject); 
begin
  TMSFMXWebGMaps1.MapPanTo(Latitude, Longitude); 
end;