6
Ajax APIを使用してBingマップv7に複数のプッシュピンを追加する方法?Bing Map複数のプッシュピンを追加
彼らは、配列、リスト、JSONまたは他のどこからロードすることができました。..
は、誰かが小さな例を提供することができますか?ありがとう
Ajax APIを使用してBingマップv7に複数のプッシュピンを追加する方法?Bing Map複数のプッシュピンを追加
彼らは、配列、リスト、JSONまたは他のどこからロードすることができました。..
は、誰かが小さな例を提供することができますか?ありがとう
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。