p-gmap in hidden containers fails
In one of my tabs I have to show a gmap component. but whatever I have tried hasn't worked. Here is my snippet:
<p-tabView>
<p-tabPanel header="div1" [selected]="true">
<div></div>
</p-tabPanel>
<p-tabPanel header="gmap">
<p-gmap.....
</p-tabPanel>
<p-tabPanel header="div3">
<div></div>
</p-tabPanel>
</p-tabView>
How to overcome the problem? Thanks in advance.
What messages, if any do you get in the console?
to mr garethlewis there is no message in the console.
This issue might be because of hidden container issue.I can see this issue with customized steps wizard as well.

@Mrtcndkn take over please.
@Mrtcndkn Is it planned for 4.1 release or is it may get delayed
@sudheerj It is planned for 4.1 release.
I also have a similar problem where the map remains blank when I open the tab. It is not the 1st tabViw tab. The solution I found is as follows:
private onTabChange(event: any): void {
if ((event.index as number) === 1) {
setTimeout(() => { window.dispatchEvent(new Event("resize")); }, 1);
}
}
This was referred from this SO question: https://stackoverflow.com/a/6879644
Any way this fix can be incorporate in p-gmap? Or has it been incorporated in this commit itself?
Thanks for the information we fixed it with an inside method.
I saw in the commit details that the map has been initialized again. The answer I linked to has a comment where the map centre has been extracted, map "resized" and centre set once again. I hope this is not needed after @Mrtcndkn fix.
In this method, map is initialized only when it gets visible so fixing the problem.