Update bounds in Angular-Google-Maps

77 views Asked by At

I am trying to use the bounds of the map to limit which markers are refreshed. However, the bounds never update in $scope or a variable after the map is clicked and dragged. I have done a lot of Googling but wasn't able to find anything about this for angular-google-maps (not google map api v3). Does anyone know how to update bounds in angular-google-maps?

This is the most recent attempt:

$scope.$watch('maps.bounds.northeast', function(newValue, oldValue) { 
    if (newValue !== oldValue) { 
        $scope.map.bounds.northeast = map.bounds.northeast;
        $scope.$apply();
    }
});

When I do this, the map does not show up. When I try just checking newValue and oldValue and having an alert box popup if they are different, it pops up when the pages loads but that's it.

0

There are 0 answers