---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# layer.tileContainer.CanvasContainer

Extends [IChildOnMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md).

Container for tiles on canvas.

[Constructor](#constructor-summary) | [Fields](#properties-summary) | [Events](#events-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
layer.tileContainer.CanvasContainer(layer[, options])
```

Creates a container for tiles on canvas. Accessible in the storage for tile container classes by the key "default#canvas".

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`layer`](#param-layer)[*](*star) | — | Type: [ILayer](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILayer.md)

Layer. ||
|| [`options`](#param-options) | — | Type: Object

Container options. ||
|| [`options.notFoundTile`](#param-options.notFoundTile) | null | Type: String\|null

Specifies the URL for downloading an image if the tile image didn't load. If the value is null, a standard tile is displayed with a text message. For transparent tiles, the notFoundTile option is not applied, and nothing is shown in place of tiles that didn't load. ||
|| [`options.tileClass`](#param-options.tileClass) | 'default#canvas' | Type: [ICanvasTile](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICanvasTile.md)

Class of tiles used by the container. Must implement the interface [ICanvasTile](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICanvasTile.md). ||
|| [`options.tileTransparent`](#param-options.tileTransparent) | false | Type: Boolean

Indicates whether container tiles are transparent. ||
|#

\* Mandatory parameter/option.

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events) | [IEventManager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md) | Event manager.

Inherited from [IEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events). ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [parentchange](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md#event-parentchange) | The parent object reference changed.

Data fields:

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

Inherited from [IChild](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md#event-parentchange). ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [getMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md#getMap)() | [Map](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map.md) | Returns reference to the map. ||
|| [getParent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md#getParent)() | [IParentOnMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IParentOnMap.md)\|null | Returns link to the parent object, or null if the parent element was not set.

Inherited from [IChildOnMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md#getParent). ||
|| [getTile](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md#getTile)([tileNumber](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md#getTile-param-tileNumber), [tileZoom](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md#getTile-param-tileZoom), [priority](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/layer.tileContainer.CanvasContainer.md#getTile-param-priority)) | [ICanvasTile](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICanvasTile.md) | Factory function for creating tiles. ||
|| [setParent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md#setParent)([parent](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md#setParent-param-parent)) | [IChildOnMap](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md) | 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](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChildOnMap.md#setParent).||
|#

## Methods details {#method_detail}

### getMap {#getMap}

```javascript
{Map} getMap()
```

**Returns** reference to the map.

### getTile {#getTile}

```javascript
{ICanvasTile} getTile(tileNumber, tileZoom, priority)
```

Factory function for creating tiles.

**Returns** tile instance.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`tileNumber`](#getTile-param-tileNumber)[*](*star) | — | Type: Number[]

Tile number. ||
|| [`tileZoom`](#getTile-param-tileZoom)[*](*star) | — | Type: Number

Tile scale. ||
|| [`priority`](#getTile-param-priority)[*](*star) | — | Type: Number

Loading priority. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.