ESTIndoorLocationView properties not applied on view

So I am able to draw the room map from the json file with

self.locationView.drawLocation(location) 

and then I do

indoorLocationManager.startIndoorLocation(location) 

after that I try to apply some properties like below:

if self.locationView.locationDrawn {
        
        //some setup
    
        self.locationView.showWallLengthLabels = true
        self.locationView.showBeaconOrientation = true
        self.locationView.positionView = self.positionView
        self.locationView.showTrace = true
        self.locationView.rotateOnPositionUpdate = true
        
    }

nothing changes on the map. What could be the problem here? Also is setting showTrace to true the way to go if I want to show the users current location on the map? Thanks for any help. I also tried setting these properties before the map is drawn, still nothing changed. The view displays the room borders only and the beacons.

Here is how I coded mine. Let me know if that works for you.

-(void)viewWillAppear:(BOOL)animated
{
    self.locationView.backgroundColor = [UIColor clearColor];    
    self.locationView.showTrace               = YES;
    self.locationView.rotateOnPositionUpdate  = NO;
    self.locationView.showWallLengthLabels    = YES;
    self.locationView.locationBorderColor     = [UIColor blackColor];
    self.locationView.locationBorderThickness = 6;
    self.locationView.doorColor               = [UIColor brownColor];
    self.locationView.doorThickness           = 5;
    self.locationView.traceColor              = [UIColor yellowColor];
    self.locationView.traceThickness          = 2;
    self.locationView.wallLengthLabelsColor   = [UIColor blackColor];
    
    [self.locationView drawLocation:self.location];  
    [self.manager startIndoorLocation:self.location];
}

Also in Swift:

override func viewWillAppear(animated: Bool) {
    myLocationView.backgroundColor = UIColor.clearColor()
    myLocationView.showTrace = true
    myLocationView.showWallLengthLabels = true
    myLocationView.rotateOnPositionUpdate = false
    myLocationView.locationBorderColor = UIColor.blackColor()
    myLocationView.locationBorderThickness = 6
    myLocationView.doorColor = UIColor.brownColor()
    myLocationView.doorThickness = 5
    myLocationView.traceColor = UIColor.yellowColor()
    myLocationView.traceThickness = 2
    myLocationView.wallLengthLabelsColor = UIColor.blackColor()
    
    myLocationView.drawLocation(location)
    manager.startIndoorLocation(location)
}
3 Likes

@phillydev716 is right as location will be drawn in the next UI thread cycle, not right after drawLocation method invocation.

1 Like

Thanks guys. I just still have a problem. I get all the changes now except show trace. Since there is no real documentation on indoor api other than what I can open by myself in xcode I wanted to is the show trace supposed to show the users current location in the room or something else?

In short: how am I supposed to use to show the location?

This is my current code inside of viewWillAppear

var indoorLocationManager : ESTIndoorLocationManager = ESTIndoorLocationManager()
    indoorLocationManager.delegate = self
    
    let appDelegate = UIApplication.sharedApplication().delegate as AppDelegate
    let locations = appDelegate.locations
    
    println("map view loaded")
    var location = ESTLocationBuilder.parseFromJSON(locations[0]?.location_string)
    println(location.creationDate)
    
   self.locationView.backgroundColor = UIColor.clearColor()
    self.locationView.showWallLengthLabels = true
    self.locationView.rotateOnPositionUpdate = true
    self.locationView.locationBorderColor = UIColor.blackColor()
    self.locationView.locationBorderThickness = 6
    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.showTrace = true
    
    self.locationView.drawLocation(location)
    indoorLocationManager.startIndoorLocation(location)

It shows all the colors and thicknesses and all that styling but not the user location.

Are you asking how the user will visually see where they are on the locationView?

If so, there is a default icon that will appear for the user. The trace will follow behind that icon so the user can will where they have been.

If you would like to access the default icon and change it try this:

self.locationView.positionImage = [UIImage imageNamed:@“philly.png”];

So the icon showing the position of the user should be visible by default? Because it is not when I run it with the code above. I have been trying to play with the positionImage and positionView and setting them but nothing worked to let me see the users location. I will be happy to provide any more data so we could debug this together.

Could it be that I am missing some permissions?

UPDATE: I have tried setting the positionImage to my custom image but it does not work. Basically I can’t get the user location to show. I have checked my CLLocationManager.authorizationStatus() and it always returns authorized and CLLocationManager.locationServicesEnabled() returns true.

I also have NSLocationAlwaysUsageDescription in my Info.plist file. I can’t figure out why the user location wont show by default… :/. Any ideas guys?

Just brainstorming. Have you gone into setting and under your app does it say location always checked?

If you want we can get on google hangouts and I can take a look

Were you ever able to figure out what the problem was for you in regards to the position not showing. I am having the exact same problem. Initially, this worked for me in a very simple app I did, but now that I have it integrated into a more complex view, for some reason I am unable to get the location to show. Everything else is working as expected.