File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ TCustomGMMapVCL = class(TCustomGMMap)
140
140
procedure Assign (Source: TPersistent); override;
141
141
142
142
procedure SaveToJPGFile (FileName: TFileName = ' ' ); override;
143
+ procedure SaveHTML (FileName: TFileName = ' ' ); override;
143
144
published
144
145
property VisualProp: TVisualProp read FVisualProp write FVisualProp;
145
146
end ;
@@ -335,7 +336,7 @@ procedure TGMMap.DocumentComplete(ASender: TObject; const pDisp: IDispatch;
335
336
begin
336
337
if Assigned(OldDocumentComplete) then OldDocumentComplete(ASender, pDisp, URL);
337
338
338
- if (pDisp = CurDispatch) then // si son iguales, la página se ha cargado
339
+ if not FDocLoaded and (pDisp = CurDispatch) then // si son iguales, la página se ha cargado
339
340
begin
340
341
FDocLoaded := True;
341
342
CurDispatch := nil ;
@@ -636,6 +637,36 @@ destructor TCustomGMMapVCL.Destroy;
636
637
inherited ;
637
638
end ;
638
639
640
+ procedure TCustomGMMapVCL.SaveHTML (FileName: TFileName);
641
+ var
642
+ SD: TSaveDialog;
643
+ L: TStringList;
644
+ begin
645
+ inherited ;
646
+
647
+ if not Assigned(FWebBrowser) or not Assigned(FWC) then Exit;
648
+
649
+ if FileName = ' ' then
650
+ begin
651
+ SD := TSaveDialog.Create(nil );
652
+ try
653
+ SD.Filter := ' *.html|*.html' ;
654
+ SD.DefaultExt := ' *.html' ;
655
+ if SD.Execute then FileName := SD.FileName;
656
+ finally
657
+ FreeAndNil(SD);
658
+ end ;
659
+ end ;
660
+
661
+ L := TStringList.Create;
662
+ try
663
+ L.Text := FWC.WebHTMLCode;
664
+ L.SaveToFile(FileName);
665
+ finally
666
+ FreeAndNil(L);
667
+ end ;
668
+ end ;
669
+
639
670
procedure TCustomGMMapVCL.SaveToJPGFile (FileName: TFileName);
640
671
var
641
672
SD: TSaveDialog;
You can’t perform that action at this time.
0 commit comments