Skip to content

Commit ce39c8f

Browse files
committed
Change NavigateToURL(LFileName) to NavigateToString(HTMLString)
Since the html code is writen to a file, the google API Key is exposed in that file. Think when you deploy the exe to all customers, your API Key made public. The prupose is navigate the HTMLString to keep the ApiKey Safe.
1 parent e58d7f2 commit ce39c8f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Source/Vcl.GoogleMap.pas

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ function TEdgeGoogleMapViewer.GetHTMLScript : string;
872872
procedure TEdgeGoogleMapViewer.ShowMap(AMapCenter: TLatLng; const AAddress: string = '');
873873
var
874874
HTMLString : String;
875-
LAddress, MyAddress, LFileName: string;
875+
LAddress, MyAddress: string;
876876
MyCenter: TLatLng;
877877
begin
878878
if csDesigning in ComponentState then Exit;
@@ -923,12 +923,11 @@ procedure TEdgeGoogleMapViewer.ShowMap(AMapCenter: TLatLng; const AAddress: stri
923923
B2S(FTraffic), //Traffic
924924
B2S(FBicycling) //Bicycling
925925
]);
926-
LFileName := TPath.GetTempFileName+'.html';
927-
TFile.AppendAllText(LFileName, HTMLString, TEncoding.UTF8);
928-
LFileName := StringReplace(LFileName, '\', '/', [rfReplaceAll]);
929926
MapIsBusy := True;
930927
try
931-
NavigateToURL('file:///'+LFileName);
928+
Sleep(1000);
929+
application.ProcessMessages;
930+
NavigateToString(HTMLString);
932931
finally
933932
MapIsBusy := False;
934933
end;

0 commit comments

Comments
 (0)