Is it possible to pause TTMSFNCMaps until it's visible?

RAD studio Alexandria with a VCL form containing a TPageControl and a TTMSFNCMaps component in one tab.

Opening this form the first time takes additional 2 seconds - even if the TTMSFNCMaps tab is not visible.
The second time opening this form is fast.

Is there a way to pause TTMSFNCMaps (e.g. Service = "do nothing" - just a proposal) to stop it from "initialization" until it will be visible (means map tab is choosen).

I tried (as a workaround) to show an hourglass cursor, but couldn't find a place where to put it. The delay is after FormShow is completed.

Best regards, Dirk

Please note that this delay is caused by map and browser cache initialization. Unfortunately it can't be delayed.
You can try using the OnMapInitialized event of the TTMSFNCMaps to hide the hourglass.

Hello Bart,

I don't want to hide the hourglass - I want to show it during the delay.
Now I set crHourGlass in FormShow and crDefault in OnMapInitialized - but this is not showing an hourglass for the whole delay. Somewhere the cursor is set back to crDefault.

Any ideas how to get an hourglass cursor until form is showing?

Regards, Dirk

Hi Dirk,

I have not been able to reproduce this issue.
The hourglass is displayed as expected in the OnShow event and hidden once OnMapInitialized is fired.

Please note that when hovering the cursor over the map, the browser cursor will be displayed instead of the application cursor.

procedure TForm1.FormShow(Sender: TObject);
begin
  Screen.Cursor := crHourGlass;
end;

procedure TForm1.TMSFNCMaps1MapInitialized(Sender: TObject);
begin
  Screen.Cursor := crDefault;
end;

If the problem persists, please provide a ready to run sample project that demonstrates the issue so I can further investigate this.

Hi Bart,

a little confusing, but in a sample project there is no delay.

After some investigation I found that these two lines cause the delay (each line about one second):

void __fastcall TMapForm::FormCreate(TObject *Sender)
{
  ...

  PopupParent = Application->MainForm;

  ...
}

void __fastcall TMapForm::FormShow(TObject *Sender)
{
  ...

  PageControl->OwnerDraw = true;

  ...
}

The OwnerDraw line only when changing the original value (in my project the value can be changed by user and is not always true).

I commented out the first line and set the value in the second line to the most probable value. Not perfect, but a work around for my project.

Regards, Dirk