IONIC 3 - <ion-segment> <div>谷歌地图没有显示

时间:2017-05-26 12:36:38

标签: css google-maps ionic2 segment ionic3

我在浏览页面时遇到问题。 这是我的代码:

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>
      Cerca
    </ion-title>
  </ion-navbar>
  <ion-toolbar>
    <ion-segment [(ngModel)]="mySegment">
      <ion-segment-button value="Mapa">
        Mapa
      </ion-segment-button>
      <ion-segment-button value="Lista">
        Lista
      </ion-segment-button>
    </ion-segment>
  </ion-toolbar>
</ion-header>

<ion-content padding>
  <div [ngSwitch]="mySegment">
    <div #map id="map" style="height:100%;" *ngSwitchCase="'Mapa'" (click)="openBestofferdetailPage(offer)">

    </div>
    <div *ngSwitchCase="'Lista'">
      <button ion-item *ngFor="let offer of offersmodelArray" (click)="openBestofferdetailPage(offer)">
        <ion-thumbnail item-left>
          <img src="{{offer.imageoffer}}">
        </ion-thumbnail>
        <p style="font-size:50%;">
          <ion-row>
            <ion-col>
              <span item-left>{{offer.cityprovider}}</span>
              <span item-left>({{offer.distanceToProvider}} km)</span>
            </ion-col>
            <ion-col right text-right>
              <s>
                <span item-right>{{offer.oldprice}}</span>
              </s>
            </ion-col>
          </ion-row>
          <ion-row>
            <ion-col>
              <span item-left>{{offer.sold}}</span>
              <span item-left>comprados</span>
            </ion-col>
            <ion-col right text-right>
              <b><p style="font-size:70%;" style="color:green">
        <span item-right>{{offer.newprice}}</span>
      </p></b>
        </ion-col>
        </ion-row>
        </p>
      </button>
    </div>
  </div>
</ion-content>

默认选项是“Mapa”,但是它没有显示地图,我猜这是与位置设置和<ion-segment>相关的问题,但我很感激您的帮助,了解我可以在哪里进行更改

正如补充信息一样,如果我将地图设置在内容之外,则地图显示没有任何问题

<ion-content padding>
  <div #map id="map" style="height:100%;"></div>
</ion-content>

我看到一些相关的问题,但没有回答 Ionic 2, use google maps in ion-segments

请你的帮助

0 个答案:

没有答案