npm install @mappedin/mappedin-js
or
yarn add @mappedin/mappedin-js
import { getMapData, show3dMap } from '@mappedin/maker-sdk';
async function init() {
const mapData = await getMapData({
key: '<key>',
secret: '<secret>',
mapId: '<mapId>',
});
const mapContainer = document.getQuerySelector('body');
const map = await show3dMap(mapContainer, mapData);
map.Labels.all();
map.on('click', event => {
const { coordinate } = event;
const { latitude, longitude } = coordinate;
console.log(`Map was clicked at ${latitude}, ${longitude}`);
});
}
document.addEventListener('DOMContentLoaded', init);
For full documentation, read our Getting Started guide on the Developer Portal.