EILLocation Class Reference

Inherits from NSObject
Conforms to NSCoding
Declared in EILLocation.h
EILLocation.m

Overview

Represents a physical location prepared for Estimote Indoor Location. Object is immutable.

Instances of EILLocation can be obtained by fetching from the Estimote Cloud (see EILRequestFetchLocation and EILRequestFetchLocations), created by EILLocationBuilder or by importing JSON with [EILLocationBuilder parseFromJSON:].

Properties

  identifier

Globally unique identifier of the location. Identifier is being set by server once location is persisted.

@property (nonatomic, strong, readonly, nullable) NSString *identifier

Declared In

EILLocation.h

  name

Name of the location.

@property (nonatomic, strong, readonly) NSString *name

Declared In

EILLocation.h

  geographicalLocation

Geographical location of the location.

@property (nonatomic, strong, readonly, nullable) NSDictionary *geographicalLocation

Declared In

EILLocation.h

  latitude

Latitude of geographical location of the location

@property (nonatomic, strong, readonly, nullable) NSNumber *latitude

Declared In

EILLocation.h

  longitude

Longitude of geographical location of the location

@property (nonatomic, strong, readonly, nullable) NSNumber *longitude

Declared In

EILLocation.h

  owner

Email address of the owner of the location.

@property (nonatomic, strong, readonly, nullable) NSString *owner

Declared In

EILLocation.h

  isPublic

Visibility of the location (private/public).

@property (nonatomic, assign, readonly) BOOL isPublic

Declared In

EILLocation.h

  boundarySegments

Boundary of the location.

@property (nonatomic, strong, readonly) NSArray<EILOrientedLineSegment*> *boundarySegments

Declared In

EILLocation.h

  shape

Bezier path of the boundary of the location.

@property (nonatomic, strong, readonly) UIBezierPath *shape

Declared In

EILLocation.h

  polygon

Polygon of shape of the location. Points are sorted clockwise.

@property (nonatomic, strong, readonly, nullable) NSArray<EILPoint*> *polygon

Declared In

EILLocation.h

  area

Area of the location in square meters.

@property (nonatomic, assign, readonly) double area

Declared In

EILLocation.h

  boundingBox

Bounding box of the location.

@property (nonatomic, assign, readonly) CGRect boundingBox

Declared In

EILLocation.h

  linearObjects

Linear objects inside the location.

@property (nonatomic, strong, readonly) NSArray<EILLocationLinearObject*> *linearObjects

Declared In

EILLocation.h

  beacons

Beacons located in the location.

@property (nonatomic, strong, readonly) NSArray<EILPositionedBeacon*> *beacons

Declared In

EILLocation.h

  orientation

Orientation to magnetic north, counted clockwise. Value is in degrees.

@property (nonatomic, assign, readonly) double orientation

Declared In

EILLocation.h

  creationDate

Creation date.

@property (nonatomic, strong, readonly) NSDate *creationDate

Declared In

EILLocation.h

Creating and Initializing

– initWithLocation:

Copy constructor.

- (instancetype)initWithLocation:(EILLocation *)location

Parameters

location

The location.

Return Value

A new location based on a given location.

Declared In

EILLocation.h

+ locationFromLocation:

Returns a new location based on a given location.

+ (EILLocation *)locationFromLocation:(EILLocation *)location

Parameters

location

The location.

Return Value

A new location based on a given location.

Declared In

EILLocation.h

Serialization

+ locationFromDictionary:

Deserializes a location from NSDictionary.

+ (nullable EILLocation *)locationFromDictionary:(NSDictionary *)dict

Parameters

dict

NSDictionary to deserialize from.

Return Value

A location created from NSDictionary.

Declared In

EILLocation.h

– toDictionary

Serializes the point to NSDictionary.

- (NSDictionary *)toDictionary

Return Value

A location representation in NSDictionary.

Declared In

EILLocation.h

Utility methods

– locationTranslatedByDX:dY:

Translates the location by a given vector (dX, dY) and returns a new location.

- (EILLocation *)locationTranslatedByDX:(double)x dY:(double)y

Parameters

x

Value of the translation on X axis.

y

Value of the translation on Y axis.

Return Value

A new location translated by (dX, dY).

Declared In

EILLocation.h

– containsPointWithX:y:

Checks if a given point is inside the location.

- (BOOL)containsPointWithX:(double)x y:(double)y

Parameters

x

X coordinate.

y

Y coordinate.

Return Value

YES if given point is inside the location.

Declared In

EILLocation.h

– containsPoint:

- (BOOL)containsPoint:(EILPoint *)point

Declared In

EILLocation.h

– randomPointInside

Returns an equally distributed random point inside the location.

- (EILPoint *)randomPointInside

Return Value

A random point inside the location.

Declared In

EILLocation.h

– linearObjectsWithType:

Filters this location linear objects and returns only those for given type.

- (NSArray<EILLocationLinearObject*> *)linearObjectsWithType:(EILLocationLinearObjectType)type

Parameters

type

Type of linear object to filter this location linear objects.

Return Value

Linear objects with given type.

Declared In

EILLocation.h

Identifying and Comparing Objects

– isEqual:

Returns a Boolean value that indicates whether a given location is equal to this location.

- (BOOL)isEqual:(id)other

Parameters

other

The object to be compared to this location. May be nil.

Return Value

YES if locations are equal, otherwise NO.

Declared In

EILLocation.h

– isEqualToLocation:

- (BOOL)isEqualToLocation:(EILLocation *)location

See Also

Declared In

EILLocation.h

– hash

Returns an integer that can be used as a table address in a hash table structure.

- (NSUInteger)hash

Declared In

EILLocation.h

Describing Objects

– description

Returns a string representation of the location.

- (NSString *)description

Return Value

A string representation of the location.

Declared In

EILLocation.h

Encoding and Decoding

– initWithCoder:

Returns a location initialized from data in a given unarchiver.

- (nullable instancetype)initWithCoder:(NSCoder *)decoder

Parameters

decoder

An unarchiver object.

Return Value

A new location initialized using the data in decoder.

Declared In

EILLocation.h

– encodeWithCoder:

Encodes the location using a given archiver.

- (void)encodeWithCoder:(NSCoder *)coder

Parameters

An

archiver object.

Declared In

EILLocation.h