code: public void setVisible(boolean visible) {
  
          switch (shapeType) {
  
              case MARKER_OPTIONS:
                  ((MarkerOptions) shape).visible(visible);
                  break;
              case POLYLINE_OPTIONS:
                  ((PolylineOptions) shape).visible(visible);
                  break;
              case POLYGON_OPTIONS:
                  ((PolygonOptions) shape).visible(visible);
                  break;
              case MULTI_POLYLINE_OPTIONS:
                  ((MultiPolylineOptions) shape).visible(visible);
                  break;
              case MULTI_POLYGON_OPTIONS:
                  ((MultiPolygonOptions) shape).visible(visible);
                  break;
              case MARKER:
                  ((Marker) shape).setVisible(visible);
                  break;
              case POLYGON:
                  ((Polygon) shape).setVisible(visible);
                  break;
              case POLYLINE:
                  ((Polyline) shape).setVisible(visible);
                  break;
              case MULTI_MARKER:
                  ((MultiMarker) shape).setVisible(visible);
                  break;
              case MULTI_POLYLINE:
                  ((MultiPolyline) shape).setVisible(visible);
                  break;
              case MULTI_POLYGON:
                  ((MultiPolygon) shape).setVisible(visible);
                  break;
              case POLYLINE_MARKERS:
                  ((PolylineMarkers) shape).setVisible(visible);
                  break;
              case POLYGON_MARKERS:
                  ((PolygonMarkers) shape).setVisible(visible);
                  break;
              case MULTI_POLYLINE_MARKERS:
                  ((MultiPolylineMarkers) shape).setVisible(visible);
                  break;
              case MULTI_POLYGON_MARKERS:
                  ((MultiPolygonMarkers) shape).setVisible(visible);
                  break;
              case COLLECTION:
                  @SuppressWarnings("unchecked")
                  List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape;
                  for (GoogleMapShape shapeListItem : shapeList) {
                      shapeListItem.setVisible(visible);
                  }
                  break;
              default:
          }
  
      }
docs: Updates visibility of all objects
  
  @param visible visible flag
  @since 1.3.2