简体   繁体   English

如何使用 agm 更改颜色或图标(标记)?

[英]How to change color or icon ( marker) using agm?

I need to change icon of pin ( marker ) but without changing iconUrl just to change color of icon...我需要更改图钉(标记)的图标,但不更改 iconUrl 只是为了更改图标的颜色...

            <agm-marker
                *ngFor="let m of markers; let i = index" 
                [latitude]="m.latitude" 
                [longitude]="m.longitude"
                [label]="m.label" >
            </agm-marker>

This is quite simple you just need to add the property color to the agm-marker这很简单,您只需将属性颜色添加到agm-marker

            <agm-marker
                *ngFor="let m of markers; let i = index" 
                [latitude]="m.latitude" 
                [longitude]="m.longitude"
                [label]="m.label" 
                [color]="blue">
            </agm-marker>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM