forked from academiadocodigo/TBGWebCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GMapsJS.pas
63 lines (49 loc) · 1.24 KB
/
GMapsJS.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
unit GMapsJS;
interface
uses Interfaces, Classes;
type
TGMapsJS = class(TInterfacedObject, iModelJS)
private
FCDN : Boolean;
FCredenciais : iModelCredenciais;
public
constructor Create;
destructor Destroy; override;
class function New: iModelJS;
function PackJS: String;
function CDN(Value: Boolean): iModelJS;
function Credenciais(Value : iModelCredenciais) : iModelJS;
end;
implementation
{ TGMapsJS }
function TGMapsJS.CDN(Value: Boolean): iModelJS;
begin
Result := Self;
FCDN := Value;
end;
constructor TGMapsJS.Create;
begin
end;
function TGMapsJS.Credenciais(Value: iModelCredenciais): iModelJS;
begin
Result := Self;
FCredenciais := Value;
end;
destructor TGMapsJS.Destroy;
begin
inherited;
end;
class function TGMapsJS.New: iModelJS;
begin
Result := Self.Create;
end;
function TGMapsJS.PackJS: String;
begin
Result := '';
if Assigned(FCredenciais) then
begin
Result := '<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>' +
'<script src="https://maps.googleapis.com/maps/api/js?key=' + FCredenciais.APIGoogle + '®ion=BR&language=pt-BR&libraries=visualization" ></script>';
end;
end;
end.