Mappedin JS - v6.14.0
    Preparing search index...

    Function getMapData

    • 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.

      Parameters

      Returns Promise<MapData>

      Promise resolving to the MapData.

      Understanding Data Sources

      This SDK supports two data sources with different location types:

      Maker (API keys starting with mik_):

      • Use mapData.getByType('location-profile') for LocationProfile
      • Use mapData.getByType('location-category') for LocationCategory
      • Enterprise types will return empty arrays

      CMS/Enterprise (clientId/clientSecret, or keys NOT starting with mik_):

      Detection Logic:

      • If accessToken is provided: Enterprise if token audience matches CMS endpoints
      • If key/secret is provided: Maker if key starts with mik_, otherwise Enterprise
      // 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