Click or drag to resize

Telogis.GeoBase.MapLayers.AbstractLayer

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

MapLayers.AbstractLayer inherits from AbstractDOMEntity.

An abstract class for handling layers on a GeoStream map. Any such map in GeoStream is composed of a number of these layers which should all derive from this class. A MapLayers.TileLayer is added implicitly with the creation of the map, but other types need to be added separately. Note also that the layer created by this constructor is automatically added to the map if one is specified.

Constructor
NameDescription
MapLayers.AbstractLayer(config, beforeAttach)

Arguments

  • config (Object) - Configuration options for the map layer.

    Properties
    NameTypeDescription
    parentWidgets.Map

    The map on which to create the layer, or its ID.

    This property may also be referenced by the name: map.
    zIndexNumber

    Specifies the initial zIndex of this layer. The index has to be greater than 10 and less than 80. General default values for layers are TILE: 20, PATH: 30, REGION: 40, FENCE: 50, CANVAS: 60, OBJECT: 70

    Defaults to 20.
  • (Optional)beforeAttach (Function) - An optional callback to be executed (in arbitrary scope) after the layer's element is created, but before the call to MapLayers.AbstractLayer.setMap (i.e. before the element is attached to the document's DOM tree). Appropriate specification of this function can avoid unnecessary DOM reflows. The layer ID is available when this is called. Defaults to function () {}.

Functions
NameDescription
destroy ()

Disassociates the layer from its map and frees the DOM nodes associated with it. This should be called after the child and objects of the layer have been destroyed.

getZIndex ()

Gets the z index of this layer

hide ()

Hides the layer from the map. See AbstractDOMEntity.hide for arguments and more information.

removeEvent (string eventType, Function action)

Removes an event from the list of handlers.

Arguments
  • eventType (string) - The event type (e.g. mousedown, mouseup)

  • action (Function) - The function to handle the event

setExpiry (Number expirySecs)

Sets the expiry time. When the expiry time elapses the layer will be refreshed.

Arguments
  • expirySecs (Number) - Seconds until the layer is refreshed.

setMap (Widgets.Map map)

Sets or changes the map to which the layer is attached, and performs appropriate initializations once having done so.

Arguments
  • map (Widgets.Map or String) - The map to attach the calling layer to.

setZIndex ()

Sets the z index of this layer. The index has to be greater than 10 and less than 80. General default values for layers are TILE: 20, PATH: 30, REGION: 40, FENCE: 50, CANVAS: 60, OBJECT: 70

show ()

Shows the layer on the map. See AbstractDOMEntity.show for arguments and more information.

suspend ()

Prevents the MapLayers.AbstractLayer from performing any updates until MapLayers.AbstractLayer.unsuspend is called.

unsuspend ()

Allows the MapLayers.AbstractLayer to resume updates after a call to MapLayers.AbstractLayer.suspend, and also performs those updates that were missed while it was suspended.

update (Number updateType)

The base update callback called by the MapLayers.AbstractLayer's map whenever it is updated, or by the layer itself when it is changed. This checks whether the layer is suspended, then passes control to the update() method defined by the derived class as appropriate.

Arguments
  • updateType (Number) - The update-type to apply.

whenAdded (Function callback)

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

Arguments
  • callback (Function) - An arbitrary function to execute, called when the layer has been added to a map.

Properties
NameTypeDescription
AddedEventHandler

An event triggered when the layer is added to a map.

mapWidgets.Map

The Widgets.Map that the MapLayers.AbstractLayer is currently associated with.

RemovedEventHandler

An event triggered when the layer is removed from a map.

UpdateEventHandler

Triggered when the map layer is updated.