function displayMapAndClick ()
{
var latlng = new google.maps.LatLng (29.0167, 77.3833);
var myOptions =
{
zoom:zm,
center:latlng,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map (document.getElementById ("map"), myOptions);
directionsDisplay.setMap (map);
}
Where zm is a global variable set to default 7.
Now, I wish to change the zoom level of this map thorough this program.
What is the way to do that without re-initializing the map, or is re-initializing the map compulsory?
Use the
setZoom()method from thegoogle.maps.Mapclass.