Google Maps Types







googletag.cmd.push(function() { googletag.display('div-gpt-ad-1422003450156-2'); });




Google Maps Types



❮ Previous
Next ❯



A Google map of type HYBRID:




function myMap()
{
var mapOptions= {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.HYBRID
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapOptions);
}


Google Maps - Basic Map Types


The following map types are supported in Google Maps API:



  • ROADMAP (normal, default 2D map)

  • SATELLITE (photographic map)

  • HYBRID (photographic map + roads and city names)

  • TERRAIN (map with mountains, rivers, etc.)


The map type is specified either within the Map properties object, with the
mapTypeId property:





var mapOptions = {
  center:new google.maps.LatLng(51.508742,-0.120850),
  zoom:7,
  mapTypeId: google.maps.MapTypeId.HYBRID
};


Or by calling the map's setMapTypeId() method:





map.setMapTypeId(google.maps.MapTypeId.HYBRID);









googletag.cmd.push(function() { googletag.display('div-gpt-ad-1493883843099-0'); });






Google Maps - 45° Perspective View


The map types SATELLITE and HYBRID support a 45° perspective imagery view for
certain locations (only at high zoom levels).


If you zoom into a location with 45° imagery view, the map will automatically
alter the perspective view. In addition, the map will add:



  • A compass wheel around the Pan control, allowing you to rotate the image

  • A Rotate control between the Pan and Zoom controls, allowing you to rotate the image 90°

  • A toggle control for displaying the 45° perspective view, under the Satellite control/label


Note: Zooming out from a map with 45° imagery will revert each of
these changes, and the original map is displayed.


The following example shows a 45° perspective view of Palazzo Ducale in
Venice, Italy:



Example



var mapOptions = {
center:myCenter,
zoom:18,
mapTypeId:google.maps.MapTypeId.HYBRID
};

Try it Yourself »



Google Maps - Disable 45° Perspective View - setTilt(0)


You can disable 45° perspective view by calling setTilt(0) on the Map object:



Example



map.setTilt(0);

Try it Yourself »

Tip: To enable 45° perspective view at a later point, call
setTilt(45).





❮ Previous
Next ❯

Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay