当前位置: 首页>>代码示例>>Java>>正文


Java IndoorBuilding.getLevels方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.model.IndoorBuilding.getLevels方法的典型用法代码示例。如果您正苦于以下问题:Java IndoorBuilding.getLevels方法的具体用法?Java IndoorBuilding.getLevels怎么用?Java IndoorBuilding.getLevels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.model.IndoorBuilding的用法示例。


在下文中一共展示了IndoorBuilding.getLevels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertIndoorBuildingToJson

import com.google.android.gms.maps.model.IndoorBuilding; //导入方法依赖的package包/类
public static JSONObject convertIndoorBuildingToJson(IndoorBuilding indoorBuilding) {
  if (indoorBuilding == null) {
    return null;
  }
  JSONObject result = new JSONObject();
  try {
    JSONArray levels = new JSONArray();
    for(IndoorLevel level : indoorBuilding.getLevels()){
      JSONObject levelInfo = new JSONObject();
        levelInfo.put("name",level.getName());
      
        // TODO Auto-generated catch block
      levelInfo.put("shortName",level.getShortName());
      levels.put(levelInfo);
    }
    result.put("activeLevelIndex",indoorBuilding.getActiveLevelIndex());
    result.put("defaultLevelIndex",indoorBuilding.getDefaultLevelIndex());
    result.put("levels",levels);
    result.put("underground",indoorBuilding.isUnderground());
  } catch (JSONException e) {
    e.printStackTrace();
    return null;
  }  
  return result;
}
 
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:26,代码来源:PluginUtil.java

示例2: onFocusedBuildingInfo

import com.google.android.gms.maps.model.IndoorBuilding; //导入方法依赖的package包/类
/**
 * Called when the focused building info is clicked.
 */
public void onFocusedBuildingInfo(View view) {
  IndoorBuilding building = mMap.getFocusedBuilding();
  if (building != null) {
    String s = "";
    for (IndoorLevel level : (List<IndoorLevel>) building.getLevels()) {
      s = s + level.getName() + " ";
    }
    if (building.isUnderground()) {
      s += "is underground";
    }
    setText(s);
  } else {
    setText("No visible building");
  }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:19,代码来源:IndoorDemoActivity.java

示例3: onHigherLevel

import com.google.android.gms.maps.model.IndoorBuilding; //导入方法依赖的package包/类
/**
 * 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");
  }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:26,代码来源:IndoorDemoActivity.java


注:本文中的com.google.android.gms.maps.model.IndoorBuilding.getLevels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。