6
A
回答
8
您可以使用EntityCollection添加几个引脚在同一时间。
实施例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=de-de" type="text/javascript" charset="UTF-8"></script>
</head>
<body onload="init()">
<div id="map" style="position: relative; width: 800px; height: 300px;"></div>
<script type="text/javascript">
function init(){
// Initialize the map
var map = new Microsoft.Maps.Map(
document.getElementById("map"),
{
credentials: "YOUR-BING-KEY",
mapTypeId: Microsoft.Maps.MapTypeId.road
}
);
// Creates a collection to store multiple pins
var pins = new Microsoft.Maps.EntityCollection();
// Creates 5 random pins
for (var i = 0; i < 5; i++){
// A random position
var position = new Microsoft.Maps.Location(Math.random() * 45, Math.random() * 90);
// Creates a Pushpin
var pin = new Microsoft.Maps.Pushpin(position);
// Adds the pin to the collection instead of adding it directly to the Map
pins.push(pin);
}
// Adds all pins at once
map.entities.push(pins);
}
</script>
</body>
</html>
另外,此处另一个example using JSON and jQuery。
相关问题
- 1. 将多个图标添加到Bing地图API的图钉v8
- 2. 将多个图钉添加到bing地图
- 3. 在Bing地图中添加图钉
- 4. 电话7必应地图控制 - 在点击时添加图钉
- 5. 必应地图悬停航点图钉图标
- 6. 必应地图Ajax 7.0图钉文本不显示
- 7. 必应地图图钉处理gridview复选框
- 8. 在ASP.net中添加图钉到bing地图视图MVC3
- 9. 如何使用jQuery和JSON添加图钉到谷歌地图
- 10. Silverlight - 通过C#将图钉添加到Bing地图
- 11. WP7必应地图插图 - 如何调整自定义图钉的位置?
- 12. 嵌入bing地图 - 图钉
- 13. iphone地图图钉替代
- 14. 如何在离线地图图块中放置多个图钉,并且还可以获得更多图钉?
- 15. 在Bing地图上显示多个图钉WPF
- 16. 如何在冰箭地图上显示多个图钉
- 17. Bing地图中信息框的多个图钉
- 18. MapView在触摸时添加图钉
- 19. 在MapControl中添加图钉Tap事件
- 20. 在地图视图中放置图钉
- 21. 必应地图图层
- 22. 有可选图钉的Android地图
- 23. Silverlight - Bing地图控件 - 图钉集群
- 24. 的AddHandler用于Bing地图图钉
- 25. Bing地图图钉和信息框
- 26. 用Bing地图突出显示图钉
- 27. 谷歌地图图钉错误
- 28. WP7在地图上拖动图钉
- 29. 地图图钉点击事件
- 30. 必应地图v7模块未加载