unit uMain;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes,
  System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, DPF.iOS.MapKit,
  DPF.iOS.BaseControl, DPF.iOS.MKMapView, DPF.iOS.UIButton, DPF.iOS.UIView,
  DPF.iOS.UILabel, DPF.iOS.ApplicationManager;

type
  TFMapView = class( TForm )
    DPFMapView1: TDPFMapView;
    DPFButton1: TDPFButton;
    DPFButton2: TDPFButton;
    DPFUIView1: TDPFUIView;
    DPFButton3: TDPFButton;
    DPFButton4: TDPFButton;
    DPFLabel1: TDPFLabel;
    DPFUIView2: TDPFUIView;
    DPFApplicationManager1: TDPFApplicationManager;
    procedure DPFButton1Click( Sender: TObject );
    procedure DPFButton2Click( Sender: TObject );
    procedure DPFButton3Click( Sender: TObject );
    procedure DPFButton4Click( Sender: TObject );
    procedure FormShow( Sender: TObject );
    procedure DPFApplicationManager1MemoryWarning( Sender: TObject );

  private
    { Private declarations }
    Marker: MKPointAnnotation;

  protected
    procedure PaintRects( const UpdateRects: array of TRectF ); override;
  public
    { Public declarations }
  end;

var
  FMapView: TFMapView;

implementation

{$R *.fmx}

procedure TFMapView.DPFApplicationManager1MemoryWarning( Sender: TObject );
begin
  ShowMessage( 'Low Memory' );
end;

procedure TFMapView.DPFButton1Click( Sender: TObject );
begin
  Marker := DPFMapView1.AddAnnotation( 'Iran', 'Tehran', 35.737229, 51.405630 );
end;

procedure TFMapView.DPFButton2Click( Sender: TObject );
begin
  DPFMapView1.RemoveAnnotation( Marker );
end;

procedure TFMapView.DPFButton3Click( Sender: TObject );
begin
  DPFMapView1.ZoomLevel := DPFMapView1.ZoomLevel + 1;
  DPFLabel1.Text        := FloatToStr( DPFMapView1.ZoomLevel );
end;

procedure TFMapView.DPFButton4Click( Sender: TObject );
begin
  DPFMapView1.ZoomLevel := DPFMapView1.ZoomLevel - 1;
  DPFLabel1.Text        := FloatToStr( DPFMapView1.ZoomLevel );
end;

procedure TFMapView.FormShow( Sender: TObject );
begin
  DPFLabel1.Text := FloatToStr( DPFMapView1.ZoomLevel );

end;

procedure TFMapView.PaintRects( const UpdateRects: array of TRectF );
begin
  { }
end;

end.
