且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ionic 2,在离子段中使用谷歌地图

更新时间:2023-12-03 16:36:04

我遇到了同样的问题,谷歌地图完全展现在外部细分市场。因此,按照建议的方法通过biranchi125在离子论坛你可以将地图放在片段之外并处理何时用选择变量显示它,如下所示:

I had the same problem as you point out, Google Maps is showing perfectly outside segments. So following the approach suggested by biranchi125 in Ionic forum you can place the map outside the segments and handle when to show it whith the selection variable, like this:

<div [ngSwitch]="report_details">
  <div *ngSwitchCase="'details'">
    <!-- you can place other elements here if you want -->
  </div>
  <div [style.display]="report_details == 'details' ? 'block' : 'none'">
     <div #map id="map"></div>
  </div>
</div>

并且有效:)