Google Maps allows you to display maps on your web page:
To demonstrate how to add a Google Map to a web page, we will use a basic HTML page:
See this example:
Set the size of the map:
See this example:
This example defines a Google Map centered in London, England:
See this example:
Example Explained
The mapOptions variable defines the properties for the map.
The center property specifies where to center the map (using latitude and longitude coordinates).
The zoom property specifies the zoom level for the map (try to experiment with the zoom level).
The mapTypeId property specifies the map type to display. The following map types are supported: ROADMAP, SATELLITE, HYBRID, and TERRAIN.
The line: var map=new google.maps.Map(document.getElementById("map"), mapOptions); creates a new map inside the <div> element with id="map", using the parameters that are passed (mapOptions).
Finally, show the map on the page!
The functionality of the map is provided by a JavaScript library located at Google. Add a script to refer to the Google Maps API with a callback to the myMap function:
See this example: