com.google.android.gms.maps.model.IndoorBuilding

Here are the examples of the java api class com.google.android.gms.maps.model.IndoorBuilding taken from open source projects.

1. IndoorDemoActivity#onFocusedBuildingInfo()

View license
/**
     * Called when the focused building info is clicked.
     */
public void onFocusedBuildingInfo(View view) {
    IndoorBuilding building = mMap.getFocusedBuilding();
    if (building != null) {
        StringBuilder s = new StringBuilder();
        for (IndoorLevel level : building.getLevels()) {
            s.append(level.getName()).append(" ");
        }
        if (building.isUnderground()) {
            s.append("is underground");
        }
        setText(s.toString());
    } else {
        setText("No visible building");
    }
}

2. IndoorDemoActivity#onVisibleLevelInfo()

View license
/**
     * Called when the focused level info is clicked.
     */
public void onVisibleLevelInfo(View view) {
    IndoorBuilding building = mMap.getFocusedBuilding();
    if (building != null) {
        IndoorLevel level = building.getLevels().get(building.getActiveLevelIndex());
        if (level != null) {
            setText(level.getName());
        } else {
            setText("No visible level");
        }
    } else {
        setText("No visible building");
    }
}

3. IndoorDemoActivity#onHigherLevel()

View license
/**
     * Called when the activate higher level is clicked.
     */
public void onHigherLevel(View view) {
    IndoorBuilding building = mMap.getFocusedBuilding();
    if (building != null) {
        List<IndoorLevel> levels = building.getLevels();
        if (!levels.isEmpty()) {
            int currentLevel = building.getActiveLevelIndex();
            // The levels are in 'display order' from top to bottom,
            // i.e. higher levels in the building are lower numbered in the array.
            int newLevel = currentLevel - 1;
            if (newLevel == -1) {
                newLevel = levels.size() - 1;
            }
            IndoorLevel level = levels.get(newLevel);
            setText("Activiating level " + level.getName());
            level.activate();
        } else {
            setText("No levels in building");
        }
    } else {
        setText("No visible building");
    }
}

4. MapFragment#onIndoorBuildingFocused()

Project: iosched
Source File: MapFragment.java
View license
@Override
public void onIndoorBuildingFocused() {
    IndoorBuilding building = mMap.getFocusedBuilding();
    if (building != null && mMosconeBuilding == null && mMap.getProjection().getVisibleRegion().latLngBounds.contains(MOSCONE)) {
        // Store the first active building. This will always be Moscone
        mMosconeBuilding = building;
    }
    if (!mAtMoscone && building != null && building.equals(mMosconeBuilding)) {
        // Map is focused on Moscone Center
        mAtMoscone = true;
        onFocusMoscone();
    } else if (mAtMoscone && mMosconeBuilding != null && !mMosconeBuilding.equals(building)) {
        // Map is no longer focused on Moscone Center
        mAtMoscone = false;
        onDefocusMoscone();
    }
    onIndoorLevelActivated(building);
}