Skip to main content

Point

Class representing a 2D point with x and y coordinates.

Extends

Constructors

new Point()

new Point(x, y): Point

Creates an instance of Point.

Parameters

x: number

The x-coordinate of the point.

y: number

The y-coordinate of the point.

Returns

Point

Overrides

Serializable.constructor

Defined in

types/Point.ts:23

Properties

x

x: number

The x-coordinate of the point.

Defined in

types/Point.ts:10


y

y: number

The y-coordinate of the point.

Defined in

types/Point.ts:15

Methods

asUntransformed()

asUntransformed(offset, zoom): this

Adjusts the point's coordinates to remove the effects of a specified pan offset and zoom level.

Parameters

offset: Point

The pan offset to remove from the current point's coordinates.

zoom: number

The zoom level to reverse from the current point's coordinates.

Returns

this

The current point with out transformation.

Defined in

types/Point.ts:67


move()

move(deltaX, deltaY): void

Moves the point by a specified delta along the x and y axes.

Parameters

deltaX: number = 0

The amount to move the point along the x-axis (default is 0).

deltaY: number = 0

The amount to move the point along the y-axis (default is 0).

Returns

void

Defined in

types/Point.ts:54


moveX()

moveX(delta): void

Moves the point along the x-axis by a specified delta.

Parameters

delta: number

The amount to move the point along the x-axis.

Returns

void

Defined in

types/Point.ts:35


moveY()

moveY(delta): void

Moves the point along the y-axis by a specified delta.

Parameters

delta: number

The amount to move the point along the y-axis.

Returns

void

Defined in

types/Point.ts:44


toArray()

toArray(): any[]

Converts the object's properties to an array. If any of the properties are objects that implement ISerializable, their toArray method is called.

Returns

any[]

An array representation of the object's properties.

Inherited from

Serializable.toArray

Defined in

common/Serializable.ts:16


toJson()

toJson(): string

Converts the object to a JSON string. If any of the properties are objects that implement ISerializable, their toJson method is called. Underscores e.g. of private members are trimmed when setting the serialized name.

Returns

string

A JSON string representation of the object.

Inherited from

Serializable.toJson

Defined in

common/Serializable.ts:32