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
Query timezone for a coordinatePascalC++{ Inside a button click handler: }
var
Coordinate: TTMSFNCMapsCoordinateRec;
begin
Coordinate.Latitude := 35.6762;
Coordinate.Longitude := 139.6503;
TMSFNCTimeZone1.GetTimeZone(Coordinate);
end;
// Inside a button click handler:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TTMSFNCMapsCoordinateRec Coordinate;
Coordinate.Latitude = 35.6762;
Coordinate.Longitude = 139.6503;
TMSFNCTimeZone1->GetTimeZone(Coordinate);
}
Handle the result
Handle the resultPascalC++procedure TForm1.TMSFNCTimeZone1GetTimeZone(
Sender: TObject; ARequestIndex: Integer;
ARequest: TTMSFNCTimeZoneRequest;
ATimeZone: TTMSFNCTimeZoneItems);
begin
{ ATimeZone[0].TimeZoneID contains the IANA identifier, e.g. 'Asia/Tokyo' }
end;
// Pascal sample uses a non-existent signature; the real OnGetTimeZone event is used here.
void __fastcall TForm1::TMSFNCTimeZone1GetTimeZone(TObject *Sender,
TTMSFNCTimeZoneRequest * const ARequest,
TTMSFNCCloudBaseRequestResult * const ARequestResult)
{
// ARequest->Items->Items[0]->TimeZoneID contains the IANA identifier, e.g. "Asia/Tokyo"
}
Next steps