Click or drag to resize

Telogis.GeoBase.Widgets.Dock

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

Widgets.Dock inherits from Widgets.MapControl.

A map widget designed to contain others, such as a slider and scale, to neatly dock them against one edge of the map.

Exceptions
TypeDescription
Errors.ConfigurationErrorIf no valid Widgets.DockSkin could be found.
Constructor
NameDescription
Widgets.Dock(config)

Arguments

  • config (Object) - Configuration options for the Widgets.Dock.

    Properties
    NameTypeDescription
    alignString

    A string specifying which edge of the map the dock should be placed on. May be either 'top', 'left', 'bottom' or 'right'.

    Defaults to bottom.
    itemsArray

    An array of Widgets.MapControls to place in the dock. These can be added after construction with calls to Widgets.MapControl.add.

    Defaults to [].
    mapWidgets.Map

    The map to base the dock upon. Setting this is redundant if the map was passed as the Widgets.AbstractWidget.config.parent property.

    Defaults to none.
    skinWidgets.DockSkin

    The skin to use to style the dock with. Ideally, this should match those of the widgets it contains.

    Defaults to Widgets.DockSkin.standard.
Functions
NameDescription
add (Widgets.MapControl control)

Adds a map control to the dock. Controls are spaced evenly along the dock as they are added.

Arguments
destroy ()

Deallocates resources used by the dock and its constituent widgets. This should only be called once the dock is never to be used again.

getLength ()

Finds the length of the Widgets.Dock, which is its width in the direction of its layout. This will be the width of the dock's Widgets.Map in the appropriate direction.

Returns

Number - The length of the dock, in pixels.

getSize (Function callback)

Finds the dimensions of the Telogis.GeoBase.MapControl.Dock, in pixels. These are returned asynchronously to a specified callback function.

Arguments
  • callback (Function) - An arbitrary callback to pass the dimensions of the control to.

    Arguments
    • size (Size) - The width and height, in pixels, of the dock.

getThickness ()

Finds the thickness of the Widgets.Dock, which is its width in the direction perpendicular to its layout. This will be the thickness of the thickest control contained in the dock.

Returns

Number - The thickness of the dock, in pixels.

isVertical ()

Tests whether the Widgets.Dock is aligned vertically. If not, it can be assumed to be horizontal.

Returns

Boolean - True if the dock is aligned left or right (vertically); false if it is aligned top or bottom (horizontally).

setMap (Widgets.Map map)

Changes the map upon which the Widgets.Dock is placed. This is invariably the same map as the one controlled by the map controls contained in the dock, so these controls are also reconfigured to refer to the new map.

Arguments
  • (Optional) map (Widgets.Map or String) - The new map to place the dock and its controls on. Defaults to this.map.

update (Number updateType)

Adjusts the locations of the controls and dock elements so that they are evenly positioned and spaced with appropriate stretches of the dock itself. There are three cases for the number of controls in the dock which are handled separately: if there are more than two controls registered, one is placed at each end of the dock and the remaining are distributed evenly between. If there is only one control registered, it is placed in the center of the dock with filler on either side. If no controls have been registered, the entire dock is occupied by filler space.

Arguments
  • updateType (Number) - A combination of Map.UPDATE_* flags describing the type of update that has occurred.

Properties
NameTypeDescription
mapWidgets.Map

The map associated with the widgets in the dock, upon which the dock will be placed.