Angularjs 没有定义谷歌的用户界面地图
正如标题所说,当我尝试使用ui映射模块时,我收到了该错误。 我试着用这个样品 在我的pc上,我也添加了依赖项ui映射和ui事件,但当我启动应用程序时,控制台日志显示google没有定义,更准确地说是在代码的第五行 这是我的密码Angularjs 没有定义谷歌的用户界面地图,angularjs,google-maps,angular-ui,Angularjs,Google Maps,Angular Ui,正如标题所说,当我尝试使用ui映射模块时,我收到了该错误。 我试着用这个样品 在我的pc上,我也添加了依赖项ui映射和ui事件,但当我启动应用程序时,控制台日志显示google没有定义,更准确地说是在代码的第五行 这是我的密码 我发现了两个相似主题的问题,我解决了以下问题: //Add the requried module 'angular-ui' as a dependency angular.module('maptesting', ['ui.event','ui.map','ui.di
我发现了两个相似主题的问题,我解决了以下问题:
//Add the requried module 'angular-ui' as a dependency
angular.module('maptesting', ['ui.event','ui.map','ui.directives']);
function MapCtrl($scope) {
var ll = new google.maps.LatLng(13.0810, 80.2740);
$scope.mapOptions = {
center: ll,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
//Markers should be added after map is loaded
$scope.onMapIdle = function() {
if ($scope.myMarkers === undefined){
var marker = new google.maps.Marker({
map: $scope.myMap,
position: ll
});
$scope.myMarkers = [marker, ];
}
};
$scope.showMarkerInfo = function(marker) {
$scope.myInfoWindow.open($scope.myMap, marker);
};