Reputation: 500
At initialization
var mapOptions = {
zoom: 6,
center: new google.maps.LatLng(30.3753, 69.3451),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
$scope.map = new google.maps.Map(document.getElementById('map'), mapOptions);
At search
$scope.map.zoom = 10;
currently I use this code but its not working, at initialization of google map zoom=6 that is working properly but when I want to change on search it is not working.
Upvotes: 0
Views: 348
Reputation: 1
var mapOptions = { zoom: level, center: new google.maps.LatLng(30.3753, 69.3451), mapTypeId: google.maps.MapTypeId.ROADMAP } $scope.map = new google.maps.Map(document.getElementById('map'), mapOptions);
On Search, set level to some value. $Scope.level = 10
Upvotes: 0
Reputation: 921
use setZoom()..
at Search Make it $scope.map.setZoom(10)... I Hope It works
Upvotes: 1