gpt4 book ai didi

android - Android Google Map Marker圈子(多个叠加层没有累积不透明度)

转载 作者:行者123 更新时间:2023-12-02 12:59:02 24 4
gpt4 key购买 nike

我正在尝试添加多个标记,这些标记在某些情况下可能会彼此靠近。我正在尝试在他们周围添加圆圈
添加圈子的代码

points.forEach { point ->
googleMap.addCircle(
CircleOptions()
.center(point.location)
.radius(10.toDouble())
.strokeWidth(1f)
.strokeColor(Color.RED)
.fillColor(Color.argb(60, 255, 0, 0))
)
}

左:这是我用我的代码得到的______________右:这是我需要的
/image/NSD1A.png
在Android中甚至可能吗?

最佳答案

我通过将zindex设置为1来解决了这个问题:

final CircleOptions options = new CircleOptions();
options.center(new LatLng(geofence.getCenter().getLatitude(), geofence.getCenter().getLongitude()));
options.radius(geofence.maxDistance().getValue());
options.strokeColor(Color.RED);
options.strokePattern(Collections.singletonList(new Dot()));
options.zIndex(1f);

geofenceCircle = googleMap.addCircle(options);

我有自己的磁贴提供程序,由于某种原因zindex为0无效。

根据Google的说法:

Z-Index The order in which this tile overlay is drawn with respect to other overlays (including GroundOverlays, TileOverlays, Polylines, and Polygons but not Markers). An overlay with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays with the same z-index is arbitrary. The default zIndex is 0.

关于android - Android Google Map Marker圈子(多个叠加层没有累积不透明度),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54998795/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com