【发布时间】:2019-10-07 07:19:56
【问题描述】:
我的地图上有 2 种类型的对象 - GroundOverlays 和折线。
我的 GroundOverlays(实际上是标记)是从位图创建的。我需要它们根据缩放级别更改大小,这就是我使用 GroundOverlays 的原因。
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(createBitmap(getApplicationContext());
GroundOverlay m = mMap.addGroundOverlay(new GroundOverlayOptions().image(bitmapDescriptor).position(latLng, 100));
然后我有我的折线:
Polyline line = mMap.addPolyline(new PolylineOptions()
.add(new LatLng(gpsLat1, gpsLon1), new LatLng(gpsLat2, gpsLon2))
.width(12)
.color(myColor));
我面临的问题是,折线是在我的 GroundOverlays 上绘制的。有没有办法改变这 2 层的顺序?谢谢。
编辑:更改绘制元素的顺序没有帮助。如果我先绘制 GroundOverlays 然后再绘制折线,反之亦然,折线总是在前面。
【问题讨论】:
-
尝试添加 z-index,为 GroundOverlays 赋予更高的 zindex,为折线赋予更低的索引值。
标签: android google-maps google-polyline