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 identifier
Declared In
PWBuilding.h
name
The name of the building as defined in MaaS Portal.
@property (readonly) NSString *name
Declared In
PWBuilding.h
floors
An array of PWFloor
objects that are contained in the building.
@property (readonly) NSArray<PWFloor*> *floors
Declared In
PWBuilding.h
pois
An array of PWPointOfInterest
objects that are contained in the building.
@property (readonly) NSArray<PWPointOfInterest*> *pois
Declared In
PWBuilding.h
pointOfInterestTypes
An array of PWPointOfInterestType
objects that are used in MaaS Portal.
@property (readonly) NSArray<PWPointOfInterestType*> *pointOfInterestTypes
Declared In
PWBuilding.h
coordinate
The center coordinate of the building.
@property (readonly) CLLocationCoordinate2D coordinate
Declared In
PWBuilding.h
userInfo
Extra information about the PWBuilding
object and the data it consumes.
@property (readonly) NSDictionary *userInfo
Declared In
PWBuilding.h
routeSegments
A list of routeSegments contained in the building
@property (readonly) NSDictionary<NSString*NSDictionary<NSString*NSNumber*> *> *routeSegments
Declared In
PWBuilding.h
routePoints
A list of routePoints contained in the building
@property (readonly) NSDictionary<NSString*id<PWMapPoint> > *routePoints
Declared 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 customImageLoaderForPointsOfInterest
Declared In
PWBuilding.h
+ buildingWithIdentifier:completion:
Create PWBuilding
with provided building identifier.
+ (void)buildingWithIdentifier:(NSInteger)identifier completion:(PWLoadBuildingCompletionBlock)completion
Parameters
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)completion
Parameters
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)completion
Parameters
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)identifier
Parameters
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)identifier
Parameters
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)identifier
Parameters
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>)location
Parameters
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)coordinate
Parameters
coordinate |
A |
---|
Return Value
Returns a BOOL value YES/NO.
Declared In
PWBuilding.h