我有一个虚拟地球地图(Bing 地图??),其中添加了一组图钉。每个图钉标记为 1 到 n。除了向地图添加图钉外,我还向包含每个图钉描述的网页添加文本。
我想添加一个指向地图外文本的链接,单击该链接将打开与相应图钉关联的气球。
如何通过地图外部的链接打开与图钉关联的气球?
为了更好地理解,请查看我的地图:链接。当您单击加载时,PushPins 将添加到地图中。我想从地图右侧的列表中获得一个链接,打开相应的 PushPin。
提前致谢!
我有一个虚拟地球地图(Bing 地图??),其中添加了一组图钉。每个图钉标记为 1 到 n。除了向地图添加图钉外,我还向包含每个图钉描述的网页添加文本。
我想添加一个指向地图外文本的链接,单击该链接将打开与相应图钉关联的气球。
如何通过地图外部的链接打开与图钉关联的气球?
为了更好地理解,请查看我的地图:链接。当您单击加载时,PushPins 将添加到地图中。我想从地图右侧的列表中获得一个链接,打开相应的 PushPin。
提前致谢!
这是一个使用 Bing 地图向地图添加一些形状并在地图旁边的列表中显示每个形状的“标题”的简单示例。然后,当用户将鼠标悬停在列表中的每个项目上时,它将在地图上打开该形状的信息框。
<!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://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
<style type="text/css">
#ShapeList div
{
padding: 4px;
border: solid 1px black;
}
</style>
<script type="text/javascript">
var map = null;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
// Add some Shapes to the Map with item in list next to map
var latlong = map.GetCenter();
AddShape("Test Pushpin", latlong);
AddShape("Another Pushpin", new VELatLong(latlong.Latitude + 2, latlong.Longitude));
AddShape("Still Another Pushpin", new VELatLong(latlong.Latitude - 2, latlong.Longitude));
}
function AddShape(title, latlong) {
// Create Pushpin Shape
var s = new VEShape(VEShapeType.Pushpin, latlong);
s.SetTitle(title);
// Add Shape to Map
map.AddShape(s);
// Display Item in List Next to Map
var elem = document.createElement("div");
elem.innerHTML = title;
document.getElementById("ShapeList").appendChild(elem);
var shapeID = s.GetID();
elem.attachEvent("onmouseover", function() { ShowInfoBoxByShapeID(shapeID); });
elem.attachEvent("onmouseout", function() { map.HideInfoBox(); });
}
function ShowInfoBoxByShapeID(shapeID) {
var shape = map.GetShapeByID(shapeID);
map.ShowInfoBox(shape);
}
</script>
</head>
<body onload="GetMap();">
<div id="ShapeList" style="float: left">
</div>
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>
如何使用 Silverlight bing 地图在弹出窗口中显示信息?