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 VCL WebGMaps
How to convert an address to a longitude, latitude coordinate

The TWebGMapsGeocoding component is a helper component to enable using the Google geocoding service to convert an address to a longitude, latitude coordinate. Set the address: STREET (NUMBER), (ZIPCODE) CITY, COUNTRY , and call the function TWebGMapsGeocoding.LaunchGeocoding. When the result of this call is erOK, the geocoding was successful and the longitude & latitude for the address can be read from:

TWebGMapsGeocoding.ResultLatitude
TWebGMapsGeocoding.ResultLongitude

Example:
WebGMapsGeocoding1.Address := 'Broadway 615, LOS ANGELES, USA';
if WebGMapsGeocoding1.LaunchGeocoding = erOk then
begin
   ShowMessage("Result:"+ FloatToStr(WebGMapsGeocoding1.ResultLongitude)+":"+ loatToStr(WebGMapsGeocoding1.ResultLatitude));
end;