We have the issue that sometimes the map isn't loaded when it is placed within a frame that is dynamically loaded.
Steps to reproduce:
- Create a Frame with
TMSFNCGoogleMaps
placed on it and set the API-Key - Create a Dialog with a Button
- Within the Click-Event of the Button create the frame and assign a parent to it
- Make sure to start the program without debugger as it only happens without it
Here's the code:
__fastcall TFormMain::TFormMain(TComponent* Owner)
: TForm(Owner)
{
// this->m_pFrameStandort = std::make_unique<TFrameStandort>(this);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button1Click(TObject *Sender)
{
this->m_pFrameStandort = std::make_unique<TFrameStandort>(this);
this->m_pFrameStandort->Parent = this;
this->m_pFrameStandort->Align = alClient;
}
//---------------------------------------------------------------------------
If i change create the Frame in the constructor and not in the Click-Event it seems to work:
__fastcall TFormMain::TFormMain(TComponent* Owner)
: TForm(Owner)
{
this->m_pFrameStandort = std::make_unique<TFrameStandort>(this);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button1Click(TObject *Sender)
{
// this->m_pFrameStandort = std::make_unique<TFrameStandort>(this);
this->m_pFrameStandort->Parent = this;
this->m_pFrameStandort->Align = alClient;
}
//---------------------------------------------------------------------------
MapsTest.zip (28.2 KB)