【问题标题】:How to add title on GeoFence circle in google maps?如何在谷歌地图的地理围栏圈上添加标题?
【发布时间】:2020-02-07 15:27:31
【问题描述】:

我正在使用 android 谷歌地图中的地理围栏。 我可以在地图中添加地理围栏。 我需要在圆圈或圆圈底部添加地理围栏的标题。 我不想在 Marker 上添加标题。

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()

要求是在圆圈内部或底部添加标题而不是标记

【问题讨论】:

    标签: android google-maps android-geofence


    【解决方案1】:

    如果您想将它们放在地图中的圆圈内,您可以尝试将文字制作成图像。然后您可以将此图像用作您的custom marker。由于您不希望它出现在标记中,因此可以使用ground overlay。由于您想将其放在圆圈内,您可以使用中心坐标作为标记或地面覆盖的位置。您可能还需要调整图片的大小以适合您的圈子。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-06
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2016-03-16
      相关资源
      最近更新 更多