@mappable-world/mappable-spherical-mercator-projection package
Mappable JS API package
![Build Status](https://github.com/mappable-world/mappable-cartesian-projection/workflows/Run%20tests/badge.svg)
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-world/mappable-spherical-mercator-projection')) {
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`);
}
Object.assign(mappable, window[`${pkg}`]);
return window[`${pkg}`];
});
and in your final code just use mappable.import
const pkg = await mappable.import('@mappable-world/mappable-spherical-mercator-projection')