Mappable JS API Hints Package
![npm](https://img.shields.io/npm/dm/@mappable-world/mappable-hint.svg)
The package adds the functionality of hanging hints on map elements
How use
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
to use Mappable JS Module you need to add your module loading handler to JS API
mappable.import.loaders.unshift(async (pkg) => {
if (!pkg.includes('mappable-hint')) {
return;
}
if (location.href.includes('localhost')) {
await mappable.import.script(`/dist/index.js`);
} else {
await mappable.import.script(`https://unpkg.com/${pkg}/dist/index.js`);
}
const [_, pkgName] = pkg.split('@')
Object.assign(mappable, window[`@${pkgName}`]);
return window[`@${pkgName}`];
});
and in your final code just use mappable.import
const pkg = await mappable.import('@mappable-world/mappable-hint@0.0.1')