Embed Google Maps Image and Street View

Google Maps APIs provide easy ways to embed maps images. The following are static map image, satellite image and street view image of “Lincoln Memorial”.

Static Maps API supports map images with custom styles, markers, satellite maps. The following is the HTML code for the static map image above.

<img src="http://maps.googleapis.com/maps/api/staticmap?center=38.8893,-77.0501118&markers=38.8893,-77.0501118&zoom=15&size=200x200&sensor=false">

Static map images use the following URL parameters:

  • center defines the center of the map by a pair of latitude and longitude or a string address. For example, center=38.8893,-77.0501118.
  • zoom defines the zoom level between 0 and 21. For example, zoom=15.
  • size defines the width and height. For example, size=200x200.
  • markers(optional) defines the markers attached to the map; each marker is separated by (|). For example, markers=38.8893,-77.0501118.

Another parameter maptype allows different types of maps.

  • roadmap (default) specifies a standard roadmap.
  • satellite specifies a satellite image. For example, maptype=satellite.
  • terrain specifies a terrain map.

Street View Image API supports embedding static Street View imagery. The following is the HTML code for the street view image above.

<img src="http://maps.googleapis.com/maps/api/streetview?size=200x200&location=38.8893,-77.050111&heading=250&sensor=false">

Street view images use the following URL parameters:

  • location specifies the center by a pair of latitude and longitude or a string address. For example, location=38.8893,-77.0501118.
  • size defines the width and height. For example, size=200x200.
  • heading defines the heading direction from 0 to 360 (North 0, East 90, South 180).

The detailed documents can found at Static Maps API and Street View Image API

Comments

comments