new IWLayout(container, layer)
A class for managing the positioning of the control elements
Parameters:
Name | Type | Description |
---|---|---|
container |
HTMLDivElement | the div element the LayoutManager works with |
layer |
number | the layer (z-index) the LayoutManager uses |
Methods
-
addControl(control, firstOrientation, secondOrientation, paddingX, paddingY)
-
Adds a new control to the map
Parameters:
Name Type Description control
IWControl control to be added firstOrientation
number (e.g. IWAlignment.LEFT) secondOrientation
number (e.g. IWAlignment.CENTER) paddingX
number the vertical x-padding in pixel paddingY
number the horizontal y-padding in pixel Returns:
- Type
- void
-
getControlByName()
-
Returns a control by its name.
Returns:
- Type
- IWControl
-
getControls()
-
Returns all controls which are placed on this layer.
Returns:
- Type
- Array.<IWControl>
-
getZIndex()
-
Returns the z-Index of this layer.
Returns:
z-Index- Type
- number
-
redraw()
-
Redraw all controls in correct positions
Returns:
- Type
- void
-
removeControl()
-
Removes a control from the map and calls its beforeRemove and afterRemove methods. Overwrite the two methods if you require some special behaviour when the control is removed.
Returns:
- Type
- void
-
setBorder(x, y)
-
Sets the the padding of the map border.
Parameters:
Name Type Description x
number x-padding in pixel y
number y-padding in pixel Returns:
- Type
- void
-
setSize()
-
Sets the size of the layer (which should be the size of the map or the panel containing this layer).