Hello,
I am trying to add locations of printers, restrooms, etc. I see this code:
let coffeeMachine = EILPoint(x: 3.1, y: 7.2)
if position.distanceToPoint(coffeeMachine) < 5 {
// start brewing coffee
}
I want to map this graphically on the existing map. Any suggestions ?
You can use the drawObjectInForeground:withPosition:identifier:
method of the EILIndoorLocationView for that. (There’s also a drawObjectInBackground
counterpart; foreground = it’ll cover the avatar, background = it’ll go “under” the avatar.)
It takes a UIView element or any subclass of it—could be a label for example, or a UIImageView.
There’s also a bunch of other related methods: e.g., moveObjectWithIdentifier:toPosition:animated:
to move the graphic, or removeObjectWithIdentifier:
to remove it from the map.
For an example project that shows how to incorporate EILIndoorLocationView into your app, check this: https://github.com/Estimote/iOS-Indoor-SDK/tree/master/Examples/IndoorMap
This is what I am working with. I can see the label now. But I have a run time error “terminating with uncaught exception of type NSException”. Any help appreciated !
let label1 = UILabel.init(frame: CGRectMake(0, 0, 150, 40))
let point = EILOrientedPoint(x:10.94, y:6.8, orientation:0)
label1.text = "printer"
self.locationView.drawObjectInBackground(label1, withPosition: point, identifier:"printer")