Search code examples
androidgoogle-mapsgoogle-polyline

How to put window on polyline like in Google maps


How to put window info on polyline like in Google maps. I need to put a window info on polyline like in Google maps. Image below in red circles. I noticed some questions in stackoverflow which did not give the expected result. So this question is not duplicate. enter image description here


Solution

  • Use this lib https://developers.google.com/maps/documentation/android-sdk/utility/

    I have tried it works good.

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