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

# MapType

Map type.

[Constructor](#constructor-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
MapType(name, layers)
```

Creates an instance of the map type.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`name`](#param-name)[*](*star) | — | Type: String

Type name. ||
|| [`layers`](#param-layers)[*](*star) | — | Type: Function[]\|String[]

Array containing constructors for layers or keys. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Creating a custom map type that consists of satellite images from MapQuest
// with the Yandex.Hybrid overlay.

// Class of MapQuest tiles
var MQLayer = function () {
    var layer = new ymaps.Layer('http://oatile%d.mqcdn.com/naip//%z/%x/%y.jpg');
    // Copyrights
    layer.getCopyrights = function () {
        return ymaps.vow.resolve('Data, imagery and map information provided by MapQuest, Open Street Map and contributors, CC-BY-SA');
    };
    // Range of available zoom levels
    layer.getZoomRange = function () {
        return ymaps.vow.resolve([0, 18]);
    };

    return layer;
};
// Adding a layer with the key
ymaps.layer.storage.add('mq#aerial', MQLayer);
// Creating a map type that consists of the layers 'mq#aerial' and 'yandex#skeleton'
var myMapType = new ymaps.MapType('MQ + Ya', ['mq#aerial', 'yandex#skeleton']);
// Adding it to the map type storage
ymaps.mapType.storage.add('mq_ya#hybrid', myMapType);
// Now we can set our map type for any map
map.setType('mq_ya#hybrid');
```

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [getLayers](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapType.md#getLayers)() | Function[]\|String[] | Returns a list of layers for the given map type - an array of constructors or keys for layers. ||
|| [getName](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/MapType.md#getName)() | String | Returns name of the map type.||
|#

## Methods details {#method_detail}

### getLayers {#getLayers}

```javascript
{Function[]|String[]} getLayers()
```

**Returns** a list of layers for the given map type - an array of constructors or keys for layers.

### getName {#getName}

```javascript
{String} getName()
```

**Returns** name of the map type.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`map`](#getName-param-map)[*](*star) | — | Type: ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.