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

The following examples show how to use com.google.android.gms.maps.model.IndoorBuilding. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IndoorDemoActivity.java    From android-samples with Apache License 2.0 6 votes vote down vote up
/**
 * Called when the focused building info is clicked.
 */
public void onFocusedBuildingInfo(View view) {
    IndoorBuilding building = map.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");
    }
}
 
Example #2
Source File: IndoorDemoActivity.java    From android-samples with Apache License 2.0 6 votes vote down vote up
/**
 * Called when the activate higher level is clicked.
 */
public void onHigherLevel(View view) {
    IndoorBuilding building = map.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("Activating level " + level.getName());
            level.activate();
        } else {
            setText("No levels in building");
        }
    } else {
        setText("No visible building");
    }
}
 
Example #3
Source File: IndoorDemoActivity.java    From android-samples with Apache License 2.0 5 votes vote down vote up
/**
 * Called when the focused level info is clicked.
 */
public void onVisibleLevelInfo(View view) {
    IndoorBuilding building = map.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");
    }
}
 
Example #4
Source File: MapFragment.java    From AndroidDemoProjects with Apache License 2.0 3 votes vote down vote up
@Override
public void onIndoorLevelActivated(IndoorBuilding indoorBuilding) {
    if( indoorBuilding == null )
        return;


}