Here i am trying to get multiple pushpins on bing maps, so i have an array of latitude & longitude and i am passing those values from array to bing maps lat&lon variable.
When i use those variables to place pushpins on map, i can't see pushpins on map. How can i solve this?
here is what i have done
Code:
function showLoc()
{
map = new Microsoft.Maps.Map(document.getElementById('myMap'), {credentials: bkey});
map.setView({ zoom: 12, center: new Microsoft.Maps.Location(lat,lon) })
map.entities.clear();
var pushpin= new Microsoft.Maps.Pushpin(map.getCenter(), null);
map.entities.push(pushpin);
var index;
var latlon = ["12.978955,77.574838", "12.981472,77.619214", "12.980332,77.617265", "13.011561,77.606354", "12.975496,77.556826", "12.97518,77.570991", "12.971599,77.594563", "12.985405,77.525386"];
for (index = 0; index < latlon.length; index++) {
var laton = latlon[index];
pushpin.setLocation(new Microsoft.Maps.Location(laton));
}
}