Overview
Optional
Needed if your app uses Regions or Location Tags.
Introduction
There are two types of content items available:
-
Regions are used to represent a geometric area on a map.
-
Location Tags are used to represent a single point on a map.
All the content items are assigned with a metadata field which can be modified using the Dashboard and accessed and searched for through the IPS SDK using the IPSContent class. For more information about searching for content items see the Search section.
You can view the hierarchy of the content available in the IPS SDK 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.getPlacements().
Each placement contains:
- ID of the placement,
IPSPlacement.getId(); - ID of the building the placement located in,
IPSPlacement.getBuildingId(); - Order of the floor the placement is located on in the building,
IPSPlacement.getFloorOrder(); - Coordinates relative to the building's coordinate system:
IPSPlacement.getX(),IPSPlacement.getY(),IPSPlacement.getZ(); - Region's placements also contain related map area description, represented by IPSShape ,
IPSRegionPlacement.getShape(); - Client category,
IPSPlacement.getClientCategory().
void handleContentItem(IPSContentItem contentItem) {
// can be casted to a region or location tag
switch (contentItem.getType()) {
case IPSContentItem.TYPE_LOCATION_TAG:
IPSLocationTag locationTag = (IPSLocationTag)contentItem;
break;
case IPSContentItem.TYPE_REGION:
IPSRegion region = (IPSRegion)contentItem;
break;
}
// information about the placement
IPSPlacement placement = contentItem.getPlacements().get(0);
String buildingId = placement.getBuildingId();
Integer floorOrder = placement.getFloorOrder();
// placement extends coordinate
IPSCoordinate coordinates = (IPSCoordinate)placement;
// region shape information
if (contentItem.getType() == IPSContentItem.TYPE_REGION) {
IPSRegionPlacement regionPlacement = (IPSRegionPlacement)placement;
IPSShape shape = regionPlacement.getShape();
}
}