Class: Size

SuperMap.Size

Instances of this class represent a width/height pair.

new SuperMap.Size(w, h)

Size.js, line 3
Name Type Default Description
w number 0.0 optional

Width.

h number 0.0 optional

Height.

Example
var size = new SuperMap.Size(31,46);

Members

hnumber

Height.

Default Value:
0.0

wnumber

Width.

Default Value:
0.0

Methods

clone(){SuperMap.Size}

Size.js, line 44

Create a clone of this size object.

Returns:
Type Description
SuperMap.Size A new SuperMap.Size object with the same w and h values.
Example
var size = new SuperMap.Size(31,46);
var size2 = size.clone();

destroy()

Size.js, line 79

Destroy the object. All properties of the object will be null after it is destroyed.

Example
var size = new SuperMap.Size(31,46);
size.destroy();

equals(sz){boolean}

Size.js, line 57

Determine whether this size is equal to another.

Name Type Description
sz SuperMap.Size

The size object to be compared.

Returns:
Type Description
boolean Returns whether the passed in size and the current size are equal, note: return false if the size passed in is empty.
Example
var size = new SuperMap.Size(31,46);
var size2 = new SuperMap.Size(31,46);
var isEquals = size.equals(size2);

toString(){string}

Size.js, line 31

Return the string format of this object.

Returns:
Type Description
string For example:"w=10,h=5".
Example
var size = new SuperMap.Size(10,5);
var str = size.toString();