Click or drag to resize

Telogis.GeoBase.Widgets.Scale

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

Widgets.Scale inherits from Widgets.MapControl.

A widget to show the distances represented by a map.

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

Arguments

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

    Properties
    NameTypeDescription
    markCountNumber

    The ideal number of unit markings to display on the scale bar.

    Defaults to 5.
    scalesArray

    The numeric array of scales that the widget may operate at.

    Defaults to [0.1, 0.2, 0.5, 0.8, 1, 2, 5, 8, 10, 20, 50, 80, 100, 200, 500, 800, 1000, 2000, 5000, 8000].
    skinWidgets.ScaleSkin

    The skin describing the appearance of the scale widget.

    Defaults to Widgets.ScaleSkin.default.
    unitsString

    The string abbreviation of the type of units to calibrate the scale in, which should be a DistanceUnit code.

    Defaults to DistanceUnit.KILOMETERS. This property may also be referenced by the name: unit.
Functions
NameDescription
getSize (Function callback)

Finds the dimensions of the scale control. Since these are only available once its skin has fully loaded, there may be a small delay before they can be returned. Hence, this procedure is asynchronous, and returns the size to a callback function.

Arguments
  • callback (Function) - The callback to pass the dimensions of the control to, when they become available.

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

setMap (Telogis.GeoBase.Map map)

Associates the Widgets.Scale with a certain Widgets.Map and updates it accordingly. After this call, the scale will be updated whenever the map is.

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

update (Number updateType)

Renders the scale to its container. This should be called whenever the scale's characteristics are changed or it needs to be redisplayed.

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