Heim > Fragen und Antworten > Hauptteil
angular.module('drApp', ['ng', 'ngRoute', 'ngAnimate'])
.controller('startCtrl', ['$scope',function ($scope) {
var map = new AMap.Map('container');
map.setZoom(16);
map.setCenter([116.397428, 39.90923]);
var marker = new AMap.Marker({
position: [116.397428, 39.90923],
map: map
});
}]);
错误提示:Uncaught ReferenceError: map is not defined
控制台打印出的map:
错误代买出处: