Closed facuferrari closed 11 years ago
When I try to place markers it returns me Cannot read property latLng of undefined.
<div ui-map="myMap" ui-options="mapOptions" ui-event="{ 'map-click' : 'addMarker($params)'}" class="map-canvas">
<div ng-repeat="marker in myMarkers" ui-map-marker="myMarkers[$index]" ui-event="{'map-click': 'markerClicked(marker)'}"> </div>
//Module angular.module('Maptesting', ['ui.map', 'ui.event']) .controller('CtrlGMap', ['$scope', function($scope) {
$scope.mapOptions = { center: new google.maps.LatLng(-54.798112, -68.303375), zoom: 11, mapTypeId: google.maps.MapTypeId.SATELLITE }; $scope.myMarkers = []; $scope.addMarker = function ($event, $params) { $scope.myMarkers.push(new google.maps.Markers({ map: $scope.myMap, position: $params.latLng })); }; $scope.markerClicked = function(m) { window.alert("clicked"); }; }]);
Don't know what I've did but I've installed with bower and know it works perfectly. :)
When I try to place markers it returns me Cannot read property latLng of undefined.
<div ui-map="myMap" ui-options="mapOptions" ui-event="{ 'map-click' : 'addMarker($params)'}" class="map-canvas">
//Module angular.module('Maptesting', ['ui.map', 'ui.event']) .controller('CtrlGMap', ['$scope', function($scope) {