Getting started with TMS FNC Time Zone
Prerequisites
- TMS FNC Core installed and the runtime package added to the project.
- TMS FNC Maps installed and the runtime package added to the project.
- An API key for the timezone service backend you intend to use.
Add the component
- Drop
TTMSFNCTimeZone from the TMS FNC Maps palette page onto a form.
- Set the
APIKey property.
- Set the
Service property to choose the timezone backend.
Query timezone for a coordinate
{ Inside a button click handler: }
var
Req: TTMSFNCTimeZoneRequest;
begin
Req := TMSFNCTimeZone1.Requests.Add;
Req.Coordinate.Latitude := 35.6762;
Req.Coordinate.Longitude := 139.6503;
TMSFNCTimeZone1.GetTimeZone;
end;
Handle the result
procedure TForm1.TMSFNCTimeZone1GetTimeZone(
Sender: TObject; ARequestIndex: Integer;
ARequest: TTMSFNCTimeZoneRequest;
ATimeZone: TTMSFNCTimeZoneItems);
begin
{ ATimeZone[0].TimeZoneID contains the IANA identifier, e.g. 'Asia/Tokyo' }
end;
Next steps