PWBuilding Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | PWBuilding.h |
Overview
The building object encompasses a wide variety of information associated with the building. Information includes but is not limited to: floor data, floor resource data, street address and location.
identifier
The identifier for the building structure that corresponds to the MaaS Portal.
@property (readonly) NSInteger identifierDeclared In
PWBuilding.h
name
The name of the building as defined in MaaS Portal.
@property (readonly) NSString *nameDeclared In
PWBuilding.h
floors
An array of PWFloor objects that are contained in the building.
@property (readonly) NSArray<PWFloor*> *floorsDeclared In
PWBuilding.h
pois
An array of PWPointOfInterest objects that are contained in the building.
@property (readonly) NSArray<PWPointOfInterest*> *poisDeclared In
PWBuilding.h
pointOfInterestTypes
An array of PWPointOfInterestType objects that are used in MaaS Portal.
@property (readonly) NSArray<PWPointOfInterestType*> *pointOfInterestTypesDeclared In
PWBuilding.h
coordinate
The center coordinate of the building.
@property (readonly) CLLocationCoordinate2D coordinateDeclared In
PWBuilding.h
userInfo
Extra information about the PWBuilding object and the data it consumes.
@property (readonly) NSDictionary *userInfoDeclared In
PWBuilding.h
routeSegments
A list of routeSegments contained in the building
@property (readonly) NSDictionary<NSString*NSDictionary<NSString*NSNumber*> *> *routeSegmentsDeclared In
PWBuilding.h
routePoints
A list of routePoints contained in the building
@property (readonly) NSDictionary<NSString*id<PWMapPoint> > *routePointsDeclared In
PWBuilding.h
customImageLoaderForPointsOfInterest
If set, images for PWPointOfInterest objects will be provided by the application using this function when loading a building. If NULL, images will be downloaded from the network based on the point of interest type. The default value is NULL.
@property (class, nonatomic, copy) PWLoadCustomImageForPointOfInterest customImageLoaderForPointsOfInterestDeclared In
PWBuilding.h
+ buildingWithIdentifier:completion:
Create PWBuilding with provided building identifier.
+ (void)buildingWithIdentifier:(NSInteger)identifier completion:(PWLoadBuildingCompletionBlock)completionParameters
identifier |
The building identifier to use for initialization. |
|---|---|
completion |
The block to execute when the building data is completely loaded. |
Discussion
It checks the network connectivity before starting to download the building: if it’s disconnected, use cached one and return immediately, otherwise check if the cached bulding is up to date then decide if it’s necessary to re-download.
Declared In
PWBuilding.h
+ buildingWithIdentifier:cacheFallbackTimeout:completion:
Create PWBuilding with provided building identifier.
+ (void)buildingWithIdentifier:(NSInteger)identifier cacheFallbackTimeout:(NSTimeInterval)cacheFallbackTimeout completion:(PWLoadBuildingCompletionBlock)completionParameters
identifier |
The building identifier to use for initialization. |
|---|---|
cacheFallbackTimeout |
The timeout for network request to get the building before falling back to the cached version. This is only used if a cached building exists. For non-cached buildings this is not honored. |
completion |
The block to execute when the building data is completely loaded. |
Discussion
It checks the network connectivity before starting to download the building: if it’s disconnected, use cached one and return immediately, otherwise check if the cached building is up to date then decide if it’s necessary to re-download if it completes within the fallback timeout. Otherwise will return the cached building.
Declared In
PWBuilding.h
+ buildingWithIdentifier:usingCache:completion:
Create PWBuilding with provided building identifier. (Deprecated: Use buildingWithIdentifier:completion: instead, since v3.2.0)
+ (void)buildingWithIdentifier:(NSInteger)identifier usingCache:(BOOL)caching completion:(PWLoadBuildingCompletionBlock)completionParameters
identifier |
The building identifier to use for initialization. |
|---|---|
caching |
YES/NO. Determines if the SDK will use prior cache information to instantiate the building structure. Default YES. |
completion |
The block to execute when the building data is completely loaded. |
Declared In
PWBuilding.h
– getFloorByFloorId:
Returns a PWFloor instance that has the given floor identifier. (Deprecated: Use floorById: instead, since v3.2.0)
- (PWFloor *)getFloorByFloorId:(NSInteger)identifierParameters
identifier |
The identifier of the floor. |
|---|
Return Value
Returns a PWFloor instance that has the given identifier.
Declared In
PWBuilding.h
– floorById:
Returns a PWFloor instance that has the given floor identifier.
- (PWFloor *)floorById:(NSInteger)identifierParameters
identifier |
The identifier of the floor. |
|---|
Return Value
Returns a PWFloor instance that has the given identifier.
Declared In
PWBuilding.h
– pointOfInterestById:
Returns a PWPointOfInterest instance that has the given identifier.
- (PWPointOfInterest *)pointOfInterestById:(NSInteger)identifierParameters
identifier |
The MaaS portal identifier of the point-of-interest. |
|---|
Return Value
Returns a PWPointOfInterest instance that has the given identifier.
Declared In
PWBuilding.h
– pointOfInterestClosestToLocation:
Finds the closest point-of-interest to the PWMapPoint object’s location.
- (PWPointOfInterest *)pointOfInterestClosestToLocation:(id<PWMapPoint>)locationParameters
location |
A |
|---|
Return Value
Returns a PWPointOfInterest object.
Declared In
PWBuilding.h
– containsCoordinate:
Determines if the coordinate is contained within the latitude and longitude bounds of the building.
- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinateParameters
coordinate |
A |
|---|
Return Value
Returns a BOOL value YES/NO.
Declared In
PWBuilding.h