Skip to content

Commit c9ca1e5

Browse files
Version 1.6.0
- Added functions to add Circles, Polylines or Polygons to map - Added function ComputeDistanceBetween - Enabled component into IDE using Win64 Platform
1 parent 8f03b82 commit c9ca1e5

15 files changed

+306
-88
lines changed

Demo/GoogleMaps/GoogleMapsTest.dproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
77
<DCC_DependencyCheckOutputName>GoogleMapsTest.exe</DCC_DependencyCheckOutputName>
8-
<ProjectVersion>19.5</ProjectVersion>
8+
<ProjectVersion>20.1</ProjectVersion>
99
<Config Condition="'$(Config)'==''">Debug</Config>
1010
<Base>True</Base>
1111
<TargetedPlatforms>3</TargetedPlatforms>
1212
<AppType>Application</AppType>
1313
<FrameworkType>VCL</FrameworkType>
1414
<Platform Condition="'$(Platform)'==''">Win32</Platform>
15+
<ProjectName Condition="'$(ProjectName)'==''">GoogleMapsTest</ProjectName>
1516
</PropertyGroup>
1617
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
1718
<Base>true</Base>
@@ -113,7 +114,6 @@
113114
</PropertyGroup>
114115
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
115116
<BT_BuildType>Debug</BT_BuildType>
116-
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
117117
</PropertyGroup>
118118
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
119119
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>

Demo/GoogleMaps/GoogleMapsTest.res

0 Bytes
Binary file not shown.

Demo/GoogleMaps/MainForm.dfm

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ object formMain: TformMain
2424
object Splitter1: TSplitter
2525
Left = 0
2626
Top = 579
27-
Width = 1445
27+
Width = 1190
2828
Height = 3
2929
Cursor = crVSplit
3030
Align = alBottom
31-
ExplicitWidth = 1190
3231
end
3332
object PanelHeader: TPanel
3433
Left = 0
@@ -37,7 +36,6 @@ object formMain: TformMain
3736
Height = 209
3837
Align = alTop
3938
TabOrder = 0
40-
ExplicitWidth = 1441
4139
object gbMapAttributes: TGroupBox
4240
Left = 1
4341
Top = 1
@@ -386,7 +384,6 @@ object formMain: TformMain
386384
Align = alClient
387385
Caption = 'Drawing'
388386
TabOrder = 3
389-
ExplicitWidth = 505
390387
object PCDrawing: TPageControl
391388
Left = 2
392389
Top = 15
@@ -395,7 +392,6 @@ object formMain: TformMain
395392
ActivePage = TabMarkers
396393
Align = alClient
397394
TabOrder = 0
398-
ExplicitWidth = 501
399395
object TabMarkers: TTabSheet
400396
Caption = 'Markers'
401397
object Panel12: TPanel
@@ -405,7 +401,6 @@ object formMain: TformMain
405401
Height = 41
406402
Align = alBottom
407403
TabOrder = 0
408-
ExplicitWidth = 493
409404
DesignSize = (
410405
497
411406
41)
@@ -429,7 +424,6 @@ object formMain: TformMain
429424
Caption = 'Clear Markers'
430425
TabOrder = 1
431426
OnClick = ButtonClearMarkersClick
432-
ExplicitLeft = 388
433427
end
434428
object chMarkerShowHide: TCheckBox
435429
Left = 282
@@ -442,7 +436,6 @@ object formMain: TformMain
442436
State = cbChecked
443437
TabOrder = 2
444438
OnClick = chMarkerShowHideClick
445-
ExplicitLeft = 278
446439
end
447440
end
448441
object PageControlMarker: TPageControl
@@ -453,7 +446,6 @@ object formMain: TformMain
453446
ActivePage = LatLongMarkerTabSheet
454447
Align = alClient
455448
TabOrder = 1
456-
ExplicitWidth = 493
457449
object LatLongMarkerTabSheet: TTabSheet
458450
Caption = 'Latitute/Longitude'
459451
object GridPanel1: TGridPanel
@@ -486,7 +478,6 @@ object formMain: TformMain
486478
Value = 50.000000000000000000
487479
end>
488480
TabOrder = 0
489-
ExplicitWidth = 485
490481
object GridPanel2: TGridPanel
491482
Left = 0
492483
Top = 0
@@ -517,7 +508,6 @@ object formMain: TformMain
517508
Value = 100.000000000000000000
518509
end>
519510
TabOrder = 0
520-
ExplicitWidth = 485
521511
object Panel2: TPanel
522512
Left = 0
523513
Top = 0
@@ -526,7 +516,6 @@ object formMain: TformMain
526516
Align = alClient
527517
BevelOuter = bvNone
528518
TabOrder = 0
529-
ExplicitWidth = 242
530519
object Label9: TLabel
531520
AlignWithMargins = True
532521
Left = 3
@@ -545,7 +534,6 @@ object formMain: TformMain
545534
Height = 21
546535
Align = alTop
547536
TabOrder = 0
548-
ExplicitWidth = 236
549537
end
550538
end
551539
object Panel3: TPanel
@@ -556,8 +544,6 @@ object formMain: TformMain
556544
Align = alClient
557545
BevelOuter = bvNone
558546
TabOrder = 1
559-
ExplicitLeft = 242
560-
ExplicitWidth = 243
561547
object Label10: TLabel
562548
AlignWithMargins = True
563549
Left = 3
@@ -576,7 +562,6 @@ object formMain: TformMain
576562
Height = 21
577563
Align = alTop
578564
TabOrder = 0
579-
ExplicitWidth = 237
580565
end
581566
end
582567
end
@@ -588,7 +573,6 @@ object formMain: TformMain
588573
Align = alClient
589574
BevelOuter = bvNone
590575
TabOrder = 1
591-
ExplicitWidth = 485
592576
object Label11: TLabel
593577
AlignWithMargins = True
594578
Left = 3
@@ -607,7 +591,8 @@ object formMain: TformMain
607591
Height = 21
608592
Align = alTop
609593
TabOrder = 0
610-
ExplicitWidth = 479
594+
ExplicitLeft = 88
595+
ExplicitWidth = 398
611596
end
612597
end
613598
end
@@ -1732,8 +1717,6 @@ object formMain: TformMain
17321717
MapLatitude = 25.767314000000000000
17331718
MapLongitude = -80.135694000000000000
17341719
BeforeShowMap = EdgeGoogleMapViewerBeforeShowMap
1735-
ExplicitWidth = 1441
1736-
ExplicitHeight = 369
17371720
end
17381721
object DBGrid: TDBGrid
17391722
Left = 0
@@ -1822,8 +1805,6 @@ object formMain: TformMain
18221805
Height = 47
18231806
Align = alBottom
18241807
TabOrder = 3
1825-
ExplicitTop = 681
1826-
ExplicitWidth = 1441
18271808
object ShowPrintUIButton: TButton
18281809
AlignWithMargins = True
18291810
Left = 90
@@ -1867,7 +1848,6 @@ object formMain: TformMain
18671848
VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast]
18681849
Align = alRight
18691850
TabOrder = 3
1870-
ExplicitLeft = 1309
18711851
end
18721852
object LoadTableButton: TButton
18731853
AlignWithMargins = True
@@ -1879,7 +1859,6 @@ object formMain: TformMain
18791859
Caption = 'Load Table'
18801860
TabOrder = 2
18811861
OnClick = LoadTableButtonClick
1882-
ExplicitLeft = 1204
18831862
end
18841863
object Button1: TButton
18851864
AlignWithMargins = True
@@ -1901,7 +1880,6 @@ object formMain: TformMain
19011880
Align = alClient
19021881
BevelOuter = bvNone
19031882
TabOrder = 5
1904-
ExplicitWidth = 856
19051883
object Label7: TLabel
19061884
Left = 0
19071885
Top = 0
@@ -1920,7 +1898,6 @@ object formMain: TformMain
19201898
Align = alTop
19211899
TabOrder = 0
19221900
Text = 'customer.xml'
1923-
ExplicitWidth = 850
19241901
end
19251902
end
19261903
end

Demo/GoogleMaps/MainForm.pas

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
{ }
33
{ Delphi Google Map Viewer Demo }
44
{ }
5-
{ Copyright (c) 2021-2023 (Ethea S.r.l.) }
5+
{ Copyright (c) 2021-2024 (Ethea S.r.l.) }
66
{ Author: Carlo Barazzetta }
77
{ Contributors: }
88
{ littleearth (https://github.com/littleearth) }
9+
{ chaupero (https://github.com/chaupero) }
910
{ }
1011
{ https://github.com/EtheaDev/DelphiGoogleMap }
1112
{ }
@@ -32,7 +33,7 @@ interface
3233
WebView2, System.SysUtils, Winapi.ActiveX, Vcl.Forms,
3334
Vcl.GoogleMap, Vcl.Edge, Data.DB, Datasnap.DBClient, Vcl.Menus, Vcl.ExtCtrls,
3435
Vcl.DBCtrls, Vcl.Grids, Vcl.DBGrids, Vcl.StdCtrls, Vcl.Samples.Spin,
35-
Vcl.Controls, System.Classes, Vcl.Mask, Vcl.ComCtrls, System.IOUtils;
36+
Vcl.Controls, System.Classes, Vcl.Mask, Vcl.ComCtrls, Vcl.Buttons;
3637

3738
type
3839
TformMain = class(TForm)
@@ -296,7 +297,7 @@ TformMain = class(TForm)
296297
implementation
297298

298299
uses
299-
Vcl.Dialogs, SecondaryForm;
300+
System.IOUtils, Vcl.Dialogs, SecondaryForm;
300301

301302
{$R *.dfm}
302303

@@ -310,7 +311,6 @@ function B2S(value: boolean): string;
310311

311312
procedure TformMain.FormCreate(Sender: TObject);
312313
begin
313-
FormatSettings.DecimalSeparator := '.';
314314
Zoom.Value := EdgeGoogleMapViewer.MapZoom;
315315

316316
//Init checkboxes based on Component Proprerties
@@ -515,16 +515,16 @@ procedure TformMain.btnAddCircleClick(Sender: TObject);
515515
EdgeGoogleMapViewer.GotoLocation(LLatLng, false);
516516
EdgeGoogleMapViewer.PutCircle(
517517
LLatLng,
518-
strtofloat(eCircleRadius.text),
518+
TEdgeGoogleMapViewer.TextToCoord(eCircleRadius.text),
519519
chkCircleEditable.Checked,
520520
chkCircleDraggable.Checked,
521521
chkCircleVisible.Checked,
522522
chkCicleClickable.Checked,
523523
eCircleStrokeColor.Text,
524-
strtofloat(eCircleStrokeOpacity.text),
524+
TEdgeGoogleMapViewer.TextToCoord(eCircleStrokeOpacity.text),
525525
strtoint(eCircleStrokeWeight.text),
526526
eCircleFillColor.Text,
527-
strtofloat(eCircleFillOpacity.text),
527+
TEdgeGoogleMapViewer.TextToCoord(eCircleFillOpacity.text),
528528
eCircleInfo.Text);
529529
end;
530530

@@ -602,8 +602,8 @@ procedure TformMain.btnGeometryComputeDistanceBetweenClick(Sender: TObject);
602602
ToLatLng.Latitude := TEdgeGoogleMapViewer.TextToCoord(eGeometryToLat.Text);
603603
ToLatLng.Longitude := TEdgeGoogleMapViewer.TextToCoord(eGeometryToLng.Text);
604604

605-
Distance:=EdgeGoogleMapViewer.ComputeDistanceBetween(FromLatLng,ToLatLng);
606-
Showmessage(Format('Distance %8.2f mts',[Distance]));
605+
Distance := EdgeGoogleMapViewer.ComputeDistanceBetween(FromLatLng,ToLatLng);
606+
ShowMessageFmt('Distance %8.2f mts',[Distance]);
607607
end;
608608

609609
procedure TformMain.Button1Click(Sender: TObject);
@@ -669,10 +669,11 @@ procedure TformMain.EdgeGoogleMapViewerContainsFullScreenElementChanged(
669669

670670
initialization
671671
//Setup UserDataFolder for Temp files
672-
TEdgeGoogleMapViewer.RegisterUserDataFolder(System.IOUtils.TPath.GetTempPath);
672+
TEdgeGoogleMapViewer.RegisterUserDataFolder(System.IOUtils.TPath.GetTempPath+ExtractFileName(ParamStr(0)));
673673
//If you have a Google API Key it's time to setup
674674
//TEdgeGoogleMapViewer.RegisterGoogleMapsApiKey('xyz');
675675

676676
{$WARN SYMBOL_PLATFORM OFF}
677677
ReportMemoryLeaksOnShutdown := DebugHook <> 0;
678-
end. `
678+
679+
end.

Demo/GoogleMaps/SecondaryForm.dfm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ object FormSecondary: TFormSecondary
1414
Font.Height = -11
1515
Font.Name = 'Tahoma'
1616
Font.Style = []
17-
OldCreateOrder = False
1817
Position = poScreenCenter
1918
Visible = True
2019
WindowState = wsMaximized
2120
OnCreate = FormCreate
2221
OnDestroy = FormDestroy
23-
PixelsPerInch = 96
2422
TextHeight = 13
2523
object PanelHeader: TPanel
2624
Left = 0

Demo/GoogleMaps/SecondaryForm.pas

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
{******************************************************************************}
2+
{ }
3+
{ Delphi Google Map Viewer Demo }
4+
{ }
5+
{ Copyright (c) 2021-2024 (Ethea S.r.l.) }
6+
{ Author: Carlo Barazzetta }
7+
{ Contributors: }
8+
{ littleearth (https://github.com/littleearth) }
9+
{ }
10+
{ https://github.com/EtheaDev/DelphiGoogleMap }
11+
{ }
12+
{******************************************************************************}
13+
{ }
14+
{ Licensed under the Apache License, Version 2.0 (the "License"); }
15+
{ you may not use this file except in compliance with the License. }
16+
{ You may obtain a copy of the License at }
17+
{ }
18+
{ http://www.apache.org/licenses/LICENSE-2.0 }
19+
{ }
20+
{ Unless required by applicable law or agreed to in writing, software }
21+
{ distributed under the License is distributed on an "AS IS" BASIS, }
22+
{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }
23+
{ See the License for the specific language governing permissions and }
24+
{ limitations under the License. }
25+
{ }
26+
{******************************************************************************}
127
unit SecondaryForm;
228

329
interface

Images/SupportingDelphi.jpg

-218 Bytes
Loading

Packages/DelphiGoogleMap.dproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
<PropertyGroup>
33
<ProjectGuid>{9C4225F1-765F-43B6-A40F-64C405F91FB5}</ProjectGuid>
44
<MainSource>DelphiGoogleMap.dpk</MainSource>
5-
<ProjectVersion>19.5</ProjectVersion>
5+
<ProjectVersion>20.1</ProjectVersion>
66
<FrameworkType>VCL</FrameworkType>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Release</Config>
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>3</TargetedPlatforms>
1111
<AppType>Package</AppType>
12+
<ProjectName Condition="'$(ProjectName)'==''">DelphiGoogleMap</ProjectName>
1213
</PropertyGroup>
1314
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
1415
<Base>true</Base>
@@ -58,6 +59,11 @@
5859
<CfgParent>Base</CfgParent>
5960
<Base>true</Base>
6061
</PropertyGroup>
62+
<PropertyGroup Condition="('$(Platform)'=='Win64x' and '$(Base)'=='true') or '$(Base_Win64x)'!=''">
63+
<Base_Win64x>true</Base_Win64x>
64+
<CfgParent>Base</CfgParent>
65+
<Base>true</Base>
66+
</PropertyGroup>
6167
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
6268
<Cfg_1>true</Cfg_1>
6369
<CfgParent>Base</CfgParent>
@@ -205,6 +211,8 @@
205211
<Source Name="MainSource">DelphiGoogleMap.dpk</Source>
206212
</Source>
207213
<Excluded_Packages/>
214+
<WelcomePageFile Path="..\README.htm"/>
215+
<WelcomePageFolder/>
208216
</Delphi.Personality>
209217
<Platforms>
210218
<Platform value="Android">False</Platform>
@@ -216,6 +224,7 @@
216224
<Platform value="OSXARM64">False</Platform>
217225
<Platform value="Win32">True</Platform>
218226
<Platform value="Win64">True</Platform>
227+
<Platform value="Win64x">False</Platform>
219228
</Platforms>
220229
</BorlandProject>
221230
<ProjectFileVersion>12</ProjectFileVersion>

Packages/DelphiGoogleMap.res

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)