Mappable JS API package
The package is located in the dist
folder:
dist/types
TypeScript typesdist/esm
es6 modules for direct connection in your projectdist/index.js
Mappable JS Module
Recommended use @mappable-world/mappable-default-ui-theme
as usual npm package:
npm install @mappable-world/mappable-default-ui-theme
and dynamic import
await mappable.ready;
// ...
const {MMapDefaultMarker} = await import('@mappable-world/mappable-default-ui-theme');
// ...
map.addChild(new MMapDefaultMarker(props));
You can use CDN with module loading handler in JS API on your page.
By default mappable.import
can load self modules.
Just use mappable.registerCdn
and mappable.import
:
// register in `mappable.import` which CDN to take the package from
mappable.import.registerCdn(
'https://cdn.jsdelivr.net/npm/{package}',
'@mappable-world/mappable-default-ui-theme@latest'
);
// ...
// import package from CDN
const pkg = await mappable.import('@mappable-world/mappable-default-ui-theme');
Read more about working with the package in the documentation.