Uncaught TypeError: Cannot read property 'credentials' of undefined RRS feed

  • Question

  • Hi,

    I am having problem making the example work. The code is below. I have removed the KEY to this post. But i have tried with two keys and the same results. It fails in both Chrome and IE. 

    <!DOCTYPE html>
    <meta charset="utf-8" />
    <!-- Reference to the Bing Maps SDK -->
    <script type='text/javascript'
    async defer></script>
    <script type='text/javascript'>
    function GetMap()
    var map = new Microsoft.Maps.Map('#myMap');
    //Add your post map load code here.
    <div id="myMap" style="width:600px;height:400px;"></div>

    The error is

    Uncaught TypeError: Cannot read property 'credentials' of undefined. 



    Wednesday, November 28, 2018 6:00 PM

All replies

  • I'm getting the same error. Looks like a recent issue.
    Wednesday, November 28, 2018 6:07 PM
  • Hi Folks,

    If you have a space in front of your key the call will fail.  Can you confirm that the key has no leading spaces?  If you email MapLic@Microsoft.com they should be able to look at your account with you and see if there are any issues with your key or account.



    Thursday, November 29, 2018 7:04 PM
  • for some silly reason, the Map needs to have second parameter with map settings even if it is an  empty object...

    var map = new Microsoft.Maps.Map('#myMap', {});
    worked in my case
    Thursday, December 6, 2018 12:12 PM
  • Worked for me too, it's crazy the official document doesn't say it. Thanks.
    Friday, April 12, 2019 12:13 PM
  • Hello Everyone,

    The team pushed out a fix for this last week so it should be live.  the second parameter should not be required.



    Tuesday, April 23, 2019 5:20 AM