2018-04-16 13:59:19 +00:00
|
|
|
unit Main;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2018-04-16 15:15:27 +00:00
|
|
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, mvgeonames,
|
|
|
|
mvMapViewer;
|
2018-04-16 13:59:19 +00:00
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
TForm1 = class(TForm)
|
2018-04-16 15:15:27 +00:00
|
|
|
MapView1: TMapView;
|
|
|
|
GeoNames: TMVGeoNames;
|
|
|
|
Panel1: TPanel;
|
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
procedure FormShow(Sender: TObject);
|
2018-04-16 13:59:19 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
public
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
Form1: TForm1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.lfm}
|
|
|
|
|
2018-04-16 15:15:27 +00:00
|
|
|
uses
|
|
|
|
mvTypes;
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
procedure TForm1.FormCreate(Sender: TObject);
|
|
|
|
begin
|
|
|
|
MapView1.DoubleBuffered := true;
|
|
|
|
MapView1.Zoom := 7;
|
|
|
|
GeoNames.LocationName := 'New York';
|
|
|
|
MapView1.Center := GeoNames.Search(MapView1.DownloadEngine);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TForm1.FormShow(Sender: TObject);
|
|
|
|
begin
|
|
|
|
MapView1.Active := true;
|
|
|
|
end;
|
|
|
|
|
2018-04-16 13:59:19 +00:00
|
|
|
end.
|
|
|
|
|