Google Maps Increase and Decrease Zoom


Prev Tutorial Next Tutorial

How to Google Maps Increase and Decrease Zoom

To increase or decrease the zoom value of google maps you need to modifying the value of the zoom attribute in the the map options.

Syntax

	
var mapOptions = {
   zoom:required zoom value
};

Example : Zoom 8

	
<!DOCTYPE html>
<html>
<head>
<script
src="http://maps.googleapis.com/maps/api/js">
</script>

<script>
function initialize()
{
  var mapProp = {
    center: new google.maps.LatLng(51.508742,-0.120850),
    zoom:8,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>

<body>
<div id="googleMap" style="width:600px;height:300px;"></div>
<br>

Output


Prev Tutorial Next Tutorial




Download Projects

Advertisements