我正在尝试显示标记标签,但只能在某个缩放级别或更高级别上显示,但它不允许我使用*ngIf
.
<div *ngIf="[zoom]=>15"
[label]="{color: 'yellow', text: point.ID, fontSize: '4'}"
</div>
如何在 Angular Agm Map 的某个缩放级别上显示标记或其标签?
组件.html
<body>
<div class="map-body">
<agm-map class="ngmap" style="text-shadow: 0px 0px 6.2px grey;"
[latitude]="30" [longitude]="-79" [styles]="mapStyle"
[zoom]="13" [streetViewControl]="false" (mapReady)="onMapReady($event)">
<agm-marker
*ngFor="let point of points"
[latitude]="point.latitude"
[longitude]="point.longitude"
*ngIf="zoom=>15" [label]="{color: 'yellow', text: point.ID, fontSize: '4'}"
else [label]=""
[openInfoWindow]="true"
(mouseOver)="infoWindow.open();"
(mouseOut)="infoWindow.close();"
[iconUrl]="{url:'.././assets/images/icons8-50.png',
scaledSize: {height: 20, width: 20}
}"
>
<agm-info-window
[disableAutoPan]="true" #infoWindow>{{point.test}}: <br>{{point.Name}}
</agm-info-window>
</agm-marker
>
</agm-map>
</div>
</body>