Asynchronously retrieves map data (MapData) based on user-provided options.
The SDK automatically detects whether you're using Maker or CMS/Enterprise credentials and populates the appropriate data types.
Understanding Data Sources
This SDK supports two data sources with different location types:
Maker (API keys starting with mik_):
mik_
mapData.getByType('location-profile')
mapData.getByType('location-category')
CMS/Enterprise (clientId/clientSecret, or keys NOT starting with mik_):
mapData.getByType('enterprise-location')
mapData.getByType('enterprise-category')
mapData.getByType('enterprise-venue')
Detection Logic:
accessToken
key
secret
// Maker usage (key starts with 'mik_')const makerData = await getMapData({ key: 'mik_xxx', secret: 'mis_xxx', mapId: '65c0ff7430b94e3fabd5bb8c'});const locations = makerData.getByType('location-profile'); // Use this for Maker Copy
// Maker usage (key starts with 'mik_')const makerData = await getMapData({ key: 'mik_xxx', secret: 'mis_xxx', mapId: '65c0ff7430b94e3fabd5bb8c'});const locations = makerData.getByType('location-profile'); // Use this for Maker
// CMS/Enterprise usage (clientId/clientSecret)const enterpriseData = await getMapData({ key: 'clientId', secret: 'clientSecret', mapId: 'mappedin-demo-mall'});const locations = enterpriseData.getByType('enterprise-location'); // Use this for Enterprise Copy
// CMS/Enterprise usage (clientId/clientSecret)const enterpriseData = await getMapData({ key: 'clientId', secret: 'clientSecret', mapId: 'mappedin-demo-mall'});const locations = enterpriseData.getByType('enterprise-location'); // Use this for Enterprise
Options provided by the user to retrieve map data.
Promise resolving to the MapData.
Asynchronously retrieves map data (MapData) based on user-provided options.
The SDK automatically detects whether you're using Maker or CMS/Enterprise credentials and populates the appropriate data types.
Remarks
Understanding Data Sources
This SDK supports two data sources with different location types:
Maker (API keys starting with
mik_):mapData.getByType('location-profile')for LocationProfilemapData.getByType('location-category')for LocationCategoryCMS/Enterprise (clientId/clientSecret, or keys NOT starting with
mik_):mapData.getByType('enterprise-location')for EnterpriseLocationmapData.getByType('enterprise-category')for EnterpriseCategorymapData.getByType('enterprise-venue')for EnterpriseVenueDetection Logic:
accessTokenis provided: Enterprise if token audience matches CMS endpointskey/secretis provided: Maker if key starts withmik_, otherwise EnterpriseExample
Example