【发布时间】:2021-09-22 09:38:29
【问题描述】:
我正在为 Angular 使用 google-maps,但我找不到如何更改标记的颜色。我有不同的坐标,我想分别给每一个上色。
目前我正在使用:
const marker = {
position: {
lat: parseFloat(site.lat),
lng: parseFloat(site.lng),
},
icon: "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png",
id: site.id,
title: site.address,
label: {
color: 'red',
text: site.contractCode,
}
};
我尝试将一个带有 url 属性的对象传递给图标和一个字符串,但没有任何效果。
提前致谢
【问题讨论】:
标签: google-maps-markers angular-google-maps angular11