Hinaba Zala
Hinaba Zala

Reputation: 61

AngularJS - Grey area in Google maps, resize map doesn't work

Sometimes Map displayed partially gray. google.maps.event.trigger($scope.map, "resize"); doesn't work.

Upvotes: 0

Views: 366

Answers (1)

Hinaba Zala
Hinaba Zala

Reputation: 61

Finally, resolved this issue by resizing map when it gets initialized. Here is my code.

$scope.$on('mapInitialized', function (event, map)
{   
     $timeout(function() {
        google.maps.event.trigger(map, 'resize');
        map.setCenter(newgoogle.maps.LatLng('your latitude','your longitude'));
     }, 100);
});

Upvotes: 1

Related Questions