I am scratching my head trying to figure out integrating bing map api to angularjs 1.6.4 . Can any one help..?.
Here is my html
https://www.bing.com/api/maps/mapcontrol?callback=loadMapScenario' async defer>
below code is inside Body tag.
my angular controller code is as follows
$scope.map = null;
function loadMapScenario() {
console.log('Load scenario called');
var map = new Microsoft.Maps.Map(document.getElementById('mapDiv'), {
credentials: 'Ao-Rs8NHwtlEI5piXQCcxMZrTfAt9zbg7a-8hB4PLAcc0eo5nZPN84aY16noJGKS',
center: new Microsoft.Maps.Location(41.264675, -96.041927),
zoom: 4
});
}
//$scope.map = null;
$scope.init = function () {
console.log('Map init');
$scope.map = new Microsoft.Maps.Map(document.getElementById('mapDiv'), {
credentials: 'api Key',
center: new Microsoft.Maps.Location(41.264675, -96.041927),
zoom: 4
});
};
angular.element(document).ready(function () {
$scope.init();
});
Issues:
I get following error
Uncaught ReferenceError: Microsoft is not defined
and
Uncaught TypeError: window[Microsoft.Maps.CallbackOnLoad] is not a function
Any idea what wrong in this code ?
Appreciate your help