Getting started with TMS FNC Places
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 places service backend you intend to use.
Add the component
- Drop
TTMSFNCPlaces from the TMS FNC Maps palette page onto a form.
- Set the
APIKey property.
- Set the
Service property to choose the places backend.
Search for places
Search for placesPascalC++{ Inside a button click handler: }
var
Location: TTMSFNCMapsCoordinateRec;
begin
Location.Latitude := 51.5074;
Location.Longitude := -0.1278;
TMSFNCPlaces1.GetAutoComplete('coffee shop', Location);
end;
// Inside a button click handler:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TTMSFNCMapsCoordinateRec Location;
Location.Latitude = 51.5074;
Location.Longitude = -0.1278;
TMSFNCPlaces1->GetAutoComplete("coffee shop", Location);
}
Handle the result
Handle the resultPascalC++procedure TForm1.TMSFNCPlaces1GetPlaces(
Sender: TObject; ARequestIndex: Integer;
ARequest: TTMSFNCPlacesRequest;
APlaces: TTMSFNCPlacesItems);
begin
{ Iterate APlaces for name, coordinate, and address }
end;
// Pascal sample uses a non-existent OnGetPlaces event; the real OnGetAutoComplete event is used here.
void __fastcall TForm1::TMSFNCPlaces1GetAutoComplete(TObject *Sender,
TTMSFNCPlacesRequest * const ARequest,
TTMSFNCCloudBaseRequestResult * const ARequestResult)
{
// Iterate ARequest->Items for name, coordinate, and address
}
Next steps
- Guides — keyword search, nearby search, and place details.
- API reference — full class reference.