Hello,
I’d like to received the data from Estimote Cloud and displayed on the application.
I can display a map on the application and capture the position of the user who entered the range.
However, I am unable to display the Beacon on the map.
How can I resolve this?
the program is following:
@interface ViewController () <EILIndoorLocationManagerDelegate>
@property (nonatomic, strong) EILIndoorLocationManager *locationManager;
@property (nonatomic, strong) EILLocation *location;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[ESTConfig setupAppID:@"<AppID>" andAppToken:@"<App Token>"];
[ESTConfig isAuthorized];
self.locationManager = [[EILIndoorLocationManager alloc] init];
self.locationManager.delegate = self;
EILRequestFetchLocation *fetchLocationRequest =
[[EILRequestFetchLocation alloc] initWithLocationIdentifier:@"<identifier>"];
[fetchLocationRequest sendRequestWithCompletion:^(EILLocation *location, NSError *error){
if (location != nil) {
self.positionLabel.text = @"Waiting.......";
self.location = location;
self.locationView.backgroundColor = [UIColor clearColor];
self.locationView.showTrace = YES;
self.locationView.rotateOnPositionUpdate = NO;
self.locationView.showWallLengthLabels = YES;
self.locationView.showBeacons = YES;
self.locationView.locationBorderColor = [UIColor blackColor];
self.locationView.locationBorderThickness = 3;
self.locationView.doorColor = [UIColor brownColor];
self.locationView.doorThickness = 5;
self.locationView.traceColor = [UIColor redColor];
self.locationView.traceThickness = 2;
self.locationView.wallLengthLabelsColor = [UIColor blackColor];
[self.locationView drawLocation:self.location];
self.locationView.positionImage = [UIImage imageNamed:@"<positionImage File>"];
[self.locationManager startMonitoringForLocation:self.location];
[self.locationManager startPositionUpdatesForLocation:self.location];
}else{
}
}];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)indoorLocationManager:(EILIndoorLocationManager *)manager didFailToUpdatePositionWithError:(NSError *)error {
self.positionLabel.text = @"failed to update position.";
}
- (void)indoorLocationManager:(EILIndoorLocationManager *)manager didUpdatePosition:(EILOrientedPoint *)position withAccuracy:(EILPositionAccuracy)positionAccuracy inLocation:(EILLocation *)location {
NSString *accuracy;
switch (positionAccuracy) {
case EILPositionAccuracyVeryHigh: accuracy = @"+/- 1.00m"; break;
case EILPositionAccuracyHigh: accuracy = @"+/- 1.62m"; break;
case EILPositionAccuracyMedium: accuracy = @"+/- 2.62m"; break;
case EILPositionAccuracyLow: accuracy = @"+/- 4.24m"; break;
case EILPositionAccuracyVeryLow: accuracy = @"+/- ? :-("; break;
case EILPositionAccuracyUnknown: accuracy = @"unknown"; break;
}
self.positionLabel.text = [NSString stringWithFormat:@"x: %.2f, y: %.2f, orientation: %3.2f\naccuracy: %@", position.x, position.y, position.orientation, accuracy];
[self.locationView updatePosition:position];
}
Regards,