Skip to main content

dg-metalayers

Allows you to create additional layers of meta information and add them to the map.

DG.Meta.layer

Inherits from DG.Layer.

Creation

FactoryUsageDescription
DG.Meta.layer( <String> source, <DG.Meta.layer options> options? ) DG.Meta.layer(…)Creates additional layer with meta-information. Takes the source URL as a parameter with which the tiles of an additional layer are available.

Options

OptionTypeDefaultDescription
tileSizeNumber256The tile size (width and height in pixels, it is assumed that the tile is square).
minZoomNumber0The minimum zoom level.
maxZoomNumber18The maximum zoom level.
zoomOffsetNumber0Value which will shift the zoom level in the tile's address.
eventBubblingString'transparent'||'layer'The way in which meta-layer handles events. Accepts values layer or transparent (default):
  • transparent — meta-layer receives all of the events and carry them to the map
  • layer — meta-layer receives all of the events and stops them after processing

Events

You can subscribe to the following events using these methods.

EventDataDescription
mouseoverMetaEvent Called when you hover the mouse over the additional layer object.
mouseoutMetaEvent Called when the mouse cursor leaves the bounds of an additional layer object.
mousemoveMetaEventCalled when the mouse cursor moves over an additional layer object.
clickMetaEventCalled when the mouse click in the additional layer.
dblclickMetaEventCalled when the mouse double-click in the additional layer.
mousedownMetaEventCalled when the mouse button is pressed while the cursor is over the additional layer.
contextmenuMetaEventCalled when you click the right mouse button in the additional layer.

Methods

MethodReturnsDescription
getOrigin()ObjectReturns origin-instance of additional layer.

DG.Meta.origin

Works with the meta data of a layer, inherits from DG.Class.

Creation

FactoryUsageDescription
DG.Meta.origin( <String> source, <DG.Meta.layer options> options? ) DG.Meta.origin(…)Creates an instance for work with the meta layer data. Takes the source URL as a parameter with which the tiles of an additional layer are available.

Options

OptionTypeDefaultDescription
subdomainsString или String[]'0123'Tile service subdomains. Can be sent as one string (where each letter — is a subdomain name) or as an array of strings.
dataFilterFunctionnullOptional parameter, which takes a function to filter or convert the meta data received from the server.

Methods

MethodReturnsDescription
getTileData( <Object> coord) ObjectReturns the metadata of the meta layer for the specified tile.
setTileData( <String>/<Object> coord, <Object> data) thisAssigns data for the tile with the coord key.
flush()thisClear cached data for all tiles.
setURL( <String> url, <Boolean> flush?) thisSets the url used to get the meta data. If the parameter flush=true, the cached data will be cleared.
getTileKey( <Object> coord) StringReturns the key of the tile as a string.