Edgar Leite Edgar Leite - 2 months ago 42
Javascript Question

Bing Maps V8 - Uncaught ReferenceError: amd is not defined

Yesterday api was working. Today an error occurs:

Uncaught ReferenceError: amd is not defined

Can someone help me please?

<!DOCTYPE html>
<html>
<head>
<title>loadMapAsyncHTML</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>
<div id='printoutPanel'></div>

<div id='myMap' style='width: 100vw; height: 100vh;'></div>
<script type='text/javascript'>
var map;
function loadMapScenario() {
map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
credentials: 'Your Bing Maps Key'
});
}


</script>
<script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?branch=release&callback=loadMapScenario' async defer></script>
</body>



Answer

https://social.msdn.microsoft.com/Forums/en-US/31063241-34a2-4787-82ba-8e58bf1a2800/uncaught-referenceerror-amd-is-not-defined?forum=bingmaps

found a fix, add:

<script type="text/javascript">
        window.amd = function(){};
        window.amd.define = function(){};
    </script>
    <script type='text/javascript' src='//www.bing.com/api/maps/mapcontrol?branch=release'></script>