I need an event listener that fetches the changes on polygon in bing maps V8. I have googled enough and found literally nothing. I did it in Google like this;
google.maps.event.addListener(regionPolygon, 'click', function () {
var ang = regionPolygon.getPath();
google.maps.event.addListener(ang, 'set_at', function () {
var newPoints = [];
newPoints = regionPolygon.getPath().getArray();
var a = newPoints.length;
var x = regionPolygon.getPath();
var bounds = new google.maps.LatLngBounds();
var strx = "";
//var b = 0;
for (b = 0; b < a; b++) {
var i = b + 1;
strx = strx + newPoints[b].lat() + ',';
if (i != a)
{
strx = strx + newPoints[b].lng() + ',';
}
else if (i == a)
{
strx = strx + newPoints[b].lng();
}
}
isFinished = true;
updateRegion(regionName, strx);
setTimeout(function () { loadRegions(); },2500);
});}
i couldnt find out in bing map. By the way i set an editable polygon like this
var polygon = new Microsoft.Maps.Polygon(points, { strokeThickness: 1 });
Microsoft.Maps.loadModule('Microsoft.Maps.DrawingTools', function () {
//Create an instance of the DrawingTools class and bind it to the map.
var tools = new Microsoft.Maps.DrawingTools(_this.mapBings);
//Pass the polygon to the drawing tools to be edited.
tools.edit(polygon);
});
var bestView = Microsoft.Maps.LocationRect.fromLocations(points);
setTimeout((function () {
this.mapBings.setView({ bounds: bestView });
}).bind(_this), 10);
_this.polygonOverlay = polygon;
// _this.mapBings.entities.push(polygon);
Microsoft.Maps.Events.addHandler(polygon, 'click',
function ()
{
alert('hey')
});