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 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.
mappable.import('@mappable-world/controls-extra').then(({MMapOpenMapsButton}) => {
const map = new mappable.MMap(document.getElementById('app'), {
location: LOCATION,
});
map.addChild(new MMapOpenMapsButton(...))
});
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 mappable.import
is called, but if you need an out-of-import type, you can connect it directly.
import type {Cartesian} from '@mappable-world/mappable-types/modules/cartesian-projection';
Attention.
The @mappable-world/mappable-types
package provides only types, no runtime modules.