如何使用角度5与agm-map设置标记颜色?

时间:2018-10-16 20:10:31

标签: angular angular5

我正在使用“角度5”,并且我试图将标记的颜色设置为取决于p.etat(该项目的状态)。这是我的代码:

    <div class="col-md-10">
    <agm-map [latitude]="36.718241" [longitude]="3.091969" [zoom]="6">
      <agm-marker [label]="{color: '#ffffff', fontWeight: 'bold'}" [latitude]="p.latitude" [longitude]="p.longitude" *ngFor="let p of pagePans?.content; let i=index">
        <agm-snazzy-info-window [maxWidth]="800" [closeWhenOthersOpen]="true">
          <ng-template>
            <strong>{{p.nom}}</strong><br>
            <h5>Status:{{p.etat}} </h5>


            <button style="color: red;" class="glyphicon glyphicon-trash" *ngIf="authService.isAllowed()"(click)="deletePan(p)" ></button>
            <button  class="glyphicon glyphicon-pencil" *ngIf="authService.isAllowed()"(click)="onEditPan(p.id)" ></button>
            <button style="color: green;" (click)="detailPan(p.id)" class="glyphicon glyphicon-ok"></button>



          </ng-template>
        </agm-snazzy-info-window>
      </agm-marker>
    </agm-map></div>

0 个答案:

没有答案