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
Overrides
Defined in
Properties
x
x:
number
The x-coordinate of the point.
Defined in
y
y:
number
The y-coordinate of the point.
Defined in
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
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
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
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
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
Defined in
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.