Click or drag to resize

Telogis.GeoBase.Size

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Size Class

Represents the 2D spatial dimensions of an object.

Constructor
NameDescription
Size(width, height)

Arguments

  • (Optional)width (Element) - The horizontal dimension of the object. This may also be another Size instance (invoking a copy constructor), a Point (in which case Size.width is set to Point.x and Size.height to Point.y) or a DOM element with size information (in decreasing order of priority: offset(Width|Height) properties; width|height attributes; CSS style.(width|height) properties). Defaults to 0.

  • (Optional)height (Number) - The vertical dimension of the object. Defaults to this.width.

Functions
NameDescription
equals (Size other)

Determines whether two Size objects are of the same value.

Arguments
  • other (Size) - The other Size to compare.

Returns

Boolean - Whether the height and width of the caller and Size.equals.other are equivalent.

isNonZero ()

Determines whether the size is non-zero, i.e. not 0x0.

Returns

Boolean - True if the size is non-zero; false otherwise.

multiply (Number scalar)

Performs component-wise multiplication of the calling Size by a given scalar value. The result is saved in the calling size, but a reference is returned for convenience.

Arguments
  • scalar (Number) - The scalar to multiply the width and height of the size by.

Returns

Size - The calling size, once scaled by Size.multiply.scalar.

toString ()

Gets a string representation of the size represented by the current object.

Returns

String - A string of the form '$wx$h'.

Properties
NameTypeDescription
heightNumber

The value of the Size in the vertical direction.

widthNumber

The value of the Size in the horizontal direction.