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.
The Enterprise Data classes described in this guide are populated in Mappedin CMS, which requires a Solutions Tier 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 ->
}
}
Search
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.
A complete example demonstrating Search can be found in the Mappedin Android Github repo: SearchDemoActivity.kt
Here are two ways to enable search:
- 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 ->
- 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:
- EnterpriseLocationOptions: Specific places such as stores, restaurants, or washrooms.
- EnterpriseCategoryOptions: Groups of locations, such as "Food Court" or "Electronics."
- PlaceOptions: Any main objects that can be searched for such as Space, Door, PointOfInterest
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
}
}
A complete example demonstrating Search can be found in the Mappedin Android Github repo: SearchDemoActivity.kt