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模塊未加載