我是棱角分明的新手,并试图在我的地图中添加标记。 我被卡住了。请考虑我的问题来纠正我的代码;连接。 我发现了很多关于它的教程和问题。有些是复杂的,休息不是我需要的。需要帮助。非常感谢
var appa = angular.module('appa',['firebase','uiGmapgoogle-maps']);
appa.controller('mainCtrl', function($firebaseObject,$scope) {
const rootRef = firebase.database().ref();
this.object = $firebaseObject(rootRef);
$scope.map =
{
center: {latitude: 51.219053, longitude: 4.404418 },
zoom: 14,
myTypeId: google.maps.MapTypeId.ROADMAP
};
$scope.markers = [];
var latLang = new google.maps.LatLng(51.2, 4.404);
var marker = new google.maps.Marker({
map : $scope.map,
position : latLang,
title : 'jhjhjh'
});
$scope.markers.push(marker);
});
<body ng-app="appa">
<div id="map_canvas" ng-controller="mainCtrl">
<ui-gmap-google-map center="map.center" zoom="map.zoom">
//sould I add marker here?? and how??
</ui-gmap-google-map>
//or somewhere here?
//sould I add marker here?? and how??
</div>
</body>