Having the TWebGMaps and TWebGMapsGeocoding virtual function for making the HTTP/HTTPS API calls would be nice to have. Obviously not everyone may want to use Indy for HTTP but for those of us who do, this would be nice for the reasons noted in the following example comments...
{code}
function TTheAPIComponent.HttpsGet(Url: string): string; override;
var
IdHttp: TIdHTTP;
IdHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
Result := '';
IdHTTP := TIdHTTP.Create(nil);
IdHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
try
IdHandler.SSLOptions.RootCertFile := '';
IdHandler.SSLOptions.KeyFile := '';
IdHandler.SSLOptions.CertFile := '';
IdHandler.SSLOptions.Method := sslvSSLv23;
IdHandler.SSLOptions.VerifyMode := [];
IdHandler.SSLOptions.VerifyDepth := 0;
IdHttp.IOHandler := IdHandler;
IdHttp.HandleRedirects := True;
{ allow use of HTTPS for using API key on URL }
if UseHTTPS then
Url := ReWriteURLForHTTPS(Url);
{ allow passing API key on URL for Google counters to work }
if Trim(APIKey) <> '' then
Url := AppendAPIKeyToURL(Url)
{ allow use for Google Maps for Work Client ID & Signature }
else if Trim(ClientID) <> '' then
Url := AppendClientIDToURL(Url);
{ allow for local logging of API calls in application }
if Assigned(FOnHttpsGet) then
FOnHttpsGet(Url);
Result := IdHttp.Get(Url);
finally
FreeAndNil(IdHandler);
FreeAndNil(IdHttp);
end;
end;
{code}
Thanks. We'll consider this for a future update.
Thanks!