Last updated

API / geotoolkit / util / Dimension / Dimension

Class: Dimension

util.Dimension.Dimension

Implements a dimension which is defined by an absolute width and height

Table of contents

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
heightnumberHeight of dimension
widthnumberWidth of dimension or properties

Contents

Constructors

new Dimension()

new Dimension()


new Dimension(options)

new Dimension(options)

Parameters

Name Type Description
optionsOptionsproperties

new Dimension(width, height)

new Dimension(width?, height?)

Parameters

Name Type Description
Optional widthnumberWidth of dimension or properties
Optional heightnumberHeight of dimension
Methods

clone

clone(): Dimension

return clone object

Returns

Dimension

clone


equalsDimension

equalsDimension(dimension, epsilon?): boolean

compares a dimension against this one, if equal returns true

Parameters

Name Type Description
dimensionDimensionto check against
Optional epsilonnumberacceptance criteria

Returns

boolean

if these two dimensions are equal


getClassName

getClassName(): string

Returns

string


getHeight

getHeight(): number

Gets height

Returns

number


getProperties

getProperties(): OptionsOut

Returns properties pertaining to dimension

Returns

OptionsOut

properties


getWidth

getWidth(): number

Gets width

Returns

number


inflate

inflate(w, h?): Dimension

Inflate dimension by the specified amount.

Parameters

Name Type Description
wnumberthe amount to inflate this dimension horizontally.
Optional hnumberthe amount to inflate this dimension vertically.

Returns

Dimension


round

round(): Dimension

Round width and height of dimension object and return itself

Returns

Dimension


setProperties

setProperties(props?): Dimension

Sets properties pertaining to dimension

Parameters

Name Type Description
Optional propsOptionsproperties

Returns

Dimension


setSize

setSize(width, height): Dimension

Sets width and height

Parameters

Name Type Description
widthnumberdesired width
heightnumberdesired height

Returns

Dimension


toString

toString(): string

Returns a string that represents the current dimension.

Returns

string


fromObject

Static fromObject(object?): Dimension

Create or get dimension from object

Parameters

Name Type Description
Optional objectDimension | Optionsobject can be in format of constructor of Dimension

Returns

Dimension

dimension


getClassName

Static getClassName(): string

Returns

string