我正在创建一个组件来在地图上显示事件位置。有些位置可能会发生多个事件,因此我想创建一个可分页的窗口信息。这样他们就可以浏览事件
我已经用Angular Map
创建了一个snazzyInfoWindow
,并且使用的是Ionic幻灯片来创建页面。
<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="zoom">
<ng-container *ngIf="!isCreating">
<agm-marker color="Blue" *ngFor="let locationGroup of locationEntitiesMap" (markerClick)="clickedMarker(locationGroup)"
[latitude]="locationGroup?.location?.latitude" [longitude]="locationGroup?.location?.longitude">
<agm-snazzy-info-window [closeWhenOthersOpen]="true">
<ng-template>
<ng-template [ngTemplateOutlet]="infoWindowTemplate || defaultTemplate" [ngTemplateOutletContext]="{group: locationGroup}">
</ng-template>
<ng-template #defaultTemplate let-group="group">
<ng-container *ngIf="group">
<ion-slides>
<ion-slide *ngFor="let data of group.data">
<ion-label>Location: </ion-label>
<ion-label>{{group.location.name}} 5 </ion-label>
<ion-button (click)="selectLocation(group.location,data)">
{{options?.selectLabel || 'Select'}}
</ion-button>
</ion-slide>
</ion-slides>
</ng-container>
</ng-template>
</ng-template>
</agm-snazzy-info-window>
</agm-marker>
</ng-container>
<agm-marker *ngIf="isCreating" [latitude]="latitude" [longitude]="longitude" [markerDraggable]="true"
(dragEnd)="markerDragEnd($event)">
</agm-marker>
</agm-map>
弹出窗口可以正常打开,但是滑动一次后,下次打开弹出窗口时,幻灯片将无响应。这似乎是Ionic Framework中的错误。
是否有一种简便的方法来使页面具有窗口功能,例如单击下一步或滑动?