VEMap.GetPitch メソッド

3D モードにおいて、現在のマップ ビューの傾斜を表す double を返します。

構文

VEMap.GetPitch();

戻り値

傾斜を表す double です。0 は水平、-90 は真下を表します。

解説

VEMap.GetAltitude メソッドVEMap.GetHeading メソッドおよび GetPitch メソッドは、マップ モード (VEMapMode 列挙体) が Mode3D に設定され、現在のマップ ビューが完全に読み込まれている場合にのみ値を返します。マップ ビューが完全に読み込まれているかどうかを確認するには、VEMap.onendpan イベントを使用します。

<!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');

// onLoadMap の設定は LoadMap を呼び出す前に行う必要があります。
map.onLoadMap = get3DSettings;
map.LoadMap(null, null, null, null, VEMapMode.Mode3D);

map.AttachEvent("onclick", get3DSettings);
map.AttachEvent("onendpan", get3DSettings);
map.AttachEvent("onendzoom", get3DSettings);
map.AttachEvent("oninitmode", get3DSettings);
         }
         
function get3DSettings()
         {
var altitude = map.GetAltitude();
var heading = map.GetHeading();
var pitch = map.GetPitch();
var info = "高度:" + altitude + "<br/>";
info += "方角:" + heading + "<br/>";
info += "傾斜:" + pitch;
infoDiv.innerHTML = info;
         }
</script>
</head>
<body onload="GetMap();" style="font-family:MS PGothic">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<div id="infoDiv"></div>
</body>
</html>