JS API modules
JS API modules are separate classes of components that are not loaded in the core API, but can be used to solve specific tasks.
Modules are developed and maintained by the Yandex Maps JS API team. They constitute an integral part of the JS API, just like the core API.
To work with a module, it generally needs to 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 subject to versioning. This means that the version of the module loaded will always be the latest one (just like for the core JS API).
TypeScript
Module types are automatically output when ymaps3.import is called, but if you need an out-of-import type, you can connect it directly.
import type {Cartesian} from '@yandex/ymaps3-types/modules/cartesian-projection';
Attention.
The @yandex/ymaps3-types package provides only types, no runtime modules.