VEMap.ShowTrafficLegend メソッド

交通情報の凡例を表示します。

構文

VEMap.ShowTrafficLegend(x, y)

パラメータ

パラメータ 説明

x

凡例の左上隅の x 座標です (任意指定)。

y

凡例の左上隅の y 座標です (任意指定)。

解説

x および y が指定されていない場合、凡例は著作権表示の右下に表示されます。凡例が既に表示されている場合、このメソッドは、指定された座標にその凡例を移動します (x および y が指定されていない場合は右下に移動します)。

<!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;
var Location = new VELatLong(47.64, -122.23);

function GetMap()
         {
map = new VEMap('myMap');
map.LoadMap(Location, 9);
         }

function ShowTraffic()
         {
map.LoadTraffic(true);
map.ShowTrafficLegend(50,50);
map.SetTrafficLegendText("交通情報の凡例");
         }

function ClearTraffic()
         {
map.ClearTraffic();
         }
</script>
</head>
<body onload="GetMap();" style="font-family:MS PGothic">
<h3>交通情報</h3>
<p> </p>
<div id='myMap' style="position:relative; width:600px; height:400px;"></div>
<input id="showtraffic"  type="button" value="交通情報の表示"  onclick="ShowTraffic();"/>
<input id="cleartraffic" type="button" value="交通情報の消去" onclick="ClearTraffic();"/>
</body>
</html>

関連項目

参照

VEMap.HideTrafficLegend メソッド
VEMap.SetTrafficLegendText メソッド