0

I have googled a lot but have failed to find answer to this problem, Problem: I am loading a Bing map as specified in this MSDN tutorial: Incorporating Map Functionality using Script]

Now map loads correctly but inside "onSilverlightLoadedHtml" js function, when I try to set its mode using following js statement, it gives me error: map.mode = "aerial"

Error that shows on firebug is following: uncaught exception: Object doesn't support this property or method

I have searched a lot but majority resources on Bing map Silverlight are in XAML or using some server side coding. But can anybody tell, how can I achieve my goal through javascript ?

Faisal Mq
  • 5,036
  • 4
  • 35
  • 39

1 Answers1

0

Well....I spoiled my whole day looking for some resolution to my mentioned question, but found nothing and now just after posting it on stackoverflow, I thought to give it an another try and yes....bingo....it worked this time. Here is the solution:

function onSilverlightLoadedHtml(plugIn, userContext, sender) {

var slCtl = document.getElementById(plugIn.id);

var mode = slCtl.Content.services.createObject("Microsoft.Maps.MapControl.AerialMode");

slCtl.Content.map.Mode = mode;

}

Faisal Mq
  • 5,036
  • 4
  • 35
  • 39