我正在Android谷歌地图中处理Geofence。我可以在地图中添加GeoFence。我需要在圆圈或圆圈底部添加地理围栏标题。我不想在标记上添加标题。
map.addCircle(CircleOptions()
.center(reminder.latLng)
.radius(radius)
.strokeColor(ContextCompat.getColor(context, R.color.colorAccent))
.fillColor(ContextCompat.getColor(context, R.color.colorReminderFill)))
对于标记,我可以使用此
map.addMarker(MarkerOptions().position(latLng).title(reminder.name)
.snippet("Radius: " + reminder.radius)).showInfoWindow()
要求是将标题添加到圆圈内或圆圈底部而不是在标记上
如果要在地图中将它们放在圆圈内,可以尝试将文本变成图像。然后,您可以将此图像用作custom marker。由于您不希望它出现在标记中,因此可以使用ground overlay。由于要将其放置在圆内,因此可以将中心坐标用作标记或地面叠加层的位置。您可能还需要调整图像大小以适合圆圈。