Skip to main content
Version: 6.0

Location Profiles & Categories

Mappedin SDK version 6 is currently in a beta state while Mappedin perfects new features and APIs. Open the v6 release notes to view the latest changes.
Using Mappedin JS with your own map requires a Pro license. Try a demo map for free or refer to the Pricing page for more information.

A Location refers to something that represents a physical position on the map, such as an annotation, area, connection (e.g. stairs or elevator), door, point of interest or space. Locations may have a LocationProfile attached to them. The profiles contain information about the location such as its name, description, social media links, opening hours, logo and more. A LocationProfile can have zero to many LocationCategory attached to it. A LocationCategory may have a child or parent category. For example, the parent Food & Drink LocationCategory has children such as Bar, Cafe, Food Court and Mediterranean Cuisine.

LocationProfile

A LocationProfile can be accessed by using the locationProfiles property of a location. For example, use Space.locationProfiles to access every LocationProfile of a space. Every LocationProfile can also be access using the MapData.getByType() method as shown below.

const locationProfiles = mapData.getByType('location-profile');

LocationCategory

To access the LocationCategory of a LocationProfile, use the LocationProfile.categories property. Note that a LocationCategory can have either parent or child categories. These are accessible using the LocationCategory.parent and LocationCategory.children properties respectively. Every LocationCategory can also be access using the MapData.getByType() method as shown below.

const locationCategories = mapData.getByType('location-category');

Example

The following CodeSandbox example demonstrates how to show every LocationCategory that contains a LocationProfile and some LocationProfile details. Both the parent and child LocationCategory name is displayed in the headers. The LocationProfile.name, LocationProfile.description and LocationProfile.logo properties are used to display the name, description and logo of the restaurant. Note how the LocationProfiles for restaurants exist in multiple LocationCategories, having both a category called Restaurant and another that describes the type of cuisine they serve, such as Italian Cuisine.