JS API modules

JS API modules are separate component classes that are not loaded in the main API, but can be used for specific tasks.

The modules are developed and maintained by the Yandex Maps JS API team, and they are the same part of the JS API as the main API.

In general, to work with a module, it must be loaded.

ymaps3.import('@yandex/controls-extra').then(({YMapOpenMapsButton}) => {
  const map = new ymaps3.YMap(document.getElementById('app'), {
    location: LOCATION,
  });

  map.addChild(new YMapOpenMapsButton(...))
});

Attention.

Modules are not versioned. That is, the latest version of the module is always loaded (as for the main JS API).

TypeScript

Module types will be automatically inferred when ymaps3.import is called, but if you need a type from a module somewhere outside of the import, then you can include it directly.

import type {YMapOpenMapsButton} from '@yandex/ymaps3-types/modules/controls-extra';

Attention.

The @yandex/ymaps3-types package provides only types, without runtime modules.

Available modules