Content
Optional
Needed if your app uses Regions or Location Tags.
Overview
There are several types of location-based content available:
-
Regions are used to describe a geometric area on a map, they can be accessed using the IPSContent class. See Regions Guide for more details. The ability to search the Regions is described in the Search section .
-
Location Tags represent marked points on a map assigned with custom metadata, see Location Tags Guide for more details. The ability to search the Location Tags is described in the Search section .
You can view the hierarchy of the content available in the IPSFramework in the diagram below.
Content Item Placements
Each Content Item can be placed in one or more locations on a floor in a building. The placements are available at IPSContentItem.placements.
Each placement contains:
- ID of the placement,
IPSPlacement.id; - ID of the building the placement located in,
IPSPlacement.buildingId; - Order of the floor the placement is located on in the building,
IPSPlacement.floorOrder; - Coordinates relative to the building's coordinate system:
IPSPlacement.x,IPSPlacement.y,IPSPlacement.z; - Region's placements also contain related map area description, represented by IPSShape,
IPSRegionPlacement.shape; - Client category,
IPSPlacement.clientCategory.
func handleContentItem(_ contentItem: IPSContentItem) {
// can be casted to a region or location tag
switch contentItem.type {
case .locationTag:
let locationTag = contentItem as! IPSLocationTag
// information about the placements
let placements = contentItem.placements
case .region:
let region = contentItem as! IPSRegion
// information about the placements
let placements = contentItem.placements
for placement in contentItem.placements {
let regionPlacement = placement as! IPSRegionPlacement
// the placement shape
let shape = regionPlacement.shape
}
}
}