小编Roh*_*dav的帖子

如何在 AGM Angular 7 中设置标记标签的背景颜色?

 <agm-map  style="text-shadow: 0px 0px 8.2px yellow; color: red;" [latitude]='latitude'
    [longitude]='longitude' (mapClick)="onChoseLocation($event)" [zoom]=15 [usePanning]="true">
    <agm-marker *ngFor="let vehicle of data1;" [agmFitBounds]="true" 
      [latitude]='vehicle.lat' [longitude]='vehicle.lng' 
      [iconUrl]="{ url: './assets/images/cars.png', scaledSize: { width: 45, height: 45, rotation: vehicle.angle, anchor : {x:19, y:19} }}"
      [label]="{color: 'blue', fontWeight: 'bold', fontSize: '12px', backgroundColor:'red',  text: vehicle.name}">
      <agm-polyline *ngFor="let initialdata of vehicleDetail">
        <agm-polyline-point  [latitude]="initialdata.lat" [longitude]="initialdata.lng">
        </agm-polyline-point>
        <agm-polyline-point *ngIf="(vehicle.id == id)"  [latitude]="vehicle.lat" [longitude]="vehicle.lng">
        </agm-polyline-point>
      </agm-polyline>
      <agm-info-window [disableAutoPan]="true" #infoWindow [isOpen]="true">
        <small>
          Name: <small>{{vehicle.name}}</small> <br>
          Speed: <small>{{vehicle.speed}} km/h </small><br>
          <!-- Lng: <small>{{vehicle.lng}}</small> <br> --> …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps typescript angular-google-maps angular

5
推荐指数
1
解决办法
3443
查看次数