code: public static void addMarkerAsPolygon(Marker marker, List<Marker> markers) {
          LatLng position = marker.getPosition();
          int insertLocation = markers.size();
          if (markers.size() > 2) {
              double[] distances = new double[markers.size()];
              insertLocation = 0;
              distances[0] = SphericalUtil.computeDistanceBetween(position,
                      markers.get(0).getPosition());
              for (int i = 1; i < markers.size(); i++) {
                  distances[i] = SphericalUtil.computeDistanceBetween(position,
                          markers.get(i).getPosition());
                  if (distances[i] < distances[insertLocation]) {
                      insertLocation = i;
                  }
              }
  
              int beforeLocation = insertLocation > 0 ? insertLocation - 1
                      : distances.length - 1;
              int afterLocation = insertLocation < distances.length - 1 ? insertLocation + 1
                      : 0;
  
              if (distances[beforeLocation] > distances[afterLocation]) {
                  insertLocation = afterLocation;
              }
  
          }
          markers.add(insertLocation, marker);
      }
docs: Polygon add a marker in the list of markers to where it is closest to the
  the surrounding points
  
  @param marker  marker
  @param markers list of markers