I am using th newest version of the API (v7), and would like to add a pushpin on mouse-click ...
var mapSettings = {
'credentials': 'myCredentials',
'mapTypeId': Microsoft.Maps.MapTypeId.road,
'enableSearchLogo': false,
'showMapTypeSelector': false,
'showScalebar': false
};
var $map = $('#map');
var map = new Microsoft.Maps.Map($map.get(0), mapSettings);
Microsoft.Maps.Events.addHandler(map, 'click', function (e) {
var latitude = ?
var longitude = ?
var location = new Microsoft.Maps.Location(latitude, longitude);
var pushpin = new Microsoft.Maps.Pushpin(location, {
'draggable': true
});
map.entites.push(pushpin);
});
As you see, I am stuck within the click-handler: How do I get latitude & longitude of the click?