本文整理汇总了Java中com.google.android.gms.maps.model.IndoorBuilding类的典型用法代码示例。如果您正苦于以下问题:Java IndoorBuilding类的具体用法?Java IndoorBuilding怎么用?Java IndoorBuilding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IndoorBuilding类属于com.google.android.gms.maps.model包,在下文中一共展示了IndoorBuilding类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onIndoorBuildingFocused
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
@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);
}
示例2: 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;
}
示例3: onIndoorBuildingFocused
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
@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;
enableMapElements();
}
if (building != null && mMosconeBuilding.equals(building)) {
// Map is focused on Moscone Center
mAtMoscone = true;
onFocusMoscone();
} else if(mAtMoscone){
// Map is no longer focused on Moscone Center
mAtMoscone = false;
onDefocusMoscone();
}
}
示例4: 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");
}
}
示例5: 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");
}
}
示例6: getFocusedBuilding
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
@SuppressWarnings("unused")
private void getFocusedBuilding(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
IndoorBuilding focusedBuilding = map.getFocusedBuilding();
if (focusedBuilding != null) {
JSONObject result = PluginUtil.convertIndoorBuildingToJson(focusedBuilding);
callbackContext.success(result);
} else {
callbackContext.success(-1);
}
}
示例7: onIndoorLevelActivated
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
@Override
public void onIndoorLevelActivated(IndoorBuilding building) {
String jsonStr = "null";
JSONObject result = PluginUtil.convertIndoorBuildingToJson(building);
if (result != null) {
jsonStr = result.toString();
}
webView.loadUrl("javascript:plugin.google.maps.Map._onMapEvent('indoor_level_activated', " + jsonStr + ")");
}
示例8: onIndoorLevelActivated
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
@Override
public void onIndoorLevelActivated(IndoorBuilding indoorBuilding) {
if (indoorBuilding.equals(mMosconeBuilding)) {
// Show map elements for this floor if at Moscone
showFloorElementsIndex(indoorBuilding.getActiveLevelIndex());
}
}
示例9: onVisibleLevelInfo
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
/**
* Called when the focused level info is clicked.
*/
public void onVisibleLevelInfo(View view) {
IndoorBuilding building = mMap.getFocusedBuilding();
if (building != null) {
IndoorLevel level = (IndoorLevel) building.getLevels().get(building.getActiveLevelIndex());
if (level != null) {
setText(level.getName());
} else {
setText("No visible level");
}
} else {
setText("No visible building");
}
}
示例10: onIndoorLevelActivated
import com.google.android.gms.maps.model.IndoorBuilding; //导入依赖的package包/类
@Override
public void onIndoorLevelActivated(IndoorBuilding indoorBuilding) {
if (indoorBuilding != null && indoorBuilding.equals(mMosconeBuilding)) {
onMosconeFloorActivated(indoorBuilding.getActiveLevelIndex());
}
}