ILayer

Extends IChildOnMap, ICustomizable, IEventEmitter.

Interface for a map layer.

Constructor | Fields | Events | Methods

Constructor

ILayer()

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

options

IOptionManager

Options manager.

Inherited from ICustomizable.

Events

Name

Description

brightnesschange

Layer brightness change event.

copyrightschange

Event for changes to available copyright information.

optionschange

Change to the object options.

Inherited from ICustomizable.

parentchange

The parent object reference changed.

Data fields:

  • oldParent - Old parent.
  • newParent - New parent.

Inherited from IChild.

tileloadchange

Tile upload status change event. Data fields:

  • readyTileNumber - Number of ready tiles. A tile is considered ready when it is downloaded and rendered. Type: Number.
  • totalTileNumber - Total number of visible tiles. Type: Number.

zoomrangechange

Event for changes to available information about the zoom level range.

Methods

Name

Returns

Description

getBrightness()

Number

Optional method.

getCopyrights(coords, zoom)

vow.Promise

Optional method. Requests information about copyrights at the specified point with the specified zoom.

getParent()

IParentOnMap|null

Returns link to the parent object, or null if the parent element was not set.

Inherited from IChildOnMap.

getZoomRange(point)

vow.Promise

Optional method. Checks the available range of zoom levels at the specified point. If there is data, the returned promise object will be resolved and will pass as a result an array of two numbers - the minimum and maximum zoom level available at the point. If there is no data, the promise is rejected with an error.

setParent(parent)

IChildOnMap

Sets the parent object. If the null value is passed, the manager element will only be deleted from the current parent object.

Inherited from IChildOnMap.

Events details

brightnesschange

Layer brightness change event.

copyrightschange

Event for changes to available copyright information.

tileloadchange

Tile upload status change event. Data fields:

  • readyTileNumber - Number of ready tiles. A tile is considered ready when it is downloaded and rendered. Type: Number.
  • totalTileNumber - Total number of visible tiles. Type: Number.

zoomrangechange

Event for changes to available information about the zoom level range.

Methods details

getBrightness

{Number} getBrightness()

Optional method.

Returns the layer brightness value from 0 to 1 (0 is zero brightness, and 1 is maximum brightness). The total brightness of the layers added to the map determines which color is selected for the logo and copyrights on the map.

getCopyrights

{vow.Promise} getCopyrights(coords, zoom)

Optional method. Requests information about copyrights at the specified point with the specified zoom.

Returns Promise that will be resolved and will pass as a result an array of strings or DOM elements with information about copyrights.

Parameters:

Parameter

Default value

Description

coords*

—

Type: Number[]

The point on the map that copyright information is being requested for.

zoom*

—

Type: Number

The zoom level that copyright information is being requested for.

* Mandatory parameter/option.

getZoomRange

{vow.Promise} getZoomRange(point)

Optional method. Checks the available range of zoom levels at the specified point. If there is data, the returned promise object will be resolved and will pass as a result an array of two numbers - the minimum and maximum zoom level available at the point. If there is no data, the promise is rejected with an error.

Returns Promise object.

Parameters:

Parameter

Default value

Description

point*

—

Type: Number[]

Point

* Mandatory parameter/option.

Previous