Ich versuche die neue Bing Maps v8 mit HeatMapLayer-Klasse. Die Dokumente beschreiben ein setLocation Verfahren, wie unten stehenden Link:Bing Maps v8 - heatMap.setLocation ist keine Funktion
https://msdn.microsoft.com/en-us/library/mt712811.aspx
ich ein Beispiel erstellt basierend auf Bing Maps Interactive SDK (http://www.bing.com/api/maps/sdk/mapcontrol/isdk#defaultHeatMap+JS).
Aber ein Fehler tritt auf, wenn ich mein Skript ausführen:
ERROR: heatMap.setLocation ist keine Funktion
Kann mir jemand helfen, bitte?
var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
credentials: 'Your Bing Maps Key',
center: new Microsoft.Maps.Location(39.393486, -98.100769),
zoom: 3
});
Microsoft.Maps.loadModule('Microsoft.Maps.HeatMap', function() {
// Creating sample Pushpin data within map view
var mapDiv = map.getRootElement();
var locations = [];
for (var i = 0; i < 1000; i++) {
locations.push(map.tryPixelToLocation(new Microsoft.Maps.Point(mapDiv.clientWidth * Math.random(), mapDiv.clientHeight * Math.random()), Microsoft.Maps.PixelReference.control));
}
var heatMap = new Microsoft.Maps.HeatMapLayer();
heatMap.setLocation(locations); // error line
map.layers.insert(heatMap);
});