Angularjs 未捕获类型错误:对象[Object global]没有方法';onGoogleReady';使用角度用户界面';带Angular.js的s ui.maps
我正在尝试将库与Angular.js一起使用,并收到错误消息 " 未捕获的TypeError:对象[Object global]没有使用ui.maps和Angular.js的方法“onGoogleReady” “ 我理解我需要包括:Angularjs 未捕获类型错误:对象[Object global]没有方法';onGoogleReady';使用角度用户界面';带Angular.js的s ui.maps,angularjs,google-maps-api-3,angular-ui,Angularjs,Google Maps Api 3,Angular Ui,我正在尝试将库与Angular.js一起使用,并收到错误消息 " 未捕获的TypeError:对象[Object global]没有使用ui.maps和Angular.js的方法“onGoogleReady” “ 我理解我需要包括: function onGoogleReady() { angular.bootstrap(document.getElementById("map"), ['app.ui-map']); } 但在哪里,如何 function initCall() { co
function onGoogleReady() {
angular.bootstrap(document.getElementById("map"), ['app.ui-map']);
}
但在哪里,如何
function initCall() {
console.log("Google maps api initialized.");
angular.bootstrap(document.getElementById("map"), ['doc.ui-map']);
}
angular.module('doc.ui-map', ['ui.map', 'prettifyDirective'])
.controller('MapCtrl', ['$scope', function ($scope) {
$scope.myMarkers = [];
$scope.mapOptions = {
center: new google.maps.LatLng(35.784, -78.670),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
$scope.addMarker = function ($event, $params) {
$scope.myMarkers.push(new google.maps.Marker({
map: $scope.myMap,
position: $params[0].latLng
}));
};
$scope.setZoomMessage = function (zoom) {
$scope.zoomMessage = 'You just zoomed to ' + zoom + '!';
console.log(zoom, 'zoomed');
};
$scope.openMarkerInfo = function (marker) {
$scope.currentMarker = marker;
$scope.currentMarkerLat = marker.getPosition().lat();
$scope.currentMarkerLng = marker.getPosition().lng();
$scope.myInfoWindow.open($scope.myMap, marker);
};
$scope.setMarkerPosition = function (marker, lat, lng) {
marker.setPosition(new google.maps.LatLng(lat, lng));
};
}]) ;
来源:谢谢!实现其他功能的好例子!非常感谢你的朋友。