Reputation: 126
How to close infowindow when clicking map or outside of the map...
Ex: google.maps.event.addListener(map, "click", function(event) {
infowindow.close();
});
how to implement this code in ng-map?
Upvotes: 1
Views: 1038
Reputation: 126
Finally found the solution my self for this..
$scope.$on("mapInitialized", function(evt, evtMap) {
$scope.map = evtMap;
google.maps.event.addListener($scope.map, 'click', function(event) {
$scope.map.hideInfoWindow('myInfoWindow', this);
});
});
Upvotes: 2