Ok this might be a silly question but I've been using TypeScript declarations, for example the Bing Maps one (https://bingmapsts.codeplex.com/
) and I can't figure out how to hook to events.
On the Map class (in Microsoft.Maps.d.ts) there are a couple of events declared:
viewchange: () => any;
viewchangeend: () => any;
viewchangestart: () => any;
And I've tried hooking a function like the following inside a typescript file without success:
///<reference path="Bing/Microsoft.Maps.All.d.ts" />
window.onload = function()
var map = new Microsoft.Maps.Map(document.getElementById('map'),
click: () => alert('click'),
viewchangestart: () => alert('viewchangestart'),
Hopefully someone can tell me what I'm doing wrong here.