Types of Google Maps

Advertisements

Prev Tutorial Next Tutorial

Types of Google Maps

Here we discuss about types of Google Maps. Every map have its own features and uses. Google Maps provides four types of maps. They are.

  • Roadmap (normal, default 2D map)
  • Satellite (photographic map)
  • Hybrid (photographic map + roads and city names)
  • Terrain (map with mountains, rivers, etc.)

Create Roadmap Google Maps

Syntax

	
<!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>

</body>
</html>

Output

Create Satellite Google Maps

Syntax

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

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

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

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

</body>
</html>

Output

Create Hybrid Google Maps

Syntax

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

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

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

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

</body>
</html>

Output

Create Terrain Google Maps

Syntax

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

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

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

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

</body>
</html>

Output


Prev Tutorial Next Tutorial

Advertisements

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet


Download Projects

Google Advertisements


Buy Websites 9999595223

Buy Fresh and Payment Receive Media.net Account with Website. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements