VEMap.IsBirdseyeAvailable メソッド

現在のマップ ビューで概観図のマップ スタイルを利用できるかどうかを識別します。

構文

VEMap.IsBirdseyeAvailable();

戻り値

マップ モードが 3D に設定されている場合は false を返します (VEMap.GetMapMode メソッド2 を返します)。概観図が利用可能でズーム レベルが 11 以上の場合は true を返します。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1"></script>

<script type="text/javascript">
var map = null;

function GetMap()
         {
map = new VEMap('myMap');
         
map.LoadMap(new VELatLong(47.62165, -122.3492), 18);

// 概観シーンを利用できるようになったときにそのことを検出します。
map.AttachEvent("onobliqueenter", OnObliqueEnterHandler);
         }

function OnObliqueEnterHandler()
         {
if (map.IsBirdseyeAvailable())
            {
map.SetMapStyle(VEMapStyle.Birdseye);

// マップ スタイルの再設定を繰り返さないようにします。
map.DetachEvent("onobliqueenter", OnObliqueEnterHandler);
            }
         }
            
function GetInfo()
         {
var info = "";

if (map.IsBirdseyeAvailable())
            {
var be = map.GetBirdseyeScene();

// マップの中央に関するピクセル情報を取得します。
var pixel = be.LatLongToPixel(map.GetCenter(), map.GetZoomLevel());

info += "マップの中央のピクセル座標:(" + pixel.x + ", " + pixel.y + ")\n\n";

var rect = be.GetBoundingRectangle();

// 境界矩形のプロパティ値をユーザーに表示します。
info += "左上隅: (" + 
rect.TopLeftLatLong.Latitude + 
                       ", " +
rect.TopLeftLatLong.Longitude +
")\n";
               
if(map.GetMapMode() == VEMapMode.Mode3D)
               {
info += "右上隅: (" + 
rect.TopRightLatLong.Latitude + 
                          ", " +
rect.TopRightLatLong.Longitude +
")\n";
               }

info += "右下隅: (" + 
rect.BottomRightLatLong.Latitude + 
                       ", " +
rect.BottomRightLatLong.Longitude +
")\n";
                       
if(map.GetMapMode() == VEMapMode.Mode3D)
               {
info += "左下隅: (" + 
rect.BottomLeftLatLong.Latitude + 
                          ", " +
rect.BottomLeftLatLong.Longitude +
")\n";
               }

alert(info);
            }
else
            {
alert("概観図は利用できません");
            }
         }
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:600px; height:400px;"></div>
<input id="getinfo" type="button" value="現在のシーンに関する情報を表示する" name="getinfo" 
onclick="GetInfo();">
</body>
</html>

関連項目

参照

VEMap.SetZoomLevel メソッド