We have a feature that allows the user to print a WebGMaps.
How can I hide the controls so they are not printed?
procedure ShowMapControls( AWebGMaps: TWebGMaps; AVisible: Boolean );
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^}
begin
AWebGMaps.ControlsOptions.ZoomControl.Visible := AVisible;
AWebGMaps.ControlsOptions.StreetViewControl.Visible := AVisible;
AWebGMaps.ControlsOptions.PanControl.Visible := AVisible;
AWebGMaps.ControlsOptions.MapTypeControl.Visible := AVisible;
AWebGMaps.ControlsOptions.ScaleControl.Visible := AVisible;
AWebGMaps.ControlsOptions.OverviewMapControl.Visible := AVisible;
AWebGMaps.ControlsOptions.RotateControl.Visible := AVisible;
end;
function GetMapJpg( AWebGMaps: TWebGMaps ): TGraphic;
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^}
begin
ShowMapControls(AWebGMaps, False);
try
//Need to somehow refresh the map so the controls no longer show
Result := AWebGMaps.ScreenShot(TImgType.itJpeg);
finally
ShowMapControls(AWebGMaps, True);
end;
end;