BingMap - getting prototype of null error

后端 未结 4 467
无人共我
无人共我 2021-01-15 14:24

I have searched google and stackoverflow, but could not find a solution for this issue. I am loading the map like this, in my vi

4条回答
  •  清歌不尽
    2021-01-15 15:13

    It seems you are generating a static map only in your view, in that case the loading of Bing Maps API (http://www.bing.com/api/maps/mapcontrol) and initializing map control (GetMap function) could be omitted.

    The reason why you are getting the error:

    TypeError: Cannot read property 'prototype' of null

    is most likely due to missing map container declaration in your view

    Example

    var app = angular.module("myApp", []);
    app.controller("bingMapsCtrl", function ($scope) {
     
        $scope.Key = "As1l7HRtrpkXzjXozp3M2ufUTDvj16b2MHlpscQmHJEtxYFZWqwyccSx7I5XXEW_";
    
    });
     
    

提交回复
热议问题