We have a Google Maps function in our Delphi apps. These are for use in a Windows Tablet PC, not cell phone. We need to have a User Field Technician (think tree location on a property) physical location Lat-Lon. We then create the data and Map Point. The TMS Location wants to return an IP. Is there a component for that? If not, can anyone suggest a solution?
Hi,
Please note that TMSFNCLocation can return both IP address and a Lat-Lon location in the OnGetLocation event. The content and accuracy of the data depends on the service used.
This sample shows how to retrieve the latitude and longitude values:
procedure TForm1.Button1Click(Sender: TObject);
begin
TMSFNCLocation1.GetLocation;
end;
procedure TForm1.TMSFNCLocation1GetLocation(Sender: TObject;
const ARequest: TTMSFNCLocationRequest;
const ARequestResult: TTMSFNCCloudBaseRequestResult);
begin
Memo1.Lines.Add('Lat: ' + FloatToStr(ARequest.Coordinate.Latitude) + ' Lon: ' + FloatToStr(ARequest.Coordinate.Longitude));
end;
Thanks Bart. So, if the database s/w is on a Hosted Cloud Server and the Tablet is in the field next to a tree, does GetLocation return the Tree or the Server?
The results are returned based on the IP address of the request location. So in this case this will most likely be the location of the server.
Thanks again Bart. Any ideas on method/tool to solve the problem?
Have you tried using the default Delphi TLocationSensor component in this scenario?