I'm currently facing an issue with the Google Maps API event listener for on click events. It seems that the variable scope is not working as expected.
google.maps.event.addListener(map, 'click', function (event) {
$scope.closeBox();
});
$scope.closeBox = function () {
$scope.showBox = false;
}
When I have $scope.showBox = true and then click on the map, the box does not close. This variable controls an ng-class that toggles the visibility of the information box.