Google Map Blank if not wrapped in .then


#1

I experienced weird issue. The app is based on conference app with a map page.

If I switch pages via tab click, map will show without any problem. However if I switch page via menu which trigger setRoot, map shows blank. I compared and nail down this part

If I wrap it with initial .then call back, my map work fine with menu page switch

onPageLoaded() {

this.confData.getMap().then(mapData => {
  this.loadMap(lat, lng, 16);
})

}

Without wrapping, menu page switch (click one other page then click map page), map shows blank

onPageLoaded() {

  this.loadMap(lat, lng, 16);

}

Any idea why call back matters for this scenario

I compare lifecycle between tab and menu page switch

Table switch trigger viewleave
Menu one trigger viewunload