Click or drag to resize

Telogis.GeoBase.Widgets.MapControl

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

Widgets.MapControl inherits from Widgets.AbstractWidget.

An abstract skinnable map widget.

Constructor
NameDescription
Widgets.MapControl(config)

Arguments

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

    Properties
    NameTypeDescription
    mapWidgets.Map

    The map to control with the widget. If no Widgets.MapControl.config.parent property was specified, the frame element of this map is used.

    Defaults to none.
    positionPoint

    The offset within the map widget to place the control.

    Defaults to new Point (0, 0).
Functions
NameDescription
destroy ()

Frees resources used by the Widgets.MapControl, in the case that it is never to be used again.

setMap (Telogis.GeoBase.Map map, Function addCallback, Function removeCallback)

Associates the Widgets.MapControl with a certain map and updates it accordingly.

Arguments
  • (Optional) map (Telogis.GeoBase.Map or String) - The reference or string ID specifying the map to bind the control to. Defaults to this.map.

  • (Optional) addCallback (Function) - An optional callback function to execute (in arbitrary scope) once the control has been registered as a listener for a new map. Defaults to function (map) {}.

    Arguments
    • map (Widgets.Map) - The map to which the control has been added.

  • (Optional) removeCallback (Function) - An optional callback function to execute (in arbitrary scope) once the control has been unregistered as a listener from its old map. Defaults to function (map) {}.

    Arguments
    • map (Widgets.Map) - The map from which the control has been removed.

setPosition (Point pos)

Sets the position of the widget within its containing map.

Arguments
  • pos (Point) - The pixel coordinates of the upper-left corner of the widget in the map.

update (Number updateType)

Invalidates the Widgets.MapControl and re-renders it to its container. This is called automatically by the Widgets.Map that the control is listening to.

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

whenAdded (Function callback)

Executes a function immediately if the control has been added to a map. If it has not, the function is queued to be called when the control's Widgets.MapControl.Added event handler is triggered.

Arguments
  • callback (Function) - The function to execute (in arbitrary scope) when the control has been added to a map.

Properties
NameTypeDescription
AddedEventHandler

The event handler triggered when the map control is added to a map.

mapWidgets.Map

The map associated with the widget.

RemovedEventHandler

The event handler triggered when the map control is removed from a map.