如何像在谷歌地图上一样在多义线上放置窗口

时间:2019-06-24 14:11:22

标签: android google-maps google-polyline

如何像在Google地图中一样在多段线上放置窗口信息。 我需要在折线上放置一个窗口信息,就像在Google地图中一样。 下图为红色圆圈。 我注意到stackoverflow中的一些问题并未给出预期的结果。所以这个问题不是重复的。 enter image description here

1 个答案:

答案 0 :(得分:1)

使用此库https://developers.google.com/maps/documentation/android-sdk/utility/

我已经尝试过了。

IconGenerator iconFactory = new IconGenerator(activity);
MarkerOptions markerOptions = new MarkerOptions()
            .icon(BitmapDescriptorFactory.fromBitmap(iconFactory.makeIcon("Your text")))
            .position("Position that you want")
            .anchor(iconFactory.getAnchorU(), iconFactory.getAnchorV());