API / geotoolkit / util / Dimension / Dimension
Implements a dimension which is defined by an absolute width and height
Constructors
| [new Dimension()](/solutions/geotoolkit/apis/classes/geotoolkit.util.dimension.dimension.md#new dimension()) | [new Dimension(options)](/solutions/geotoolkit/apis/classes/geotoolkit.util.dimension.dimension.md#new dimension(options)) | [new Dimension(width, height)](/solutions/geotoolkit/apis/classes/geotoolkit.util.dimension.dimension.md#new dimension(width, height)) |
|---|
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
height | number | Height of dimension |
width | number | Width of dimension or properties |
Constructors
• new Dimension()
• new Dimension(options)
| Name | Type | Description |
|---|---|---|
options | Options | properties |
• new Dimension(width?, height?)
| Name | Type | Description |
|---|---|---|
Optional width | number | Width of dimension or properties |
Optional height | number | Height of dimension |
Methods
▸ clone(): Dimension
return clone object
clone
▸ equalsDimension(dimension, epsilon?): boolean
compares a dimension against this one, if equal returns true
| Name | Type | Description |
|---|---|---|
dimension | Dimension | to check against |
Optional epsilon | number | acceptance criteria |
boolean
if these two dimensions are equal
▸ getClassName(): string
string
▸ getHeight(): number
Gets height
number
▸ getProperties(): OptionsOut
Returns properties pertaining to dimension
properties
▸ getWidth(): number
Gets width
number
▸ inflate(w, h?): Dimension
Inflate dimension by the specified amount.
| Name | Type | Description |
|---|---|---|
w | number | the amount to inflate this dimension horizontally. |
Optional h | number | the amount to inflate this dimension vertically. |
▸ round(): Dimension
Round width and height of dimension object and return itself
▸ setProperties(props?): Dimension
Sets properties pertaining to dimension
| Name | Type | Description |
|---|---|---|
Optional props | Options | properties |
▸ setSize(width, height): Dimension
Sets width and height
| Name | Type | Description |
|---|---|---|
width | number | desired width |
height | number | desired height |
▸ toString(): string
Returns a string that represents the current dimension.
string
▸ Static fromObject(object?): Dimension
Create or get dimension from object
| Name | Type | Description |
|---|---|---|
Optional object | Dimension | Options | object can be in format of constructor of Dimension |
dimension
▸ Static getClassName(): string
string