CreateShapeOptions: Partial<ShapeConstructorOptions> & CommonCreationOptions & {
    closeRing?: boolean;
    constraints?: Permissions;
    maxPoints?: number;
    minPoints?: number;
    onPointCreated?: ((shape, index, position) => void);
}

Options for the DrawTool.createShape method.

Type declaration

  • Optional closeRing?: boolean

    If true, the shape's line will be closed just before being returned to the caller.

  • Optional constraints?: Permissions

    An optional list of permitted operations.

  • Optional maxPoints?: number

    The maximum number of points to create before the shape is automatically completed.

  • Optional minPoints?: number

    The minimum number of points to create before the shape can be completed.

  • Optional onPointCreated?: ((shape, index, position) => void)

    An optional callback to be called when a point has been added to the shape.

      • (shape, index, position): void
      • Parameters

        • shape: entities.Shape

          The shape being created.

        • index: number

          The index of the point.

        • position: Vector3

          The position of the point.

        Returns void