我在地图上显示5个标记,我只想更改一种标记的颜色,我正在使用Google角形地图,该怎么做。
我已经使用[iconUrl]更改了标记的颜色,但是它正在更改所有颜色,但是我只想更改标记的一种颜色
HTML:
<agm-map [latitude]="lat" [longitude]="lng" [fitBounds]="true" >
<agm-marker [iconUrl]="iconUrl" *ngFor="let data of map_dev" [latitude]="data.latitude" [longitude]="data.longitude"
[agmFitBounds]="true" (markerClick)="markerdata(data)" >
</agm-marker>
</agm-map>
答案 0 :(得分:0)
编辑-由于作者更改了整个说明,因此不再相关。
公式是(基于我搜索“开尔文到华氏温度”时的第一个Google结果)
(Kelvin − 273.15) × 9/5 + 32 = Fahrenheit
。
由于您已经添加了“打字稿”作为唯一的标签,因此我认为您使用的是Javascript。
function kelvinToFahrenheit(kelvin) {
return (kelvin - 273.15) * 9/5 + 32;
}
kelvinToFahrenheit(380.5); // Will return 225.23