VEMap.GetCenter メソッド

現在のマップ ビューの中心点を表す VELatLong クラス オブジェクトを返します。

構文

VEMap.GetCenter();

戻り値

VELatLong クラス オブジェクトです。

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
<script>
var map = null;
var pinID = 1;
         
function GetMap()
         {
map = new VEMap('myMap');
map.LoadMap();
         }   
         
function AddPin()
         {  
    var center = map.GetCenter();
var pin = map.AddPushpin(center);
            pin.SetTitle('これはタイトル テキストです');
            pin.SetDescription('これは説明のテキストです。');
         }   
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<a href="#" onclick="AddPin();">マップの中央にプッシュピンを追加</a>
</body>
</html>