none
'Microsoft' is undefined while loading Bing maps... RRS feed

  • Question

  • I am facing error message : 'Microsoft' is undefined in mapping.js file loaded by bing.

    Below is the specific line :

     map = new Microsoft.Maps.Map(document.getElementById("map"), mapSpec);

    This works fine on IE9 though but not on IE8.

    My questions are:

    1. Does Bing maps work with specific IE versions? {In my case its working good with IE9}

    2. If YES, how do we get it working on IE8 or other versions too? 

    3. Do we need to install any specific ActiveX or do some settings?


    • Edited by Sachin Bijwe Wednesday, November 7, 2012 6:22 PM
    Wednesday, November 7, 2012 6:20 PM

Answers

  • I've tested using IE7, 8 9, 10 and it worked fine. As Alastair mentioned this sounds like a timing issue where your application is trying to load the map before the map control has finished loading. One idea you could use to get around this issue is check to see if "Microsoft" is undefined before loading the map. If it is then set a timeout to call the map load functionality again after a short period of time. This would then do the check again and if not loaded do another timeout until the Microsoft namespace is loaded.

    http://rbrundritt.wordpress.com

    Friday, November 9, 2012 10:01 AM

All replies

  • Sounds like a timing issue, with you trying to reference the Microsoft "namespace" before it's been properly loaded.

    Please give the URL of your page so that we can help investigate


    twitter: @alastaira blog: http://alastaira.wordpress.com/ | Pro Spatial with SQL Server 2012

    Wednesday, November 7, 2012 7:16 PM
    Moderator
  • Thanks for your attention...

    I am trying with URL: //storelocator.sprint.com/locator/

     This works great on my machine but not on my clients machine.

    It may work at your end too...

    Wednesday, November 7, 2012 9:52 PM
  • I've tested using IE7, 8 9, 10 and it worked fine. As Alastair mentioned this sounds like a timing issue where your application is trying to load the map before the map control has finished loading. One idea you could use to get around this issue is check to see if "Microsoft" is undefined before loading the map. If it is then set a timeout to call the map load functionality again after a short period of time. This would then do the check again and if not loaded do another timeout until the Microsoft namespace is loaded.

    http://rbrundritt.wordpress.com

    Friday, November 9, 2012 10:01 AM