unit Unit1;

interface

uses
  System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
  WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, CIC.TMSWeb.Cesium, WEBLib.WebCtrls,
  WEBLib.ExtCtrls, Vcl.StdCtrls, WEBLib.StdCtrls;

type
  TForm1 = class(TWebForm)
    pnlHeader: TWebPanel;
    pnlMain: TWebPanel;
    pnlFooter: TWebPanel;
    CICWebCesium1: TCICWebCesium;
    gMap1: TWebGoogleMaps;
    WebSplitter1: TWebSplitter;
    WebButton1: TWebButton;
    memLog: TWebMemo;
    pnlMousePosition: TWebPanel;
    WebLabel1: TWebLabel;
    edtMouseLat: TWebEdit;
    edtMouseLon: TWebEdit;
    procedure WebFormCreate(Sender: TObject);
    procedure WebButton1Click(Sender: TObject);
    procedure CICWebCesium1ViewerClick(Sender: TObject; pLat, pLon: Double);
    procedure CICWebCesium1ViewerMouseMove(Sender: TObject; pLat, pLon: Double);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}



procedure TForm1.CICWebCesium1ViewerClick(Sender: TObject; pLat, pLon: Double);
begin
  memLog.Lines.Insert(0, FormatDateTime('hh:nn:ss.zzz', Now) + ' Clicked Lat: ' + Format('%0.3f', [pLat]) + ' Lon: ' + Format('%0.3f', [pLon]));
  gMap1.PanTo(pLat, pLon);
end;

procedure TForm1.CICWebCesium1ViewerMouseMove(Sender: TObject; pLat,
  pLon: Double);
begin
  edtMouseLat.Text := Format('%0.3f', [pLat]);
  edtMouseLon.Text := Format('%0.3f', [pLon]);
end;

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  CICWebCesium1.ConsoleLog(FormatDateTime('hh:nn:ss.zzz', Now));
end;

procedure TForm1.WebFormCreate(Sender: TObject);
begin
  memLog.Clear;
  CICWebCesium1.ConsoleLog('Hello Cesium');
end;

end.