BingMap - obtendo protótipo de erro nulo
Eu pesquisei no google estackoverflow
, mas não conseguiu encontrar umsolution
para esta questão. Estou carregando omap
assim, na minhaview
.
<img
ng-src='https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/
{{Latitude.__text}},{{Longitude.__text}}/12?mapSize=77,120&
key={{Key}}'></img>
Abaixo está como é carregado em index.html
<script type='text/javascript' src='https://www.bing.com/mapspreview/sdkrelease/mapcontrol?callback=loadMapScenario' async defer></script>
<script type='text/javascript' src='app/services/bing.js?' async defer></script>
Abaixo está o meucontroller
código, onde estou tentando chamar omaps
.
function GetMap() {
if (typeof Microsoft !== undefined && typeof Microsoft.Maps !== undefined &&
Microsoft.Maps.Map !== null) {
//Map API available add your map load code.
angular.element(document).ready(function() {
map = new Microsoft.Maps.Map(document.getElementById('myMapL'), {
credentials: Key,
mapTypeId: "r",
zoom: 4
});
});
} else {
setTimeout(GetMap(), 100);
}
}
Estou recebendo o erro abaixo:
TypeError: Cannot read property 'prototype' of null
at k (bing.js:11)
at h (bing.js:11)
at e (bing.js:11)
at t.l [as instance] (bing.js:11)
at h (bing.js:11)
at e (bing.js:11)
at t.l [as instance] (bing.js:11)
at new Microsoft.Maps.Map (bing.js:13)
at HTMLDocument.<anonymous> (file-location.js:121)
at j (jquery-1.11.0.min.js:2)