【发布时间】:2022-01-09 21:50:13
【问题描述】:
我正在使用 Google 地图实用程序库为我的标记生成图标,但 setColor 不起作用,我设置的每种颜色都是不同的蓝色阴影,这不是我的颜色,而且它还有黑色到处乱跑,我不想要。
这是代码:
for (place in location.locations) {
val locationPoz = LatLng(place.lat, place.long)
boundsBuilder.include(locationPoz)
//Here is the icon part
val icon = IconGenerator(requireContext())
icon.setColor(R.color.red)
val fIcon = icon.makeIcon("${place.price}€")
val marker = MarkerOptions()
.position(locationPoz)
.title(place.name)
.icon(BitmapDescriptorFactory.fromBitmap(fIcon))
.alpha(5f)
googleMap.addMarker(marker)
}
这就是我的地图的样子
【问题讨论】:
标签: android kotlin google-maps icons