[FMX] Need advice

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Post Reply
Lena
BCBJ Master
BCBJ Master
Posts: 696
Joined: Sun Feb 06, 2011 1:28 pm

[FMX] Need advice

Post by Lena »

Hi.
I am starting a new FMX project for IOS. Please give advice on the interface.
I need such an interface, the user clicks on the American state and receives a list of addresses and phone numbers where honey is sold in this state.
Something similar is shown on this site: honey
My questions so far are:
1. Is it possible to create such a clickable map on FMX or just use ComboBox-es for American state and zip code?
2. Where is it better to store all the data in INI or SQlite?
What do you think is the right way to approach the implementation of such a task?
Thanks.
Lena
BCBJ Master
BCBJ Master
Posts: 696
Joined: Sun Feb 06, 2011 1:28 pm

Re: [FMX] Need advice

Post by Lena »

For the first question, I found the component TMapView in FMX. Code below works:

Code: Select all

void __fastcall TForm1::FormShow(TObject *Sender)
{
	//USA
	//широта 37.09024  Latitude
	//долгота -95.712891 Longitude
	MapPiter->Location = TMapCoordinate::Create(37.09024, -95.712891);
	MapPiter->Zoom = 4;

	//маркер Филадельфия 39.9525839 -75.1652215 штат Pennsylvania
	TMapCoordinate Position;
	Position.Latitude = 39.9525839; //широта
	Position.Longitude = -75.1652215; //долгота
	TMapMarkerDescriptor myMarker = TMapMarkerDescriptor::Create(Position, L"Pennsylvania");
	myMarker.Draggable = false;
	myMarker.Visible = true;
	MapPiter->AddMarker(myMarker);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::MapPiterMarkerClick(TMapMarker *Marker)
{
  //test
  if(Marker->Descriptor.Title == L"Pennsylvania")
   {
    ShowMessage(L"Hello Pennsylvania!");
   }

}
//---------------------------------------------------------------------------

void __fastcall TForm1::ButtonSatelliteClick(TObject *Sender)
{
 MapPiter->MapType = TMapType::Satellite;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ButtonHybridClick(TObject *Sender)
{
 MapPiter->MapType = TMapType::Hybrid;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ButtonNormalClick(TObject *Sender)
{
 MapPiter->MapType = TMapType::Normal;
}
//---------------------------------------------------------------------------

Post Reply