【问题标题】:How to Set background image of a custom google map marker?如何设置自定义谷歌地图标记的背景图像?
【发布时间】:2016-02-22 12:41:28
【问题描述】:

我有一张用于 Google 标记的自定义图片,但我必须在其背景上设置另一张图片。

是否可以设置地图标记的背景图片?

【问题讨论】:

  • 你的意思是自定义标记..???
  • 是的,在自定义标记上,我必须在上面的部分设置背景图像
  • 查看我和 Abx 的答案。

标签: android google-maps background-image google-maps-markers


【解决方案1】:

是的,你可以

试试这个问题How to create a custom-shaped bitmap marker with Android map API v2

另请阅读this

【讨论】:

    【解决方案2】:

    来自@Abx 的回答

    您可以像这样添加自定义标记,

    googleMap.addMarker(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_me))
                .anchor(0.5f, 1.0f) // Anchors the marker on the bottom left
                .position(new LatLng(latitude, longitude)));
    

    感谢@Abx

    【讨论】:

    • 在那个答案中 mMap.addMarker 被写了两次?
    • 不,我需要在自定义标记 Nils 的背景上设置图像
    • 你能发布任何你正在寻找的例子吗??
    • 查看 Nils 我已经编辑了我的问题,有两个图像我必须将小图像一个设置在标记图标图像的白色圆形部分。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-20
    • 1970-01-01
    • 2013-08-21
    相关资源
    最近更新 更多