code: public static boolean isPointOnShape(LatLng point,
                                           GoogleMapShape shape, boolean geodesic, double tolerance) {
  
          boolean onShape = false;
  
          switch (shape.getShapeType()) {
  
              case LAT_LNG:
                  onShape = isPointNearPoint(point, (LatLng) shape.getShape(), tolerance);
                  break;
              case MARKER_OPTIONS:
                  onShape = isPointNearMarker(point, (MarkerOptions) shape.getShape(), tolerance);
                  break;
              case POLYLINE_OPTIONS:
                  onShape = isPointOnPolyline(point, (PolylineOptions) shape.getShape(), geodesic, tolerance);
                  break;
              case POLYGON_OPTIONS:
                  onShape = isPointOnPolygon(point, (PolygonOptions) shape.getShape(), geodesic, tolerance);
                  break;
              case MULTI_LAT_LNG:
                  onShape = isPointNearMultiLatLng(point, (MultiLatLng) shape.getShape(), tolerance);
                  break;
              case MULTI_POLYLINE_OPTIONS:
                  onShape = isPointOnMultiPolyline(point, (MultiPolylineOptions) shape.getShape(), geodesic, tolerance);
                  break;
              case MULTI_POLYGON_OPTIONS:
                  onShape = isPointOnMultiPolygon(point, (MultiPolygonOptions) shape.getShape(), geodesic, tolerance);
                  break;
              case COLLECTION:
                  @SuppressWarnings("unchecked")
                  List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape
                          .getShape();
                  for (GoogleMapShape shapeListItem : shapeList) {
                      onShape = isPointOnShape(point, shapeListItem, geodesic, tolerance);
                      if (onShape) {
                          break;
                      }
                  }
                  break;
              default:
                  throw new GeoPackageException("Unsupported Shape Type: "
                          + shape.getShapeType());
  
          }
  
          return onShape;
      }
docs: Is the point on or near the shape
  
  @param point     lat lng point
  @param shape     map shape
  @param geodesic  geodesic check flag
  @param tolerance distance tolerance
  @return true if point is on shape