code: public PolylineMarkers addPolylineToMapAsMarkers(GoogleMap map,
                                                       PolylineOptions polylineOptions,
                                                       MarkerOptions polylineMarkerOptions,
                                                       PolylineOptions globalPolylineOptions) {
  
          PolylineMarkers polylineMarkers = new PolylineMarkers(this);
  
          if (globalPolylineOptions != null) {
              polylineOptions.color(globalPolylineOptions.getColor());
              polylineOptions.geodesic(globalPolylineOptions.isGeodesic());
              polylineOptions.visible(globalPolylineOptions.isVisible());
              polylineOptions.zIndex(globalPolylineOptions.getZIndex());
              polylineOptions.width(globalPolylineOptions.getWidth());
          }
  
          Polyline polyline = addPolylineToMap(map, polylineOptions);
          polylineMarkers.setPolyline(polyline);
  
          List<Marker> markers = addPointsToMapAsMarkers(map,
                  polylineOptions.getPoints(), polylineMarkerOptions, false);
          polylineMarkers.setMarkers(markers);
  
          return polylineMarkers;
      }
docs: Add a Polyline to the map as markers
  
  @param map                   google map
  @param polylineOptions       polyline options
  @param polylineMarkerOptions polyline marker options
  @param globalPolylineOptions global polyline options
  @return polyline markers