How to read the map extents

I haven't found a way of reading the lat/lon extents of the currently displayed TTMSFNCGoogleMap. Is there a way of reading the max and min lat/lon's for the currently displayed map?
Thanks.

We are implementing a GetBounds, which will be available in the next release. The code to accomplish this in the current version is:

unit Unit43;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.TMSFNCGoogleMaps,
  FMX.Controls.Presentation, FMX.StdCtrls;

type
  TForm43 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    m: TTMSFNCGoogleMaps;
  public
    { Public declarations }
  end;

var
  Form43: TForm43;

implementation

{$R *.fmx}

uses
  FMX.TMSFNCMaps, FMX.TMSFNCUtils,
  FMX.TMSFNCTypes, FMX.TMSFNCMapsCommonTypes;

procedure TForm43.Button1Click(Sender: TObject);
var
  s: string;
begin
  s :=
   'function getBounds(){' + LB +
    '  var jsonObj = getDefaultBoundsObject();' + LB +
    '  var loc = ' + MAPVAR + '.getBounds();' + LB +
    '  jsonObj["NorthEast"]["Latitude"] = loc.getNorthEast().lat();' + LB +
    '  jsonObj["NorthEast"]["Longitude"] = loc.getNorthEast().lng();' + LB +
    '  jsonObj["SouthWest"]["Latitude"] = loc.getSouthWest().lat();' + LB +
    '  jsonObj["SouthWest"]["Longitude"] = loc.getSouthWest().lng();' + LB +
    '  return jsonObj;' + LB +
    '}' + LB +
    'getBounds();';

  m.ExecuteJavascript(s,
  procedure(const AValue: string)
  var
    b: TTMSFNCMapsBounds;
    v: string;
  begin
    if AValue = 'null' then
      Exit;

    v := TTMSFNCUtils.URLDecode(AValue);
    b := TTMSFNCMapsBounds.Create;
    try
      b.JSON := v;
      //b.NorthEast;
      //b.SouthWest;
    finally
      b.Free;
    end;
  end
  );
end;

procedure TForm43.FormCreate(Sender: TObject);
begin
  ReportMemoryLeaksOnShutdown := True;
  m := TTMSFNCGoogleMaps.Create(Self);
  m.Parent := Self;
  m.APIKey := 'ENTER API-KEY';
  m.Left := 40;
  m.Top := 40;
end;

end.

Thanks Pieter.
I have measured the time taken for the bounds to become available after executing the Javascript to be around 563mSec on my 32 bit tablet. That's too long for what I require so I will wait for the next release to become available.

Hi,

The code that is executing JavaScript is the same as we have implemented in GetBounds, so you won't see a difference in timing. Did you test this in debug mode or release mode?

I've investigated this further and it appears that at the exact time I was measuring the bounds function duration happened to correspond with the map repositioning. I've moved the timing code such that the map is in a idle state before testing the time taken for the bounds to become available.
On my tablet:
In debug mode it takes 18 - 23mSec
In release mode it takes 15 - 31mSec
So it looks like it is working well and it was my test method that was causing the issue.
Thanks again for supplying the bounds code.

Great! Thanks for confirming the implementation is working.