Skip to main content
Version: 6.0

Enterprise Data

Using Mappedin SDK for Android with your own map requires a Pro license. Try a demo map for free or refer to the Pricing page for more information.
note

The Enterprise Data classes described in this guide are populated in Mappedin CMS, which requires an Enterprise subscription.

Enterprise Locations

An EnterpriseLocation contains metadata about a location, such as its name, description, logo, phone number, social medial links, hours of operation and more. They can be accessed using the MapData.getByType() method as shown below.

mapView.mapData.getByType<EnterpriseLocation>(MapDataType.ENTERPRISE_LOCATION) { result ->
result.onSuccess { enterpriseLocations ->
}
}

Enterprise Categories

An EnterpriseCategory groups one or more EnterpriseLocation. These allow similar locations to be sorted in a logical fashion. For example a mall may group locations into Food Court, Footwear and Women's Fashion. They can be accessed using the MapData.getByType() method as shown below.

mapView.mapData.getByType<EnterpriseCategory>(MapDataType.ENTERPRISE_CATEGORY) { result ->
result.onSuccess { enterpriseCategories ->
}
}

EnterpriseCategory can contain one or more sub EnterpriseCategory that are accessed from its children member.

Enterprise Venue

The EnterpriseVenue class holds metadata about the map, which includes the map name, supported languages, default language, top locations and more. It can be accessed using the MapData.getByType() method as shown below.

mapView.mapData.getByType<EnterpriseVenue>(MapDataType.ENTERPRISE_VENUE) { result ->
result.onSuccess { enterpriseVenue ->
}
}
tip

Note that the MapData class instantiates the Search class and exposes it as MapView.mapData.search. Use MapView.mapData.search to utilize Search' methods.

The Search functionality allows users to search for locations, categories, and other points of interest within the venue.

tip

A complete example demonstrating Search can be found in the Mappedin Android GitHub repo: SearchDemoActivity.kt

Here are two ways to enable search:

  1. Enable Search on map initialization:
// See Trial API key Terms and Conditions
// https://developer.mappedin.com/docs/demo-keys-and-maps
val options =
GetMapDataWithCredentialsOptions(
key = "5eab30aa91b055001a68e996",
secret = "RJyRXKcryCMy4erZqqCbuB1NbR66QTGNXVE0x3Pg6oCIlUR1",
mapId = "mappedin-demo-mall",
search = SearchOptions(enabled = true)
)

mapView.getMapData(options) { result ->
  1. Enable Search via method:
mapView.mapData.search.enable { result ->
result.onSuccess {
runOnUiThread {
setupSearch()
}
}
}

Search Query

Use Search.query to search for locations based on a string input:

Search query returns a list of matching SearchResult based on the input string.

SearchResult include information about the type of match, the score (relevance), and detailed metadata about the matching items.

Example Search Query

mapView.mapData.search.query(item.suggestion.suggestion) { result ->
result.onSuccess { searchResult ->
// Handle search results
}
}

Search Suggestions

Use Search.suggest to fetch real-time suggestions based on partial input. This is useful for creating an autocomplete feature for a search bar.

Example Code

mapView.mapData.search.suggest(query) { result ->
result.onSuccess { suggestions ->
// Handle suggestions
}
}
tip

A complete example demonstrating Search can be found in the Mappedin Android GitHub repo: SearchDemoActivity.kt

Events & Deals

Events and deals created in Mappedin CMS can be retrieved using the EventsManager class. The Events APIs are included in the SDK, so no additional package or dependency is required.

The EventsManager is accessed from MapView.mapData.eventsManager.

Usage

The following example demonstrates how to load and read event data.

// Load all events for the map
mapView.mapData.eventsManager.load { result ->
result.onSuccess {
// Read all events
mapView.mapData.eventsManager.getEvents { eventsResult ->
eventsResult.onSuccess { events ->
for (event in events) {
println(event.name)
}
}
}
}
}

getEvents returns a list of EventMetaData, which contains the event name, description, start and end dates, and more.

tip

A complete example demonstrating the Events APIs can be found in the Mappedin Android GitHub repo: EventsDemoActivity.kt