I dont find any way in the documentation how to change the floor level programmatically. For example:
I load a specific polygon for 1 room, and i want to change the floor map to the specific floor level (For example Zoom to Level 2, and then add my Polygon).
Polygon adding with Infoboxes are not the problem, ill just want to know if its possible to programmatically select the right floor level.
Like here:
I still know that there is the GMSIndoorDisplayDelegate - and i am able to set the active building. There should be an "activeLevel" method, but i am unable to assign any value.
I found the solution on how to force the floor change for a particular building.
GMSIndoorDisplayDelegate
to the class,Set the delegates:
mapView.delegate = self
mapView.indoorDisplay.delegate = self
Add the delegate methods:
func didChangeActiveBuilding(building: GMSIndoorBuilding!) {
if let currentBuilding = building {
var levels = currentBuilding.levels as! [GMSIndoorLevel]
mapView.indoorDisplay.activeLevel = levels[2] // set the level (key)
}
}
func didChangeActiveLevel(level: GMSIndoorLevel!) {
println("will be called after activeBuilding")
}
P.S. Just a friendly reminder, the upmost level is the first item in the array. It's backwards.