Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces

mapType.storage

Static object.

Instance of util.Storage

Storage for map types.

Methods

mapType.storage()

Example:

// Adding a custom map type

// Let's say we have our own map layer
var myLayer = function () {
    return new ymaps.Layer('http://some.server/?%c');
}
// Adding it to the layer storage
ymaps.layer.storage.add('my#layer', myLayer);
// Creating our own map type, consisting of a single layer
var myType = new ymaps.MapType('My map type', ['my#layer']);
// Adding it to the map type storage
ymaps.mapType.storage.add('my#mapType', myType);
// Now we can assign our map type to a map
map.setType('my#type');

Methods

NameReturnsDescription
add(key, object)

util.Storage

Adds an object to storage.

get(key)

Object

Returns object stored for the specified key, or the primary key, if this is not a string.

remove(key)

util.Storage

Deletes the "key: value" pair from storage.