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 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.

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 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 mappable.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 {MMapOpenMapsButton} from '@mappable-world/mappable-types/modules/controls-extra';

Attention.

The @mappable-world/mappable-types package provides only types, without runtime modules.

Available modules