Mappedin Web SDK - v5.34.1

Mappedin Web SDK

Resources

Usage

Installation

npm install @mappedin/mappedin-js

or

yarn add @mappedin/mappedin-js

Getting Started

import { getVenue, showVenue, E_SDK_EVENT } from '@mappedin/mappedin-js';
import '@mappedin/mappedin-js/lib/index.css';

async function init() {
const venueData = await getVenue({
clientId: '<clientId>',
clientSecret: '<clientSecret>',
venue: '<venue>',
});

const mapView = await showVenue(document.getElementById('mappedin-map'), venueData);
mapView.FloatingLabels.labelAllLocations();
mapView.addInteractivePolygonsForAllLocations();
mapView.on(E_SDK_EVENT.CLICK, ({ polygons }) => {
console.log(`Polygon with id ${polygons[0].id} clicked!`);
});
}
document.addEventListener('DOMContentLoaded', init);

For full documentation, read our Getting Started guide on the Developer Portal. Developers using React or Angular should follow our Using React or Using Angular guides.